14 #include "CaloDetDescr/CaloDetDescrElement.h"
16 #include "Identifier/Identifier.h"
25 #include "GaudiKernel/ThreadLocalContext.h"
28 #include "TProfile2D.h"
42 m_trigDec(
"Trig::TrigDecisionTool/TrigDecisionTool"),
43 m_LArOnlineIDHelper(nullptr),
45 m_counter_sporadic_protc(0),
48 declareInterface<IMonitorToolBase>(
this);
157 ATH_MSG_WARNING(
"UseTrigger set to true but no trigger names given! Forcing useTrigger to false");
188 return StatusCode::SUCCESS;
201 std::set<std::string> uniqunesCheck;
203 auto r=uniqunesCheck.insert(
s);
205 ATH_MSG_ERROR(
"Configuration error: Threshold type " <<
s <<
" appears more than once" );
206 return StatusCode::FAILURE;
209 uniqunesCheck.clear();
214 #define CONSISTENCY(ARRAYPROP) if (ARRAYPROP.value().size()!= nThr) {\
215 ATH_MSG_ERROR( "Configuration problem: Property 'ThresholdType' has size " << nThr \
216 << " but '" << ARRAYPROP.name() << "' has size " << ARRAYPROP.value().size() );\
217 sc=StatusCode::FAILURE; \
241 if (
sc.isFailure())
return sc;
243 const std::map<const std::string, const Direction> stringToDirection {{
"over",
OVER},{
"under",
UNDER},{
"both",
BOTH},{
"none",
NONE}};
244 const std::map<const std::string, const TriggerType> stringToTrigType {{
"nota",
NOTA},{
"rndm",
RNDM},{
"calo",
CALO},{
"minbias",
MINBIAS},
248 for (
size_t iThr=0;iThr<nThr;++iThr) {
256 if (itD!=stringToDirection.end()) {
260 ATH_MSG_ERROR(
"Configuration problem. Unknown threshold direction '"
263 return StatusCode::FAILURE;
267 if (itT!=stringToTrigType.end()) {
268 threshold.m_triggersToExclude.set(itT->second);
269 if (itT->first==
"all") {
ATH_MSG_WARNING(
"Setting TriggersToExclude to 'all' has no effect!" );}
272 ATH_MSG_ERROR(
"Configuration problem. Unknown trigger type '"
274 <<
"' given in propety 'TriggersToExlude'" );
275 return StatusCode::FAILURE;
279 if (itT!=stringToTrigType.end()) {
280 threshold.m_triggersToInclude.set(itT->second);
281 if (itT->first==
"none") {
ATH_MSG_WARNING(
"Setting TriggersToInclude to 'none' has no effect!" );}
284 ATH_MSG_ERROR(
"Configuration problem. Unknown trigger type '"
286 <<
"' given in propety 'TriggersToInclude'" );
287 return StatusCode::FAILURE;
314 ATH_MSG_ERROR(
"Configuration error reading 'ThresholdColumnType': Threshold type '" << nameToOverwrite <<
"' is not defined in 'ThresholdType'" );
315 return StatusCode::FAILURE;
318 for (
unsigned iLyr=0;iLyr<
MAXLYRNS;++iLyr) {
320 ATH_MSG_ERROR(
"Configuration error: Not enough values in threshold vector for layer " << iLyr );
321 return StatusCode::FAILURE;
336 ATH_MSG_INFO(
"Config issue: Threshold type '" << thr.
m_threshName <<
"' defined but no histograms requested. Deleting." );
340 ATH_MSG_INFO(
"Threshold histograms requested for threshold '" << thrIt->m_threshName <<
"'");
348 if (thr.m_threshDirection!=
NONE &&
349 std::count(thr.m_threshTitleTemplate.begin(),thr.m_threshTitleTemplate.end(),
'%')==1) {
350 const size_t maxTitleLenght=thr.m_threshTitleTemplate.size()+32;
351 std::unique_ptr<char[]> toBeFilled(
new char[maxTitleLenght]);
353 for (
unsigned iLyrns=0;iLyrns<
MAXLYRNS;++iLyrns) {
355 snprintf(toBeFilled.get(),maxTitleLenght,thr.m_threshTitleTemplate.c_str(),thr.m_threshValue[iLyrns]);
356 toBeFilled[maxTitleLenght-1]=
'\0';
357 thr.m_threshTitles[iLyrns]=toBeFilled.get();
363 for (
unsigned iLyrns=0;iLyrns<
MAXLYRNS;++iLyrns) {
364 thr.m_threshTitles[iLyrns]=thr.m_threshTitleTemplate;
369 return StatusCode::SUCCESS;
388 return StatusCode::SUCCESS;
394 std::stringstream
dir;
396 dir.setf(std::ios_base::fixed, std::ios_base::floatfield);
404 std::string hTitle=
"Number of sporadic-cell plots in "+
partitionName+
" with CSC veto";
409 return StatusCode::SUCCESS;
418 m_h_n_trigEvent =
new TH1F(
"nEvtsByTrigger",
"Total Events: bin 0, RNDM Trigger: 1, Calo Trigger: 2, MinBias Trigger: 3, MET Trigger: 4, Misc Trigger: 5, Events Selected for Noise Plots: 6 ",7,1.,8.);
446 const std::string histTitle=std::string(
"Cell Energy in ") +
m_layerNames[ilyr]+
" with CSC veto";
449 m_h_energy[ilyr]->GetYaxis()->SetTitle(
"Cell Events");
450 m_h_energy[ilyr]->GetYaxis()->SetTitleOffset(2);
462 ytitle <<
"Cell Events/" <<
m_h_energy[ilyr]->GetYaxis()->GetBinWidth(1) <<
"MeV";
464 m_h_energy[ilyr]->GetYaxis()->SetTitleOffset(2);
467 m_h_energy[ilyr]->GetXaxis()->SetTitle(
"Cell Energy (MeV)");
468 m_h_energy[ilyr]->GetXaxis()->SetLabelSize(0.02);
469 m_h_energy[ilyr]->GetXaxis()->SetLabelOffset(0.01);
470 m_h_energy[ilyr]->GetXaxis()->SetTitleSize(0.03);
471 m_h_energy[ilyr]->GetXaxis()->SetTitleOffset(1.5);
478 const int nbintime = 92;
479 const double timescale[93] = {-200,-195,-190,-185,-180,-175,-170,-165,-160,-155,-150,-145,-140,-135,-130,-125,-120,-115,-110,-105,-100,-95,-90,-85,-80,-75,-70,-65,-60,-55,-50,-45,-40,-35,-30,-25,-20,-15,-10,-8,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,8,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200};
480 const int nbinenergy = 11;
481 const double energyscale[12] = {250,500,1000,2500,5000,10000,25000,50000,100000,250000,500000,1000000};
484 const std::string histTitle=std::string(
"Cell Energy vs Cell Time in ") +
m_layerNames[ilyr]+
" with CSC veto";
491 std::stringstream shistName;
492 shistName <<
"CellEnergyVsTime_" <<
m_layerNames[ilyr] <<
"_" << eThr;
493 std::stringstream shistTitle;
494 shistTitle <<
m_layerNames[ilyr] <<
" - Cell Time (E>" << eThr <<
" MeV) with CSC veto";
502 return StatusCode::SUCCESS;
511 std::bitset<MAXTRIGTYPE> triggersPassed(0
x1<<
NOTA);
512 constexpr std::bitset<MAXTRIGTYPE> NOTAmask=~(0x1<<
NOTA);
517 for (
unsigned i=0;
i<
NOTA;++
i) {
522 thr.m_threshTriggerDecision=(thr.m_triggersToInclude & triggersPassed).any() && (thr.m_triggersToExclude & triggersPassed & NOTAmask).
none();
534 thr.m_eventsPassed++;
542 const Identifier
id=
cell->ID();
544 ATH_MSG_INFO(
"Found sporadic noise candidate cell with id 0x" << std::hex <<
id.get_identifier32().get_compact() << std::dec <<
" in " <<
m_partitionNames[
part] );
561 const float quality=
cell->quality();
571 const LArOnOffIdMapping*
cabling) {
573 const HWIdentifier onlID=
cabling->createSignalChannelID(dde->
identify());
579 std::stringstream hName;
583 std::stringstream titleSuffix;
584 titleSuffix.precision(0);
585 titleSuffix <<
"::" <<
threshold*1
e-3 <<
"GeV with CSC veto";
590 result.m_h_energy=
new TH1F((hName.str()+
"_EN").c_str(),
591 (hName.str()+
"_EN"+titleSuffix.str()).c_str(),
593 result.m_h_energy->GetXaxis()->SetTitle(
"MeV");
594 result.m_h_energy->GetYaxis()->SetTitle(
"Number of Events");
600 result.m_h_quality=
new TH1F((hName.str()+
"_Quality").c_str(),
601 (hName.str()+
"_Quality"+titleSuffix.str()).c_str(),
603 result.m_h_quality->GetXaxis()->SetTitle(
"Quality Factor");
604 result.m_h_quality->GetYaxis()->SetTitle(
"Number of Events");
610 (hName.str()+
"_LB"+titleSuffix.str()).c_str(),
612 result.m_h_energyVsLB->GetXaxis()->SetTitle(
"LumiBlocks");
613 result.m_h_energyVsLB->GetYaxis()->SetTitle(
"MeV");
625 const EventContext& ctx = Gaudi::Hive::currentContext();
628 const LArOnOffIdMapping*
cabling{*cablingHdl};
631 return StatusCode::FAILURE;
641 return StatusCode::FAILURE;
646 if (! cellContHandle.
isValid()) {
return StatusCode::FAILURE; }
656 if(!ifPass)
return StatusCode::SUCCESS;
663 for ( ;
it!=it_e;++
it) {
666 Identifier
id =
cell->ID();
669 if(!is_lar)
continue;
675 const float cellen =
cell->energy();
676 const float celltime =
cell->time();
679 const bool celltqavailable = ( cellprovenance & 0x2000 );
687 float celleta, cellphi;
688 unsigned iLyr, iLyrNS;
705 float thresholdVal=thr.m_threshValue[iLyrNS];
706 if (thresholdVal==0) {
710 if (thr.m_inSigNoise) thresholdVal*=
noise->getNoise(
id,
gain);
712 if (thr.m_threshDirection==
OVER && cellen <= thresholdVal)
continue;
713 if (thr.m_threshDirection==
UNDER && cellen > thresholdVal)
continue;
714 if (thr.m_threshDirection==
BOTH && (cellen > -thresholdVal && cellen <= thresholdVal))
continue;
717 (thr.m_occupancyCounter[
cellHash])++;
719 if (thr.m_h_totalEnergy_etaphi[iLyr]) thr.m_h_totalEnergy_etaphi[iLyr]->Fill(celleta,cellphi,cellen);
721 if(thr.m_h_poorQualityOccupancy_etaphi[iLyr] && (cellquality > thr.m_qualityFactorThreshold)) {
722 thr.m_h_poorQualityOccupancy_etaphi[iLyr]->Fill(celleta,cellphi);
724 if (thr.m_h_totalQuality_etaphi[iLyr]) thr.m_h_totalQuality_etaphi[iLyr]->Fill(celleta,cellphi,cellquality);
727 if(thr.m_h_totalTime_etaphi[iLyr]) {
728 thr.m_h_totalTime_etaphi[iLyr]->Fill(celleta,cellphi,celltime);
731 if (thr.m_h_poorTimeOccupancy_etaphi[iLyr] && (fabs(celltime) > thr.m_timeThreshold)) {
732 thr.m_h_poorTimeOccupancy_etaphi[iLyr]->Fill(celleta,cellphi);
751 float energyThreshold;
759 if (
cell->energy()> energyThreshold) {
767 return StatusCode::SUCCESS;
779 ATH_MSG_INFO(
"processHist for threshold '" << thr.m_threshName <<
"', nb of events passed Trigger and Background removal: " << thr.m_eventsPassed);
784 for (
size_t iLyr=0;iLyr<
MAXLAYER;++iLyr) {
788 if (thr.m_h_occupancy_eta[iLyr]) {
791 ATH_MSG_DEBUG(
"Adjusting number of entries in eta occupancy histogram from " << thr.m_h_occupancy_eta[iLyr]->GetEntries() <<
" to " << thr.m_eventsPassed);
792 thr.m_h_occupancy_eta[iLyr]->SetEntries(thr.m_eventsPassed);
793 if (thr.m_doPercentageOccupancy) thr.m_h_occupancy_eta[iLyr]->Scale(100.0/thr.m_eventsPassed);
796 if (thr.m_h_occupancy_phi[iLyr]) {
799 ATH_MSG_DEBUG(
"Adjusting number of entries from in phi occupancy histogram" << thr.m_h_occupancy_phi[iLyr]->GetEntries() <<
" to " << thr.m_eventsPassed);
800 if (thr.m_doPercentageOccupancy) thr.m_h_occupancy_phi[iLyr]->Scale(100.0/thr.m_eventsPassed);
801 thr.m_h_occupancy_phi[iLyr]->SetEntries(thr.m_eventsPassed);
805 if (thr.m_h_averageEnergy_etaphi[iLyr]) {
806 assert(thr.m_h_totalEnergy_etaphi[iLyr]);
807 assert(thr.m_h_occupancy_etaphi[iLyr]);
808 divideByOccupancy(thr.m_h_averageEnergy_etaphi[iLyr],thr.m_h_totalEnergy_etaphi[iLyr],thr.m_h_occupancy_etaphi[iLyr]);
809 thr.m_h_averageEnergy_etaphi[iLyr]->SetEntries(thr.m_h_totalEnergy_etaphi[iLyr]->GetEntries());
812 if (thr.m_h_averageTime_etaphi[iLyr]) {
813 assert(thr.m_h_totalTime_etaphi[iLyr]);
814 assert(thr.m_h_occupancy_etaphi[iLyr]);
815 divideByOccupancy(thr.m_h_averageTime_etaphi[iLyr],thr.m_h_totalTime_etaphi[iLyr],thr.m_h_occupancy_etaphi[iLyr]);
816 thr.m_h_averageTime_etaphi[iLyr]->SetEntries(thr.m_h_totalTime_etaphi[iLyr]->GetEntries());
819 if (thr.m_doEtaPhiFractionPastTth) {
820 assert(thr.m_h_poorTimeOccupancy_etaphi[iLyr]);
821 assert(thr.m_h_fractionPastTth_etaphi[iLyr]);
822 divideByOccupancy(thr.m_h_fractionPastTth_etaphi[iLyr],thr.m_h_poorTimeOccupancy_etaphi[iLyr],thr.m_h_occupancy_etaphi[iLyr]);
823 thr.m_h_fractionPastTth_etaphi[iLyr]->SetEntries(thr.m_h_poorTimeOccupancy_etaphi[iLyr]->GetEntries());
826 if (thr.m_h_averageQuality_etaphi[iLyr]) {
827 assert(thr.m_h_totalQuality_etaphi[iLyr]);
828 assert(thr.m_h_occupancy_etaphi[iLyr]);
829 divideByOccupancy(thr.m_h_averageQuality_etaphi[iLyr],thr.m_h_totalQuality_etaphi[iLyr],thr.m_h_occupancy_etaphi[iLyr]);
830 thr.m_h_averageQuality_etaphi[iLyr]->SetEntries(thr.m_h_totalQuality_etaphi[iLyr]->GetEntries());
833 if (thr.m_doEtaPhiFractionOverQth) {
834 assert(thr.m_h_poorQualityOccupancy_etaphi[iLyr]);
835 assert(thr.m_h_fractionOverQth_etaphi[iLyr]);
836 divideByOccupancy(thr.m_h_fractionOverQth_etaphi[iLyr],thr.m_h_poorQualityOccupancy_etaphi[iLyr],thr.m_h_occupancy_etaphi[iLyr]);
837 thr.m_h_fractionOverQth_etaphi[iLyr]->SetEntries(thr.m_h_poorQualityOccupancy_etaphi[iLyr]->GetEntries());
842 if (thr.m_h_occupancy_etaphi[iLyr] && thr.m_doPercentageOccupancy) {
843 thr.m_h_occupancy_phi[iLyr]->Scale(100.0/thr.m_eventsPassed);
852 ATH_MSG_INFO(
"New Lumi-Block. Resetting internal counters");
856 return StatusCode::SUCCESS;
863 mg.regHist(
h).ignore();
866 h->SetDirectory(
nullptr);
875 ATH_MSG_INFO(
"Total number of single-cell sporadic-noise histograms produced: "
885 for (
size_t iLyr=0;iLyr<
MAXLAYER;++iLyr) {
891 for (
size_t iLyr=0;iLyr<
MAXLAYER;++iLyr) {
892 for (TH1*
h : {thr.m_h_totalTime_etaphi[iLyr], thr.m_h_poorTimeOccupancy_etaphi[iLyr],
893 thr.m_h_poorQualityOccupancy_etaphi[iLyr],thr.m_h_totalQuality_etaphi[iLyr]}) {
896 if (!thr.m_doEtaPhiOccupancy && thr.m_h_occupancy_etaphi[iLyr]) {
897 delete thr.m_h_occupancy_etaphi[iLyr]; thr.m_h_occupancy_etaphi[iLyr]=
nullptr;
903 return StatusCode::SUCCESS;
914 result->GetXaxis()->SetTitle(
"#eta");
915 result->GetYaxis()->SetTitle(
"#phi");
935 for (
unsigned iLyr=0;iLyr<
MAXLAYER;++iLyr) {
938 std::string histTitle=std::string(
"Map of known bad channels in (#eta,#phi) for ") +
m_layerNames[iLyr];
952 for (
unsigned iLyr=0;iLyr<
MAXLAYER;++iLyr) {
955 std::string histTitle=std::string(
"Map of Noise Values from the Database vs (#eta,#phi) for ") +
m_layerNames[iLyr];
970 if (thr.m_doEtaOccupancy) {
972 for (
unsigned iLyr=0;iLyr<
MAXLAYER;++iLyr) {
975 const std::string histTitle=std::string(
"No. of Active Cells in #eta for ") +
m_layerNames[iLyr];
985 if (thr.m_doPhiOccupancy) {
987 for (
unsigned iLyr=0;iLyr<
MAXLAYER;++iLyr) {
990 const std::string histTitle=std::string(
"No. of Active Cells in #phi for ") +
m_layerNames[iLyr];
1003 return StatusCode::FAILURE;
1011 for ( ;
it!=it_e;++
it) {
1013 Identifier
id =
cell->ID();
1015 if(!is_lar)
continue;
1017 float celleta, cellphi;
1018 unsigned iLyr, iLyrNS;
1022 const LArBadChannel larBadChannel = bcCont->offlineStatus(
id);
1023 if (!larBadChannel.good()) {
1024 const uint32_t badCellWord = larBadChannel.packedData();
1030 const float cellnoisedb =
noise->getNoise(
id,
cell->gain());
1044 return StatusCode::SUCCESS;
1066 const std::string cscVetoTitle(thr.m_doBeamBackgroundRemoval ?
" with CSC veto" :
" w/o CSC veto");
1067 const std::string cscVetoName(thr.m_doBeamBackgroundRemoval ?
"_CSCveto" :
"");
1069 for (
unsigned iLyr=0;iLyr<
MAXLAYER;++iLyr) {
1070 const unsigned iLyrNS=iLyr/2;
1074 if (thr.m_doEtaPhiOccupancy || thr.m_doEtaPhiAverageEnergy || thr.m_doEtaPhiAverageTime || thr.m_doEtaPhiFractionPastTth) {
1075 ATH_MSG_DEBUG(
"Booking 2D occupancy histograms for threshold " << thr.m_threshName <<
", layer " <<
m_layerNames[iLyr]);
1076 if (thr.m_doPercentageOccupancy) {
1078 thr.m_h_occupancy_etaphi[iLyr]=
newEtaPhiHist(std::string(
"PercentCellOccupancyVsEtaPhi_")+
m_layerNames[iLyr]+
"_"+thr.m_threshName+cscVetoName,
1079 "Percentage of events in (#eta,#phi) for "+
m_layerNames[iLyr]+
" - "+thr.m_threshTitles[iLyrNS]+cscVetoTitle,
1083 thr.m_h_occupancy_etaphi[iLyr]=
newEtaPhiHist(std::string(
"CellOccupancyVsEtaPhi_")+
m_layerNames[iLyr]+
"_"+thr.m_threshName,
1084 "No. of events in (#eta,#phi) for "+
m_layerNames[iLyr]+
" - "+thr.m_threshTitles[iLyrNS]+cscVetoTitle,
1087 if (thr.m_doEtaPhiOccupancy)
1090 regTempHist(thr.m_h_occupancy_etaphi[iLyr],monGroupTemp);
1096 if (thr.m_doEtaOccupancy) {
1097 ATH_MSG_DEBUG(
"Booking eta occupancy histograms for threshold " << thr.m_threshName <<
", layer " <<
m_layerNames[iLyr]);
1098 std::string
histName=std::string(
"CellOccupancyVsEta_") +
m_layerNames[iLyr] +
"_" + thr.m_threshName;
1099 std::string histTitle;
1100 if (thr.m_doPercentageOccupancy)
1101 histTitle=
"Percentage of events in (#eta) for ";
1103 histTitle=
"No. of events in (#eta) for ";
1105 histTitle+=(
m_layerNames[iLyr] +
" - " + thr.m_threshTitles[iLyrNS] + cscVetoTitle);
1108 thr.m_h_occupancy_eta[iLyr]->GetXaxis()->SetTitle(
"#eta");
1113 if (thr.m_doPhiOccupancy) {
1114 ATH_MSG_DEBUG(
"Booking phi occupancy histograms for threshold " << thr.m_threshName <<
", layer " <<
m_layerNames[iLyr]);
1115 std::string
histName=std::string(
"CellOccupancyVsPhi_") +
m_layerNames[iLyr] +
"_" + thr.m_threshName;
1116 std::string histTitle;
1117 if (thr.m_doPercentageOccupancy)
1118 histTitle=
"Percentage of events in (#phi) for ";
1120 histTitle=
"No. of events in (#phi) for ";
1122 histTitle+=(
m_layerNames[iLyr] +
" - " + thr.m_threshTitles[iLyrNS] + cscVetoTitle);
1125 thr.m_h_occupancy_phi[iLyr]->GetXaxis()->SetTitle(
"#phi");
1131 if (thr.m_doEtaPhiTotalEnergy || thr.m_doEtaPhiAverageEnergy) {
1132 ATH_MSG_DEBUG(
"Booking 2D total energy histograms for threshold " << thr.m_threshName <<
", layer " <<
m_layerNames[iLyr]);
1133 thr.m_h_totalEnergy_etaphi[iLyr]=
newEtaPhiHist(
"TotalEnergyVsEtaPhi_"+
m_layerNames[iLyr]+
"_"+thr.m_threshName+cscVetoName,
1134 "Total Cell Energy vs (#eta,#phi) in "+
m_layerNames[iLyr]+
" - "+thr.m_threshTitles[iLyrNS]+cscVetoTitle,
1139 if (thr.m_doEtaPhiAverageEnergy) {
1140 ATH_MSG_DEBUG(
"Booking 2D average energy histograms for threshold " << thr.m_threshName <<
", layer " <<
m_layerNames[iLyr]);
1142 "Average Cell Energy vs (#eta,#phi) for "+
m_layerNames[iLyr]+
" - "+thr.m_threshTitles[iLyrNS]+cscVetoTitle,
1148 if (thr.m_doEtaPhiAverageTime) {
1149 ATH_MSG_DEBUG(
"Booking 2D average time histograms for threshold " << thr.m_threshName <<
", layer " <<
m_layerNames[iLyr]);
1151 thr.m_h_totalTime_etaphi[iLyr]=
newEtaPhiHist(
"TempTotalTimeVsEtaPhi_"+
m_layerNames[iLyr]+
"_"+thr.m_threshName+cscVetoName,
1152 "Total Cell Time vs (#eta,#phi) for "+
m_layerNames[iLyr]+
" - "+thr.m_threshTitles[iLyrNS]+cscVetoTitle,
1155 regTempHist(thr.m_h_totalTime_etaphi[iLyr],monGroupTemp);
1159 "Average Cell Time vs (#eta,#phi) for "+
m_layerNames[iLyr]+
" - "+thr.m_threshTitles[iLyrNS]+cscVetoTitle,
1165 if (thr.m_doEtaPhiFractionPastTth) {
1166 ATH_MSG_DEBUG(
"Booking 2D poor time histograms for threshold " << thr.m_threshName <<
", layer " <<
m_layerNames[iLyr]);
1168 "Occupancy of Cells beyond quality threshold vs (#eta,#phi) for "+
m_layerNames[iLyr]+
" - "+thr.m_threshTitles[iLyrNS]+cscVetoTitle,
1171 regTempHist(thr.m_h_poorTimeOccupancy_etaphi[iLyr],monGroupTemp);
1173 std::stringstream sHistTitle;
1174 sHistTitle.precision(0);
1175 sHistTitle <<
"Fraction of Events in " <<
m_layerNames[iLyr] <<
" with " << thr.m_threshName
1176 <<
" for which the Time is further than " << thr.m_timeThreshold <<
" from Zero";
1180 ATH_CHECK(monGroupOutOfTime.
regHist(thr.m_h_fractionPastTth_etaphi[iLyr]));
1183 if (thr.m_doEtaPhiFractionOverQth) {
1184 thr.m_h_poorQualityOccupancy_etaphi[iLyr]=
newEtaPhiHist(
"TempPoorQualityOccupancy"+
m_layerNames[iLyr]+
"_"+thr.m_threshName+cscVetoName,
1185 "Occupancy of Cells beyond quality threshold vs (#eta,#phi) in" +
m_layerNames[iLyr]+
" - "+thr.m_threshTitles[iLyrNS]+cscVetoTitle,
1187 regTempHist(thr.m_h_poorQualityOccupancy_etaphi[iLyr],monGroupTemp);
1191 std::stringstream sHistTitle;
1192 sHistTitle.precision(0);
1193 sHistTitle <<
"Fraction of Events in " <<
m_layerNames[iLyr] <<
" with " << thr.m_threshName
1194 <<
" for which the Quality Factor Exceeds " << thr.m_qualityFactorThreshold;
1202 if (thr.m_doEtaPhiAverageQuality) {
1203 thr.m_h_totalQuality_etaphi[iLyr]=
newEtaPhiHist(
"TempTotalQuality_"+
m_layerNames[iLyr]+
"_"+thr.m_threshName+cscVetoName,
1204 "Total quality factor of Cells vs (#eta,#phi) in " +
m_layerNames[iLyr]+
" - "+thr.m_threshTitles[iLyrNS]+cscVetoTitle,
1206 regTempHist(thr.m_h_totalQuality_etaphi[iLyr],monGroupTemp);
1209 thr.m_h_averageQuality_etaphi[iLyr]=
newEtaPhiHist(
"AverageQualityVsEtaPhi_"+
m_layerNames[iLyr]+
"_"+thr.m_threshName+cscVetoName,
1210 "Average Cell Quality in " +
m_layerNames[iLyr] +
" with " + thr.m_threshTitles[iLyrNS]+cscVetoTitle,
1218 return StatusCode::SUCCESS;
1224 for (
const auto&
c :
input) {
1232 ATH_MSG_DEBUG(
"Resetting internal counters and temporary histograms");
1242 thr.m_eventsPassed=0;
1243 for (
auto&
ctr : thr.m_occupancyCounter) {
ctr=0;}
1249 for (
size_t iLyr=0;iLyr<
MAXLAYER;++iLyr) {
1250 for (TH1*
h : {thr.m_h_totalTime_etaphi[iLyr], thr.m_h_poorTimeOccupancy_etaphi[iLyr],
1251 thr.m_h_poorQualityOccupancy_etaphi[iLyr],thr.m_h_totalQuality_etaphi[iLyr]}) {
1255 if (!thr.m_doEtaPhiOccupancy && thr.m_h_occupancy_etaphi[iLyr]) {
1256 thr.m_h_occupancy_etaphi[iLyr]->Reset();
1270 for (
size_t iLyr=0;iLyr<
MAXLAYER;++iLyr) {
1279 for (;
it!=it_e;++
it) {
1289 float celleta, cellphi;
1290 unsigned iLyr, iLyrNS;
1301 return StatusCode::SUCCESS;
1329 const unsigned side=(celleta>0) ? 0 : 1;
1330 iLyr=iLyrNS*2+
side; }
1340 const size_t nCells=total->GetNcells();
1341 assert(
static_cast<int>(
nCells)==fraction->GetNcells());
1342 assert(
static_cast<int>(
nCells)==occupancy->GetNcells());
1345 const double t = total->GetBinContent(
i);
1346 const double o = occupancy->GetBinContent(
i);
1349 fraction->SetBinContent(
i,
t/o);
1350 fraction->SetBinError(
i,std::sqrt(1./o));