33 h->GetXaxis()->SetTitle(
"");
34 h->GetXaxis()->SetLabelSize(0.03);
36 for(
unsigned int j=6; j<86; j++) {
38 float xmid =
h->GetBinLowEdge(j) +
h->GetBinWidth(j);
39 xmid -= 1.0; xmid *= -1.0;
40 int seclay =
int(ceil(xmid*10));
42 int lay = (seclay%10)/2 ;
44 h->GetXaxis()->SetBinLabel(j,Form(
"%c%02d:%d",(sec%2==0?
'S':
'L'),sec,lay));
47 }
else if (
side == 1) {
48 for(
unsigned int j=6; j<86; j++) {
50 float xmid =
h->GetBinLowEdge(j) +
h->GetBinWidth(j);
51 int seclay =
int(ceil(xmid*10));
53 int lay = (seclay%10)/2 ;
54 h->GetXaxis()->SetBinLabel(j,Form(
"%c%02d:%d",(sec%2==0?
'S':
'L'),sec,lay));
68 m_stripFitter(
name, this),
69 m_cscCalibTool(
name, this),
70 m_trigDec(
"Trig::TrigDecisionTool/TrigDecisionTool" ),
71 m_cscclus_oviewEA(nullptr),
72 m_cscclus_oviewEC(nullptr)
125 if (
m_trigDec.retrieve().isFailure() ) {
126 ATH_MSG_WARNING (
"CscClusterValAlg: Unable to retrieve trigger decision tool");
138 ATH_MSG_WARNING(
"Event selection triggers not specified. Switching off trigger-aware monitoring");
143 return StatusCode::SUCCESS;
289 float nyminEC = -17.;
305 float Nxmax = 15361.;
311 "Cluster occupancy ;channel;[sector] + [0.2 #times layer]",nxbins,nxmin,nxmax,nybins,nymin,nymax);
314 Form(
"Cluster occupancy, Qmax #leq %4u counts;channel;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
315 nxbins,nxmin,nxmax,nybins,nymin,nymax);
318 Form(
"Cluster occupancy, Qmax > %4u counts;channel;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
319 nxbins,nxmin,nxmax,nybins,nymin,nymax);
322 Form(
"Segment occupancy, Qmax > %4u counts;segment;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
323 16,-0.5,15.5,nybins,nymin,nymax);
327 Form(
"EndCap A: Layer occupancy, Qmax > %4u counts;[sector] + [0.2 #times layer];entries/layer",
m_qmaxADCCut),nybinsEA,nyminEA,nymaxEA);
331 Form(
"EndCap C: Layer occupancy, Qmax > %4u counts;[sector] + [0.2 #times layer];entries/layer",
m_qmaxADCCut),nybinsEC,nyminEC,nymaxEC);
335 m_h2csc_clus_qsum =
new TH2F(
"h2csc_clus_qsum",
"Cluster charge (Qsum);counts;[sector] + [0.2 #times layer]",
336 nqbins,nqmin,nqmax,nybins,nymin,nymax);
338 Form(
"Cluster charge(Qsum), Qmax #leq %4u counts;counts;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
339 nqbins,nqmin,nqmax,nybins,nymin,nymax);
342 Form(
"Cluster charge(Qsum), Qmax > %4u counts;counts;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
343 nqbins,nqmin,nqmax,nybins,nymin,nymax);
346 Form(
"EndCap A: Cluster charge(Qsum), Qmax > %4u counts;counts;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
347 nqbins,nqmin,nqmax,nybinsEA,nyminEA,nymaxEA);
350 Form(
"EndCap A: Cluster charge(Qsum), Qmax > %4u counts;counts;entries/20 counts;",
m_qmaxADCCut),nqbins,nqmin,nqmax);
353 Form(
"EndCap A: MPV of Landau fit to Cluster charge(Qsum);[sector] + [0.2 #times layer];counts/layer"),nybinsEA,nyminEA,nymaxEA);
357 Form(
"EndCap C: Cluster charge(Qsum), Qmax > %4u counts;counts;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
358 nqbins,nqmin,nqmax,nybinsEC,nyminEC,nymaxEC);
361 Form(
"EndCap C: Cluster charge(Qsum), Qmax > %4u counts;counts;entries/20 counts;",
m_qmaxADCCut),nqbins,nqmin,nqmax);
363 Form(
"EndCap C: MPV of Landau fit to Cluster charge(Qsum);[sector] + [0.2 #times layer];counts/layer"),nybinsEC,nyminEC,nymaxEC);
367 m_h2csc_clus_qmax =
new TH2F(
"h2csc_clus_qmax",
"Cluster peak-strip charge, Qmax;counts;[sector] + [0.2 #times layer]",
368 nqbins,nqmin,nqmax,nybins,nymin,nymax);
370 Form(
"Cluster peak-strip charge, Qmax #leq %4u counts;counts;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
371 nqbins,nqmin,nqmax,nybins,nymin,nymax);
373 Form(
"Cluster peak-strip charge, Qmax > %4u counts;counts;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
374 nqbins,nqmin,nqmax,nybins,nymin,nymax);
377 Form(
"EndCap A: Cluster peak-strip charge, Qmax > %4u counts;counts;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
378 nqbins,nqmin,nqmax,nybinsEA,nyminEA,nymaxEA);
381 Form(
"EndCap A: Cluster peak-strip charge, Qmax > %4u counts;counts;entries/20 counts;",
m_qmaxADCCut),nqbins,nqmin,nqmax);
384 Form(
"EndCap C: Cluster peak-strip charge, Qmax > %4u counts;counts;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
385 nqbins,nqmin,nqmax,nybinsEC,nyminEC,nymaxEC);
388 Form(
"EndCap C: Cluster peak-strip charge, Qmax > %4u counts;counts;entries/20 counts;",
m_qmaxADCCut),nqbins,nqmin,nqmax);
392 "#eta-cluster sampling time;ns;entries/ns",ntbins,ntmin,ntmax );
394 Form(
"#eta-cluster sampling time, Qmax #leq %4u counts;ns;entries/ns",
m_qmaxADCCut),ntbins,ntmin,ntmax );
396 Form(
"#eta-cluster sampling time, Qmax > %4u counts;ns;entries/ns",
m_qmaxADCCut),ntbins,ntmin,ntmax );
399 Form(
"EndCap A: #eta-cluster sampling time, Qmax > %4u counts;ns;entries/ns",
m_qmaxADCCut),ntbins,ntmin,ntmax );
401 Form(
"EndCap C: #eta-cluster sampling time, Qmax > %4u counts;ns;entries/ns",
m_qmaxADCCut),ntbins,ntmin,ntmax );
405 "#eta-cluster charge;counts;entries/count",nqbins,nqmin,nqmax );
407 Form(
"#eta-cluster charge, Qmax #leq %4u counts;counts;entries/count",
m_qmaxADCCut),nqbins,nqmin,nqmax );
409 Form(
"#eta-cluster charge, Qmax > %4u counts;counts;entries/count",
m_qmaxADCCut),nqbins,nqmin,nqmax );
413 "#phi-cluster sampling time;ns;entries/ns",ntbins,ntmin,ntmax );
415 Form(
"#phi-cluster sampling time, Qmax #leq %4u counts;ns;entries/ns",
m_qmaxADCCut),ntbins,ntmin,ntmax );
417 Form(
"#phi-cluster sampling time, Qmax > %4u counts;ns;entries/ns",
m_qmaxADCCut),ntbins,ntmin,ntmax );
421 "#phi-cluster charge;counts;entries/count",nqbins,nqmin,nqmax );
423 Form(
"#phi-cluster charge, Qmax #leq %4u counts;counts;entries/count",
m_qmaxADCCut),nqbins,nqmin,nqmax );
425 Form(
"#phi-cluster charge, Qmax > %4u counts;counts;entries/count",
m_qmaxADCCut),nqbins,nqmin,nqmax );
430 "#eta-cluster width;# strips;[sector] + [0.2 #times layer]",
431 192,0,192,nybins,nymin,nymax);
433 Form(
"#eta-cluster width, Qmax #leq %4u counts;# strips;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
434 192,0,192,nybins,nymin,nymax);
436 Form(
"#eta-cluster width, Qmax > %4u counts;# strips;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
437 192,0,192,nybins,nymin,nymax);
441 "#phi-cluster width;# strips;[sector] + [0.2 #times layer]",
442 48,0,48,nybins,nymin,nymax);
444 Form(
"#phi-cluster width, Qmax #leq %4u counts;# strips;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
445 48,0,48,nybins,nymin,nymax);
447 Form(
"#phi-cluster width, Qmax > %4u counts;# strips;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
448 48,0,48,nybins,nymin,nymax);
451 m_h1csc_clus_totalWidth_EA =
new TH1F(
"h1csc_clus_totalWidth_EA",
"EndCap A: Cluster hits in all EA eta(#eta) & phi(#phi) strips;strips;cluster hits",Nxbins,Nxmin,Nxmax);
453 m_h1csc_clus_totalWidth_EC =
new TH1F(
"h1csc_clus_totalWidth_EC",
"EndCap C: Cluster hits in all EC eta(#eta) & phi(#phi) strips;strips;cluster hits",Nxbins,Nxmin,Nxmax);
457 "#eta-cluster count;no.of clusters;[sector] + [0.2 #times layer]",
458 20,0,20,nybins,nymin,nymax);
460 Form(
"#eta-cluster count, Qmax #leq %4u counts;# clusters;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
461 20,0,20,nybins,nymin,nymax);
463 Form(
"#eta-cluster count, Qmax > %4u counts;# clusters;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
464 20,0,20,nybins,nymin,nymax);
468 "#phi-cluster count;# clusters;[sector] + [0.2 #times layer]",
469 20,0,20,nybins,nymin,nymax);
471 Form(
"#phi-cluster count, Qmax #leq %4u counts;# clusters;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
472 20,0,20,nybins,nymin,nymax);
474 Form(
"#phi-cluster count, Qmax > %4u counts;# clusters;[sector] + [0.2 #times layer]",
m_qmaxADCCut),
475 20,0,20,nybins,nymin,nymax);
479 Form(
"Clusters per event, Qmax #leq %4u counts;no.of clusters;entries",
m_qmaxADCCut),26,-1,25);
481 Form(
"Clusters per event, Qmax > %4u counts;no.of clusters;entries",
m_qmaxADCCut),26,-1,25);
485 "Eta vs. Phi Cluster count correlation;#varphi-cluster count;#eta-cluster count",100,0,100,100,0,100);
487 "Eta vs. Phi Noise-Cluster count correlation;#varphi-cluster count;#eta-cluster count",100,0,100,100,0,100);
489 "Eta vs. Phi Signal-Cluster count correlation;#varphi-cluster count;#eta-cluster count",100,0,100,100,0,100);
492 "Eta vs. Phi Cluster width correlation;#varphi-cluster width;#eta-cluster width",100,0,100,100,0,100);
495 "R vs. Z Cluster hitmap;z(mm);R(mm)",200, -10000., 10000., 40, 0., 4000);
498 "Y vs. X Cluster hitmap;x(mm);y(mm)",100, -5000., 5000., 100, -5000., 5000);
618 if (
sc.isFailure() ) {
619 ATH_MSG_ERROR (
"Cannot register histogram " << (*iT)->GetName() );
630 if (
sc.isFailure() ) {
631 ATH_MSG_ERROR (
"Cannot register histogram " << (*iT)->GetName() );
643 if (
sc.isFailure() ) {
644 ATH_MSG_ERROR (
"Cannot register overview histogram for Endcap A: " << (*iT)->GetName() );
656 if (
sc.isFailure() ) {
657 ATH_MSG_ERROR (
"Cannot register overview histogram for Endcap C: " << (*iT)->GetName() );
698 Icol !=
cols->end(); ++Icol ) {
703 int clusCount[33][9], sigclusCount[33][9];
704 unsigned int nEtaClusWidthCnt = 0, nPhiClusWidthCnt = 0;
705 for(
unsigned int kl = 0;
kl < 33;
kl++ ) {
706 for(
unsigned int km = 0;
km < 9;
km++ ) {
707 clusCount[
kl][
km] = 0;
708 sigclusCount[
kl][
km] = 0;
734 ATH_MSG_DEBUG (
" Begin loop over clusters ============================");
736 Itclu != clus.
end(); ++Itclu ) {
738 const std::vector<Identifier>& stripIds = iClus.
rdoList();
739 float clu_charge = iClus.
charge();
740 float clu_time = iClus.
time();
742 ATH_MSG_DEBUG(
" cluster charge = " << clu_charge <<
"\t cluster time = " << clu_time );
744 unsigned int noStrips = stripIds.size();
745 Identifier clusId = iClus.
identify();
750 int chamberType = stationString ==
"CSS" ? 0 : 1;
753 int wireLayer =
m_idHelperSvc->cscIdHelper().wireLayer(clusId);
754 int measuresPhi =
m_idHelperSvc->cscIdHelper().measuresPhi(clusId);
760 float r = sqrt(
x*
x +
y*
y);
766 float secLayer = sectorNo + 0.2 * (wireLayer - 1) + 0.1;
767 int xfac = measuresPhi ? -1 : 1;
778 if(secLayer < 0. || secLayer == 0.) {
786 int ns = sectorNo < 0 ? sectorNo*(-1) : sectorNo+16;
787 int nl = (measuresPhi ? wireLayer : wireLayer+4);
794 ATH_MSG_DEBUG(
" ns = " <<
ns <<
"\tm_nl = " << nl <<
"\tm_sec = " << sectorNo <<
"\t m_lay= " << wireLayer <<
"\tmPhi = " << measuresPhi);
801 bool cluster_status = ( (
stat ==
"unspoiled") ||
802 (
stat ==
"unspoiled with split") ||
807 bool eta_cluster_status = cluster_status && ( noStrips > 2 ) && (measuresPhi == 0);
810 bool phi_cluster_status = cluster_status && ( noStrips > 0 ) && (measuresPhi == 1);
812 ATH_MSG_DEBUG (
" ClusterStatus eta = " << eta_cluster_status <<
" ,phi = " << phi_cluster_status);
814 << measuresPhi <<
",wire:" << wireLayer <<
") = " << secLayer <<
" status = "
815 <<
stat <<
" #of strips = " << noStrips );
818 if(eta_cluster_status || phi_cluster_status ) {
820 bool found_id =
true;
821 std::vector <const CscStripPrepData*> stripVec;
822 std::vector <float> fStripIDs;
823 float maxStripCharge = 0., maxStipId = 0.;
824 int sIdx = 0, mxIdx = 0;
836 for ( std::vector<Identifier>::const_iterator sId = stripIds.begin(); sId != stripIds.end(); ++sId, sIdx++ ) {
837 Identifier
id = *sId;
839 float stripid = thisStrip * xfac;
840 fStripIDs.push_back(stripid);
845 if (
icol ==
nullptr ) {
853 bool found_strip =
false;
854 float maxsampChVal = 0.;
857 found_strip = ( *istrip )->identify() ==
id ;
859 stripVec.push_back(*istrip);
860 const std::vector<float> &samp_charges = ( *istrip )->sampleCharges();
861 for(
unsigned int i = 0;
i < samp_charges.size();
i++ ) {
862 if(samp_charges[
i] > maxsampChVal) maxsampChVal = samp_charges[
i];
864 if(maxsampChVal > maxStripCharge ) {
865 maxStripCharge = maxsampChVal;
872 ATH_MSG_DEBUG (
" " << (found_strip?
"FoundStrip " :
"NoStripFound ") <<
" with max sampling = " << maxsampChVal);
875 ATH_MSG_DEBUG (
" Max Strip charge = " << maxStripCharge <<
" and strip Id = " << maxStipId <<
" and index = " << mxIdx);
876 float qmax = 0., qleft = 0., qright = 0., qsum = 0.;
880 bool size_ids_coll = (noStrips == stripVec.size() ? true :
false) ;
882 if(found_id && size_ids_coll ) {
884 std::vector<ICscStripFitter::Result>
res;
886 bool range_check = (mxIdx > -1) && (mxIdx <
int(noStrips));
888 ATH_MSG_DEBUG (
" Range check = (" << mxIdx <<
" > -1 ) && (" << mxIdx <<
" < " << noStrips <<
" ) = " << range_check
889 <<
"\t size of vec check " << noStrips <<
" == " << stripVec.size());
895 qleft =
res[0].charge;
899 <<
res[0].dwidth <<
"\t status= " <<
res[0].
status <<
"\t chisq= " <<
res[0].chsq);
903 qmax =
res[1].charge;
907 <<
res[1].dwidth <<
"\t status= " <<
res[1].
status <<
"\t chisq= " <<
res[1].chsq);
909 if(mxIdx+1 <
int(noStrips)) {
911 qright =
res[2].charge;
915 <<
res[2].dwidth <<
"\t status= " <<
res[2].
status <<
"\t chisq= " <<
res[2].chsq);
924 float kiloele = 1.0e-3;
928 float QmaxADC = qmax * kiloele;
929 float QsumADC = qsum * kiloele;
939 sigclusCount[
ns][nl]++;
941 for(
unsigned int j =0; j < fStripIDs.size(); j++)
956 for(
unsigned int j =0; j < fStripIDs.size(); j++)
1028 ATH_MSG_DEBUG (
" End loop over clusters ============================");
1033 int numeta = 0, numphi = 0;
1034 int numetasignal = 0, numphisignal = 0;
1036 for(
int kl = 1;
kl < 33;
kl++ ) {
1039 int eta_hits[4] = {0,0,0,0};
1040 bool chamber_empty =
true;
1041 int sec =
kl < 17 ?
kl*(-1) :
kl;
1042 for(
int km = 1;
km < 9;
km++ ) {
1043 int lay = (
km > 4 &&
km < 9) ?
km-4 :
km;
1044 bool mphi = (
km > 0 &&
km < 5) ?
true :
false;
1045 std::string wlay = mphi ?
"Phi-Layer " :
"Eta-Layer: ";
1050 float secLayer = sec + 0.2 * (lay - 1) + 0.1;
1052 ATH_MSG_DEBUG (
"sec[" << sec <<
"]\t" << wlay <<
"[" << lay <<
"] = " <<
1053 secLayer <<
"= " <<
"\tNsig = " <<
scount <<
", Ntot = " <<
count);
1059 chamber_empty =
false;
1070 chamber_empty =
false;
1077 ATH_MSG_DEBUG ( wlay <<
"Counts sec: [" <<
kl-16 <<
"]\tlayer: [" <<
km <<
"] = " <<
1082 if(!chamber_empty) {
1083 std::ostringstream nseglist;
1084 std::bitset<4> segNum;
1085 for(
unsigned int mm = 0;
mm < 4;
mm++) {
1086 bool set = (eta_hits[
mm] > 0 ? true :
false);
1087 if(
set) segNum.set(
mm);
1088 nseglist << (
set ?
"1" :
"0");
1091 ATH_MSG_DEBUG(
"segments= " << nseglist.str() <<
"\t = " << segNum.to_ulong());
1098 ATH_MSG_DEBUG(
" numphi = " << numphi <<
"\t numeta = " << numeta <<
"\tm_sphi = "
1099 << numphisignal <<
"\t m_seta = " << numetasignal);
1120 std::vector<std::string>::const_iterator
1123 if (
m_trigDec->isPassed(*
it, TrigDefs::eventAccepted)) {