13 gInterpreter->ProcessLine(
".L Chain.C");
19 Double_t RaftMirror(Double_t pXL, Double_t pYL, Double_t PhiT, Int_t Raft, Int_t Mirror) {
28 if (Raft < 1 || Raft > 14 ||
29 Mirror < 1 || Mirror > 7)
return 0;
30 Double_t phiL = TMath::ATan2(pYL,pXL);
31 Double_t dPhi = phiL - PhiT;
32 if (dPhi >= TMath::Pi()) dPhi -= 2*TMath::Pi();
33 if (dPhi <= -TMath::Pi()) dPhi += 2*TMath::Pi();
37 Double_t SectorMirror(Double_t PhiL, Double_t PhiT, Int_t Sector, Int_t Mirror) {
47 SectorCorr_t SectorCorr0[12] = {
49 {2, -0.0186195, 1.4527e-05, 0.00184551, 1.02723e-05},
50 {4, -0.0196896, 2.33502e-05, 0.00184777, 1.65113e-05},
51 {6, -0.005116, 2.93135e-05, 0.00260989, 2.07281e-05},
52 {8, 0.00437859, 2.77778e-05, 0.00329948, 1.96424e-05},
54 {12, 0.000916182, 2.43739e-05, 0.00234977, 1.72353e-05},
55 {14, -0.0180773, 2.52572e-05, 0.00275963, 1.78601e-05},
56 {16, 0.00312329, 1.55691e-05, 0.00204276, 1.10091e-05},
57 {18, -0.00609319, 1.41944e-05, 0.00136081, 1.00371e-05},
58 {20, 0.00649718, 2.39854e-05, 0.00278396, 1.69605e-05},
59 {22, 0.0201383, 2.10855e-05, 0.00128673, 1.49099e-05},
60 {24, 0.0374981, 4.71165e-05, 0.00324044, 3.33172e-05}
62 SectorCorr_t SectorMirror[7][12] = {
77 {2, 1.47897e-02, 2.50330e-05, 5.15724e-04, 2.14312e-05},
78 {4, -6.08707e-02, 2.16937e-05, 6.93992e-04, 1.60809e-05},
80 {8, -3.50111e-03, 3.93290e-05, 1.60574e-03, 2.70401e-05},
82 {12,-1.45117e-02, 5.64167e-05, 1.54124e-03, 3.65524e-05},
83 {14,-3.28631e-02, 9.47326e-05, 1.92888e-03, 6.99189e-05},
84 {16, 2.65153e-02, 1.00910e-05, 5.09772e-04, 5.99093e-06},
85 {18, 2.26290e-02, 1.61950e-05, 5.65004e-04, 8.09284e-06},
86 {20,-6.06357e-02, 1.44520e-05, 7.23663e-04, 1.35932e-05},
87 {22, 6.01550e-03, 9.13966e-05, 1.07660e-03, 6.33931e-05},
88 {24,-5.20394e-02, 2.44742e-05, 9.68631e-04, 1.61593e-05}
91 {2, 0.0172837, 9.29745e-06, 0.000480627, 6.46204e-06},
92 {4, 0.00212475, 5.27541e-05, 0.00229639, 3.73615e-05},
93 {6, -0.00222559, 6.13796e-06, 6.34452e-05, 1.34243e-06},
94 {8, 0.0433267, 9.80298e-06, 0.00051389, 6.37242e-06},
96 {12, 0.0246517, 1.91944e-05, 0.00101986, 1.51846e-0 },
97 {14, 0.0047278, 0.000260374, 0.00157437, 0.000349249},
98 {16, 0.00466532,1.16948e-05, 0.000832494,7.36983e-06},
99 {18,-0.00221707,6.30134e-05, 0.00184436, 3.70755e-05},
100 {20,-0.00400158,6.86993e-05, 0.00225299, 4.08153e-05},
101 {22, 0.00392405,0.00010365, 0.00119326, 0.000110543},
102 {24, 0.00557869,2.23633e-05, 0.000991408,1.30714e-05}
105 {2, -2.0143e-05, 1.65561e-05, 0.00171236, 7.53284e-06},
106 {4, -0.000256831,2.38597e-05, 0.00101118, 2.03843e-05},
107 {6, 0.001134, 1.91263e-05, 0.00134625, 1.07783e-05},
108 {8, -0.00081522, 1.04845e-05, 0.000613908,1.08238e-05},
110 {12, 0.000987496,1.66857e-05, 0.00104992, 1.11315e-05},
111 {14, -0.00122242, 4.50794e-05, 0.00344171, 3.18769e-05},
112 {16, 0.000131596,2.89793e-05, 0.00185695, 1.72874e-05},
113 {18, 0.000805035,1.34267e-05, 0.000764655,7.61076e-06},
114 {20, -0.00240851, 1.75617e-05, 0.00109031, 1.29384e-05},
115 {22, -0.000366494,1.51986e-05, 0.000679965,1.06328e-05},
116 {24, 0.00159829, 1.97649e-05, 0.00106986, 1.39759e-05}
119 {2, 0.0202492, 1.21405e-05, 0.000651143, 8.64812e-06},
120 {4, -0.127498, 4.41647e-05, 0.0015842, 2.73322e-05},
121 {6, -0.0111096, 1.71769e-05, 0.000746844, 1.27916e-05},
122 {8, 0.0115083, 1.07084e-05, 0.000388096, 4.30121e-06},
124 {12, 0.0797944, 2.68801e-05, 0.000825459, 2.09022e-05},
125 {14, -0.00656188, 3.06239e-05, 0.00137091, 2.16544e-05},
126 {16, -0.00293398, 1.50938e-05, 0.000800728, 1.4194e-05},
128 {20, 0.0247521, 1.0784e-05, 0.000544184, 8.77057e-06},
130 {24, -0.0035, 0.00010766, 0.000854507, 7.6101e-05}
133 {2, -0.0211806, 8.82803e-05, 0.00193211, 6.24233e-05},
134 {4, 0.00960692, 0.000803011, 0.00207609, 0.000503285},
135 {6, -0.019809, 6.20976e-05, 0.00178037, 4.39096e-05},
136 {8, -0.0244286, 3.08233e-05, 0.00143618, 2.17956e-05},
138 {12, 0.00980073, 9.14786e-05, 0.00101579, 6.82576e-05},
140 {16, -0.000329188, 6.08403e-05, 0.000869988, 4.33747e-05},
141 {18, -0.00445835, 0.000235526, 0.000686245, 0.000139439},
142 {20, 0.00150319, 0.000115474, 0.000571378, 8.76884e-05},
144 {24, 0.00230525, 5.80364e-05, 0.0015616, 4.10378e-05}
161 Double_t dPhi = -999;
162 if (Sector < 1 || Sector > 24 ||
163 Mirror < 1 || Mirror > 7)
return dPhi;
166 Int_t i = (Sector-1)/2;
167 Int_t m = Mirror - 1;
168 if (SectorCorr0[i].sigma <= 0)
return dPhi;
169 if (SectorMirror[m][i].sigma <= 0)
return dPhi;
171 Double_t dPhi = PhiL - PhiT - SectorCorr0[i].phi - SectorMirror[m][i].phi;
173 Double_t dPhi = PhiL - PhiT - SectorMirror[m][i].phi;
175 if (dPhi >= TMath::Pi()) dPhi -= 2*TMath::Pi();
176 if (dPhi <= -TMath::Pi()) dPhi += 2*TMath::Pi();
180 void FitRM(TH2* hist) {
182 hist->FitSlicesY(0,-1,0,10,
"lnr");
183 TH1 *fit = (TH1 *) gDirectory->Get(Form(
"%s_1",hist->GetName()));
184 TH1 *sigma = (TH1 *) gDirectory->Get(Form(
"%s_2",hist->GetName()));
185 if (! fit || ! sigma)
return;
186 fit->SetMarkerStyle(20);
189 Int_t nx = fit->GetNbinsX();
190 for (Int_t i = 1; i <= nx; i++)
191 cout <<
"{" << 2*i <<
", \t" << fit->GetBinContent(i) <<
",\t" << fit->GetBinError(i) <<
",\t" << sigma->GetBinContent(i) <<
",\t" << sigma->GetBinError(i) <<
"}," << endl;
194 void FillRM(Int_t Mirror) {
195 TTree *laser = (TTree *) gDirectory->Get(
"laser");
196 if (! laser )
return;
198 TString Plot(
"SectorMirror(fTracks.Laser.PhiG,fTracks.fgeoOut.mPsi,fTracks.Laser.Sector,fTracks.Laser.Mirror):fTracks.Laser.Sector>>");
199 TString hName(Form(
"Sector%iPhi2",Mirror));
201 Plot +=
"(12,1,25,400,-.2,.2)";
202 TString
Cut(Form(
"fTracks.Flag==2&&fTracks.Laser.Mirror==%i",Mirror));
203 Cut +=
"&&abs(fTracks.XyzP.mX1-fTracks.Laser.XyzG.mX1)<0.1";
204 Cut +=
"&&abs(fTracks.XyzP.mX2-fTracks.Laser.XyzG.mX2)<0.1";
205 Cut +=
"&&fTracks.thePath > 5 && fTracks.thePath < 12";
206 Cut +=
"&&fTracks.mNumberOfFitPointsTpc > 25";
207 Cut +=
"&&TMath::Abs(fTracks.Laser.ThetaG-fTracks.fgeoOut.mDipAngle-TMath::Pi()/2) < 0.05";
208 laser->Draw(Plot,
Cut,
"colz");
209 TH2 *hist = (TH2 *) gDirectory->Get(hName);
210 if (! hist) {cout << hName
" << is missing" << endl;
return;}
215 TTree *laser = (TTree *) gDirectory->Get(
"laser");
216 if (! laser )
return;
217 TF1 *SS =
new TF1(
"SS",
"[0]+[1]*TMath::Sin(x+[2])");
218 SS->SetParName(0,
"A");
219 SS->SetParName(1,
"B");
220 SS->SetParName(3,
"#phi 0");
221 TCanvas *c1 =
new TCanvas();
223 c1->cd(1)->SetLogz(1);
225 TString
Cut(
"fTracks.Flag==1&&(abs(fTracks.Vertex.mX3+3.3)<2||abs(fTracks.Vertex.mX3-3.6)<2)&&abs(fTracks.fgeoIn.mDipAngle)<0.010");
227 cut +=
"&&fTracks.mSector<=12";
228 laser->Draw(
"1.e3*fTracks.fgeoIn.mDipAngle:fTracks.fgeoIn.mPsi>>DipPsiWW",cut,
"colz");
229 TH2 *DipPsiWW = (TH2 *) gDirectory->Get(
"DipPsiWW");
230 DipPsiWW->SetXTitle(
"#psi");
231 DipPsiWW->SetYTitle(
"#lambda");
232 DipPsiWW->FitSlicesY();
233 TH1 *DipPsiWW_1 = (TH1 *) gDirectory->Get(
"DipPsiWW_1");
234 DipPsiWW_1->SetMarkerStyle(2);
235 SS->SetParameter(2,1);
237 DipPsiWW_1->SetMarkerStyle(20);
238 DipPsiWW->Draw(
"colz");
239 DipPsiWW_1->Draw(
"sames");
240 TLegend *w =
new TLegend(0.25,0.7,0.4,0.9,
"");
241 w->AddEntry(DipPsiWW_1,
"West");
243 c1->cd(2)->SetLogz(1);
245 cut +=
"&&fTracks.mSector>12";
246 laser->Draw(
"1.e3*fTracks.fgeoIn.mDipAngle:fTracks.fgeoIn.mPsi>>DipPsiEE",cut,
"colz");
247 TH2 *DipPsiEE = (TH2 *) gDirectory->Get(
"DipPsiEE");
248 DipPsiEE->SetXTitle(
"#psi");
249 DipPsiEE->SetYTitle(
"#lambda");
250 DipPsiEE->FitSlicesY();
251 TH1 *DipPsiEE_1 = (TH1 *) gDirectory->Get(
"DipPsiEE_1");
252 DipPsiEE_1->SetMarkerStyle(2);
253 SS->SetParameter(2,1);
255 DipPsiEE_1->SetMarkerStyle(20);
256 DipPsiEE->Draw(
"colz");
257 DipPsiEE_1->Draw(
"sames");
258 TLegend *e =
new TLegend(0.25,0.6,0.4,0.9,
"");
259 e->AddEntry(DipPsiEE_1,
"East");