82 |
|
|
83 |
TString trgconf[31]={"TOF1","TOF2","TOF3","TOF4","TOF5","TOF6","TOF7","S4","CALO","CALO-S4","TOF1-S4","TOF2-S4","TOF3-S4","TOF4-S4","TOF5-S4","TOF6-S4","TOF7-S4","TOF1-CALO","TOF2-CALO","TOF3-CALO","TOF4-CALO","TOF5-CALO","TOF6-CALO","TOF7-CALO","TOF1-CALO-S4","TOF2-CALO-S4","TOF3-CALO-S4","TOF4-CALO-S4","TOF5-CALO-S4","TOF6-CALO-S4","TOF7-CALO-S4",}; |
TString trgconf[31]={"TOF1","TOF2","TOF3","TOF4","TOF5","TOF6","TOF7","S4","CALO","CALO-S4","TOF1-S4","TOF2-S4","TOF3-S4","TOF4-S4","TOF5-S4","TOF6-S4","TOF7-S4","TOF1-CALO","TOF2-CALO","TOF3-CALO","TOF4-CALO","TOF5-CALO","TOF6-CALO","TOF7-CALO","TOF1-CALO-S4","TOF2-CALO-S4","TOF3-CALO-S4","TOF4-CALO-S4","TOF5-CALO-S4","TOF6-CALO-S4","TOF7-CALO-S4",}; |
84 |
stringstream oss, oss1, oss2, oss3, s4soglia, buffer, conftrig, noentries; |
stringstream oss, oss1, oss2, oss3, s4soglia, buffer, conftrig, noentries; |
85 |
ULong_t lastime, firstime; |
ULong_t lastime, firstime,obmin,obmax,obt; |
86 |
Int_t vardumpentries = 0; |
Int_t vardumpentries = 0; |
87 |
Int_t channels = 4096; |
Int_t channels = 4096; |
88 |
char S4_TRH[10]; |
char S4_TRH[10]; |
90 |
Int_t trigconf = 0; |
Int_t trigconf = 0; |
91 |
Long64_t nevents; |
Long64_t nevents; |
92 |
string title; |
string title; |
93 |
double obmin=0.; |
|
|
double obmax=0.; |
|
|
double obt; |
|
94 |
double s4rate; |
double s4rate; |
95 |
//------to open headerfile, s4file, Trigfile and vardumpfile---------------------------/ |
//------to open headerfile, s4file, Trigfile and vardumpfile---------------------------/ |
96 |
TFile *file =new TFile(base.Data()) ; |
TFile *file =new TFile(base.Data()) ; |
265 |
lastime = ph->GetOrbitalTime(); |
lastime = ph->GetOrbitalTime(); |
266 |
headBr->GetEntry(nevents-100); |
headBr->GetEntry(nevents-100); |
267 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
268 |
if(lastime-ph->GetOrbitalTime()> 100000) nevents=nevents-100; |
obt=ph->GetOrbitalTime(); |
269 |
|
if(lastime-obt> 100000)nevents=nevents-100; |
270 |
int iii=0,MaxR=0; |
int iii=0,MaxR=0; |
271 |
while(iii < nevents){ |
while(iii < nevents){ |
272 |
headBr->GetEntry(iii); |
headBr->GetEntry(iii); |
273 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
274 |
if((ph->GetOrbitalTime()) <= firstime) firstime=ph->GetOrbitalTime(); |
obt=ph->GetOrbitalTime(); |
275 |
if((ph->GetOrbitalTime()) >= lastime) lastime=ph->GetOrbitalTime(); |
if(obt<=firstime) firstime=ph->GetOrbitalTime(); |
276 |
|
if(obt>=lastime) lastime=ph->GetOrbitalTime(); |
277 |
TriggerBr->GetEntry(iii); |
TriggerBr->GetEntry(iii); |
278 |
if(trige->s4calcount[0]>MaxR)MaxR=trige->s4calcount[0]; |
if(trige->s4calcount[0]>MaxR)MaxR=trige->s4calcount[0]; |
279 |
iii++; |
iii++; |
280 |
} |
} |
281 |
MaxR=10+2*(MaxR/2); |
MaxR=2*(1.05*MaxR/2); |
282 |
|
|
283 |
obmin=firstime; |
obmin=firstime; |
284 |
obmax=lastime; |
obmax=lastime; |
311 |
S4Br->GetEntry(i); |
S4Br->GetEntry(i); |
312 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
313 |
if (s4e->unpackError == 1 && (s4e->S4_DATA)==0) continue; |
if (s4e->unpackError == 1 && (s4e->S4_DATA)==0) continue; |
314 |
rate->Fill(ph->GetOrbitalTime(),trige->s4calcount[0]); |
obt=ph->GetOrbitalTime(); |
315 |
|
rate->Fill(obt,trige->s4calcount[0]); |
316 |
h1->Fill(s4e->S4_DATA); |
h1->Fill(s4e->S4_DATA); |
317 |
Allev->Fill(ph->GetOrbitalTime(),s4e->S4_DATA); |
Allev->Fill(obt,s4e->S4_DATA); |
318 |
Alltime->Fill(ph->GetOrbitalTime()); |
Alltime->Fill(obt); |
319 |
if ((trige->patterntrig[0] == 0)&&(trige->patterntrig[1] != 0)&&(trige->patterntrig[2] == 0)&&(trige->patterntrig[3] == 0)&&(trige->patterntrig[4] == 0)&&(trige->patterntrig[5] == 0)){ |
if ((trige->patterntrig[0] == 0)&&(trige->patterntrig[1] != 0)&&(trige->patterntrig[2] == 0)&&(trige->patterntrig[3] == 0)&&(trige->patterntrig[4] == 0)&&(trige->patterntrig[5] == 0)){ |
320 |
h2->Fill(s4e->S4_DATA); |
h2->Fill(s4e->S4_DATA); |
321 |
S4ev->Fill(ph->GetOrbitalTime(),s4e->S4_DATA); |
S4ev->Fill(obt,s4e->S4_DATA); |
322 |
S4time->Fill(ph->GetOrbitalTime()); |
S4time->Fill(obt); |
323 |
p=p+1; |
p=p+1; |
324 |
} |
} |
325 |
} |
} |
326 |
Int_t kk=0; |
Int_t kk=0; |
327 |
Double_t Aobt=0; |
ULong_t Aobt=0; |
328 |
while (kk < nevents){ |
while (kk < nevents){ |
329 |
obt=0; |
obt=0; |
330 |
s4rate=0; |
s4rate=0; |
332 |
for(Int_t jj=kk; jj< (kk+100); jj++){ |
for(Int_t jj=kk; jj< (kk+100); jj++){ |
333 |
TriggerBr->GetEntry(jj); |
TriggerBr->GetEntry(jj); |
334 |
headBr->GetEntry(jj); |
headBr->GetEntry(jj); |
335 |
obt = obt+(ph->GetOrbitalTime()); |
obt=ph->GetOrbitalTime(); |
336 |
s4rate= s4rate+(trige->s4calcount[0]); |
s4rate= s4rate+(trige->s4calcount[0]); |
337 |
Aobt=Aobt+((ph->GetOrbitalTime())-obmin)*(trige->s4calcount[0]); |
Aobt=Aobt-obmin+obt; |
338 |
|
//*(trige->s4calcount[0])/1000; |
339 |
} |
} |
340 |
rateline->Fill((Aobt/s4rate)+obmin,(s4rate/100)); |
Aobt=Aobt/100; |
341 |
|
Aobt=Aobt+obmin; |
342 |
|
rateline->Fill(Aobt,s4rate/100); |
343 |
|
//rateline->Fill(ph->GetOrbitalTime(),(s4rate/100)); |
344 |
kk=kk+100; |
kk=kk+100; |
345 |
} |
} |
346 |
|
|
543 |
rate->GetXaxis()->CenterTitle(); |
rate->GetXaxis()->CenterTitle(); |
544 |
rate->GetYaxis()->SetTitle("S4 rate (Hz)"); |
rate->GetYaxis()->SetTitle("S4 rate (Hz)"); |
545 |
rate->GetYaxis()->CenterTitle(); |
rate->GetYaxis()->CenterTitle(); |
546 |
if(rate->GetMaximum() > 1000) gPad->SetLogy(); |
if(MaxR>500) gPad->SetLogy(); |
547 |
rate->Draw("9p"); |
rate->Draw("9p"); |
548 |
|
|
549 |
canvas3->cd(2); |
canvas3->cd(2); |
556 |
rateline->GetYaxis()->SetTitle("S4 rate (Hz)"); |
rateline->GetYaxis()->SetTitle("S4 rate (Hz)"); |
557 |
rateline->GetYaxis()->CenterTitle(); |
rateline->GetYaxis()->CenterTitle(); |
558 |
rateline->SetMaximum(rate->GetMaximum()); |
rateline->SetMaximum(rate->GetMaximum()); |
559 |
if(rateline->GetMaximum() > 1000) gPad->SetLogy(); |
if(MaxR>500) gPad->SetLogy(); |
560 |
rateline->Draw("9p"); |
rateline->Draw("9p"); |
561 |
|
|
562 |
|
|
640 |
S4_QL(argv[1], outDir, format, DeltaT); |
S4_QL(argv[1], outDir, format, DeltaT); |
641 |
|
|
642 |
} |
} |
|
|
|