1 #include "StEEmcTimingMaker.h"
5 #include <TGraphErrors.h>
8 #include <TPaveStats.h>
18 #include "StMessMgr.h"
20 #include "StEEmcUtil/database/StEEmcDb.h"
21 #include "StEEmcUtil/database/EEmcDbItem.h"
22 #include "StEEmcUtil/EEfeeRaw/EEname2Index.h"
24 #include "StEEmcPool/StEEmcA2EMaker/StEEmcA2EMaker.h"
26 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
27 #include "StarRoot/TH1Helper.h"
32 StEEmcTimingMaker::StEEmcTimingMaker(
const Char_t *name):
StMaker(name)
40 mOutputFile=
"timing.root";
44 for ( Int_t i=0;i<MaxTwCrates;i++ )
45 for ( Int_t j=0;j<MaxTwCrateCh;j++ )
51 for ( Int_t i=0;i<MaxMapmtCrates;i++ )
52 for ( Int_t j=0;j<MaxMapmtCrateCh;j++ )
60 for ( Int_t icrate=0;icrate<MaxTwCrates;icrate++ )
62 mTowerCrateYield[icrate]=0;
64 for ( Int_t icrate=0;icrate<MaxMapmtCrates;icrate++ )
66 mMapmtCrateYield[icrate]=0;
69 for ( Int_t icrate=0;icrate<MaxTwCrates;icrate++ )
70 for ( Int_t ichan=0;ichan<MaxTwCrateCh;ichan++ )
72 mTowerChanYield[icrate][ichan]=0;
73 mTowerChanSlope[icrate][ichan]=0.;
76 for ( Int_t icrate=0;icrate<MaxMapmtCrates;icrate++ )
77 for ( Int_t ichan=0;ichan<MaxMapmtCrateCh;ichan++ )
79 mMapmtChanYield[icrate][ichan]=0;
80 mMapmtChanSlope[icrate][ichan]=0.;
88 void StEEmcTimingMaker::setRunNumber( Int_t r )
94 Int_t StEEmcTimingMaker::InitRun(Int_t run){
95 assert(run==mRunNumber);
99 std::cout <<
"No ADC to E maker" <<std::endl;
105 std::cout <<
"No database maker" << std::endl;
111 for ( Int_t itower=0;itower<720;itower++ )
116 Int_t crate=dbitem->crate;
117 Int_t channel=dbitem->
chan;
118 TString twname=dbitem->
name;
119 TString tbname=dbitem->
tube;
121 Form(
"ADC spectrum run=%i, name=%s, cr/chan=%3.3d/%3.3d, tube=%s, ",run,twname.Data(),crate,channel,tbname.Data());
122 TString hname=
"h";hname+=twname;
123 hTower[crate-1][channel]->SetTitle(title);
124 hTower[crate-1][channel]->SetName(hname);
128 for ( ilayer=1; ilayer<4;ilayer++ ) {
129 for ( Int_t itower=0;itower<720;itower++ )
134 Int_t crate=dbitem->crate;
135 Int_t channel=dbitem->
chan;
136 TString twname=dbitem->
name;
137 TString tbname=dbitem->
tube;
138 TString title=Form(
"ADC spectrum run=%i, name=%s, cr/chan=%3.3d/%3.3d, tube=%s, ",run,twname.Data(),crate,channel,tbname.Data());
139 TString hname=
"h";hname+=twname;
140 hMapmt[crate-MinMapmtCrateID][channel]->SetTitle(title);
141 hMapmt[crate-MinMapmtCrateID][channel]->SetName(hname);
147 for ( Int_t isector=0;isector<12;isector++ )
148 for ( Int_t iplane=0;iplane<2;iplane++ )
150 for ( Int_t index=0;index<288;index++ ) {
153 if (!dbitem)
continue;
154 Int_t crate=dbitem->crate;
155 Int_t channel=dbitem->
chan;
156 TString twname=dbitem->
name;
157 TString tbname=dbitem->
tube;
159 Form(
"ADC spectrum run=%i, name=%s, cr/chan=%3.3d/%3.3d, tube=%s, ",run,twname.Data(),crate,channel,tbname.Data());
160 TString hname=
"h";hname+=twname;
161 hMapmt[crate-MinMapmtCrateID][channel]->SetTitle(title);
162 hMapmt[crate-MinMapmtCrateID][channel]->SetName(hname);
166 LOG_INFO<<
GetName()<<
"::InitRun("<<run<<
") histograms renamed"<<endm;
175 Int_t StEEmcTimingMaker::Init()
178 hCounter=
new TH1F(
"hCounter",
"Event counter;status",1,0.,1.);
179 TH1Helper::SetCanRebin(hCounter);
183 for ( Int_t icrate=0;icrate<MaxTwCrates;icrate++ )
184 for ( Int_t ichan=0;ichan<MaxTwCrateCh;ichan++ )
186 TString name=
"hTwCr";name+=icrate+1;name+=
"Ch";name+=ichan;
187 TString title=
"ADC spectrum crate/chan=";
188 title += icrate+1;title+=
"/";title+=ichan;
189 hTower[icrate][ichan]=
new TH1F(name,title,512,0.,512.);
192 for ( Int_t icrate=0;icrate<MaxMapmtCrates;icrate++ )
193 for ( Int_t ichan=0;ichan<MaxMapmtCrateCh;ichan++ )
195 TString name=
"hMaCr";name+=MinMapmtCrateID+icrate;name+=
"Ch";name+=ichan;
196 TString title=
"ADC spectrum crate/chan=";
197 title += MinMapmtCrateID+icrate; title+=
"/";title+=ichan;
198 hMapmt[icrate][ichan]=
new TH1F(name,title,512,0.,512.);
202 for ( Int_t icrate=0;icrate<MaxTwCrates;icrate++ )
204 mTowerCrateYield[icrate]=0;
206 for ( Int_t icrate=0;icrate<MaxMapmtCrates;icrate++ )
208 mMapmtCrateYield[icrate]=0;
211 for ( Int_t icrate=0;icrate<MaxTwCrates;icrate++ )
212 for ( Int_t ichan=0;ichan<MaxTwCrateCh;ichan++ )
214 mTowerChanYield[icrate][ichan]=0;
215 mTowerChanSlope[icrate][ichan]=0.;
218 for ( Int_t icrate=0;icrate<MaxMapmtCrates;icrate++ )
219 for ( Int_t ichan=0;ichan<MaxMapmtCrateCh;ichan++ )
221 mMapmtChanYield[icrate][ichan]=0;
222 mMapmtChanSlope[icrate][ichan]=0.;
235 hCounter->Fill(
"Nevents",1.);
239 std::cout <<
"No ADC to E maker" <<std::endl;
243 hCounter->Fill(
"Nadc2e",1.0);
247 std::cout <<
"No database maker" << std::endl;
251 hCounter->Fill(
"Ndb",1.0);
256 for ( Int_t itower=0;itower<720;itower++ )
261 Int_t crate=dbitem->crate;
262 Int_t channel=dbitem->
chan;
263 hTower[crate-1][channel] -> Fill( tow.
raw() );
267 for ( ilayer=1;ilayer<4;ilayer++ )
269 for ( Int_t itower=0;itower<720;itower++ )
274 Int_t crate=dbitem->crate;
275 Int_t channel=dbitem->
chan;
276 hMapmt[crate-MinMapmtCrateID][channel]->Fill(tow.
raw());
280 for ( Int_t isector=0;isector<12;isector++ )
281 for ( Int_t iplane=0;iplane<2;iplane++ )
283 for ( Int_t index=0;index<288;index++ ) {
286 if (!dbitem)
continue;
287 Int_t crate=dbitem->crate;
288 Int_t channel=dbitem->
chan;
289 hMapmt[crate-MinMapmtCrateID][channel]->Fill(strip.
raw());
300 static Int_t ncalled=0;
301 std::cout << Form(
"StEEmcTimingMaker::Finish() called for the %i-%s time",ncalled+1,(ncalled)?
"nd":
"st") << std::endl;
302 if ( ncalled )
return kStOK;
305 std::vector<TH1F*> histos;
307 for ( Int_t icrate=0;icrate<MaxTwCrates;icrate++ )
308 for ( Int_t ichan=0;ichan<MaxTwCrateCh;ichan++ )
311 if ( !hTower[icrate][ichan] )
continue;
312 if ( hTower[icrate][ichan]->Integral()<10 )
continue;
313 histos.push_back( hTower[icrate][ichan] );
316 for ( Int_t icrate=0;icrate<MaxMapmtCrates;icrate++ )
317 for ( Int_t ichan=0;ichan<MaxMapmtCrateCh;ichan++ )
319 if ( !hMapmt[icrate][ichan] )
continue;
320 if ( hMapmt[icrate][ichan]->Integral()<10 )
continue;
321 histos.push_back(hMapmt[icrate][ichan]);
324 for ( UInt_t ii=0;ii<histos.size();ii++ )
326 TF1 fit(
"fit",
"gaus");
327 Float_t xmax=(Float_t)histos[ii]->GetMaximumBin();
328 fit.SetParameter(0, histos[ii]->Integral() );
329 fit.SetParameter(1, xmax );
330 fit.SetParLimits(1, xmax-2.0, xmax+2.0 );
331 fit.SetParameter(2, 0.90 );
332 histos[ii]->GetXaxis()->SetRangeUser(xmax-10.,xmax+10.);
333 histos[ii]->Fit(&fit,
"RQ",
"",xmax-10.0,xmax+10.0);
336 std::cout << Form(
"+ fit %s: ped=%5.2f sig=%5.3f",histos[ii]->
GetName(),fit.GetParameter(1),fit.GetParameter(2)) << std::endl;
338 histos[ii]->GetListOfFunctions()->Print();
347 for ( Int_t icrate=0;icrate<MaxTwCrates;icrate++ )
350 TString hname=
"hCrate";hname+=(icrate+1);
351 TString htitle=
"Pedestal-subtracted spectrum for crate ";htitle+=(icrate+1);
352 TH1F *hSumTowers=
new TH1F(hname,htitle,524,-12.,512.);
354 for ( Int_t ichan=0;ichan<MaxTwCrateCh;ichan++ )
357 TH1F *h=hTower[icrate][ichan];
360 TString htitle=h->GetTitle();
361 LOG_INFO<<
"Fitting "<<htitle<<endl;
363 TF1 *f=(TF1*)h->GetListOfFunctions()->At(0);
365 if ( f->IsA() != TF1::Class() ) {
366 LOG_WARN<<
" somebody inserted something into "<<h->GetName()<<
"'s list of functions, and it's messing up the output"<<endm;
368 std::cout <<
"Print out slot 0" << std::endl;
370 std::cout <<
"Print all functions" << std::endl;
371 h->GetListOfFunctions()->Print();
376 Float_t xmean = f->GetParameter(1);
377 Float_t xwidth= f->GetParameter(2);
378 Float_t xmin = xmean+mTowerMin;
379 Float_t xmax = xmean+mTowerMax;
380 h->GetXaxis()->SetRangeUser(xmin,xmax);
381 Float_t sum=h->Integral();
382 if ( !mTowerMask[icrate][ichan] ) mTowerCrateYield[icrate]+=(Int_t)sum;
383 mTowerChanYield[icrate][ichan]+=(Int_t)sum;
385 h->GetXaxis()->SetRangeUser(xmin-2.0*mTowerMin,xmax+mTowerMin);
388 TLine *l1=
new TLine( xmin, -0.05*h->GetMaximum(), xmin, +0.05*h->GetMaximum() );l1->SetLineColor(2);
389 TLine *l2=
new TLine( xmax, -0.05*h->GetMaximum(), xmax, +0.05*h->GetMaximum() );l2->SetLineColor(2);
390 h->GetListOfFunctions()->Add(l1);
391 h->GetListOfFunctions()->Add(l2);
393 for ( Int_t ii=1;ii<=512;ii++ )
395 hSumTowers->Fill( ((Float_t)ii) - xmean, h->GetBinContent(ii) );
398 TF1 *slope=
new TF1(
"slope",
"expo",0.,512.);
399 slope->SetLineColor(2);
400 h->Fit(slope,
"RQ+",
"",xmin,xmax);
401 if ( slope->GetParameter(1) != 0. )
402 mTowerChanSlope[icrate][ichan]=1.0/slope->GetParameter(1);
404 htitle+=Form(
"ped=%6.2f, ",xmean);
405 htitle+=Form(
"width=%6.4f, ",xwidth);
406 htitle+=Form(
"xmin=%5.1f, xmax=%5.1f, Integral=%i, ",xmin,xmax,mTowerChanYield[icrate][ichan]);
407 htitle+=Form(
"inv. slope=%8.5g+/-%8.5g, ",slope->GetParameter(1),slope->GetParError(1));
412 AddHist(hSumTowers,
".hist");
414 std::cout <<
"crate="<<icrate+1<<
" sum="<<mTowerCrateYield[icrate]<<std::endl;
419 for ( Int_t icrate=0;icrate<MaxMapmtCrates;icrate++ )
422 TString hname=
"hCrate";hname+=(icrate+MinMapmtCrateID);
423 TString htitle=
"Pedestal-subtracted spectrum for crate ";htitle+=(icrate+1);
424 TH1F *hSumMapmt=
new TH1F(hname,htitle,524,-12.,512.);
426 for ( Int_t ichan=0;ichan<MaxMapmtCrateCh;ichan++ )
428 TH1F *h=hMapmt[icrate][ichan];
431 TString htitle=h->GetTitle();
432 LOG_INFO<<
"Fitting "<<htitle<<endl;
434 TF1 *f=(TF1*)h->GetListOfFunctions()->At(0);
436 if ( f->IsA() != TF1::Class() ) {
437 LOG_WARN<<
" somebody inserted something into "<<h->GetName()<<
"'s list of functions, and it's messing up the output"<<endm;
441 Float_t xmean = f->GetParameter(1);
442 Float_t xwidth = f->GetParameter(2);
443 Float_t xmin = xmean+mMapmtMin;
444 Float_t xmax = xmean+mMapmtMax;
445 h->GetXaxis()->SetRangeUser(xmin,xmax);
446 Float_t sum=h->Integral();
449 if ( !mMapmtMask[icrate][ichan] ) mMapmtCrateYield[icrate]+=(Int_t)sum;
450 mMapmtChanYield[icrate][ichan]+=(Int_t)sum;
451 h->GetXaxis()->SetRangeUser(xmin-2.0*mMapmtMin,xmax+mMapmtMin);
455 sprintf(buf,
"Integral [%5.1f,%5.1f] = %i",xmin,xmax,mMapmtChanYield[icrate][ichan]);
456 TString title=h->GetTitle();title+=
" ";title+=buf;
459 TLine *l1=
new TLine( xmin, -0.05*h->GetMaximum(), xmin, +0.05*h->GetMaximum() );l1->SetLineColor(2);
460 TLine *l2=
new TLine( xmax, -0.05*h->GetMaximum(), xmax, +0.05*h->GetMaximum() );l2->SetLineColor(2);
461 h->GetListOfFunctions()->Add(l1);
462 h->GetListOfFunctions()->Add(l2);
464 for ( Int_t ii=1;ii<=512;ii++ )
466 hSumMapmt->Fill( ((Float_t)ii) - xmean, h->GetBinContent(ii) );
469 TF1 *slope=
new TF1(
"slope",
"expo",0.,512.);
470 slope->SetLineColor(2);
471 h->Fit(slope,
"RQ+",
"",xmin,xmax);
472 if ( slope->GetParameter(1) != 0. )
473 mMapmtChanSlope[icrate][ichan]=1.0/slope->GetParameter(1);
475 htitle+=Form(
"ped=%6.2f, ",xmean);
476 htitle+=Form(
"width=%6.4f, ",xwidth);
477 htitle+=Form(
"xmin=%5.1f, xmax=%5.1f, Integral=%i, ",xmin,xmax,mMapmtChanYield[icrate][ichan]);
478 htitle+=Form(
"inv. slope=%8.5g+/-%8.5g, ",slope->GetParameter(1),slope->GetParError(1));
482 AddHist(hSumMapmt,
".hist");
484 std::cout <<
"crate="<<icrate+MinMapmtCrateID<<
" sum="<<mMapmtCrateYield[icrate]<<std::endl;
491 TTree *tree=
new TTree(
"timing",
"EEmc timing scan TTree");
494 tree->Branch(
"mRunNumber",&mRunNumber,
"mRunNumber/I");
495 tree->Branch(
"mTowerDelay",&mTowerDelay,
"mTowerDelay/F");
496 tree->Branch(
"mMapmtDelay",&mMapmtDelay,
"mMapmtDelay/F");
498 tree->Branch(
"mTotalYield",&mTotalYield,
"mTotalYield/I");
500 Int_t nTowerCrates = MaxTwCrates;
501 Int_t nMapmtCrates = MaxMapmtCrates;
502 Int_t nTowerCrateChannels = MaxTwCrateCh * MaxTwCrates;
503 Int_t nMapmtCrateChannels = MaxMapmtCrateCh * MaxMapmtCrates;
505 tree->Branch(
"nTowerCrates",&nTowerCrates,
"nTowerCrates/I");
506 tree->Branch(
"nMapmtCrates",&nMapmtCrates,
"nMapmtCrates/I");
507 tree->Branch(
"nTowerCrateChannels",&nTowerCrateChannels,
"nTowerCrateChannels/I");
508 tree->Branch(
"nMapmtCrateChannels",&nMapmtCrateChannels,
"nMapmtCrateChannels/I");
510 tree->Branch(
"mTowerCrateYield",mTowerCrateYield,
"mTowerCrateYield[nTowerCrates]/I");
511 tree->Branch(
"mMapmtCrateYield",mMapmtCrateYield,
"mMapmtCrateYield[nMapmtCrates]/I");
513 tree->Branch(
"mTowerChanYield",mTowerChanYield,
"mTowerChanYield[nTowerCrateChannels]/I");
514 tree->Branch(
"mMapmtChanYield",mMapmtChanYield,
"mMapmtChanYield[nMapmtCrateChannels]/I");
518 tree->Branch(
"mTowerMin",&mTowerMin,
"mTowerMin/I");
519 tree->Branch(
"mTowerMax",&mTowerMax,
"mTowerMax/I");
520 tree->Branch(
"mMapmtMin",&mMapmtMin,
"mMapmtMin/I");
521 tree->Branch(
"mMapmtMax",&mMapmtMax,
"mMapmtMax/I");
525 AddObj(tree,
".hist");
536 void StEEmcTimingMaker::setTiming( Float_t t, Float_t m )
542 void StEEmcTimingMaker::setTowerCuts(Int_t min, Int_t max)
544 mTowerMin=min;mTowerMax=max;
545 LOG_INFO<<
GetName()<<
" set tower cuts: ped+"<<min<<
",ped+"<<max<<endm;
547 void StEEmcTimingMaker::setMapmtCuts(Int_t min, Int_t max)
549 mMapmtMin=min;mMapmtMax=max;
550 LOG_INFO<<
GetName()<<
" set mapmt cuts: ped+"<<min<<
",ped+"<<max<<endm;
554 void StEEmcTimingMaker::dumpAsciiFile(
const Char_t *fname )
558 LOG_INFO<<
GetName()<<
"::dumpAsciiFile("<<fname<<
");"<<endm;
560 ofstream ofile(fname);
561 ofile <<
"Run number: " << mRunNumber << endl;
567 ofile <<
"Number of entries: " << mumk->
chain()->GetEntries() << endl;
568 TObjArray *oa=mumk->
chain()->GetListOfFiles();
569 Int_t n=oa->GetEntries();
570 for ( Int_t i=0;i<n;i++ ) {
571 TNamed *named=(TNamed*)oa->At(i);
573 ofile <<
"+ "<<named->GetName()<<endl;
578 ofile<<
"Tower cuts: "<<mTowerMin<<
" "<<mTowerMax<<endl;
579 ofile<<
"Mapmt cuts: "<<mMapmtMin<<
" "<<mMapmtMax<<endl;
584 const Char_t *sn[]={
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"12"};
585 const Char_t *ln[]={
"T",
"P",
"Q",
"R"};
586 const Char_t *bn[]={
"A",
"B",
"C",
"D",
"E"};
588 for ( Int_t lay=0;lay<4;lay++ ){
589 for ( Int_t sec=0;sec<12;sec++ ){
590 for ( Int_t sub=0;sub<5;sub++ ){
592 for ( Int_t eta=0;eta<12;eta++ )
594 TString tname=sn[sec];tname+=ln[lay];tname+=bn[sub];tname+=sn[eta];
595 TString hname=
"h";hname+=tname;
596 TH1F *h=(TH1F*)GetHist(hname);
597 ofile << h->GetTitle() <<endl;
604 const Char_t *pn[]={
"U",
"V"};
605 for ( Int_t pln=0;pln<2;pln++ )
606 for ( Int_t sec=0;sec<12;sec++ )
608 for ( Int_t strip=0;strip<288;strip+=16 ) {
609 for ( Int_t i=0;i<16;i++ ) {
610 Int_t istrip=strip+i;
611 TString tname =sn[sec];
613 if (istrip+1<100) tname+=
"0";
614 if (istrip+1<10) tname+=
"0";
616 TString hname=
"h";hname+=tname;
617 TH1F *h=(TH1F*)GetHist(hname);
618 ofile<<h->GetTitle()<<endl;
629 void StEEmcTimingMaker::dumpPDF(
const Char_t *fname )
634 TCanvas *c1=
new TCanvas(
"c1",
"c1",850,1100);
638 const Char_t *sn[]={
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"12"};
639 const Char_t *ln[]={
"T",
"P",
"Q",
"R"};
640 const Char_t *bn[]={
"A",
"B",
"C",
"D",
"E"};
642 c1->Print(TString(fname)+
"(");
643 for ( Int_t lay=0;lay<4;lay++ ){
644 for ( Int_t sec=0;sec<12;sec++ ){
645 for ( Int_t sub=0;sub<5;sub++ ){
647 for ( Int_t eta=0;eta<12;eta++ )
650 c1->cd(eta+1)->SetLogy();
651 TString tname=sn[sec];tname+=ln[lay];tname+=bn[sub];tname+=sn[eta];
652 TString hname=
"h";hname+=tname;
654 h=(TH1F*)GetHist(hname);
657 hname.ReplaceAll(
"h",
"a");
658 h=(TH1F*)GetHist(hname);
662 c1->Print(TString(fname)+
"(");
673 const Char_t *pn[]={
"U",
"V"};
674 for ( Int_t pln=0;pln<2;pln++ )
675 for ( Int_t sec=0;sec<12;sec++ )
677 for ( Int_t strip=0;strip<288;strip+=16 ) {
678 for ( Int_t i=0;i<16;i++ ) {
679 Int_t istrip=strip+i;
681 c1->cd(i+1)->SetLogy();
682 TString tname =sn[sec];
684 if (istrip+1<100) tname+=
"0";
685 if (istrip+1<10) tname+=
"0";
687 TString hname=
"h";hname+=tname;
688 TH1F *h=(TH1F*)GetHist(hname);
691 c1->Print(TString(fname)+
"(");
695 c1->Print(TString(fname)+
")");
702 TCanvas *c1=
new TCanvas(
"c1",
"c1",850,1100);
703 TPDF *pdf=
new TPDF(fname,111);
707 const Char_t *sn[]={
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"12"};
708 const Char_t *ln[]={
"T",
"P",
"Q",
"R"};
709 const Char_t *bn[]={
"A",
"B",
"C",
"D",
"E"};
714 for ( Int_t lay=0;lay<4;lay++ )
715 for ( Int_t sec=0;sec<12;sec++ )
716 for ( Int_t sub=0;sub<5;sub++ )
717 for ( Int_t eta=0;eta<12;eta++ )
723 TString tname=sn[sec];tname+=ln[lay];tname+=bn[sub];tname+=sn[eta];
724 TString hname=
"h";hname+=tname;
725 TH1F *h=(TH1F*)GetHist(hname);
732 c1=
new TCanvas(
"c1",
"c1",850,1100);
737 const Char_t *pn[]={
"U",
"V"};
741 for ( Int_t sec=0;sec<12;sec++ )
742 for ( Int_t pln=0;pln<2;pln++ )
743 for ( Int_t strip=0;strip<288;strip++ )
749 TString tname =sn[sec];
751 if (strip+1<100) tname+=
"0";
752 if (strip+1<10) tname+=
"0";
754 TString hname=
"h";hname+=tname;
755 TH1F *h=(TH1F*)GetHist(hname);
787 mTotalYield = nevents;
788 std::cout << Form(
"Timing from L2ped file: %s nevents: %i",fname,nevents) << std::endl;
789 TFile *f=
new TFile(fname);
791 TList *l = f->GetListOfKeys();
794 while ((key = (TKey*)next()))
796 TObject *o = key->ReadObj();
797 TString name = o->GetName();
798 if ( !name.Contains(
"T") )
continue;
800 TString title=h->GetTitle();
805 sscanf(title.Data(),
"%*s cr/ch=%03d/%03d",&crate,&channel);
807 std::cout << Form(
"+ name: %s title: %s crate: %i channel: %i",name.Data(),title.Data(),crate,channel) << std::endl;
811 hTower[crate-1][channel] = h;
EEmc ADC –> energy maker.
void processFromL2(const Char_t *name, int nevents)
Process ready-made histograms from level 2.
const EEmcDbItem * getByIndex(int ikey) const
returns full DB info for one pixel
char name[StEEmcNameLen]
ASCII name of the channel, see Readme.
StEEmcStrip & strip(Int_t sector, Int_t plane, Int_t strip)
void name(const Char_t *n)
Set the name for this element.
void raw(Float_t r)
Set the raw ADC for this element.
void supressZeroAdc()
Do not fill histograms with ADC=0.
Base class for representing tower, preshower and postshower elements.
char tube[StEEmcNameLen]
name of PMT or MAPMT pixel
virtual const char * GetName() const
special overload
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
StEEmcTower & tower(Int_t index, Int_t layer=0)
void Clear(Option_t *opts="")
User defined functions.
Base class for describing an endcap SMD strip.