diff --git a/NPLib/Detectors/AnnularS1/TAnnularS1Physics.cxx b/NPLib/Detectors/AnnularS1/TAnnularS1Physics.cxx index a6bcd7bff61e15434e1530d4bcd824c416c60b62..15ad094df503fc616d48366efa54347ca638d0e7 100644 --- a/NPLib/Detectors/AnnularS1/TAnnularS1Physics.cxx +++ b/NPLib/Detectors/AnnularS1/TAnnularS1Physics.cxx @@ -490,16 +490,16 @@ void TAnnularS1Physics::InitializeRootOutput(){ ///// Specific to AnnularS1Array //// void TAnnularS1Physics::AddDetector(double Z){ - double R_Min = 23; - double R_Max = 50; + double R_Min = 24; + double R_Max = 48; double Phi_Min = 0 ; double Phi_Max = 360; int Ring_NumberOfStrip = 16 ; - int Ring_NumberOfQuadrant = 4 ; int Sector_NumberOfStrip = 16 ; - + int Ring_NumberOfQuadrant = 4 ; + double StripPitchSector = (Phi_Max-Phi_Min)/Sector_NumberOfStrip ; //radial strip spacing in rad double StripPitchRing = (R_Max-R_Min)/Ring_NumberOfStrip ; // ring strip spacing in mm @@ -516,17 +516,16 @@ void TAnnularS1Physics::AddDetector(double Z){ vector< vector< double > > OneStripPositionZ ; TVector3 StripCenter = Strip_1_1; - for(int f = 0 ; f < Ring_NumberOfStrip ; f++){ - for(int q = 0 ; q < Ring_NumberOfQuadrant ; q++){ + for(int q = 0 ; q < Ring_NumberOfQuadrant ; q++){ + for(int f = 0 ; f < Ring_NumberOfStrip ; f++){ lineX.clear() ; lineY.clear() ; lineZ.clear() ; for(int b = 0 ; b < Sector_NumberOfStrip ; b++){ StripCenter = Strip_1_1; - StripCenter.SetY(R_Min+f*StripPitchRing); - StripCenter.SetZ(Z); - StripCenter.RotateZ(Phi_Min+b*StripPitchSector); + StripCenter = TVector3(0, R_Min+f*StripPitchRing+StripPitchRing*0.5, Z); + StripCenter.RotateZ((Phi_Min+b*StripPitchSector+StripPitchSector*0.5)); lineX.push_back( StripCenter.X() ); lineY.push_back( StripCenter.Y() ); lineZ.push_back( StripCenter.Z() ); diff --git a/Projects/S1554/macro/MgCS2.cxx b/Projects/S1554/macro/MgCS2.cxx index 13b54c2fee0679edfbb225cbb3eb442d51fd05e5..061aad91b58966f1538e8167089d4d2776ec456e 100644 --- a/Projects/S1554/macro/MgCS2.cxx +++ b/Projects/S1554/macro/MgCS2.cxx @@ -2,7 +2,7 @@ void Scale(TGraph* g , TGraphErrors* ex); TGraph* TWOFNR(double E, double J0, double J, double n, double l, double j); TH1* Region(double Emin, double Emax,TH2* h, TCanvas* c, int pad, TH2* Eff); double ToMininize(const double* parameter); -TGraph* FindNormalisation(TGraph* cs1, TGraph* cs2, TH1* hexp); +TGraph* FindNormalisation(TGraph* cs1, TGraph* cs2, TH1* hexp, double& s1, double& s2); TGraph* g1; TGraph* g2; @@ -45,34 +45,37 @@ void MgCS2(){ c->Divide(2,2); // Region + double s1,s2; current = Region(-0.1,0.4,h,c,nn++,Eff); g1 = TWOFNR(0.000, 0, 0.5, 1, 0, 0.5); g2 = TWOFNR(0.054, 0, 1.5, 0, 2, 1.5); g1->SetLineStyle(2);g1->Draw("c"); g2->SetLineStyle(3);g2->Draw("c"); - FindNormalisation(g1,g2,current)->Draw("c"); - + FindNormalisation(g1,g2,current,s1,s2)->Draw("c"); + + double s3,s4; current = Region(0.6,1.8,h,c,nn++,Eff); g1 = TWOFNR(1.095, 0, 1.5, 1, 1, 1.5); g2 = TWOFNR(1.431, 0, 3.5, 0, 3, 3.5); g1->SetLineStyle(2);g1->Draw("c"); g2->SetLineStyle(3);g2->Draw("c"); - FindNormalisation(g1,g2,current)->Draw("c"); + FindNormalisation(g1,g2,current,s3,s4)->Draw("c"); + double s5,s6; current = Region(2,3,h,c,nn++,Eff); g1 = TWOFNR(2.266, 0, 0.5, 1, 1, 0.5); g2 = TWOFNR(2.500, 0, 1.5, 0, 2, 1.5); g1->SetLineStyle(2);g1->Draw("c"); g2->SetLineStyle(3);g2->Draw("c"); - FindNormalisation(g1,g2,current)->Draw("c"); - + FindNormalisation(g1,g2,current,s5,s6)->Draw("c"); + + double s7,s8; current = Region(3,4.8,h,c,nn++,Eff); g1 = TWOFNR(3.2, 0, 2.5, 0, 2, 2.5); g2 = TWOFNR(3.2, 0, 3.5, 0, 3, 3.5); g1->SetLineStyle(2);g1->Draw("c"); g2->SetLineStyle(3);g2->Draw("c"); - FindNormalisation(g1,g2,current)->Draw("c"); - + FindNormalisation(g1,g2,current,s7,s8)->Draw("c"); } //////////////////////////////////////////////////////////////////////////////// @@ -190,7 +193,7 @@ TGraph* TWOFNR(double E, double J0, double J, double n, double l, double j){ } //////////////////////////////////////////////////////////////////////////////// -TGraph* FindNormalisation(TGraph* cs1, TGraph* cs2, TH1* hexp){ +TGraph* FindNormalisation(TGraph* cs1, TGraph* cs2, TH1* hexp, double& s1, double& s2){ // Set global variable g1 = cs1; g2 = cs2; @@ -233,6 +236,9 @@ TGraph* FindNormalisation(TGraph* cs1, TGraph* cs2, TH1* hexp){ for(int i = 0 ; i < cs1->GetN() ; i++){ g->SetPoint(g->GetN(),X[i],xs[0]*Y[i] + xs[1]*cs2->Eval(X[i]) ); } + s1 = xs[0]; + s2 = xs[1]; + return g; }