178 #include "StMessMgr.h"
179 #include "StQAMakerBase.h"
180 #include "StQABookHist.h"
183 #include "StDetectorDbMaker/St_tpcPadConfigC.h"
184 #include "StarRoot/TH1Helper.h"
190 StMaker(name,title), QAMakerType(type) {
193 histsList.Expand(32);
194 histsList.SetOwner();
196 for (i=0;i<32;i++) histsList.AddAt(0,i);
197 histsSet = StQA_Undef;
221 m_ftpc_chargestepW=0;
222 m_ftpc_chargestepE=0;
223 m_ftpc_fcl_radialW=0;
224 m_ftpc_fcl_radialE=0;
229 for (
int i =0; i < 24; ++ i) {
230 mTpcSectorPlot[i] = 0;
231 m_tpc_adc_chargevstb[i] = 0;
232 m_tpc_adc_chargevstbTPX[i] = 0;
233 m_tpc_adc_chargevsrowvstb[i] = 0;
234 m_tpc_adc_chargesum[i] = 0;
235 m_tpc_clust_stats[i] = 0;
236 m_tpc_clust_statsvsrow[i] = 0;
237 m_tpc_clust_charge[i] = 0;
238 m_tpc_clust_chargeTPX[i] = 0;
239 m_tpc_clust_chargesum[i] = 0;
240 m_tpc_clust_chargevstb[i] = 0;
241 m_tpc_clust_chargevstbTPX[i] = 0;
242 m_tpc_clust_chargevsrow[i] = 0;
244 m_tpc_adc_chargepersector = 0;
245 m_tpc_adc_chargepersectorTPX = 0;
246 m_tpc_adc_numhitsvsrowvssector = 0;
247 m_tpc_clust_pxltb = 0;
248 m_tpc_clust_pxltbTPX = 0;
249 m_tpc_clust_pxlp = 0;
250 m_tpc_clust_pxlpTPX = 0;
251 m_tpc_clust_numclust = 0;
252 m_tpc_clust_numclustTPX = 0;
258 m_h1_inv_mass_cluster = 0;
259 m_h1_dgg_cluster = 0;
260 m_h1_two_cluster_energy_allcut = 0;
261 m_h2_cluster_dgg_vs_E1pE2 = 0;
268 for (i=0; i<kRP_MAXSEQ; i++) m_RP_clusters_xy[i] = 0 ;
271 for (i=0; i<10; i++) m_etofHist[i] = 0;
275 StQAMakerBase::~StQAMakerBase() {
276 if (mNullPrimVtx)
delete mNullPrimVtx;
277 if (mMultClass)
delete mMultClass;
278 if (mTrigWord)
delete mTrigWord;
279 if (mTrigBits)
delete mTrigBits;
283 for (Int_t i=0; i<24; i++) {
284 delete mTpcSectorPlot[i];
310 Int_t StQAMakerBase::Init() {
313 if (IAttr(
"allTrigs")) allTrigs = kTRUE;
314 if (IAttr(
"allEvents")) allEvents = kTRUE;
315 return StMaker::Init();
325 gMessMgr->Info(
" In StQAMakerBase::Make()");
327 if (!mNullPrimVtx) BookHist();
332 case (StQA_AuAuOld) :
333 mMultClass->Fill((
float) eventClass);
339 if (!
hists) NewQABookHist();
343 if (!(fillHists || allEvents))
return kStOk;
354 if (!eventClassIdx) MakeHistTPC();
364 if (
histsSet==StQA_MC) MakeHistEval();
366 if (
histsSet==StQA_AuAuOld) MakeHistBBC();
368 if (
histsSet==StQA_AuAuOld) MakeHistFPD();
370 if (
histsSet<StQA_run12all) MakeHistPMD();
372 if (
histsSet>=StQA_run8) MakeHistTOF();
374 if (
histsSet>=StQA_run13 && !eventClassIdx) MakeHistFMS();
376 if (
histsSet>=StQA_run12all) MakeHistMTD();
385 if (
histsSet>=StQA_run15 && !eventClassIdx) MakeHistRP();
396 void StQAMakerBase::NewQABookHist() {
397 const char* pre = prefix[eventClass].Data();
400 "StQAMakerBase: booking histograms with prefix: " <<
402 QAH::maker = (
StMaker*) (
this);
404 histsList.AddAt(
hists,eventClass);
408 TH2F* StQAMakerBase::MH1F(
const Text_t* name,
const Text_t* title,
409 Int_t nbinsx, Axis_t xlow, Axis_t xup) {
410 TH2F* h = QAH::MH1F(name,title,nbinsx,xlow,xup,eventClass);
412 h->Rebin(0,
"low mult");
413 h->Rebin(1,
"mid mult");
414 h->Rebin(2,
"high mult");
419 void StQAMakerBase::BookHist() {
422 Int_t tempClass = eventClass;
425 prefix[0] = QAMakerType;
432 case (StQA_AuAuOld) : {
433 (prefix[0] = QAMakerType) +=
"LM";
434 (prefix[1] = QAMakerType) +=
"MM";
435 (prefix[2] = QAMakerType) +=
"HM";
452 (prefix[0] = QAMakerType) +=
"MB";
453 (prefix[1] = QAMakerType) +=
"CL";
454 (prefix[2] = QAMakerType) +=
"HT";
455 (prefix[3] = QAMakerType) +=
"XX";
456 (prefix[4] = QAMakerType) +=
"JP";
461 prefix[0] = QAMakerType;
462 (prefix[1] = QAMakerType) +=
"HP";
463 (prefix[2] = QAMakerType) +=
"XX";
474 case (StQA_run12all) :
477 prefix[0] = QAMakerType;
483 QAH::maker = (
StMaker*) (
this);
484 QAH::preString = QAMakerType;
491 if (
histsSet>=StQA_run22) BookHistFCS();
493 if (
histsSet>=StQA_run15) BookHistRP();
494 if (
histsSet>=StQA_run19) BookHistETOF();
496 Int_t tempClass2 = eventClass;
498 for (eventClass=0; eventClass<tempClass2; eventClass++) {
499 if (!(QAMakerType.CompareTo(prefix[eventClass]))) {
504 eventClass = tempClass;
508 void StQAMakerBase::BookHistGeneral(){
510 mNullPrimVtx = QAH::H1F(
"QaNullPrimVtx",
"event primary vertex check",40,-2,2);
511 mNullPrimVtx->SetXTitle(
"has primary vertex? (yes = 1, no = -1)");
512 mNullPrimVtx->SetYTitle(
"# of events");
515 mMultClass = QAH::H1F(
"QaMultClass",
"event multiplicity class",5,-0.5,4.5);
516 mMultClass->SetXTitle(
"mult class (0=?/MC, 1=LM, 2=MM, 3=HM)");
517 mMultClass->SetYTitle(
"# of events");
520 m_glb_simpactTime = QAH::H2F(
"QaGtrkSImpactTime",
"globtrk: signed impact param from prim vtx vs. time",
521 18000,0.,3600.,120,-3.0,3.0);
525 void StQAMakerBase::BookHistTrigger(){
527 QAH::maker = (
StMaker*) (
this);
528 QAH::preString = QAMakerType;
529 if (mTrigWord)
return;
530 mTrigWord = QAH::H1F(
"QaTrigWord",
"trigger word",8,0.5,8.5);
531 mTrigWord->SetXTitle(
"1:MinBias 2:Central 3:HiPt 4:Jet 5:HiTower 6:OtherPhys");
532 mTrigBits = QAH::H1F(
"QaTrigBits",
"trigger bits",64,-0.5,63.5);
535 void StQAMakerBase::BookHistDE(){
540 StMaker* fhMaker = GetMaker(
"dEdxY2");
542 m_dedx_Z3A = (TH3F*) (fhMaker->GetHist(
"Z3A"));
551 m_dedx_Z3A = (TH3F*) (fhDS->FindObject(
"Z3A"));
560 void StQAMakerBase::BookHistFcl(){
563 if (!(m_ftpc_chargestepW)) {
565 StMaker* fhMaker = GetMaker(
"ftpc_hits");
567 m_ftpc_chargestepW = (TH1F*) (fhMaker->GetHist(
"fcl_chargestepW"));
568 AddHist(m_ftpc_chargestepW);
584 (TH1F*) (fhDS->FindObject(
"fcl_chargestepW"));
585 AddHist(m_ftpc_chargestepW);
587 (TH1F*) (fhDS->FindObject(
"fcl_chargestepE"));
590 (TH1F*) (fhDS->FindObject(
"fcl_radialW"));
593 (TH1F*) (fhDS->FindObject(
"fcl_radialE"));
601 void StQAMakerBase::BookHistFCS(){
603 if (!(m_h1_inv_mass_cluster)) {
604 StMaker* fhMaker = GetMaker(
"FcsPi0F");
606 m_h1_inv_mass_cluster = (TH1F*) (fhMaker->GetHist(
"h1_inv_mass_cluster"));
607 m_h1_dgg_cluster = (TH1F*) (fhMaker->GetHist(
"h1_dgg_cluster"));
608 m_h1_two_cluster_energy_allcut = (TH1F*) (fhMaker->GetHist(
"h1_two_cluster_energy_allcut"));
609 m_h2_cluster_dgg_vs_E1pE2 = (TH2F*) (fhMaker->GetHist(
"h2_cluster_dgg_vs_E1pE2"));
617 m_h1_inv_mass_cluster = (TH1F*) (fhDS->FindObject(
"h1_inv_mass_cluster"));
618 m_h1_dgg_cluster = (TH1F*) (fhDS->FindObject(
"h1_dgg_cluster"));
619 m_h1_two_cluster_energy_allcut = (TH1F*) (fhDS->FindObject(
"h1_two_cluster_energy_allcut"));
620 m_h2_cluster_dgg_vs_E1pE2 = (TH2F*) (fhDS->FindObject(
"h2_cluster_dgg_vs_E1pE2"));
624 AddHist(m_h1_inv_mass_cluster);
625 AddHist(m_h1_dgg_cluster);
626 AddHist(m_h1_two_cluster_energy_allcut);
627 AddHist(m_h2_cluster_dgg_vs_E1pE2);
632 void StQAMakerBase::BookHistFMS(){
634 for(
int qt = kQt1; qt < kQtError; ++qt) {
658 if(qt >= kQt1 and qt <= kQt4) {
659 std::stringstream stream;
660 stream <<
"fms_qt_channel_adc_crate_" << qt;
664 stream <<
"Input to FMS QT crate " << qt <<
" (" << s <<
")";
665 title = stream.str();
668 else if(kFpd == qt) {
669 name =
"fpd_channel_adc";
670 title =
"Input to FPD QT crate";
674 TH2F* h =
new TH2F(name.c_str(),
676 kNChannels, 0., kNChannels,
678 TH1Helper::SetCanRebin(h);
679 h->SetXTitle(
"slot * 32 + channel");
688 void StQAMakerBase::BookHistRP(){
691 char rpname[kRP_MAXSEQ][5] = {
"E1U",
"E1D",
"E2U",
"E2D",
"W1U",
"W1D",
"W2U",
"W2D" };
693 char strs[20], strl[100];
694 for ( Int_t i=0; i<kRP_MAXSEQ; i++ ) {
695 sprintf(strs,
"RP_cluster_xy_%s", rpname[i] ) ;
696 sprintf(strl,
"Clusters Y vs X in %s", rpname[i] ) ;
697 m_RP_clusters_xy[i] = QAH::H2F(strs, strl, 96, 0., 768., 96, 0., 768. );
702 void StQAMakerBase::BookHistETOF(){
705 if (!(m_etofHist[0])) {
708 StMaker* ehMaker = GetMaker(
"etofHit");
710 m_etofHist[etofCnt++] = (TH1*) (ehMaker->GetHist(
"etofHit_tof"));
711 m_etofHist[etofCnt++] = (TH1*) (ehMaker->GetHist(
"averageTimeDiff_etofHits_btofHits"));
712 m_etofHist[etofCnt++] = (TH1*) (ehMaker->GetHist(
"multiplicity_etofHits_btofHits"));
713 m_etofHist[etofCnt++] = (TH1*) (ehMaker->GetHist(
"multiplicity_etofHits_epdEast"));
716 StMaker* emMaker = GetMaker(
"etofMatch");
718 m_etofHist[etofCnt++] = (TH1*) (emMaker->GetHist(
"A_eTofHits_globalXY"));
719 m_etofHist[etofCnt++] = (TH1*) (emMaker->GetHist(
"B_intersectionMult_etofMult"));
720 m_etofHist[etofCnt++] = (TH1*) (emMaker->GetHist(
"G_matchCand_beta_signmom"));
721 m_etofHist[etofCnt++] = (TH1*) (emMaker->GetHist(
"G_matchCand_timeOfFlight_pathLength"));
722 m_etofHist[etofCnt++] = (TH1*) (emMaker->GetHist(
"G_primary_Intersection_validMatch"));
723 m_etofHist[etofCnt++] = (TH1*) (emMaker->GetHist(
"H_matchCand_t0corr_1d"));
725 for (
int i=0; i<etofCnt; i++) AddHist(m_etofHist[i]);
729 void StQAMakerBase::BookHistTPC(){
731 for (
int i = 0; i < 24; ++ i) {
732 int num_rows = St_tpcPadConfigC::instance()->numberOfRows(i+1);
733 mTpcSectorPlot[i] = QAH::H2F(Form(
"Qa%sTpcSector%d",(num_rows > 45 ?
"i" :
""),i+1),
734 Form(
"Hits in %sTPC Sector %d",(num_rows > 45 ?
"i" :
""),i+1),
735 104,-52.,52.,num_rows+2,-0.5,((
float) num_rows)+1.5);
736 mTpcSectorPlot[i]->SetXTitle(
"along padrows [cm]");
737 mTpcSectorPlot[i]->SetYTitle(
"padrow");
739 m_pnt_rpTQW = QAH::H2F(
"QaPointRPTpcQW",
"point: r-phi distribution of charge, tpcW",20,58.75,196.75,72,0,TMath::TwoPi());
740 m_pnt_rpTQE = QAH::H2F(
"QaPointRPTpcQE",
"point: r-phi distribution of charge, tpcE",20,58.75,196.75,72,0,TMath::TwoPi());
742 for (
int i = 0; i < 24; ++ i) {
743 int num_rows = St_tpcPadConfigC::instance()->numberOfRows(i+1);
744 int max_pads_per_row = St_tpcPadConfigC::instance()->numberOfPadsAtRow(i+1,num_rows);
745 m_tpc_adc_chargevstb[i] = QAH::H1F(Form(
"QaTpc_adc_chargevstb_%d",i+1),Form(
"ADC charge vs. time bucket (iTPC), sector %d",i+1),512,0,511);
746 m_tpc_adc_chargevstbTPX[i] = QAH::H1F(Form(
"QaTpc_adc_chargevstbTPX_%d",i+1),Form(
"ADC charge vs. time bucket (TPX), sector %d",i+1),512,0,511);
747 m_tpc_adc_chargevsrowvstb[i] = QAH::H2F(Form(
"QaTpc_adc_chargevsrowvstb_%d",i+1),Form(
"charge vs. row vs. time bucket, sector %d",i+1),400,0.5,0.5+400,72,0.5,72+0.5);
748 m_tpc_adc_chargesum[i] = QAH::H2F(Form(
"QaTpc_adc_chargesum_%d",i+1),Form(
"ADC sum over all events, sector %d",i+1),max_pads_per_row,0.5,max_pads_per_row+0.5,num_rows,0.5,num_rows+0.5);
750 m_tpc_clust_stats[i] = QAH::H1F(Form(
"QaTpc_clust_stats_%d",i+1),Form(
"status of clusters, sector %d",i+1),32,-0.5,31.5);
751 m_tpc_clust_statsvsrow[i] = QAH::H2F(Form(
"QaTpc_clust_statsvsrow_%d",i+1),Form(
"status of clusters vs. row, sector %d",i+1),72,0.5,72+0.5, 32,-0.5,31.5);
752 m_tpc_clust_charge[i] = QAH::H1F(Form(
"QaTpc_clust_charge_%d",i+1),Form(
"charge per cluster (iTPC), sector %d",i+1),1024,0,8096);
753 m_tpc_clust_chargeTPX[i] = QAH::H1F(Form(
"QaTpc_clust_chargeTPX_%d",i+1),Form(
"charge per cluster (TPX), sector %d",i+1),2048,0,2048);
754 m_tpc_clust_chargesum[i] = QAH::H2F(Form(
"QaTpc_clust_chargesum_%d",i+1),Form(
"cluster sum over all events, sector %d",i+1),max_pads_per_row,0.5,max_pads_per_row+0.5,num_rows,0.5,num_rows+0.5);
755 m_tpc_clust_chargevstb[i] = QAH::H2F(Form(
"QaTpc_clust_chargevstb_%d",i+1),Form(
"charge vs. time bucket (iTPC), sector %d",i+1),128,0.5,512+0.5,64,0.5,0.5+2048);
756 m_tpc_clust_chargevstbTPX[i] = QAH::H2F(Form(
"QaTpc_clust_chargevstbTPX_%d",i+1),Form(
"charge vs. time bucket (TPX), sector %d",i+1),128,0.5,512+0.5,64,0.5,0.5+2048);
757 m_tpc_clust_chargevsrow[i] = QAH::H2F(Form(
"QaTpc_clust_chargevsrow_%d",i+1),Form(
"charge vs. row, sector %d",i+1),72,0.5,72+0.5,128,0.5,0.5+2048);
763 m_tpc_clust_pxltb = QAH::H2F(
"QaTpc_clust_pxltb",
"cluster pixel time bucket size (iTPC)",24,0.5,24.5,100,0,100);
764 m_tpc_clust_pxltbTPX = QAH::H2F(
"QaTpc_clust_pxltbTPX",
"cluster pixel time bucket size (TPX)",24,0.5,24.5,100,0,100);
765 m_tpc_clust_pxlp = QAH::H2F(
"QaTpc_clust_pxlp",
"cluster pixel pad size (iTPC)",24,0.5,24.5,100,0,100);
766 m_tpc_clust_pxlpTPX = QAH::H2F(
"QaTpc_clust_pxlpTPX",
"cluster pixel pad size (TPX)",24,0.5,24.5,100,0,100);
767 m_tpc_clust_numclust = QAH::H2F(
"QaTpc_clust_numclust",
"number of clusters vs. sector (iTPC)",24,0.5,24.5,120,0,6);
768 m_tpc_clust_numclustTPX = QAH::H2F(
"QaTpc_clust_numclustTPX",
"number of clusters vs. sector (TPX)",24,0.5,24.5,120,0,6);
Int_t histsSet
event class-dependent histograms
virtual void Clear(Option_t *)
User defined functions.
TH2F * m_tpc_adc_numhitsvsrowvssector
charge per sector (TPX)
TH2F * m_tpc_clust_numclust
cluster pixel pad size (outer)
TH1F * m_ftpc_fcl_radialW
Chargestep from ftpc east.
virtual void Clear(Option_t *option="")
User defined functions.
TH2F * m_tpc_clust_statsvsrow[24]
status of clusters
TH1PtrMap mFMShistograms
signed impact parameter from primary vertex vs. time
TH2F * m_tpc_clust_pxltb
adc hits vs row vs sector
TH2F * m_tpc_clust_chargevstb[24]
cluster sum over all events
TH1F * m_tpc_clust_chargeTPX[24]
charge per cluster (inner)
TH2F * m_tpc_clust_chargevstbTPX[24]
charge vs. time bucket (inner)
TH1F * m_ftpc_chargestepE
Chargestep from ftpc west.
TH1F * m_ftpc_fcl_radialE
ftpc west cluster radial position
TH3F * m_dedx_Z3A
number of clusters vs. sector (outer)
TH2F * m_tpc_adc_chargevsrowvstb[24]
ADC charge vs. time bucket (outer)
TH2F * m_tpc_clust_pxlp
cluster pixel time bucket size (outer)
StQABookHist * hists
pointers to the histogram classes for the
TH2F * m_tpc_clust_pxltbTPX
cluster pixel time bucket size (inner)
TH2F * m_tpc_clust_chargevsrow[24]
charge vs. time bucket (outer)
TH2F * m_tpc_clust_chargesum[24]
charge per cluster (outer)
TH2F * m_tpc_clust_numclustTPX
number of clusters vs. sector (inner)
TH1F * m_tpc_clust_charge[24]
status of clusters vs. row
TH1F * m_tpc_adc_chargepersectorTPX
charge per sector
TH1F * m_tpc_adc_chargepersector
charge vs. row
TH1F * m_tpc_adc_chargevstbTPX[24]
ADC charge vs. time bucket (inner)
TH2F * m_tpc_adc_chargesum[24]
charge vs. row vs. time bucket
TH1F * m_tpc_adc_chargevstb[24]
ftpc east cluster radial position
TH2F * m_tpc_clust_pxlpTPX
cluster pixel pad size (inner)
TH1F * m_tpc_clust_stats[24]
ADC sum over all events.
virtual TDataSet * Find(const char *path) const