00001 #include "DQM/HcalMonitorTasks/interface/HcalDeadCellMonitor.h"
00002 #include "FWCore/Framework/interface/LuminosityBlock.h"
00003
00004 HcalDeadCellMonitor::HcalDeadCellMonitor(const edm::ParameterSet& ps)
00005 {
00006 Online_ = ps.getUntrackedParameter<bool>("online",false);
00007 mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns",false);
00008 enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
00009 debug_ = ps.getUntrackedParameter<int>("debug",0);
00010 makeDiagnostics_ = ps.getUntrackedParameter<bool>("makeDiagnostics",false);
00011 prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
00012 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
00013 prefixME_.append("/");
00014 subdir_ = ps.getUntrackedParameter<std::string>("TaskFolder","DeadCellMonitor_Hcal");
00015 if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
00016 subdir_.append("/");
00017 subdir_=prefixME_+subdir_;
00018 AllowedCalibTypes_ = ps.getUntrackedParameter<std::vector<int> > ("AllowedCalibTypes");
00019 skipOutOfOrderLS_ = ps.getUntrackedParameter<bool>("skipOutOfOrderLS",true);
00020 NLumiBlocks_ = ps.getUntrackedParameter<int>("NLumiBlocks",4000);
00021
00022 badChannelStatusMask_ = ps.getUntrackedParameter<int>("BadChannelStatusMask",
00023 ps.getUntrackedParameter<int>("BadChannelStatusMask",
00024 (1<<HcalChannelStatus::HcalCellDead)));
00025
00026
00027
00028 digiLabel_ =ps.getUntrackedParameter<edm::InputTag>("digiLabel");
00029 hbheRechitLabel_ = ps.getUntrackedParameter<edm::InputTag>("hbheRechitLabel");
00030 hoRechitLabel_ = ps.getUntrackedParameter<edm::InputTag>("hoRechitLabel");
00031 hfRechitLabel_ = ps.getUntrackedParameter<edm::InputTag>("hfRechitLabel");
00032
00033
00034 minDeadEventCount_ = ps.getUntrackedParameter<int>("minDeadEventCount",1000);
00035 excludeHORing2_ = ps.getUntrackedParameter<bool>("excludeHORing2",false);
00036 excludeHO1P02_ = ps.getUntrackedParameter<bool>("excludeHO1P02",false);
00037 endLumiProcessed_ = false;
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 deadmon_test_digis_ = ps.getUntrackedParameter<bool>("test_digis",true);
00052 deadmon_test_rechits_ = ps.getUntrackedParameter<bool>("test_rechits",false);
00053
00054
00055 energyThreshold_ = ps.getUntrackedParameter<double>("MissingRechitEnergyThreshold",0);
00056 HBenergyThreshold_ = ps.getUntrackedParameter<double>("HB_energyThreshold",energyThreshold_);
00057 HEenergyThreshold_ = ps.getUntrackedParameter<double>("HE_energyThreshold",energyThreshold_);
00058 HOenergyThreshold_ = ps.getUntrackedParameter<double>("HO_energyThreshold",energyThreshold_);
00059 HFenergyThreshold_ = ps.getUntrackedParameter<double>("HF_energyThreshold",energyThreshold_);
00060
00061 HcalLogicalMapGenerator gen;
00062 logicalMap_=new HcalLogicalMap(gen.createMap());
00063 }
00064
00065 HcalDeadCellMonitor::~HcalDeadCellMonitor()
00066 {
00067 if (logicalMap_ == 0) delete logicalMap_;
00068 }
00069
00070
00071
00072
00073 void HcalDeadCellMonitor::setup()
00074 {
00075 HcalBaseDQMonitor::setup();
00076 zeroCounters(1);
00077 if (debug_>0)
00078 std::cout <<"<HcalDeadCellMonitor::setup> Setting up histograms"<<std::endl;
00079
00080 if (!dbe_) return;
00081
00082 dbe_->setCurrentFolder(subdir_);
00083 MonitorElement* excludeHO2=dbe_->bookInt("ExcludeHOring2");
00084
00085 if (excludeHO2) excludeHO2->Fill(excludeHORing2_==true ? 1 : 0);
00086
00087 Nevents = dbe_->book1D("NumberOfDeadCellEvents","Number of Events Seen by DeadCellMonitor",2,0,2);
00088 Nevents->setBinLabel(1,"allEvents");
00089 Nevents->setBinLabel(2,"lumiCheck");
00090
00091 ProblemsVsLB=dbe_->bookProfile("TotalDeadCells_HCAL_vs_LS",
00092 "Total Number of Dead Hcal Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
00093 NLumiBlocks_,0.5,NLumiBlocks_+0.5,
00094 100,0,10000);
00095 ProblemsVsLB_HB=dbe_->bookProfile("TotalDeadCells_HB_vs_LS",
00096 "Total Number of Dead HB Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
00097 NLumiBlocks_,0.5,NLumiBlocks_+0.5,
00098 100,0,10000);
00099 ProblemsVsLB_HE=dbe_->bookProfile("TotalDeadCells_HE_vs_LS",
00100 "Total Number of Dead HE Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
00101 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00102 ProblemsVsLB_HO=dbe_->bookProfile("TotalDeadCells_HO_vs_LS",
00103 "Total Number of Dead HO Cells Ring 0,1 |ieta|<=10 (excluding known problems) vs LS;Lumi Section;Dead Cells",
00104 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00105 ProblemsVsLB_HO2=dbe_->bookProfile("TotalDeadCells_HO2_vs_LS",
00106 "Total Number of Dead HO Cells Ring 2 |ieta|>10 (excluding known problems) vs LS;Lumi Section;Dead Cells",
00107 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00108 ProblemsVsLB_HF=dbe_->bookProfile("TotalDeadCells_HF_vs_LS",
00109 "Total Number of Dead HF Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
00110 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00111 ProblemsVsLB_HBHEHF=dbe_->bookProfile("TotalDeadCells_HBHEHF_vs_LS",
00112 "Total Number of Dead HBHEHF Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
00113 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00114
00115 (ProblemsVsLB->getTProfile())->SetMarkerStyle(20);
00116 (ProblemsVsLB_HB->getTProfile())->SetMarkerStyle(20);
00117 (ProblemsVsLB_HE->getTProfile())->SetMarkerStyle(20);
00118 (ProblemsVsLB_HO->getTProfile())->SetMarkerStyle(20);
00119 (ProblemsVsLB_HO2->getTProfile())->SetMarkerStyle(20);
00120 (ProblemsVsLB_HF->getTProfile())->SetMarkerStyle(20);
00121 (ProblemsVsLB_HBHEHF->getTProfile())->SetMarkerStyle(20);
00122
00123 RBX_loss_VS_LB=dbe_->book2D("RBX_loss_VS_LB",
00124 "RBX loss vs LS; Lumi Section; Index of lost RBX",
00125 NLumiBlocks_,0.5,NLumiBlocks_+0.5,156,0,156);
00126
00127 ProblemsInLastNLB_HBHEHF_alarm=dbe_->book1D("ProblemsInLastNLB_HBHEHF_alarm",
00128 "Total Number of Dead HBHEHF Cells in last 10 LS. Last bin contains OverFlow",
00129 100,0,100);
00130 ProblemsInLastNLB_HO01_alarm=dbe_->book1D("ProblemsInLastNLB_HO01_alarm",
00131 "Total Number of Dead Cells Ring 0,1 (abs(ieta)<=10) in last 10 LS. Last bin contains OverFlow",
00132 100,0,100);
00133
00134
00135 dbe_->setCurrentFolder(subdir_+"dead_cell_parameters");
00136 MonitorElement* me=dbe_->bookInt("Test_NeverPresent_Digis");
00137 me->Fill(1);
00138 me=dbe_->bookInt("Test_DigiMissing_Periodic_Lumi_Check");
00139 if (deadmon_test_digis_)
00140 me->Fill(1);
00141 else
00142 me->Fill(0);
00143 me=dbe_->bookInt("Min_Events_Required_Periodic_Lumi_Check");
00144 me->Fill(minDeadEventCount_);
00145 me=dbe_->bookInt("Test_NeverPresent_RecHits");
00146 deadmon_test_rechits_>0 ? me->Fill(1) : me->Fill(0);
00147 me=dbe_->bookFloat("HBMinimumRecHitEnergy");
00148 me->Fill(HBenergyThreshold_);
00149 me=dbe_->bookFloat("HEMinimumRecHitEnergy");
00150 me->Fill(HEenergyThreshold_);
00151 me=dbe_->bookFloat("HOMinimumRecHitEnergy");
00152 me->Fill(HOenergyThreshold_);
00153 me=dbe_->bookFloat("HFMinimumRecHitEnergy");
00154 me->Fill(HFenergyThreshold_);
00155 me=dbe_->bookInt("Test_RecHitsMissing_Periodic_Lumi_Check");
00156 deadmon_test_rechits_>0 ? me->Fill(1) : me->Fill(0);
00157
00158
00159
00160
00161 std::stringstream units;
00162 std::stringstream name;
00163
00164
00165
00166 dbe_->setCurrentFolder(subdir_+"dead_digi_never_present");
00167 SetupEtaPhiHists(DigiPresentByDepth,
00168 "Digi Present At Least Once","");
00169
00170 NumberOfNeverPresentDigis=dbe_->bookProfile("Problem_NeverPresentDigis_HCAL_vs_LS",
00171 "Total Number of Never-Present Hcal Cells vs LS;Lumi Section;Dead Cells",
00172 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00173
00174 NumberOfNeverPresentDigisHB=dbe_->bookProfile("Problem_NeverPresentDigis_HB_vs_LS",
00175 "Total Number of Never-Present HB Cells vs LS;Lumi Section;Dead Cells",
00176 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00177
00178 NumberOfNeverPresentDigisHE=dbe_->bookProfile("Problem_NeverPresentDigis_HE_vs_LS",
00179 "Total Number of Never-Present HE Cells vs LS;Lumi Section;Dead Cells",
00180 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00181
00182 NumberOfNeverPresentDigisHO=dbe_->bookProfile("Problem_NeverPresentDigis_HO_vs_LS",
00183 "Total Number of Never-Present HO Cells vs LS;Lumi Section;Dead Cells",
00184 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00185
00186 NumberOfNeverPresentDigisHF=dbe_->bookProfile("Problem_NeverPresentDigis_HF_vs_LS",
00187 "Total Number of Never-Present HF Cells vs LS;Lumi Section;Dead Cells",
00188 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00189 (NumberOfNeverPresentDigis->getTProfile())->SetMarkerStyle(20);
00190 (NumberOfNeverPresentDigisHB->getTProfile())->SetMarkerStyle(20);
00191 (NumberOfNeverPresentDigisHE->getTProfile())->SetMarkerStyle(20);
00192 (NumberOfNeverPresentDigisHO->getTProfile())->SetMarkerStyle(20);
00193 (NumberOfNeverPresentDigisHF->getTProfile())->SetMarkerStyle(20);
00194
00195 FillUnphysicalHEHFBins(DigiPresentByDepth);
00196
00197 if (deadmon_test_digis_)
00198 {
00199 dbe_->setCurrentFolder(subdir_+"dead_digi_often_missing");
00200
00201 name<<"Dead Cells with No Digis";
00202 SetupEtaPhiHists(RecentMissingDigisByDepth,
00203 name.str(),
00204 "");
00205 name.str("");
00206 name<<"HB HE HF Depth 1 Dead Cells with No Digis for at least 1 Full Luminosity Block";
00207 RecentMissingDigisByDepth.depth[0]->setTitle(name.str().c_str());
00208
00209 name.str("");
00210 name<<"HB HE HF Depth 2 Dead Cells with No Digis for at least 1 Full Luminosity Block";
00211 RecentMissingDigisByDepth.depth[1]->setTitle(name.str().c_str());
00212
00213 name.str("");
00214 name<<"HE Depth 3 Dead Cells with No Digis for at least 1 Full Luminosity Block";
00215 RecentMissingDigisByDepth.depth[2]->setTitle(name.str().c_str());
00216
00217 name.str("");
00218 name<<"HO Depth 4 Dead Cells with No Digis for at least 1 Full Luminosity Block";
00219 RecentMissingDigisByDepth.depth[3]->setTitle(name.str().c_str());
00220 name.str("");
00221
00222
00223 name<<"Total Number of Hcal Digis Unoccupied for at least 1 Full Luminosity Block";
00224 NumberOfRecentMissingDigis=dbe_->bookProfile("Problem_RecentMissingDigis_HCAL_vs_LS",
00225 name.str(),
00226 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00227 name.str("");
00228 name<<"Total Number of HB Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
00229 NumberOfRecentMissingDigisHB=dbe_->bookProfile("Problem_RecentMissingDigis_HB_vs_LS",
00230 name.str(),
00231 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00232 name.str("");
00233 name<<"Total Number of HE Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
00234 NumberOfRecentMissingDigisHE=dbe_->bookProfile("Problem_RecentMissingDigis_HE_vs_LS",
00235 name.str(),
00236 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00237 name.str("");
00238 name<<"Total Number of HO Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
00239 NumberOfRecentMissingDigisHO=dbe_->bookProfile("Problem_RecentMissingDigis_HO_vs_LS",
00240 name.str(),
00241 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00242 name.str("");
00243 name<<"Total Number of HF Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
00244 NumberOfRecentMissingDigisHF=dbe_->bookProfile("Problem_RecentMissingDigis_HF_vs_LS",
00245 name.str(),
00246 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00247 (NumberOfRecentMissingDigis->getTProfile())->SetMarkerStyle(20);
00248 (NumberOfRecentMissingDigisHB->getTProfile())->SetMarkerStyle(20);
00249 (NumberOfRecentMissingDigisHE->getTProfile())->SetMarkerStyle(20);
00250 (NumberOfRecentMissingDigisHO->getTProfile())->SetMarkerStyle(20);
00251 (NumberOfRecentMissingDigisHF->getTProfile())->SetMarkerStyle(20);
00252
00253 }
00254
00255 if (deadmon_test_rechits_)
00256 {
00257
00258 dbe_->setCurrentFolder(subdir_+"dead_rechit_neverpresent");
00259 SetupEtaPhiHists(RecHitPresentByDepth,"RecHit Above Threshold At Least Once","");
00260
00261 units.str("");
00262 units<<"Cells Above Energy Threshold At Least Once: Depth 1 -- HB >="<<HBenergyThreshold_<<" GeV, HE >= "<<HEenergyThreshold_<<", HF >="<<HFenergyThreshold_<<" GeV";
00263 RecHitPresentByDepth.depth[0]->setTitle(units.str().c_str());
00264 units.str("");
00265 units<<"Cells Above Energy Threshold At Least Once: Depth 2 -- HB >="<<HBenergyThreshold_<<" GeV, HE >= "<<HEenergyThreshold_<<", HF >="<<HFenergyThreshold_<<" GeV";
00266 RecHitPresentByDepth.depth[1]->setTitle(units.str().c_str());
00267 units.str("");
00268 units<<"Cells Above Energy Threshold At Least Once: Depth 3 -- HE >="<<HEenergyThreshold_<<" GeV";
00269 RecHitPresentByDepth.depth[2]->setTitle(units.str().c_str());
00270 units.str("");
00271 units<<"Cells Above Energy Threshold At Least Once: Depth 4 -- HO >="<<HOenergyThreshold_<<" GeV";
00272 RecHitPresentByDepth.depth[3]->setTitle(units.str().c_str());
00273 units.str("");
00274
00275
00276 NumberOfNeverPresentRecHits=dbe_->bookProfile("Problem_RecHitsNeverPresent_HCAL_vs_LS",
00277 "Total Number of Hcal Rechits with Low Energy;Lumi Section;Dead Cells",
00278 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00279 name.str("");
00280 name<<"Total Number of HB RecHits with Energy Never >= "<<HBenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00281 NumberOfNeverPresentRecHitsHB=dbe_->bookProfile("Problem_RecHitsNeverPresent_HB_vs_LS",
00282 name.str(),
00283 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00284 name.str("");
00285 name<<"Total Number of HE RecHits with Energy Never >= "<<HEenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00286 NumberOfNeverPresentRecHitsHE=dbe_->bookProfile("Problem_RecHitsNeverPresent_HE_vs_LS",
00287 name.str(),
00288 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00289 name.str("");
00290 name<<"Total Number of HO RecHits with Energy Never >= "<<HOenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00291 NumberOfNeverPresentRecHitsHO=dbe_->bookProfile("Problem_RecHitsNeverPresent_HO_vs_LS",
00292 name.str(),
00293 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00294 name.str("");
00295 name<<"Total Number of HF RecHits with Energy Never >= "<<HFenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00296 NumberOfNeverPresentRecHitsHF=dbe_->bookProfile("Problem_RecHitsNeverPresent_HF_vs_LS",
00297 name.str(),
00298 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00299 (NumberOfNeverPresentRecHits->getTProfile())->SetMarkerStyle(20);
00300 (NumberOfNeverPresentRecHitsHB->getTProfile())->SetMarkerStyle(20);
00301 (NumberOfNeverPresentRecHitsHE->getTProfile())->SetMarkerStyle(20);
00302 (NumberOfNeverPresentRecHitsHO->getTProfile())->SetMarkerStyle(20);
00303 (NumberOfNeverPresentRecHitsHF->getTProfile())->SetMarkerStyle(20);
00304
00305 dbe_->setCurrentFolder(subdir_+"dead_rechit_often_missing");
00306 SetupEtaPhiHists(RecentMissingRecHitsByDepth,"RecHits Failing Energy Threshold Test","");
00307
00308 units.str("");
00309 units<<"RecHits with Consistent Low Energy Depth 1 -- HB <"<<HBenergyThreshold_<<" GeV, HE < "<<HEenergyThreshold_<<", HF <"<<HFenergyThreshold_<<" GeV";
00310 RecentMissingRecHitsByDepth.depth[0]->setTitle(units.str().c_str());
00311 units.str("");
00312 units<<"RecHits with Consistent Low Energy Depth 2 -- HB <"<<HBenergyThreshold_<<" GeV, HE < "<<HEenergyThreshold_<<", HF <"<<HFenergyThreshold_<<" GeV";
00313 RecentMissingRecHitsByDepth.depth[1]->setTitle(units.str().c_str());
00314 units.str("");
00315 units<<"RecHits with Consistent Low Energy Depth 3 -- HE <"<<HEenergyThreshold_<<" GeV";
00316 RecentMissingRecHitsByDepth.depth[2]->setTitle(units.str().c_str());
00317 units.str("");
00318 units<<"RecHits with Consistent Low Energy Depth 4 -- HO <"<<HOenergyThreshold_<<" GeV";
00319 RecentMissingRecHitsByDepth.depth[3]->setTitle(units.str().c_str());
00320 units.str("");
00321
00322
00323
00324 name.str("");
00325 name<<"Total Number of Hcal RecHits with Consistent Low Energy;Lumi Section;Dead Cells";
00326 NumberOfRecentMissingRecHits=dbe_->bookProfile("Problem_BelowEnergyRecHits_HCAL_vs_LS",
00327 name.str(),
00328 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00329 name.str("");
00330 name<<"Total Number of HB RecHits with Consistent Low Energy < "<<HBenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00331 NumberOfRecentMissingRecHitsHB=dbe_->bookProfile("Problem_BelowEnergyRecHits_HB_vs_LS",
00332 name.str(),
00333 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00334 name.str("");
00335 name<<"Total Number of HE RecHits with Consistent Low Energy < "<<HEenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00336 NumberOfRecentMissingRecHitsHE=dbe_->bookProfile("Problem_BelowEnergyRecHits_HE_vs_LS",
00337 name.str(),
00338 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00339 name.str("");
00340 name<<"Total Number of HO RecHits with Consistent Low Energy < "<<HOenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00341 NumberOfRecentMissingRecHitsHO=dbe_->bookProfile("Problem_BelowEnergyRecHits_HO_vs_LS",
00342 name.str(),
00343 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00344 name.str("");
00345 name<<"Total Number of HF RecHits with Consistent Low Energy < "<<HFenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00346 NumberOfRecentMissingRecHitsHF=dbe_->bookProfile("Problem_BelowEnergyRecHits_HF_vs_LS",
00347 name.str(),
00348 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00349 (NumberOfRecentMissingRecHits->getTProfile())->SetMarkerStyle(20);
00350 (NumberOfRecentMissingRecHitsHB->getTProfile())->SetMarkerStyle(20);
00351 (NumberOfRecentMissingRecHitsHE->getTProfile())->SetMarkerStyle(20);
00352 (NumberOfRecentMissingRecHitsHO->getTProfile())->SetMarkerStyle(20);
00353 (NumberOfRecentMissingRecHitsHF->getTProfile())->SetMarkerStyle(20);
00354
00355 }
00356
00357
00358 if (makeDiagnostics_)
00359 {
00360 dbe_->setCurrentFolder(subdir_+"DiagnosticPlots");
00361 HBDeadVsEvent=dbe_->book1D("HBDeadVsEvent","HB Total Dead Cells Vs Event", NLumiBlocks_/10,-0.5,NLumiBlocks_-0.5);
00362 HEDeadVsEvent=dbe_->book1D("HEDeadVsEvent","HE Total Dead Cells Vs Event", NLumiBlocks_/10,-0.5,NLumiBlocks_-0.5);
00363 HODeadVsEvent=dbe_->book1D("HODeadVsEvent","HO Total Dead Cells Vs Event", NLumiBlocks_/10,-0.5,NLumiBlocks_-0.5);
00364 HFDeadVsEvent=dbe_->book1D("HFDeadVsEvent","HF Total Dead Cells Vs Event", NLumiBlocks_/10,-0.5,NLumiBlocks_-0.5);
00365 }
00366
00367 this->reset();
00368 return;
00369
00370 }
00371
00372 void HcalDeadCellMonitor::beginRun(const edm::Run& run, const edm::EventSetup& c)
00373 {
00374 if (debug_>1) std::cout <<"HcalDeadCellMonitor::beginRun"<<std::endl;
00375 HcalBaseDQMonitor::beginRun(run,c);
00376
00377 if (tevt_==0) this->setup();
00378 if (mergeRuns_==false)
00379 this->reset();
00380
00381 doReset_ = true;
00382
00383
00384 KnownBadCells_.clear();
00385 if (badChannelStatusMask_>0)
00386 {
00387 edm::ESHandle<HcalChannelQuality> p;
00388 c.get<HcalChannelQualityRcd>().get(p);
00389 HcalChannelQuality* chanquality= new HcalChannelQuality(*p.product());
00390 std::vector<DetId> mydetids = chanquality->getAllChannels();
00391 for (std::vector<DetId>::const_iterator i = mydetids.begin();
00392 i!=mydetids.end();
00393 ++i)
00394 {
00395 if (i->det()!=DetId::Hcal) continue;
00396 HcalDetId id=HcalDetId(*i);
00397 int status=(chanquality->getValues(id))->getValue();
00398 if ((status & badChannelStatusMask_))
00399 KnownBadCells_[id.rawId()]=status;
00400 }
00401 delete chanquality;
00402 }
00403 return;
00404 }
00405
00406 void HcalDeadCellMonitor::reset()
00407 {
00408 if (debug_>1) std::cout <<"HcalDeadCellMonitor::reset()"<<std::endl;
00409 doReset_ = false;
00410
00411 HcalBaseDQMonitor::reset();
00412 zeroCounters();
00413 deadevt_=0;
00414 is_RBX_loss_ = 0;
00415 beamMode_ = 0 ;
00416 alarmer_counter_ = 0;
00417 alarmer_counterHO01_ = 0;
00418 is_stable_beam = true;
00419 hbhedcsON = true; hfdcsON = true; hodcsON = true;
00420 ProblemsVsLB->Reset(); ProblemsVsLB_HB->Reset(); ProblemsVsLB_HE->Reset(); ProblemsVsLB_HO->Reset(); ProblemsVsLB_HO2->Reset(); ProblemsVsLB_HF->Reset(); ProblemsVsLB_HBHEHF->Reset();
00421 RBX_loss_VS_LB->Reset();
00422 ProblemsInLastNLB_HBHEHF_alarm->Reset();
00423 ProblemsInLastNLB_HO01_alarm->Reset();
00424 NumberOfNeverPresentDigis->Reset(); NumberOfNeverPresentDigisHB->Reset(); NumberOfNeverPresentDigisHE->Reset(); NumberOfNeverPresentDigisHO->Reset(); NumberOfNeverPresentDigisHF->Reset();
00425
00426 for (unsigned int depth=0;depth<DigiPresentByDepth.depth.size();++depth)
00427 DigiPresentByDepth.depth[depth]->Reset();
00428
00429
00430 if (excludeHORing2_==true && DigiPresentByDepth.depth.size()>3)
00431 {
00432 for (int ieta=11;ieta<=15;++ieta)
00433 for (int iphi=1;iphi<=72;++iphi)
00434 {
00435
00436 if (isSiPM(ieta,iphi,4)==false)
00437 DigiPresentByDepth.depth[3]->Fill(ieta,iphi,2);
00438
00439 DigiPresentByDepth.depth[3]->Fill(-1*ieta,iphi,2);
00440 }
00441 }
00442 FillUnphysicalHEHFBins(DigiPresentByDepth);
00443
00444
00445 if (deadmon_test_digis_)
00446 {
00447 NumberOfRecentMissingDigis->Reset(); NumberOfRecentMissingDigisHB->Reset(); NumberOfRecentMissingDigisHE->Reset(); NumberOfRecentMissingDigisHO->Reset(); NumberOfRecentMissingDigisHF->Reset();
00448 RecentMissingDigisByDepth.Reset();
00449 }
00450 if (deadmon_test_rechits_)
00451 {
00452 NumberOfRecentMissingRecHits->Reset();
00453 NumberOfRecentMissingRecHitsHB->Reset();
00454 NumberOfRecentMissingRecHitsHE->Reset();
00455 NumberOfRecentMissingRecHitsHO->Reset();
00456 NumberOfRecentMissingRecHitsHF->Reset();
00457 NumberOfNeverPresentRecHits->Reset();
00458 NumberOfNeverPresentRecHitsHB->Reset();
00459 NumberOfNeverPresentRecHitsHE->Reset();
00460 NumberOfNeverPresentRecHitsHO->Reset();
00461 NumberOfNeverPresentRecHitsHF->Reset();
00462 RecentMissingRecHitsByDepth.Reset();
00463 RecHitPresentByDepth.Reset();
00464
00465
00466 if (excludeHORing2_==true && RecHitPresentByDepth.depth.size()>3)
00467 {
00468 for (int ieta=11;ieta<=15;++ieta)
00469 for (int iphi=1;iphi<=72;++iphi)
00470 {
00471 RecHitPresentByDepth.depth[3]->Fill(ieta,iphi,2);
00472 RecHitPresentByDepth.depth[3]->Fill(-1*ieta,iphi,2);
00473 }
00474 }
00475 FillUnphysicalHEHFBins(RecHitPresentByDepth);
00476 }
00477
00478 Nevents->Reset();
00479 }
00480
00481
00482
00483
00484 void HcalDeadCellMonitor::cleanup()
00485 {
00486 if (!enableCleanup_) return;
00487 if (dbe_)
00488 {
00489 dbe_->setCurrentFolder(subdir_);
00490 dbe_->removeContents();
00491 dbe_->setCurrentFolder(subdir_+"dead_digi_never_present");
00492 dbe_->removeContents();
00493 dbe_->setCurrentFolder(subdir_+"dead_digi_often_missing");
00494 dbe_->removeContents();
00495 dbe_->setCurrentFolder(subdir_+"dead_rechit_neverpresent");
00496 dbe_->removeContents();
00497 dbe_->setCurrentFolder(subdir_+"dead_rechit_often_missing");
00498 dbe_->removeContents();
00499 dbe_->setCurrentFolder(subdir_+"dead_cell_parameters");
00500 dbe_->removeContents();
00501 dbe_->setCurrentFolder(subdir_+"LSvalues");
00502 dbe_->removeContents();
00503 }
00504 return;
00505 }
00506
00507
00508
00509 void HcalDeadCellMonitor::endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
00510 const edm::EventSetup& c)
00511 {
00512
00513 if (this->LumiInOrder(lumiSeg.luminosityBlock())==false) return;
00514
00515
00516 if (ProblemsCurrentLB)
00517 ProblemsCurrentLB->Reset();
00518
00519 ProblemsInLastNLB_HBHEHF_alarm->Reset();
00520 ProblemsInLastNLB_HO01_alarm->Reset();
00521
00522
00523 if(hbhedcsON == true && hfdcsON == true && HBpresent_ == 1 && HEpresent_ == 1 && HFpresent_ == 1)
00524 ++alarmer_counter_;
00525 else
00526 alarmer_counter_ = 0;
00527
00528 if(hodcsON==true && HOpresent_ == 1)
00529 ++alarmer_counterHO01_;
00530 else
00531 alarmer_counterHO01_ = 0;
00532
00533 if (!is_stable_beam)
00534 {
00535 alarmer_counter_ = 0;
00536 alarmer_counterHO01_ = 0;
00537 }
00538
00539
00540
00541
00542
00543 if (deadevt_>=10 && deadevt_<minDeadEventCount_ && is_RBX_loss_==1)
00544 {
00545 fillNevents_problemCells();
00546 fillNevents_recentrechits();
00547 fillNevents_recentdigis();
00548
00549 endLumiProcessed_=true;
00550 is_RBX_loss_=0;
00551
00552 for (unsigned int i=0;i<156;++i)
00553 rbxlost[i] = 0;
00554
00555 if (ProblemsCurrentLB)
00556 {
00557 ProblemsCurrentLB->setBinContent(0,0, levt_);
00558 ProblemsCurrentLB->setBinContent(1,1, NumBadHB*levt_);
00559 ProblemsCurrentLB->setBinContent(2,1, NumBadHE*levt_);
00560 ProblemsCurrentLB->setBinContent(3,1, NumBadHO*levt_);
00561 ProblemsCurrentLB->setBinContent(4,1, NumBadHF*levt_);
00562 ProblemsCurrentLB->setBinContent(5,1, NumBadHO0*levt_);
00563 ProblemsCurrentLB->setBinContent(6,1, NumBadHO12*levt_);
00564 ProblemsCurrentLB->setBinContent(7,1, NumBadHFLUMI*levt_);
00565 }
00566 }
00567
00568 if (deadevt_<minDeadEventCount_)
00569 return;
00570
00571 endLumiProcessed_=true;
00572
00573 fillNevents_problemCells();
00574 fillNevents_recentdigis();
00575 fillNevents_recentrechits();
00576
00577 if (ProblemsCurrentLB)
00578 {
00579 ProblemsCurrentLB->setBinContent(0,0, levt_);
00580 ProblemsCurrentLB->setBinContent(1,1, NumBadHB*levt_);
00581 ProblemsCurrentLB->setBinContent(2,1, NumBadHE*levt_);
00582 ProblemsCurrentLB->setBinContent(3,1, NumBadHO*levt_);
00583 ProblemsCurrentLB->setBinContent(4,1, NumBadHF*levt_);
00584 ProblemsCurrentLB->setBinContent(5,1, NumBadHO0*levt_);
00585 ProblemsCurrentLB->setBinContent(6,1, NumBadHO12*levt_);
00586 ProblemsCurrentLB->setBinContent(7,1, NumBadHFLUMI*levt_);
00587 }
00588 zeroCounters();
00589 deadevt_=0;
00590 is_RBX_loss_=0;
00591 beamMode_ = 0;
00592 return;
00593 }
00594
00595 void HcalDeadCellMonitor::endRun(const edm::Run& run, const edm::EventSetup& c)
00596 {
00597
00598
00599
00600 if (endLumiProcessed_==false) fillNevents_problemCells();
00601
00602 return;
00603 }
00604
00605 void HcalDeadCellMonitor::endJob()
00606 {
00607 if (debug_>0) std::cout <<"HcalDeadCellMonitor::endJob()"<<std::endl;
00608 if (enableCleanup_) cleanup();
00609 }
00610
00611 void HcalDeadCellMonitor::analyze(edm::Event const&e, edm::EventSetup const&s)
00612 {
00613 if (!IsAllowedCalibType()) return;
00614 endLumiProcessed_=false;
00615
00616 if(doReset_)
00617 this->reset();
00618
00619 Nevents->Fill(0,1);
00620 if (LumiInOrder(e.luminosityBlock())==false) return;
00621
00622 edm::Handle<HBHEDigiCollection> hbhe_digi;
00623 edm::Handle<HODigiCollection> ho_digi;
00624 edm::Handle<HFDigiCollection> hf_digi;
00625
00626 edm::Handle<HBHERecHitCollection> hbhe_rechit;
00627 edm::Handle<HORecHitCollection> ho_rechit;
00628 edm::Handle<HFRecHitCollection> hf_rechit;
00629
00630 edm::Handle<L1GlobalTriggerEvmReadoutRecord> gtEvm_handle;
00631
00633
00634 edm::Handle<DcsStatusCollection> dcsStatus;
00635 e.getByLabel("scalersRawToDigi", dcsStatus);
00636
00637 if (dcsStatus.isValid() && dcsStatus->size() != 0)
00638 {
00639 if ((*dcsStatus)[0].ready(DcsStatus::HBHEa) &&
00640 (*dcsStatus)[0].ready(DcsStatus::HBHEb) &&
00641 (*dcsStatus)[0].ready(DcsStatus::HBHEc))
00642 {
00643 hbhedcsON = true;
00644 if (debug_) std::cout << "hbhe on" << std::endl;
00645 }
00646 else hbhedcsON = false;
00647
00648 if ((*dcsStatus)[0].ready(DcsStatus::HF))
00649 {
00650 hfdcsON = true;
00651 if (debug_) std::cout << "hf on" << std::endl;
00652 }
00653 else hfdcsON = false;
00654
00655 if ((*dcsStatus)[0].ready(DcsStatus::HO))
00656 {
00657 hodcsON = true;
00658 if (debug_) std::cout << "ho on" << std::endl;
00659 }
00660 else hodcsON = false;
00661 }
00663
00664 if (!(e.getByLabel(digiLabel_,hbhe_digi)))
00665 {
00666 edm::LogWarning("HcalDeadCellMonitor")<< digiLabel_<<" hbhe_digi not available";
00667 return;
00668 }
00669 if (!(e.getByLabel(digiLabel_,ho_digi)))
00670 {
00671 edm::LogWarning("HcalDeadCellMonitor")<< digiLabel_<<" ho_digi not available";
00672 return;
00673 }
00674 if (!(e.getByLabel(digiLabel_,hf_digi)))
00675 {
00676 edm::LogWarning("HcalDeadCellMonitor")<< digiLabel_<<" hf_digi not available";
00677 return;
00678 }
00679
00680 if (!(e.getByLabel(hbheRechitLabel_,hbhe_rechit)))
00681 {
00682 edm::LogWarning("HcalDeadCellMonitor")<< hbheRechitLabel_<<" hbhe_rechit not available";
00683 return;
00684 }
00685
00686 if (!(e.getByLabel(hfRechitLabel_,hf_rechit)))
00687 {
00688 edm::LogWarning("HcalDeadCellMonitor")<< hfRechitLabel_<<" hf_rechit not available";
00689 return;
00690 }
00691 if (!(e.getByLabel(hoRechitLabel_,ho_rechit)))
00692 {
00693 edm::LogWarning("HcalDeadCellMonitor")<< hoRechitLabel_<<" ho_rechit not available";
00694 return;
00695 }
00696 if (!(e.getByLabel("gtEvmDigis", gtEvm_handle)))
00697 {
00698 edm::LogWarning("HcalDeadCellMonitor")<< "gtEvmDigis"<<" gtEvmDigis not available";
00699 return;
00700 }
00701 L1GtfeExtWord gtfeEvmExtWord = gtEvm_handle.product()->gtfeWord();
00702
00703 if (debug_>1) std::cout <<"\t<HcalDeadCellMonitor::analyze> Processing good event! event # = "<<ievt_<<std::endl;
00704
00705
00706 HcalBaseDQMonitor::analyze(e,s);
00707
00708 ++deadevt_;
00709
00710 processEvent(*hbhe_rechit, *ho_rechit, *hf_rechit, *hbhe_digi, *ho_digi, *hf_digi);
00711
00712
00713 if(levt_>10 && tevt_ % 10 == 0 )
00714 {
00715 for(int i=71; i<132; i++)
00716 {
00717
00718
00719
00720
00721 if(i >= 72 && i < 95 && i%2==0)
00722 occupancy_RBX[i] = 1;
00723 if(i >=108 && i <= 131 && i%2==0)
00724 occupancy_RBX[i] = 1;
00725
00726 if(i==117 || i==131)
00727 occupancy_RBX[i] = 1;
00728 if(i==77)
00729 occupancy_RBX[i] = 1;
00730 }
00731
00732
00733 for (unsigned int i=0;i<132;++i)
00734 if(occupancy_RBX[i] == 0)
00735 {
00736 is_RBX_loss_ = 1;
00737 rbxlost[i] = 1;
00738 }
00739
00740 int intensity1_ = gtfeEvmExtWord.totalIntensityBeam1();
00741 int intensity2_ = gtfeEvmExtWord.totalIntensityBeam2();
00742
00743 is_stable_beam = gtfeEvmExtWord.beamMode() == 11 ? true : false;
00744
00745 for (unsigned int i=132;i<156;++i)
00746 if(occupancy_RBX[i] == 0 && gtfeEvmExtWord.beamMode() == 11)
00747 if(intensity1_>100 && intensity2_>100)
00748 {
00749 is_RBX_loss_ = 1;
00750 rbxlost[i] = 1;
00751 }
00752
00753
00754 if (is_RBX_loss_ == 0)
00755 for (unsigned int i=0;i<156;++i)
00756 occupancy_RBX[i] = 0;
00757 }
00758
00759
00760 if(is_RBX_loss_ == 1)
00761 for (unsigned int i=0;i<156;++i)
00762 if(rbxlost[i]==1) occupancy_RBX[i] = 0;
00763
00764 }
00765
00766
00767
00768
00769 void HcalDeadCellMonitor::processEvent(const HBHERecHitCollection& hbHits,
00770 const HORecHitCollection& hoHits,
00771 const HFRecHitCollection& hfHits,
00772 const HBHEDigiCollection& hbhedigi,
00773 const HODigiCollection& hodigi,
00774 const HFDigiCollection& hfdigi)
00775 {
00776 if (debug_>1) std::cout <<"<HcalDeadCellMonitor::processEvent> Processing event..."<<std::endl;
00777
00778
00779
00780
00781 for (unsigned int i=0;i<DigiPresentByDepth.depth.size();++i)
00782 DigiPresentByDepth.depth[i]->update();
00783
00784 NumberOfNeverPresentDigis->update();;
00785 NumberOfNeverPresentDigisHB->update();
00786 NumberOfNeverPresentDigisHE->update();
00787 NumberOfNeverPresentDigisHO->update();
00788 NumberOfNeverPresentDigisHF->update();
00789
00790 if (deadmon_test_digis_)
00791 {
00792
00793 for (unsigned int i=0;i<RecentMissingDigisByDepth.depth.size();++i)
00794 RecentMissingDigisByDepth.depth[i]->update();
00795
00796 NumberOfRecentMissingDigis->update();
00797 NumberOfRecentMissingDigisHB->update();
00798 NumberOfRecentMissingDigisHE->update();
00799 NumberOfRecentMissingDigisHO->update();
00800 NumberOfRecentMissingDigisHF->update();
00801 }
00802
00803 for (HBHEDigiCollection::const_iterator j=hbhedigi.begin();
00804 j!=hbhedigi.end(); ++j)
00805 {
00806 const HBHEDataFrame digi = (const HBHEDataFrame)(*j);
00807 processEvent_HBHEdigi(digi);
00808 }
00809
00810 for (HODigiCollection::const_iterator j=hodigi.begin();
00811 j!=hodigi.end(); ++j)
00812 {
00813 const HODataFrame digi = (const HODataFrame)(*j);
00814 process_Digi(digi);
00815 }
00816 for (HFDigiCollection::const_iterator j=hfdigi.begin();
00817 j!=hfdigi.end(); ++j)
00818 {
00819 const HFDataFrame digi = (const HFDataFrame)(*j);
00820 process_Digi(digi);
00821 }
00822 FillUnphysicalHEHFBins(DigiPresentByDepth);
00823
00824
00825 if (deadmon_test_rechits_)
00826 {
00827
00828 for (unsigned int i=0;i<RecentMissingRecHitsByDepth.depth.size();++i)
00829 RecentMissingRecHitsByDepth.depth[i]->update();
00830
00831 NumberOfRecentMissingRecHits->update();
00832 NumberOfRecentMissingRecHitsHB->update();
00833 NumberOfRecentMissingRecHitsHE->update();
00834 NumberOfRecentMissingRecHitsHO->update();
00835 NumberOfRecentMissingRecHitsHF->update();
00836
00837 for (HBHERecHitCollection::const_iterator j=hbHits.begin();
00838 j!=hbHits.end(); ++j)
00839 process_RecHit(j);
00840
00841 for (HORecHitCollection::const_iterator k=hoHits.begin();
00842 k!=hoHits.end(); ++k)
00843 process_RecHit(k);
00844
00845 for (HFRecHitCollection::const_iterator j=hfHits.begin();
00846 j!=hfHits.end(); ++j)
00847 process_RecHit(j);
00848
00849 }
00850
00851 if (!makeDiagnostics_) return;
00852 if (tevt_>=NLumiBlocks_) return;
00853
00854 int hbpresent=0;
00855 int hepresent=0;
00856 int hopresent=0;
00857 int hfpresent=0;
00858 int ieta=0;
00859 for (int d=0;d<4;++d)
00860 {
00861 for (int phi=0;phi<72;++phi)
00862 {
00863 for (int eta=0;eta<85;++eta)
00864 {
00865 if (!present_digi[eta][phi][d]) continue;
00866 if (d==3) ++hopresent;
00867 else if (d==2) ++hepresent;
00868 else if (d==1)
00869 {
00870 ieta=binmapd2[eta];
00871
00872 if (abs(ieta)>29) ++hfpresent;
00873 else if (abs(ieta)<17) ++hbpresent;
00874 else ++hepresent;
00875 }
00876 else if (d==0)
00877 {
00878 ieta=eta-42;
00879 if (abs(ieta)>29) ++hfpresent;
00880 else if (abs(ieta)<17) ++hbpresent;
00881 else ++hepresent;
00882 }
00883 }
00884 }
00885 }
00886 HBDeadVsEvent->Fill(tevt_,2592-hbpresent);
00887 HEDeadVsEvent->Fill(tevt_,2592-hepresent);
00888 HODeadVsEvent->Fill(tevt_,2160-hopresent);
00889 HFDeadVsEvent->Fill(tevt_,1728-hfpresent);
00890 return;
00891 }
00892
00893
00894
00895
00896
00897
00898 void HcalDeadCellMonitor::processEvent_HBHEdigi(const HBHEDataFrame digi)
00899 {
00900
00901 process_Digi(digi);
00902 return;
00903 }
00904
00905 template<class DIGI>
00906 void HcalDeadCellMonitor::process_Digi(DIGI& digi)
00907 {
00908
00909
00910 int ieta=digi.id().ieta();
00911 int iphi=digi.id().iphi();
00912 int depth=digi.id().depth();
00913
00914
00915 ++recentoccupancy_digi[CalcEtaBin(digi.id().subdet(),ieta,depth)][iphi-1][depth-1];
00916
00917
00918 if (present_digi[CalcEtaBin(digi.id().subdet(),ieta,depth)][iphi-1][depth-1]==false)
00919 {
00920 if (DigiPresentByDepth.depth[depth-1])
00921 {
00922 DigiPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(digi.id().subdet(),ieta,depth)+1,iphi,1);
00923 }
00924 present_digi[CalcEtaBin(digi.id().subdet(),ieta,depth)][iphi-1][depth-1]=true;
00925 }
00926 return;
00927 }
00928
00929
00930
00931 template<class RECHIT>
00932 void HcalDeadCellMonitor::process_RecHit(RECHIT& rechit)
00933 {
00934 float en = rechit->energy();
00935 HcalDetId id(rechit->detid().rawId());
00936 int ieta = id.ieta();
00937 int iphi = id.iphi();
00938 int depth = id.depth();
00939
00940 if (id.subdet()==HcalBarrel)
00941 {
00942 if (en>=HBenergyThreshold_)
00943 {
00944 ++recentoccupancy_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
00945 present_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1]=true;
00946 if (RecHitPresentByDepth.depth[depth-1])
00947 RecHitPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(id.subdet(),ieta,depth)+1,iphi,1);
00948 }
00950
00951 int RBXindex = logicalMap_->getHcalFrontEndId(rechit->detid()).rbxIndex();
00952
00953 occupancy_RBX[RBXindex]++;
00955 }
00956 else if (id.subdet()==HcalEndcap)
00957 {
00958 if (en>=HEenergyThreshold_)
00959 {
00960 ++recentoccupancy_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
00961 present_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1]=true;
00962 if (RecHitPresentByDepth.depth[depth-1])
00963 RecHitPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(id.subdet(),ieta,depth)+1,iphi,1);
00964 }
00966
00967 int RBXindex = logicalMap_->getHcalFrontEndId(rechit->detid()).rbxIndex();
00968
00969 occupancy_RBX[RBXindex]++;
00971 }
00972 else if (id.subdet()==HcalForward)
00973 {
00974 if (en>=HFenergyThreshold_)
00975 {
00976 ++recentoccupancy_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
00977
00978 present_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1]=true;
00979 if (RecHitPresentByDepth.depth[depth-1])
00980 RecHitPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(id.subdet(),ieta,depth)+1,iphi,1);
00981 }
00983
00984 int RBXindex = logicalMap_->getHcalFrontEndId(rechit->detid()).rbxIndex();
00985
00986 occupancy_RBX[RBXindex]++;
00988 }
00989 else if (id.subdet()==HcalOuter)
00990 {
00991 if (en>=HOenergyThreshold_)
00992 {
00993 ++recentoccupancy_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
00994 present_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1]=true;
00995 if (RecHitPresentByDepth.depth[depth-1])
00996 RecHitPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(id.subdet(),ieta,depth)+1,iphi,1);
00997 }
00999
01000 int RBXindex = logicalMap_->getHcalFrontEndId(rechit->detid()).rbxIndex();
01001
01002 occupancy_RBX[RBXindex]++;
01004 }
01005 }
01006
01007 void HcalDeadCellMonitor::fillNevents_recentdigis()
01008 {
01009
01010 if (!deadmon_test_digis_) return;
01011
01012 if (debug_>0)
01013 std::cout <<"<HcalDeadCellMonitor::fillNevents_recentdigis> CHECKING FOR RECENT MISSING DIGIS evtcount = "<<deadevt_<<std::endl;
01014
01015 int ieta=0;
01016 int iphi=0;
01017
01018 int etabins=0;
01019 int phibins=0;
01020
01022 if ((deadevt_ >= 10 && deadevt_<minDeadEventCount_) || (deadevt_ >= 10 && is_RBX_loss_==1))
01023
01024 for (unsigned int depth=0;depth<RecentMissingDigisByDepth.depth.size();++depth)
01025 {
01026 RecentMissingDigisByDepth.depth[depth]->setBinContent(0,0,ievt_);
01027 etabins=RecentMissingDigisByDepth.depth[depth]->getNbinsX();
01028 phibins=RecentMissingDigisByDepth.depth[depth]->getNbinsY();
01029 for (int eta=0;eta<etabins;++eta)
01030 for (int phi=0;phi<phibins;++phi)
01031 {
01032 iphi=phi+1;
01033 for (int subdet=1;subdet<=4;++subdet)
01034 {
01035 ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1);
01036 if (ieta==-9999) continue;
01037 if (!validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))
01038 continue;
01039
01040 HcalDetId TempID((HcalSubdetector)subdet, ieta, iphi, (int)depth+1);
01041
01042 int index = logicalMap_->getHcalFrontEndId(TempID).rbxIndex();
01043
01044
01045 if(occupancy_RBX[index]==0)
01046 {
01047 recentoccupancy_digi[eta][phi][depth] = 0;
01048 RecentMissingDigisByDepth.depth[depth]->Fill(ieta,iphi,deadevt_);
01049 }
01050 }
01051 }
01052 }
01054
01055 if (deadevt_ < minDeadEventCount_) return;
01056
01057 for (unsigned int depth=0;depth<RecentMissingDigisByDepth.depth.size();++depth)
01058 {
01059 RecentMissingDigisByDepth.depth[depth]->setBinContent(0,0,ievt_);
01060 etabins=RecentMissingDigisByDepth.depth[depth]->getNbinsX();
01061 phibins=RecentMissingDigisByDepth.depth[depth]->getNbinsY();
01062 for (int eta=0;eta<etabins;++eta)
01063 {
01064 for (int subdet=1;subdet<=4;++subdet)
01065 {
01066 ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1);
01067 if (ieta==-9999) continue;
01068 for (int phi=0;phi<phibins;++phi)
01069 {
01070 iphi=phi+1;
01071
01072 if (!validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))
01073 continue;
01074
01075
01076
01077
01078
01079
01080
01081
01082 int zside=0;
01083 if (subdet==HcalForward)
01084 ieta<0 ? zside=-1 : zside=+1;
01085
01086 if (recentoccupancy_digi[eta][phi][depth]==0)
01087 {
01088 if (debug_>0)
01089 {
01090 std::cout <<"DEAD CELL; NO RECENT OCCUPANCY: subdet = "<<subdet<<", ieta = "<<ieta<<", iphi = "<<iphi<<" depth = "<<depth+1<<std::endl;
01091 std::cout <<"\t RAW COORDINATES: eta = "<<eta<< " phi = "<<phi<<" depth = "<<depth<<std::endl;
01092 std::cout <<"\t Present? "<<present_digi[eta][phi][depth]<<std::endl;
01093 }
01094
01095
01096 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01097 continue;
01098
01099
01100 if (RecentMissingDigisByDepth.depth[depth]) RecentMissingDigisByDepth.depth[depth]->Fill(ieta+zside,iphi,deadevt_);
01101 }
01102 }
01103 }
01104 }
01105 }
01106 FillUnphysicalHEHFBins(RecentMissingDigisByDepth);
01107
01108 return;
01109
01110 }
01111
01112
01113
01114
01115
01116 void HcalDeadCellMonitor::fillNevents_recentrechits()
01117 {
01118
01119
01120
01121
01122
01123
01124
01125
01126 if (!deadmon_test_rechits_) return;
01127 FillUnphysicalHEHFBins(RecHitPresentByDepth);
01128
01129 if (debug_>0)
01130 std::cout <<"<HcalDeadCellMonitor::fillNevents_energy> BELOW-ENERGY-THRESHOLD PLOTS"<<std::endl;
01131
01132 int ieta=0;
01133 int iphi=0;
01134
01135 int etabins=0;
01136 int phibins=0;
01137
01139 if ((deadevt_ >= 10 && deadevt_<minDeadEventCount_) || (deadevt_ >= 10 && is_RBX_loss_==1))
01140
01141 for (unsigned int depth=0;depth<RecentMissingRecHitsByDepth.depth.size();++depth)
01142 {
01143 RecentMissingRecHitsByDepth.depth[depth]->setBinContent(0,0,ievt_);
01144 etabins=RecentMissingRecHitsByDepth.depth[depth]->getNbinsX();
01145 phibins=RecentMissingRecHitsByDepth.depth[depth]->getNbinsY();
01146 for (int eta=0;eta<etabins;++eta)
01147 for (int phi=0;phi<phibins;++phi)
01148 {
01149 iphi=phi+1;
01150 for (int subdet=1;subdet<=4;++subdet)
01151 {
01152 ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1);
01153 if (ieta==-9999) continue;
01154 if (!validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))
01155 continue;
01156
01157 HcalDetId TempID((HcalSubdetector)subdet, ieta, iphi, (int)depth+1);
01158
01159 int index = logicalMap_->getHcalFrontEndId(TempID).rbxIndex();
01160
01161
01162 if(occupancy_RBX[index]==0)
01163 {
01164 recentoccupancy_rechit[eta][phi][depth] = 0;
01165 RecentMissingRecHitsByDepth.depth[depth]->Fill(ieta,iphi,deadevt_);
01166 }
01167 }
01168 }
01169 }
01171
01172 if (deadevt_ < minDeadEventCount_) return;
01173
01174 for (unsigned int depth=0;depth<RecentMissingRecHitsByDepth.depth.size();++depth)
01175 {
01176 RecentMissingRecHitsByDepth.depth[depth]->setBinContent(0,0,ievt_);
01177 etabins=RecentMissingRecHitsByDepth.depth[depth]->getNbinsX();
01178 phibins=RecentMissingRecHitsByDepth.depth[depth]->getNbinsY();
01179 for (int eta=0;eta<etabins;++eta)
01180 {
01181 for (int subdet=1;subdet<=4;++subdet)
01182 {
01183 ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1);
01184 if (ieta==-9999) continue;
01185 for (int phi=0;phi<phibins;++phi)
01186 {
01187 iphi=phi+1;
01188 if (!validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))
01189 continue;
01190
01191 if (recentoccupancy_rechit[eta][phi][depth]>0) continue;
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201 int zside=0;
01202 if (subdet==HcalForward)
01203 {
01204 ieta<0 ? zside=-1 : zside=+1;
01205 }
01206
01207 if (debug_>2)
01208 std::cout <<"DEAD CELL; BELOW ENERGY THRESHOLD; subdet = "<<subdet<<" ieta = "<<ieta<<", phi = "<<iphi<<" depth = "<<depth+1<<std::endl;
01209 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01210 continue;
01211
01212 if (RecentMissingRecHitsByDepth.depth[depth]) RecentMissingRecHitsByDepth.depth[depth]->Fill(ieta+zside,iphi,deadevt_);
01213 }
01214 }
01215 }
01216 }
01217
01218 FillUnphysicalHEHFBins(RecentMissingRecHitsByDepth);
01219
01220 return;
01221 }
01222
01223
01224 void HcalDeadCellMonitor::fillNevents_problemCells()
01225 {
01226
01227
01228 if (debug_>0)
01229 std::cout <<"<HcalDeadCellMonitor::fillNevents_problemCells> FILLING PROBLEM CELL PLOTS"<<std::endl;
01230
01231 int ieta=0;
01232 int iphi=0;
01233
01234
01235
01236 NumBadHB=0;
01237 NumBadHE=0;
01238 NumBadHO=0;
01239 NumBadHF=0;
01240 NumBadHFLUMI=0;
01241 NumBadHO01=0;
01242 NumBadHO2=0;
01243 NumBadHO12=0;
01244 NumBadHO1P02=0;
01245
01246 int knownBadHB=0;
01247 int knownBadHE=0;
01248 int knownBadHF=0;
01249 int knownBadHO=0;
01250 int knownBadHFLUMI=0;
01251 int knownBadHO01=0;
01252 int knownBadHO2=0;
01253 int knownBadHO12=0;
01254
01255
01256 unsigned int neverpresentHB=0;
01257 unsigned int neverpresentHE=0;
01258 unsigned int neverpresentHO=0;
01259 unsigned int neverpresentHF=0;
01260
01261 unsigned int unoccupiedHB=0;
01262 unsigned int unoccupiedHE=0;
01263 unsigned int unoccupiedHO=0;
01264 unsigned int unoccupiedHF=0;
01265
01266 unsigned int belowenergyHB=0;
01267 unsigned int belowenergyHE=0;
01268 unsigned int belowenergyHO=0;
01269 unsigned int belowenergyHF=0;
01270
01271 unsigned int energyneverpresentHB=0;
01272 unsigned int energyneverpresentHE=0;
01273 unsigned int energyneverpresentHO=0;
01274 unsigned int energyneverpresentHF=0;
01275
01276 if (deadevt_>=minDeadEventCount_)
01277 Nevents->Fill(1,deadevt_);
01278
01279 int etabins=0;
01280 int phibins=0;
01281
01282
01283
01284
01285
01287
01288 unsigned int RBX_loss_HB=0;
01289 unsigned int RBX_loss_HE=0;
01290 unsigned int RBX_loss_HO01=0;
01291 unsigned int RBX_loss_HO2=0;
01292 unsigned int RBX_loss_HF=0;
01293
01294 unsigned int counter_HB = 0;
01295 unsigned int counter_HE = 0;
01296 unsigned int counter_HO01 = 0;
01297 unsigned int counter_HO2 = 0;
01298 unsigned int counter_HF = 0;
01299
01300 for(int i=0; i<156; i++)
01301 {
01302 if(occupancy_RBX[i]==0 && is_RBX_loss_ == 1)
01303 {
01304 if(i<=35)
01305 { counter_HB ++ ; RBX_loss_HB = 72*(counter_HB); }
01306 if(i>=36 && i<=71)
01307 { counter_HE ++ ; RBX_loss_HE = 72*(counter_HE); }
01308 if(i>=85 && i<=119)
01309 { counter_HO01 ++ ; RBX_loss_HO01 = 72*(counter_HO01); }
01310 if(i>=121 || i<=83)
01311 { counter_HO2 ++ ; RBX_loss_HO2 = 72*(counter_HO2); }
01312 if(i>=132 && i<=155)
01313 { counter_HF ++ ; RBX_loss_HF = 72*(counter_HF); }
01314
01315 if(excludeHO1P02_==true && i==109) NumBadHO1P02 = 72;
01316 }
01317 if(occupancy_RBX[i]>0)
01318 RBX_loss_VS_LB->Fill(currentLS, i, 0);
01319 if(occupancy_RBX[i]==0 && is_RBX_loss_ == 1)
01320 RBX_loss_VS_LB->Fill(currentLS, i, 1);
01321 }
01322
01323 if (deadevt_ >= 10 && deadevt_<minDeadEventCount_)
01324 if( is_RBX_loss_ == 1 )
01325 {
01326 NumBadHB+=RBX_loss_HB;
01327 NumBadHE+=RBX_loss_HE;
01328 NumBadHO+=RBX_loss_HO01+RBX_loss_HO2;
01329 NumBadHO01+=RBX_loss_HO01;
01330 NumBadHO2+=RBX_loss_HO2;
01331 NumBadHF+=RBX_loss_HF;
01332
01333 belowenergyHB+=RBX_loss_HB;
01334 belowenergyHE+=RBX_loss_HE;
01335 belowenergyHO+=RBX_loss_HO01+RBX_loss_HO2;
01336 belowenergyHF+=RBX_loss_HF;
01337
01338 unoccupiedHB+=RBX_loss_HB;
01339 unoccupiedHE+=RBX_loss_HE;
01340 unoccupiedHO+=RBX_loss_HO01+RBX_loss_HO2;
01341 unoccupiedHF+=RBX_loss_HF;
01342 }
01344
01345 for (unsigned int depth=0;depth<DigiPresentByDepth.depth.size();++depth)
01346 {
01347 DigiPresentByDepth.depth[depth]->setBinContent(0,0,ievt_);
01348 etabins=DigiPresentByDepth.depth[depth]->getNbinsX();
01349 phibins=DigiPresentByDepth.depth[depth]->getNbinsY();
01350 for (int eta=0;eta<etabins;++eta)
01351 {
01352 for (int phi=0;phi<phibins;++phi)
01353 {
01354 iphi=phi+1;
01355 for (int subdet=1;subdet<=4;++subdet)
01356 {
01357 ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1);
01358 if (ieta==-9999) continue;
01359 if (!validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))
01360 continue;
01361
01362
01363
01364
01365
01366
01367
01368
01369
01370
01371
01372
01373
01374
01375
01376
01377 if ((present_digi[eta][phi][depth]==0) ||
01378 (deadmon_test_digis_ && recentoccupancy_digi[eta][phi][depth]==0 && (deadevt_>=minDeadEventCount_)) ||
01379 (deadmon_test_rechits_ && recentoccupancy_rechit[eta][phi][depth]==0 && (deadevt_>=minDeadEventCount_))
01380 )
01381 {
01382 HcalDetId TempID((HcalSubdetector)subdet, ieta, iphi, (int)depth+1);
01383 if (subdet==HcalBarrel)
01384 {
01385 ++NumBadHB;
01386 if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end())
01387 ++knownBadHB;
01388 }
01389 else if (subdet==HcalEndcap)
01390 {
01391 ++NumBadHE;
01392 if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end())
01393 ++knownBadHE;
01394 }
01395
01396 else if (subdet==HcalOuter)
01397 {
01398 ++NumBadHO;
01399 if (abs(ieta)<=10) ++NumBadHO01;
01400 else ++NumBadHO2;
01401
01402 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01403 {
01404 --NumBadHO;
01405 --NumBadHO2;
01406 --NumBadHO12;
01407 }
01408
01409 if (excludeHO1P02_==true && ( (ieta>4 && ieta<10) && (iphi<=10 || iphi>70) ) )
01410 ++NumBadHO1P02;
01411
01412 if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end())
01413 {
01414 ++knownBadHO;
01415 if (abs(ieta)<=10) ++knownBadHO01;
01416 else ++knownBadHO2;
01417
01418 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01419 {
01420 --knownBadHO;
01421 --knownBadHO12;
01422 }
01423 }
01424 }
01425 else if (subdet==HcalForward)
01426 {
01427 ++NumBadHF;
01428 if (depth==1 && (abs(ieta)==33 || abs(ieta)==34))
01429 ++NumBadHFLUMI;
01430 else if (depth==2 && (abs(ieta)==35 || abs(ieta)==36))
01431 ++NumBadHFLUMI;
01432 if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end())
01433 {
01434 ++knownBadHF;
01435 if (depth==1 && (abs(ieta)==33 || abs(ieta)==34))
01436 ++knownBadHFLUMI;
01437 else if (depth==2 && (abs(ieta)==35 || abs(ieta)==36))
01438 ++knownBadHFLUMI;
01439 }
01440 }
01441 }
01442 if (present_digi[eta][phi][depth]==0 )
01443 {
01444 if (subdet==HcalBarrel) ++neverpresentHB;
01445 else if (subdet==HcalEndcap) ++neverpresentHE;
01446 else if (subdet==HcalOuter)
01447 {
01448 ++neverpresentHO;
01449 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01450 --neverpresentHO;
01451 }
01452 else if (subdet==HcalForward) ++neverpresentHF;
01453 }
01454
01455 if (deadmon_test_digis_ && recentoccupancy_digi[eta][phi][depth]==0 && deadevt_>=minDeadEventCount_)
01456 {
01457 HcalDetId TempID((HcalSubdetector)subdet, ieta, iphi, (int)depth+1);
01458 if (subdet==HcalBarrel) ++unoccupiedHB;
01459 else if (subdet==HcalEndcap) ++unoccupiedHE;
01460 else if (subdet==HcalOuter)
01461 {
01462 ++unoccupiedHO;
01463 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01464 --unoccupiedHO;
01465 if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end() && abs(ieta)<=10)
01466 --unoccupiedHO;
01467 }
01468 else if (subdet==HcalForward) ++unoccupiedHF;
01469 }
01470
01471 if (deadmon_test_rechits_)
01472 {
01473 if (present_rechit[eta][phi][depth]==0)
01474 {
01475 if (subdet==HcalBarrel) ++energyneverpresentHB;
01476 else if (subdet==HcalEndcap) ++energyneverpresentHE;
01477 else if (subdet==HcalOuter)
01478 {
01479 ++energyneverpresentHO;
01480 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01481 --energyneverpresentHO;
01482 }
01483 else if (subdet==HcalForward) ++energyneverpresentHF;
01484 }
01485 if (recentoccupancy_rechit[eta][phi][depth]==0 && deadevt_>=minDeadEventCount_)
01486 {
01487 HcalDetId TempID((HcalSubdetector)subdet, ieta, iphi, (int)depth+1);
01488 if (subdet==HcalBarrel) ++belowenergyHB;
01489 else if (subdet==HcalEndcap) ++belowenergyHE;
01490 else if (subdet==HcalOuter)
01491 {
01492 ++belowenergyHO;
01493 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01494 --belowenergyHO;
01495 if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end() && abs(ieta)<=10)
01496 --belowenergyHO;
01497 }
01498 else if (subdet==HcalForward) ++belowenergyHF;
01499 }
01500 }
01501 }
01502 }
01503 }
01504 }
01505
01506
01507 NumberOfNeverPresentDigisHB->Fill(currentLS,neverpresentHB);
01508 NumberOfNeverPresentDigisHE->Fill(currentLS,neverpresentHE);
01509 NumberOfNeverPresentDigisHO->Fill(currentLS,neverpresentHO);
01510 NumberOfNeverPresentDigisHF->Fill(currentLS,neverpresentHF);
01511 NumberOfNeverPresentDigis->Fill(currentLS,neverpresentHB+neverpresentHE+neverpresentHO+neverpresentHF);
01512
01513 if (deadevt_>=minDeadEventCount_ && is_RBX_loss_ == 1 )
01514 {
01515 if( NumBadHB<RBX_loss_HB )
01516 NumBadHB+=RBX_loss_HB;
01517 if( NumBadHE<RBX_loss_HE )
01518 NumBadHE+=RBX_loss_HE;
01519 if( NumBadHO01<RBX_loss_HO01 )
01520 NumBadHO01+=RBX_loss_HO01;
01521 if( NumBadHO2<RBX_loss_HO2 )
01522 NumBadHO2+=RBX_loss_HO2;
01523 if( NumBadHF<RBX_loss_HF )
01524 NumBadHF+=RBX_loss_HF;
01525
01526 if( belowenergyHB<RBX_loss_HB )
01527 belowenergyHB+=RBX_loss_HB;
01528 if( belowenergyHE<RBX_loss_HE )
01529 belowenergyHE+=RBX_loss_HE;
01530 if( belowenergyHO<RBX_loss_HO01+RBX_loss_HO2)
01531 belowenergyHO+=RBX_loss_HO01+RBX_loss_HO2;
01532 if( belowenergyHF<RBX_loss_HF )
01533 belowenergyHF+=RBX_loss_HF;
01534
01535 if( unoccupiedHB<RBX_loss_HB )
01536 unoccupiedHB+=RBX_loss_HB;
01537 if( unoccupiedHE<RBX_loss_HE )
01538 unoccupiedHE+=RBX_loss_HE;
01539 if( unoccupiedHO<RBX_loss_HO01+RBX_loss_HO2 )
01540 unoccupiedHO+=RBX_loss_HO01+RBX_loss_HO2;
01541 if( unoccupiedHF<RBX_loss_HF )
01542 unoccupiedHF+=RBX_loss_HF;
01543
01544
01545 }
01546
01547 ProblemsVsLB_HB->Fill(currentLS,NumBadHB-knownBadHB+0.0001);
01548 ProblemsVsLB_HE->Fill(currentLS,NumBadHE-knownBadHE+0.0001);
01549 ProblemsVsLB_HO->Fill(currentLS,NumBadHO01-knownBadHO01+0.0001);
01550 ProblemsVsLB_HO2->Fill(currentLS,NumBadHO2-knownBadHO2+0.0001);
01551 ProblemsVsLB_HF->Fill(currentLS,NumBadHF-knownBadHF+0.0001);
01552 ProblemsVsLB_HBHEHF->Fill(currentLS,NumBadHB+NumBadHE+NumBadHF-knownBadHB-knownBadHE-knownBadHF+0.0001);
01553 ProblemsVsLB->Fill(currentLS,NumBadHB+NumBadHE+NumBadHO01+NumBadHO2+NumBadHF-knownBadHB-knownBadHE-knownBadHO01-knownBadHO2-knownBadHF+0.0001);
01554
01555 if(excludeHO1P02_==true)
01556 ProblemsVsLB_HO->Fill(0, NumBadHO1P02);
01557
01558 if( NumBadHB+NumBadHE+NumBadHF-knownBadHB-knownBadHE-knownBadHF < 30 )
01559 alarmer_counter_ = 0;
01560 if( NumBadHO01-knownBadHO01 < 30 )
01561 alarmer_counterHO01_ = 0;
01562
01563 if( alarmer_counter_ >= 10 )
01564 ProblemsInLastNLB_HBHEHF_alarm->Fill( std::min(int(NumBadHB+NumBadHE+NumBadHF-knownBadHB-knownBadHE-knownBadHF), 99) );
01565 if( alarmer_counterHO01_ >= 10 )
01566 ProblemsInLastNLB_HO01_alarm->Fill( std::min(int(NumBadHO01-knownBadHO01), 99) );
01567
01568
01569
01570
01571 if (deadmon_test_digis_)
01572 {
01573 NumberOfRecentMissingDigisHB->Fill(currentLS,unoccupiedHB);
01574 NumberOfRecentMissingDigisHE->Fill(currentLS,unoccupiedHE);
01575 NumberOfRecentMissingDigisHO->Fill(currentLS,unoccupiedHO);
01576 NumberOfRecentMissingDigisHF->Fill(currentLS,unoccupiedHF);
01577 NumberOfRecentMissingDigis->Fill(currentLS,unoccupiedHB+unoccupiedHE+unoccupiedHO+unoccupiedHF);
01578 }
01579
01580 if (deadmon_test_rechits_)
01581 {
01582 NumberOfNeverPresentRecHitsHB->Fill(currentLS,energyneverpresentHB);
01583 NumberOfNeverPresentRecHitsHE->Fill(currentLS,energyneverpresentHE);
01584 NumberOfNeverPresentRecHitsHO->Fill(currentLS,energyneverpresentHO);
01585 NumberOfNeverPresentRecHitsHF->Fill(currentLS,energyneverpresentHF);
01586 NumberOfNeverPresentRecHits->Fill(currentLS,energyneverpresentHB+energyneverpresentHE+energyneverpresentHO+energyneverpresentHF);
01587
01588 NumberOfRecentMissingRecHitsHB->Fill(currentLS,belowenergyHB);
01589 NumberOfRecentMissingRecHitsHE->Fill(currentLS,belowenergyHE);
01590 NumberOfRecentMissingRecHitsHO->Fill(currentLS,belowenergyHO);
01591 NumberOfRecentMissingRecHitsHF->Fill(currentLS,belowenergyHF);
01592 NumberOfRecentMissingRecHits->Fill(currentLS,belowenergyHB+belowenergyHE+belowenergyHO+belowenergyHF);
01593 }
01594
01595 return;
01596 }
01597
01598
01599 void HcalDeadCellMonitor::zeroCounters(bool resetpresent)
01600 {
01601
01602
01603
01604
01605 for (unsigned int i=0;i<85;++i)
01606 {
01607 for (unsigned int j=0;j<72;++j)
01608 {
01609 for (unsigned int k=0;k<4;++k)
01610 {
01611 if (resetpresent) present_digi[i][j][k]=false;
01612 if (resetpresent) present_rechit[i][j][k]=false;
01613 recentoccupancy_digi[i][j][k]=0;
01614 recentoccupancy_rechit[i][j][k]=0;
01615 }
01616 }
01617 }
01618
01619 for (unsigned int i=0;i<156;++i)
01620 {
01621 occupancy_RBX[i] = 0;
01622 rbxlost[i] = 0;
01623 }
01624
01625 return;
01626 }
01627
01628 DEFINE_FWK_MODULE(HcalDeadCellMonitor);