62 gROOT->LoadMacro(
"$VMCWORKDIR/macro/run/bmnloadlibs.C");
76 cout <<
"Open file " << inName << endl << endl;
91 cout <<
"Will be readed " << nEvForRead <<
" events from " << nEvents << endl;
96 ofstream f_call, f_dt;
97 TF1* f_gaus =
new TF1(
"f_gaus",
"gaus", -20, 40);
121 TH1I* hLevtMinusRightPlane2[
kNST + 1];
123 name =
Form(
"hAmpTofPlane2_%d",
i);
124 hAmpTofPlane2[
i] =
new TH1I(name, name, 1024, 0, 50.);
125 ListAmpTofPlane2->
Add(hAmpTofPlane2[
i]);
126 name =
Form(
"hTimeTofPlane2_%d",
i);
127 hTimeTofPlane2[
i] =
new TH1I(name, name, 1000, 0, 1000.);
128 ListTimeTofPlane2->
Add(hTimeTofPlane2[
i]);
129 name =
Form(
"hLevtMinusRightPlane2_%d",
i);
130 hLevtMinusRightPlane2[
i] =
new TH1I(name, name, 1024, -12., 12.);
131 ListLRTofPlane2->
Add(hLevtMinusRightPlane2[
i]);
133 TH2I* hAmpLRPlane2 =
new TH2I(
"hAmpLRPlane2",
"hAmpLRPlane2", 1024, 0., 50., 1024, 0., 50.);
134 ListAmpTofPlane2->
Add(hAmpLRPlane2);
138 TH1I* hLeftMinusRightPlane7[
kNST + 1];
139 TH2S* hLeftRightVsAmpLPlane7[
kNST + 1];
140 TH2S* hLeftRightVsAmpRPlane7[
kNST + 1];
141 TH2S* hLeftRightCorelationRPlane7[
kNST + 1];
143 name =
Form(
"hAmpTofPlane7_%d",
i);
144 hAmpTofPlane7[
i] =
new TH1I(name, name, 1024, 0, 50.);
145 ListAmpTofPlane7->
Add(hAmpTofPlane7[
i]);
146 name =
Form(
"hTimeTofPlane7_%d",
i);
147 hTimeTofPlane7[
i] =
new TH1I(name, name, 1000, 0, 1000.);
148 ListTimeTofPlane7->
Add(hTimeTofPlane7[
i]);
149 name =
Form(
"hLeftRightCorelationRPlane7_%d",
i);
150 hLeftRightCorelationRPlane7[
i] =
new TH2S(name, name, 1024, 0., 50., 1024, 0., 50.);
151 ListLRCorrTofPlane7->
Add(hLeftRightCorelationRPlane7[
i]);
152 name =
Form(
"hLeftMinusRightPlane7_%d",
i);
153 hLeftMinusRightPlane7[
i] =
new TH1I(name, name, 1024, -12., 12.);
154 ListLRTofPlane7->
Add(hLeftMinusRightPlane7[
i]);
155 name =
Form(
"hLeftRightVsAmpLPlane7_%d",
i);
156 hLeftRightVsAmpLPlane7[
i] =
new TH2S(name, name, 1024, 0., 50., 1024, -12., 12.);
157 ListLRvsAmpLTofPlane7->
Add(hLeftRightVsAmpLPlane7[
i]);
158 name =
Form(
"hLeftRightVsAmpRPlane7_%d",
i);
159 hLeftRightVsAmpRPlane7[
i] =
new TH2S(name, name, 1024, 0., 50., 1024, -12., 12.);
160 ListLRvsAmpRTofPlane7->
Add(hLeftRightVsAmpRPlane7[
i]);
162 TH2I* hAmpLRPlane7 =
new TH2I(
"hAmpLRPlane7",
"hAmpLRPlane7", 1024, 0., 50., 1024, 0., 50.);
163 ListAmpTofPlane7->
Add(hAmpLRPlane7);
165 TH1I* hHitStripsPerEvPlane2 =
new TH1I(
"hHitStripsPerEvPlane2",
"Hit Strips Per Ev on Plane#2",
kNST, 0,
kNST);
166 ListStat->
Add(hHitStripsPerEvPlane2);
167 TH1I* hHitStripsPerEvPlane7 =
new TH1I(
"hHitStripsPerEvPlane7",
"Hit Strips Per Ev on Plane#7",
kNST, 0,
kNST);
168 ListStat->
Add(hHitStripsPerEvPlane7);
169 TH2I* hLefRightCorelation_Plane2 =
170 new TH2I(
"hLefRightCorelation_Plane2",
" Lef-Right Corelation Plane#2",
kNST, 0,
kNST,
kNST, 0,
kNST);
171 ListStat->
Add(hLefRightCorelation_Plane2);
172 TH2I* hLefRightCorelation_Plane7 =
173 new TH2I(
"hLefRightCorelation_Plane7",
" Lef-Right Corelation Plane#7",
kNST, 0,
kNST,
kNST, 0,
kNST);
174 ListStat->
Add(hLefRightCorelation_Plane7);
175 TH2I* hPlane2Plane7Correlation =
176 new TH2I(
"hPlane2Plane7Correlation",
" Plane2-Plane7 Correlation",
kNST, 0,
kNST,
kNST, 0,
kNST);
177 ListStat->
Add(hPlane2Plane7Correlation);
178 TH1S* hNoize =
new TH1S(
"hNoize",
"hNoize", 500, 0, 50);
180 ListStat->
Add(hNoize);
181 Int_t NEvStrip47 = 0;
182 TH1I* hNEvStrip47 =
new TH1I(
"hNEvStrip47",
"hNEvStrip47", 20, 0, 20);
183 ListStat->
Add(hNEvStrip47);
186 TH1I* hHitT0PerEv =
new TH1I(
"hHitT0PerEv",
"Hit T0 Per Ev", 10, 0, 10);
187 ListT0->
Add(hHitT0PerEv);
188 TH1I* hAmpT0 =
new TH1I(
"hAmpT0",
"Amp T0", 1024, 0, 50);
190 TH1I* hTimeT0 =
new TH1I(
"hTimeT0",
"Time T0", 1000, 0, 1000);
191 ListT0->
Add(hTimeT0);
196 name =
Form(
"hdt_%d",
i);
197 name2 =
Form(
"dt T0 - ToF400_Plane7_str_%d",
i);
198 hdt[
i] =
new TH1I(name, name2, 1024 + 512, -18., 18.);
200 ListAnalysis->
Add(hdt[
i]);
205 name =
Form(
"hdt_vs_AmpT0_%d",
i);
206 name2 =
Form(
"dt T0 - ToF400_Plane7_str_%d vs AMP_T0",
i);
207 hdt_vs_AmpT0[
i] =
new TH2I(name, name2, 1024, 0, 50, 1024 + 512, -24, 48);
208 ListAnalysis->
Add(hdt_vs_AmpT0[
i]);
213 name =
Form(
"hdt_vs_AmpToF_%d",
i);
214 name2 =
Form(
"dt T0 - ToF400_Plane7_str_%d vs AMP_TOF400",
i);
215 hdt_vs_AmpToF[
i] =
new TH2I(name, name2, 1024, 0, 50, 1024 + 512, -24, 48);
216 ListAnalysis->
Add(hdt_vs_AmpToF[
i]);
219 TH2F* h_StripHit =
new TH2F(
"h_StripHit",
"h_StripHit",
kNST, 0,
kNST, 2, 0, 2);
220 TH1I* h_StripHitSum =
new TH1I(
"h_StripHitSum",
"h_StripHitSum",
kNST, 0,
kNST);
234 TH1F* h_StripTimeL =
new TH1F(
"h_StripTimeL",
"h_StripTimeL",
kNST, 0,
kNST);
243 TH1F* h_StripTimeR =
new TH1F(
"h_StripTimeR",
"h_StripTimeR",
kNST, 0,
kNST);
248 TH1F* h_StripLeftMinusRight =
new TH1F(
"h_StripLeftMinusRight",
"h_StripLeftMinusRight",
kNST, 0,
kNST);
253 TH2F* h_StripLeftMinusRight_vs_Time =
254 new TH2F(
"h_StripLeftMinusRight_vs_Time",
"h_StripLeftMinusRight_vs_Time", 512, -5., 5., 2048, 250., 450.);
259 TH2F* h_XYTime =
new TH2F(
"h_XYTime",
"h_XYTime",
kNST, 0,
kNST, 64, -16, 16.);
267 TPad* Pad_StripHit =
new TPad(
"Pad_StripHit",
"Pad_StripHit", 0.01, 0.51, 0.49, 0.99, 21);
268 TPad* Pad_StripHitSum =
new TPad(
"Pad_StripHitSum",
"Pad_StripHitSum", 0.01, 0.01, 0.49, 0.49, 21);
269 TPad* Pad_StripAmp =
new TPad(
"Pad_StripAmp",
"Pad_StripAmp", 0.51, 0.51, 0.99, 0.99, 21);
270 TPad* Pad_StripTime =
new TPad(
"Pad_StripTime",
"Pad_StripTime", 0.51, 0.01, 0.99, 0.49, 21);
272 Pad_StripHit->
Draw();
273 Pad_StripHitSum->
Draw();
274 Pad_StripAmp->
Draw();
276 Pad_StripTime->
Draw();
280 Point = NameDTFile.
First(
'.');
281 NameDTFile.
Replace(Point, 15,
"_dt.dat");
282 cout <<
"Write call to " << NameDTFile.
Data() << endl;
283 f_dt.open(NameDTFile.
Data());
285 for (
Int_t iEv = 0; iEv < nEvForRead; iEv++) {
286 if (iEv % 50000 == 0)
287 cout <<
"EVENT: " << iEv << endl;
294 h_StripTime->
Reset();
295 h_StripAmpL->
Reset();
296 h_StripTimeL->
Reset();
297 h_StripAmpR->
Reset();
298 h_StripTimeR->
Reset();
299 h_StripLeftMinusRight->
Reset();
300 h_StripLeftMinusRight_vs_Time->
Reset();
320 if ((Plane2.
sTimeR[strip] != 0 && Plane2.
sTimeL[strip] != 0 && strip != 47
337 if (Plane7.
sTimeL[strip] != 0)
353 if ((Plane7.
sTimeR[strip] != 0 && Plane7.
sTimeL[strip] != 0 && strip != 47
360 hNEvStrip47->
Fill(NEvStrip47);
397 hLefRightCorelation_Plane2->
Fill(
i, j);
399 hLefRightCorelation_Plane7->
Fill(
i, j);
407 h_StripHitSum->
Fill(
i);
432 h_StripHitSum->
Fill(
i);
480 hPlane2Plane7Correlation->
Fill(MaxStrPlane2, MaxStrPlane7);
489 hdt[MaxStr]->
Fill(dt);
490 hdt_vs_AmpT0[MaxStr]->
Fill(T0.
sAmp, dt);
491 hdt_vs_AmpToF[MaxStr]->
Fill(Plane7.
sAmpL[MaxStr], dt);
496 Int_t iEvDig = EventHeader->GetEntriesFast();
498 cout <<
"iEvDig == " << iEvDig << endl;
500 f_dt << (digEvent->
GetEventId()) <<
"\t" << MaxStr <<
"\t" << dt << endl;
533 Point = NameCallFile.
First(
'.');
534 NameCallFile.
Replace(Point, 15,
"_call.dat");
535 cout <<
"Write call to " << NameCallFile.
Data() << endl;
536 f_call.open(NameCallFile.
Data());
539 for (
i = 0;
i <
kNST + 1;
i++) {
541 hAmpTofPlane7[
i]->
Fit(f_gaus,
"QW",
"QW",
542 hAmpTofPlane7[
i]->GetMaximumBin() * hAmpTofPlane7[
i]->GetXaxis()->GetBinWidth(1) - 0.5,
543 hAmpTofPlane7[
i]->GetMaximumBin() * hAmpTofPlane7[
i]->GetXaxis()->GetBinWidth(1) + 0.8);
544 sprintf(hid,
"Plane7 Strip %d\t mean %f\t integral %.0f",
i, f_gaus->
GetParameter(1),
546 f_call << hid << endl;
558 f_call <<
"Strip\t Mean\t Sigma" << endl;
559 for (
i = 0;
i <
kNST + 1;
i++) {
562 hdt[
i]->
Fit(f_gaus,
"QW",
"QW", -1, 1);
570 Point = outName.
First(
'.');
571 outName.
Replace(Point, 15,
"_TofAn.root");
575 Dir = fileout->
mkdir(
"ToF");
579 DirPlane2 = Dir->
mkdir(
"Plane2");
581 ListTimeTofPlane2->
Write();
582 ListAmpTofPlane2->
Write();
583 ListLRTofPlane2->
Write();
587 DirPlane7 = Dir->
mkdir(
"Plane7");
588 DirLRPlane7 = DirPlane7->
mkdir(
"LRCorelation");
590 ListTimeTofPlane7->
Write();
591 ListAmpTofPlane7->
Write();
593 ListLRCorrTofPlane7->
Write();
594 ListLRTofPlane7->
Write();
595 ListLRvsAmpLTofPlane7->
Write();
596 ListLRvsAmpRTofPlane7->
Write();
599 DirT0 = fileout->
mkdir(
"T0");
604 DirAnalysis = fileout->
mkdir(
"Analysis");
606 ListAnalysis->
Write();