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
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 deadmon_test_digis_ = ps.getUntrackedParameter<bool>("test_digis",true);
00050 deadmon_test_rechits_ = ps.getUntrackedParameter<bool>("test_rechits",false);
00051
00052
00053 energyThreshold_ = ps.getUntrackedParameter<double>("MissingRechitEnergyThreshold",0);
00054 HBenergyThreshold_ = ps.getUntrackedParameter<double>("HB_energyThreshold",energyThreshold_);
00055 HEenergyThreshold_ = ps.getUntrackedParameter<double>("HE_energyThreshold",energyThreshold_);
00056 HOenergyThreshold_ = ps.getUntrackedParameter<double>("HO_energyThreshold",energyThreshold_);
00057 HFenergyThreshold_ = ps.getUntrackedParameter<double>("HF_energyThreshold",energyThreshold_);
00058
00059 }
00060
00061 HcalDeadCellMonitor::~HcalDeadCellMonitor()
00062 {
00063 }
00064
00065
00066
00067
00068 void HcalDeadCellMonitor::setup()
00069 {
00070 HcalBaseDQMonitor::setup();
00071 zeroCounters(1);
00072 if (debug_>0)
00073 std::cout <<"<HcalDeadCellMonitor::setup> Setting up histograms"<<std::endl;
00074
00075 if (!dbe_) return;
00076
00077 dbe_->setCurrentFolder(subdir_);
00078 MonitorElement* excludeHO2=dbe_->bookInt("ExcludeHOring2");
00079
00080 if (excludeHO2) excludeHO2->Fill(excludeHORing2_==true ? 1 : 0);
00081
00082 Nevents = dbe_->book1D("NumberOfDeadCellEvents","Number of Events Seen by DeadCellMonitor",2,0,2);
00083 Nevents->setBinLabel(1,"allEvents");
00084 Nevents->setBinLabel(2,"lumiCheck");
00085
00086 ProblemsVsLB=dbe_->bookProfile("TotalDeadCells_HCAL_vs_LS",
00087 "Total Number of Dead Hcal Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
00088 NLumiBlocks_,0.5,NLumiBlocks_+0.5,
00089 100,0,10000);
00090 ProblemsVsLB_HB=dbe_->bookProfile("TotalDeadCells_HB_vs_LS",
00091 "Total Number of Dead HB Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
00092 NLumiBlocks_,0.5,NLumiBlocks_+0.5,
00093 100,0,10000);
00094 ProblemsVsLB_HE=dbe_->bookProfile("TotalDeadCells_HE_vs_LS",
00095 "Total Number of Dead HE Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
00096 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00097 ProblemsVsLB_HO=dbe_->bookProfile("TotalDeadCells_HO_vs_LS",
00098 "Total Number of Dead HO Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
00099 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00100 ProblemsVsLB_HF=dbe_->bookProfile("TotalDeadCells_HF_vs_LS",
00101 "Total Number of Dead HF Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
00102 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00103 ProblemsVsLB_HBHEHF=dbe_->bookProfile("TotalDeadCells_HBHEHF_vs_LS",
00104 "Total Number of Dead HBHEHF Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
00105 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00106
00107 (ProblemsVsLB->getTProfile())->SetMarkerStyle(20);
00108 (ProblemsVsLB_HB->getTProfile())->SetMarkerStyle(20);
00109 (ProblemsVsLB_HE->getTProfile())->SetMarkerStyle(20);
00110 (ProblemsVsLB_HO->getTProfile())->SetMarkerStyle(20);
00111 (ProblemsVsLB_HF->getTProfile())->SetMarkerStyle(20);
00112 (ProblemsVsLB_HBHEHF->getTProfile())->SetMarkerStyle(20);
00113
00114 dbe_->setCurrentFolder(subdir_+"dead_cell_parameters");
00115 MonitorElement* me=dbe_->bookInt("Test_NeverPresent_Digis");
00116 me->Fill(1);
00117 me=dbe_->bookInt("Test_DigiMissing_Periodic_Lumi_Check");
00118 if (deadmon_test_digis_)
00119 me->Fill(1);
00120 else
00121 me->Fill(0);
00122 me=dbe_->bookInt("Min_Events_Required_Periodic_Lumi_Check");
00123 me->Fill(minDeadEventCount_);
00124 me=dbe_->bookInt("Test_NeverPresent_RecHits");
00125 deadmon_test_rechits_>0 ? me->Fill(1) : me->Fill(0);
00126 me=dbe_->bookFloat("HBMinimumRecHitEnergy");
00127 me->Fill(HBenergyThreshold_);
00128 me=dbe_->bookFloat("HEMinimumRecHitEnergy");
00129 me->Fill(HEenergyThreshold_);
00130 me=dbe_->bookFloat("HOMinimumRecHitEnergy");
00131 me->Fill(HOenergyThreshold_);
00132 me=dbe_->bookFloat("HFMinimumRecHitEnergy");
00133 me->Fill(HFenergyThreshold_);
00134 me=dbe_->bookInt("Test_RecHitsMissing_Periodic_Lumi_Check");
00135 deadmon_test_rechits_>0 ? me->Fill(1) : me->Fill(0);
00136
00137
00138
00139
00140 std::stringstream units;
00141 std::stringstream name;
00142
00143
00144
00145 dbe_->setCurrentFolder(subdir_+"dead_digi_never_present");
00146 SetupEtaPhiHists(DigiPresentByDepth,
00147 "Digi Present At Least Once","");
00148
00149 NumberOfNeverPresentDigis=dbe_->bookProfile("Problem_NeverPresentDigis_HCAL_vs_LS",
00150 "Total Number of Never-Present Hcal Cells vs LS;Lumi Section;Dead Cells",
00151 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00152
00153 NumberOfNeverPresentDigisHB=dbe_->bookProfile("Problem_NeverPresentDigis_HB_vs_LS",
00154 "Total Number of Never-Present HB Cells vs LS;Lumi Section;Dead Cells",
00155 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00156
00157 NumberOfNeverPresentDigisHE=dbe_->bookProfile("Problem_NeverPresentDigis_HE_vs_LS",
00158 "Total Number of Never-Present HE Cells vs LS;Lumi Section;Dead Cells",
00159 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00160
00161 NumberOfNeverPresentDigisHO=dbe_->bookProfile("Problem_NeverPresentDigis_HO_vs_LS",
00162 "Total Number of Never-Present HO Cells vs LS;Lumi Section;Dead Cells",
00163 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00164
00165 NumberOfNeverPresentDigisHF=dbe_->bookProfile("Problem_NeverPresentDigis_HF_vs_LS",
00166 "Total Number of Never-Present HF Cells vs LS;Lumi Section;Dead Cells",
00167 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00168 (NumberOfNeverPresentDigis->getTProfile())->SetMarkerStyle(20);
00169 (NumberOfNeverPresentDigisHB->getTProfile())->SetMarkerStyle(20);
00170 (NumberOfNeverPresentDigisHE->getTProfile())->SetMarkerStyle(20);
00171 (NumberOfNeverPresentDigisHO->getTProfile())->SetMarkerStyle(20);
00172 (NumberOfNeverPresentDigisHF->getTProfile())->SetMarkerStyle(20);
00173
00174 FillUnphysicalHEHFBins(DigiPresentByDepth);
00175
00176 if (deadmon_test_digis_)
00177 {
00178 dbe_->setCurrentFolder(subdir_+"dead_digi_often_missing");
00179
00180 name<<"Dead Cells with No Digis";
00181 SetupEtaPhiHists(RecentMissingDigisByDepth,
00182 name.str(),
00183 "");
00184 name.str("");
00185 name<<"HB HE HF Depth 1 Dead Cells with No Digis for at least 1 Full Luminosity Block";
00186 RecentMissingDigisByDepth.depth[0]->setTitle(name.str().c_str());
00187
00188 name.str("");
00189 name<<"HB HE HF Depth 2 Dead Cells with No Digis for at least 1 Full Luminosity Block";
00190 RecentMissingDigisByDepth.depth[1]->setTitle(name.str().c_str());
00191
00192 name.str("");
00193 name<<"HE Depth 3 Dead Cells with No Digis for at least 1 Full Luminosity Block";
00194 RecentMissingDigisByDepth.depth[2]->setTitle(name.str().c_str());
00195
00196 name.str("");
00197 name<<"HO Depth 4 Dead Cells with No Digis for at least 1 Full Luminosity Block";
00198 RecentMissingDigisByDepth.depth[3]->setTitle(name.str().c_str());
00199 name.str("");
00200
00201
00202 name<<"Total Number of Hcal Digis Unoccupied for at least 1 Full Luminosity Block";
00203 NumberOfRecentMissingDigis=dbe_->bookProfile("Problem_RecentMissingDigis_HCAL_vs_LS",
00204 name.str(),
00205 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00206 name.str("");
00207 name<<"Total Number of HB Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
00208 NumberOfRecentMissingDigisHB=dbe_->bookProfile("Problem_RecentMissingDigis_HB_vs_LS",
00209 name.str(),
00210 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00211 name.str("");
00212 name<<"Total Number of HE Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
00213 NumberOfRecentMissingDigisHE=dbe_->bookProfile("Problem_RecentMissingDigis_HE_vs_LS",
00214 name.str(),
00215 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00216 name.str("");
00217 name<<"Total Number of HO Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
00218 NumberOfRecentMissingDigisHO=dbe_->bookProfile("Problem_RecentMissingDigis_HO_vs_LS",
00219 name.str(),
00220 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00221 name.str("");
00222 name<<"Total Number of HF Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
00223 NumberOfRecentMissingDigisHF=dbe_->bookProfile("Problem_RecentMissingDigis_HF_vs_LS",
00224 name.str(),
00225 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00226 (NumberOfRecentMissingDigis->getTProfile())->SetMarkerStyle(20);
00227 (NumberOfRecentMissingDigisHB->getTProfile())->SetMarkerStyle(20);
00228 (NumberOfRecentMissingDigisHE->getTProfile())->SetMarkerStyle(20);
00229 (NumberOfRecentMissingDigisHO->getTProfile())->SetMarkerStyle(20);
00230 (NumberOfRecentMissingDigisHF->getTProfile())->SetMarkerStyle(20);
00231
00232 }
00233
00234 if (deadmon_test_rechits_)
00235 {
00236
00237 dbe_->setCurrentFolder(subdir_+"dead_rechit_neverpresent");
00238 SetupEtaPhiHists(RecHitPresentByDepth,"RecHit Above Threshold At Least Once","");
00239
00240 units.str("");
00241 units<<"Cells Above Energy Threshold At Least Once: Depth 1 -- HB >="<<HBenergyThreshold_<<" GeV, HE >= "<<HEenergyThreshold_<<", HF >="<<HFenergyThreshold_<<" GeV";
00242 RecHitPresentByDepth.depth[0]->setTitle(units.str().c_str());
00243 units.str("");
00244 units<<"Cells Above Energy Threshold At Least Once: Depth 2 -- HB >="<<HBenergyThreshold_<<" GeV, HE >= "<<HEenergyThreshold_<<", HF >="<<HFenergyThreshold_<<" GeV";
00245 RecHitPresentByDepth.depth[1]->setTitle(units.str().c_str());
00246 units.str("");
00247 units<<"Cells Above Energy Threshold At Least Once: Depth 3 -- HE >="<<HEenergyThreshold_<<" GeV";
00248 RecHitPresentByDepth.depth[2]->setTitle(units.str().c_str());
00249 units.str("");
00250 units<<"Cells Above Energy Threshold At Least Once: Depth 4 -- HO >="<<HOenergyThreshold_<<" GeV";
00251 RecHitPresentByDepth.depth[3]->setTitle(units.str().c_str());
00252 units.str("");
00253
00254
00255 NumberOfNeverPresentRecHits=dbe_->bookProfile("Problem_RecHitsNeverPresent_HCAL_vs_LS",
00256 "Total Number of Hcal Rechits with Low Energy;Lumi Section;Dead Cells",
00257 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00258 name.str("");
00259 name<<"Total Number of HB RecHits with Energy Never >= "<<HBenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00260 NumberOfNeverPresentRecHitsHB=dbe_->bookProfile("Problem_RecHitsNeverPresent_HB_vs_LS",
00261 name.str(),
00262 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00263 name.str("");
00264 name<<"Total Number of HE RecHits with Energy Never >= "<<HEenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00265 NumberOfNeverPresentRecHitsHE=dbe_->bookProfile("Problem_RecHitsNeverPresent_HE_vs_LS",
00266 name.str(),
00267 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00268 name.str("");
00269 name<<"Total Number of HO RecHits with Energy Never >= "<<HOenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00270 NumberOfNeverPresentRecHitsHO=dbe_->bookProfile("Problem_RecHitsNeverPresent_HO_vs_LS",
00271 name.str(),
00272 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00273 name.str("");
00274 name<<"Total Number of HF RecHits with Energy Never >= "<<HFenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00275 NumberOfNeverPresentRecHitsHF=dbe_->bookProfile("Problem_RecHitsNeverPresent_HF_vs_LS",
00276 name.str(),
00277 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00278 (NumberOfNeverPresentRecHits->getTProfile())->SetMarkerStyle(20);
00279 (NumberOfNeverPresentRecHitsHB->getTProfile())->SetMarkerStyle(20);
00280 (NumberOfNeverPresentRecHitsHE->getTProfile())->SetMarkerStyle(20);
00281 (NumberOfNeverPresentRecHitsHO->getTProfile())->SetMarkerStyle(20);
00282 (NumberOfNeverPresentRecHitsHF->getTProfile())->SetMarkerStyle(20);
00283
00284 dbe_->setCurrentFolder(subdir_+"dead_rechit_often_missing");
00285 SetupEtaPhiHists(RecentMissingRecHitsByDepth,"RecHits Failing Energy Threshold Test","");
00286
00287 units.str("");
00288 units<<"RecHits with Consistent Low Energy Depth 1 -- HB <"<<HBenergyThreshold_<<" GeV, HE < "<<HEenergyThreshold_<<", HF <"<<HFenergyThreshold_<<" GeV";
00289 RecentMissingRecHitsByDepth.depth[0]->setTitle(units.str().c_str());
00290 units.str("");
00291 units<<"RecHits with Consistent Low Energy Depth 2 -- HB <"<<HBenergyThreshold_<<" GeV, HE < "<<HEenergyThreshold_<<", HF <"<<HFenergyThreshold_<<" GeV";
00292 RecentMissingRecHitsByDepth.depth[1]->setTitle(units.str().c_str());
00293 units.str("");
00294 units<<"RecHits with Consistent Low Energy Depth 3 -- HE <"<<HEenergyThreshold_<<" GeV";
00295 RecentMissingRecHitsByDepth.depth[2]->setTitle(units.str().c_str());
00296 units.str("");
00297 units<<"RecHits with Consistent Low Energy Depth 4 -- HO <"<<HOenergyThreshold_<<" GeV";
00298 RecentMissingRecHitsByDepth.depth[3]->setTitle(units.str().c_str());
00299 units.str("");
00300
00301
00302
00303 name<<"Total Number of Hcal RecHits with Consistent Low Energy;Lumi Section;Dead Cells";
00304 NumberOfRecentMissingRecHits=dbe_->bookProfile("Problem_BelowEnergyRecHits_HCAL_vs_LS",
00305 name.str(),
00306 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00307 name.str("");
00308 name<<"Total Number of HB RecHits with Consistent Low Energy < "<<HBenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00309 NumberOfRecentMissingRecHitsHB=dbe_->bookProfile("Problem_BelowEnergyRecHits_HB_vs_LS",
00310 name.str(),
00311 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00312 name.str("");
00313 name<<"Total Number of HE RecHits with Consistent Low Energy < "<<HEenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00314 NumberOfRecentMissingRecHitsHE=dbe_->bookProfile("Problem_BelowEnergyRecHits_HE_vs_LS",
00315 name.str(),
00316 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00317 name.str("");
00318 name<<"Total Number of HO RecHits with Consistent Low Energy < "<<HOenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00319 NumberOfRecentMissingRecHitsHO=dbe_->bookProfile("Problem_BelowEnergyRecHits_HO_vs_LS",
00320 name.str(),
00321 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00322 name.str("");
00323 name<<"Total Number of HF RecHits with Consistent Low Energy < "<<HFenergyThreshold_<<" GeV;Lumi Section;Dead Cells";
00324 NumberOfRecentMissingRecHitsHF=dbe_->bookProfile("Problem_BelowEnergyRecHits_HF_vs_LS",
00325 name.str(),
00326 NLumiBlocks_,0.5,NLumiBlocks_+0.5,100,0,10000);
00327 (NumberOfRecentMissingRecHits->getTProfile())->SetMarkerStyle(20);
00328 (NumberOfRecentMissingRecHitsHB->getTProfile())->SetMarkerStyle(20);
00329 (NumberOfRecentMissingRecHitsHE->getTProfile())->SetMarkerStyle(20);
00330 (NumberOfRecentMissingRecHitsHO->getTProfile())->SetMarkerStyle(20);
00331 (NumberOfRecentMissingRecHitsHF->getTProfile())->SetMarkerStyle(20);
00332
00333 }
00334
00335
00336 if (makeDiagnostics_)
00337 {
00338 dbe_->setCurrentFolder(subdir_+"DiagnosticPlots");
00339 HBDeadVsEvent=dbe_->book1D("HBDeadVsEvent","HB Total Dead Cells Vs Event", NLumiBlocks_,-0.5,NLumiBlocks_-0.5);
00340 HEDeadVsEvent=dbe_->book1D("HEDeadVsEvent","HE Total Dead Cells Vs Event", NLumiBlocks_,-0.5,NLumiBlocks_-0.5);
00341 HODeadVsEvent=dbe_->book1D("HODeadVsEvent","HO Total Dead Cells Vs Event", NLumiBlocks_,-0.5,NLumiBlocks_-0.5);
00342 HFDeadVsEvent=dbe_->book1D("HFDeadVsEvent","HF Total Dead Cells Vs Event", NLumiBlocks_,-0.5,NLumiBlocks_-0.5);
00343 }
00344
00345 this->reset();
00346 return;
00347
00348 }
00349
00350 void HcalDeadCellMonitor::beginRun(const edm::Run& run, const edm::EventSetup& c)
00351 {
00352 if (debug_>1) std::cout <<"HcalDeadCellMonitor::beginRun"<<std::endl;
00353 HcalBaseDQMonitor::beginRun(run,c);
00354
00355 if (tevt_==0) this->setup();
00356 if (mergeRuns_==false)
00357 this->reset();
00358
00359
00360 KnownBadCells_.clear();
00361 if (badChannelStatusMask_>0)
00362 {
00363 edm::ESHandle<HcalChannelQuality> p;
00364 c.get<HcalChannelQualityRcd>().get(p);
00365 HcalChannelQuality* chanquality= new HcalChannelQuality(*p.product());
00366 std::vector<DetId> mydetids = chanquality->getAllChannels();
00367 for (std::vector<DetId>::const_iterator i = mydetids.begin();
00368 i!=mydetids.end();
00369 ++i)
00370 {
00371 if (i->det()!=DetId::Hcal) continue;
00372 HcalDetId id=HcalDetId(*i);
00373 int status=(chanquality->getValues(id))->getValue();
00374 if ((status & badChannelStatusMask_))
00375 {
00376 KnownBadCells_[id.rawId()]=status;
00377 }
00378 }
00379 }
00380 return;
00381 }
00382
00383 void HcalDeadCellMonitor::reset()
00384 {
00385 if (debug_>1) std::cout <<"HcalDeadCellMonitor::reset()"<<std::endl;
00386 HcalBaseDQMonitor::reset();
00387 zeroCounters();
00388 deadevt_=0;
00389 ProblemsVsLB->Reset(); ProblemsVsLB_HB->Reset(); ProblemsVsLB_HE->Reset(); ProblemsVsLB_HO->Reset(); ProblemsVsLB_HF->Reset(); ProblemsVsLB_HBHEHF->Reset();
00390 NumberOfNeverPresentDigis->Reset(); NumberOfNeverPresentDigisHB->Reset(); NumberOfNeverPresentDigisHE->Reset(); NumberOfNeverPresentDigisHO->Reset(); NumberOfNeverPresentDigisHF->Reset();
00391
00392 for (unsigned int depth=0;depth<DigiPresentByDepth.depth.size();++depth)
00393 DigiPresentByDepth.depth[depth]->Reset();
00394
00395
00396 if (excludeHORing2_==true && DigiPresentByDepth.depth.size()>3)
00397 {
00398 for (int ieta=11;ieta<=15;++ieta)
00399 for (int iphi=1;iphi<=72;++iphi)
00400 {
00401
00402 if (isSiPM(ieta,iphi,4)==false)
00403 DigiPresentByDepth.depth[3]->Fill(ieta,iphi,2);
00404
00405 DigiPresentByDepth.depth[3]->Fill(-1*ieta,iphi,2);
00406 }
00407 }
00408 FillUnphysicalHEHFBins(DigiPresentByDepth);
00409
00410
00411 if (deadmon_test_digis_)
00412 {
00413 NumberOfRecentMissingDigis->Reset(); NumberOfRecentMissingDigisHB->Reset(); NumberOfRecentMissingDigisHE->Reset(); NumberOfRecentMissingDigisHO->Reset(); NumberOfRecentMissingDigisHF->Reset();
00414 RecentMissingDigisByDepth.Reset();
00415 }
00416 if (deadmon_test_rechits_)
00417 {
00418 NumberOfRecentMissingRecHits->Reset();
00419 NumberOfRecentMissingRecHitsHB->Reset();
00420 NumberOfRecentMissingRecHitsHE->Reset();
00421 NumberOfRecentMissingRecHitsHO->Reset();
00422 NumberOfRecentMissingRecHitsHF->Reset();
00423 NumberOfNeverPresentRecHits->Reset();
00424 NumberOfNeverPresentRecHitsHB->Reset();
00425 NumberOfNeverPresentRecHitsHE->Reset();
00426 NumberOfNeverPresentRecHitsHO->Reset();
00427 NumberOfNeverPresentRecHitsHF->Reset();
00428 RecentMissingRecHitsByDepth.Reset();
00429 RecHitPresentByDepth.Reset();
00430
00431
00432 if (excludeHORing2_==true && RecHitPresentByDepth.depth.size()>3)
00433 {
00434 for (int ieta=11;ieta<=15;++ieta)
00435 for (int iphi=1;iphi<=72;++iphi)
00436 {
00437 RecHitPresentByDepth.depth[3]->Fill(ieta,iphi,2);
00438 RecHitPresentByDepth.depth[3]->Fill(-1*ieta,iphi,2);
00439 }
00440 }
00441 FillUnphysicalHEHFBins(RecHitPresentByDepth);
00442 }
00443
00444 Nevents->Reset();
00445 }
00446
00447
00448
00449
00450 void HcalDeadCellMonitor::cleanup()
00451 {
00452 if (!enableCleanup_) return;
00453 if (dbe_)
00454 {
00455 dbe_->setCurrentFolder(subdir_);
00456 dbe_->removeContents();
00457 dbe_->setCurrentFolder(subdir_+"dead_digi_never_present");
00458 dbe_->removeContents();
00459 dbe_->setCurrentFolder(subdir_+"dead_digi_often_missing");
00460 dbe_->removeContents();
00461 dbe_->setCurrentFolder(subdir_+"dead_rechit_neverpresent");
00462 dbe_->removeContents();
00463 dbe_->setCurrentFolder(subdir_+"dead_rechit_often_missing");
00464 dbe_->removeContents();
00465 dbe_->setCurrentFolder(subdir_+"dead_cell_parameters");
00466 dbe_->removeContents();
00467 dbe_->setCurrentFolder(subdir_+"LSvalues");
00468 dbe_->removeContents();
00469 }
00470 return;
00471 }
00472
00473
00474
00475 void HcalDeadCellMonitor::endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
00476 const edm::EventSetup& c)
00477 {
00478
00479 if (this->LumiInOrder(lumiSeg.luminosityBlock())==false) return;
00480
00481
00482 if (ProblemsCurrentLB)
00483 ProblemsCurrentLB->Reset();
00484
00485
00486
00487 if (deadevt_<minDeadEventCount_)
00488 return;
00489 endLumiProcessed_=true;
00490
00491 fillNevents_problemCells();
00492 fillNevents_recentdigis();
00493 fillNevents_recentrechits();
00494
00495 if (ProblemsCurrentLB)
00496 {
00497 ProblemsCurrentLB->setBinContent(0,0, levt_);
00498 ProblemsCurrentLB->setBinContent(1,1, NumBadHB*levt_);
00499 ProblemsCurrentLB->setBinContent(2,1, NumBadHE*levt_);
00500 ProblemsCurrentLB->setBinContent(3,1, NumBadHO*levt_);
00501 ProblemsCurrentLB->setBinContent(4,1, NumBadHF*levt_);
00502 ProblemsCurrentLB->setBinContent(5,1, NumBadHO0*levt_);
00503 ProblemsCurrentLB->setBinContent(6,1, NumBadHO12*levt_);
00504 ProblemsCurrentLB->setBinContent(7,1, NumBadHFLUMI*levt_);
00505 }
00506 zeroCounters();
00507 deadevt_=0;
00508 return;
00509 }
00510
00511 void HcalDeadCellMonitor::endRun(const edm::Run& run, const edm::EventSetup& c)
00512 {
00513
00514
00515
00516 if (endLumiProcessed_==false) fillNevents_problemCells();
00517 return;
00518 }
00519
00520 void HcalDeadCellMonitor::endJob()
00521 {
00522 if (debug_>0) std::cout <<"HcalDeadCellMonitor::endJob()"<<std::endl;
00523 if (enableCleanup_) cleanup();
00524 }
00525
00526 void HcalDeadCellMonitor::analyze(edm::Event const&e, edm::EventSetup const&s)
00527 {
00528 if (!IsAllowedCalibType()) return;
00529 endLumiProcessed_=false;
00530 Nevents->Fill(0,1);
00531 if (LumiInOrder(e.luminosityBlock())==false) return;
00532
00533 edm::Handle<HBHEDigiCollection> hbhe_digi;
00534 edm::Handle<HODigiCollection> ho_digi;
00535 edm::Handle<HFDigiCollection> hf_digi;
00536
00537 edm::Handle<HBHERecHitCollection> hbhe_rechit;
00538 edm::Handle<HORecHitCollection> ho_rechit;
00539 edm::Handle<HFRecHitCollection> hf_rechit;
00540
00541 if (!(e.getByLabel(digiLabel_,hbhe_digi)))
00542 {
00543 edm::LogWarning("HcalDeadCellMonitor")<< digiLabel_<<" hbhe_digi not available";
00544 return;
00545 }
00546 if (!(e.getByLabel(digiLabel_,ho_digi)))
00547 {
00548 edm::LogWarning("HcalDeadCellMonitor")<< digiLabel_<<" ho_digi not available";
00549 return;
00550 }
00551 if (!(e.getByLabel(digiLabel_,hf_digi)))
00552 {
00553 edm::LogWarning("HcalDeadCellMonitor")<< digiLabel_<<" hf_digi not available";
00554 return;
00555 }
00556
00557 if (!(e.getByLabel(hbheRechitLabel_,hbhe_rechit)))
00558 {
00559 edm::LogWarning("HcalDeadCellMonitor")<< hbheRechitLabel_<<" hbhe_rechit not available";
00560 return;
00561 }
00562
00563 if (!(e.getByLabel(hfRechitLabel_,hf_rechit)))
00564 {
00565 edm::LogWarning("HcalDeadCellMonitor")<< hfRechitLabel_<<" hf_rechit not available";
00566 return;
00567 }
00568 if (!(e.getByLabel(hoRechitLabel_,ho_rechit)))
00569 {
00570 edm::LogWarning("HcalDeadCellMonitor")<< hoRechitLabel_<<" ho_rechit not available";
00571 return;
00572 }
00573 if (debug_>1) std::cout <<"\t<HcalDeadCellMonitor::analyze> Processing good event! event # = "<<ievt_<<std::endl;
00574
00575
00576 HcalBaseDQMonitor::analyze(e,s);
00577
00578 ++deadevt_;
00579
00580 processEvent(*hbhe_rechit, *ho_rechit, *hf_rechit, *hbhe_digi, *ho_digi, *hf_digi);
00581
00582 }
00583
00584
00585
00586
00587 void HcalDeadCellMonitor::processEvent(const HBHERecHitCollection& hbHits,
00588 const HORecHitCollection& hoHits,
00589 const HFRecHitCollection& hfHits,
00590 const HBHEDigiCollection& hbhedigi,
00591 const HODigiCollection& hodigi,
00592 const HFDigiCollection& hfdigi)
00593 {
00594 if (debug_>1) std::cout <<"<HcalDeadCellMonitor::processEvent> Processing event..."<<std::endl;
00595
00596
00597
00598
00599 for (unsigned int i=0;i<DigiPresentByDepth.depth.size();++i)
00600 DigiPresentByDepth.depth[i]->update();
00601
00602 NumberOfNeverPresentDigis->update();;
00603 NumberOfNeverPresentDigisHB->update();
00604 NumberOfNeverPresentDigisHE->update();
00605 NumberOfNeverPresentDigisHO->update();
00606 NumberOfNeverPresentDigisHF->update();
00607
00608 if (deadmon_test_digis_)
00609 {
00610
00611 for (unsigned int i=0;i<RecentMissingDigisByDepth.depth.size();++i)
00612 RecentMissingDigisByDepth.depth[i]->update();
00613
00614 NumberOfRecentMissingDigis->update();
00615 NumberOfRecentMissingDigisHB->update();
00616 NumberOfRecentMissingDigisHE->update();
00617 NumberOfRecentMissingDigisHO->update();
00618 NumberOfRecentMissingDigisHF->update();
00619 }
00620
00621 for (HBHEDigiCollection::const_iterator j=hbhedigi.begin();
00622 j!=hbhedigi.end(); ++j)
00623 {
00624 const HBHEDataFrame digi = (const HBHEDataFrame)(*j);
00625 processEvent_HBHEdigi(digi);
00626 }
00627
00628 for (HODigiCollection::const_iterator j=hodigi.begin();
00629 j!=hodigi.end(); ++j)
00630 {
00631 const HODataFrame digi = (const HODataFrame)(*j);
00632 process_Digi(digi);
00633 }
00634 for (HFDigiCollection::const_iterator j=hfdigi.begin();
00635 j!=hfdigi.end(); ++j)
00636 {
00637 const HFDataFrame digi = (const HFDataFrame)(*j);
00638 process_Digi(digi);
00639 }
00640 FillUnphysicalHEHFBins(DigiPresentByDepth);
00641
00642
00643 if (deadmon_test_rechits_)
00644 {
00645
00646 for (unsigned int i=0;i<RecentMissingRecHitsByDepth.depth.size();++i)
00647 RecentMissingRecHitsByDepth.depth[i]->update();
00648
00649 NumberOfRecentMissingRecHits->update();
00650 NumberOfRecentMissingRecHitsHB->update();
00651 NumberOfRecentMissingRecHitsHE->update();
00652 NumberOfRecentMissingRecHitsHO->update();
00653 NumberOfRecentMissingRecHitsHF->update();
00654
00655 for (HBHERecHitCollection::const_iterator j=hbHits.begin();
00656 j!=hbHits.end(); ++j)
00657 process_RecHit(j);
00658
00659 for (HORecHitCollection::const_iterator k=hoHits.begin();
00660 k!=hoHits.end(); ++k)
00661 process_RecHit(k);
00662
00663 for (HFRecHitCollection::const_iterator j=hfHits.begin();
00664 j!=hfHits.end(); ++j)
00665 process_RecHit(j);
00666
00667 }
00668
00669 if (!makeDiagnostics_) return;
00670 if (tevt_>=NLumiBlocks_) return;
00671
00672 int hbpresent=0;
00673 int hepresent=0;
00674 int hopresent=0;
00675 int hfpresent=0;
00676 int ieta=0;
00677 for (int d=0;d<4;++d)
00678 {
00679 for (int phi=0;phi<72;++phi)
00680 {
00681 for (int eta=0;eta<85;++eta)
00682 {
00683 if (!present_digi[eta][phi][d]) continue;
00684 if (d==3) ++hopresent;
00685 else if (d==2) ++hepresent;
00686 else if (d==1)
00687 {
00688 ieta=binmapd2[eta];
00689
00690 if (abs(ieta)>29) ++hfpresent;
00691 else if (abs(ieta)<17) ++hbpresent;
00692 else ++hepresent;
00693 }
00694 else if (d==0)
00695 {
00696 ieta=eta-42;
00697 if (abs(ieta)>29) ++hfpresent;
00698 else if (abs(ieta)<17) ++hbpresent;
00699 else ++hepresent;
00700 }
00701 }
00702 }
00703 }
00704 HBDeadVsEvent->Fill(tevt_,2592-hbpresent);
00705 HEDeadVsEvent->Fill(tevt_,2592-hepresent);
00706 HODeadVsEvent->Fill(tevt_,2160-hopresent);
00707 HFDeadVsEvent->Fill(tevt_,1728-hfpresent);
00708 return;
00709 }
00710
00711
00712
00713
00714
00715
00716 void HcalDeadCellMonitor::processEvent_HBHEdigi(const HBHEDataFrame digi)
00717 {
00718
00719 process_Digi(digi);
00720 return;
00721 }
00722
00723 template<class DIGI>
00724 void HcalDeadCellMonitor::process_Digi(DIGI& digi)
00725 {
00726
00727
00728 int ieta=digi.id().ieta();
00729 int iphi=digi.id().iphi();
00730 int depth=digi.id().depth();
00731
00732
00733 ++recentoccupancy_digi[CalcEtaBin(digi.id().subdet(),ieta,depth)][iphi-1][depth-1];
00734
00735
00736 if (present_digi[CalcEtaBin(digi.id().subdet(),ieta,depth)][iphi-1][depth-1]==false)
00737 {
00738 if (DigiPresentByDepth.depth[depth-1])
00739 {
00740 DigiPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(digi.id().subdet(),ieta,depth)+1,iphi,1);
00741 }
00742 present_digi[CalcEtaBin(digi.id().subdet(),ieta,depth)][iphi-1][depth-1]=true;
00743 }
00744 return;
00745 }
00746
00747
00748
00749 template<class RECHIT>
00750 void HcalDeadCellMonitor::process_RecHit(RECHIT& rechit)
00751 {
00752 float en = rechit->energy();
00753 HcalDetId id(rechit->detid().rawId());
00754 int ieta = id.ieta();
00755 int iphi = id.iphi();
00756 int depth = id.depth();
00757
00758 if (id.subdet()==HcalBarrel)
00759 {
00760 if (en>=HBenergyThreshold_)
00761 {
00762 ++recentoccupancy_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
00763 present_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1]=true;
00764 if (RecHitPresentByDepth.depth[depth-1])
00765 RecHitPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(id.subdet(),ieta,depth)+1,iphi,1);
00766 }
00767 }
00768 else if (id.subdet()==HcalEndcap)
00769 {
00770 if (en>=HEenergyThreshold_)
00771 {
00772 ++recentoccupancy_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
00773 present_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1]=true;
00774 if (RecHitPresentByDepth.depth[depth-1])
00775 RecHitPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(id.subdet(),ieta,depth)+1,iphi,1);
00776 }
00777 }
00778 else if (id.subdet()==HcalForward)
00779 {
00780 if (en>=HFenergyThreshold_)
00781 {
00782 ++recentoccupancy_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
00783
00784 present_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1]=true;
00785 if (RecHitPresentByDepth.depth[depth-1])
00786 RecHitPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(id.subdet(),ieta,depth)+1,iphi,1);
00787 }
00788 }
00789 else if (id.subdet()==HcalOuter)
00790 {
00791 if (en>=HOenergyThreshold_)
00792 {
00793 ++recentoccupancy_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1];
00794 present_rechit[CalcEtaBin(id.subdet(),ieta,depth)][iphi-1][depth-1]=true;
00795 if (RecHitPresentByDepth.depth[depth-1])
00796 RecHitPresentByDepth.depth[depth-1]->setBinContent(CalcEtaBin(id.subdet(),ieta,depth)+1,iphi,1);
00797 }
00798 }
00799 }
00800
00801 void HcalDeadCellMonitor::fillNevents_recentdigis()
00802 {
00803
00804 if (!deadmon_test_digis_) return;
00805
00806 if (deadevt_ < minDeadEventCount_) return;
00807
00808 if (debug_>0)
00809 std::cout <<"<HcalDeadCellMonitor::fillNevents_recentdigis> CHECKING FOR RECENT MISSING DIGIS evtcount = "<<deadevt_<<std::endl;
00810
00811 int ieta=0;
00812 int iphi=0;
00813
00814 int etabins=0;
00815 int phibins=0;
00816
00817 for (unsigned int depth=0;depth<RecentMissingDigisByDepth.depth.size();++depth)
00818 {
00819 RecentMissingDigisByDepth.depth[depth]->setBinContent(0,0,ievt_);
00820 etabins=RecentMissingDigisByDepth.depth[depth]->getNbinsX();
00821 phibins=RecentMissingDigisByDepth.depth[depth]->getNbinsY();
00822 for (int eta=0;eta<etabins;++eta)
00823 {
00824 for (int subdet=1;subdet<=4;++subdet)
00825 {
00826 ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1);
00827 if (ieta==-9999) continue;
00828 for (int phi=0;phi<phibins;++phi)
00829 {
00830 iphi=phi+1;
00831
00832 if (!validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))
00833 continue;
00834
00835
00836
00837
00838
00839
00840
00841
00842 int zside=0;
00843 if (subdet==HcalForward)
00844 ieta<0 ? zside=-1 : zside=+1;
00845
00846 if (recentoccupancy_digi[eta][phi][depth]==0)
00847 {
00848 if (debug_>0)
00849 {
00850 std::cout <<"DEAD CELL; NO RECENT OCCUPANCY: subdet = "<<subdet<<", ieta = "<<ieta<<", iphi = "<<iphi<<" depth = "<<depth+1<<std::endl;
00851 std::cout <<"\t RAW COORDINATES: eta = "<<eta<< " phi = "<<phi<<" depth = "<<depth<<std::endl;
00852 std::cout <<"\t Present? "<<present_digi[eta][phi][depth]<<std::endl;
00853 }
00854
00855
00856 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
00857 continue;
00858
00859
00860 if (RecentMissingDigisByDepth.depth[depth]) RecentMissingDigisByDepth.depth[depth]->Fill(ieta+zside,iphi,deadevt_);
00861 }
00862 }
00863 }
00864 }
00865 }
00866 FillUnphysicalHEHFBins(RecentMissingDigisByDepth);
00867
00868 return;
00869
00870 }
00871
00872
00873
00874
00875
00876 void HcalDeadCellMonitor::fillNevents_recentrechits()
00877 {
00878
00879
00880
00881
00882
00883
00884
00885
00886 if (!deadmon_test_rechits_) return;
00887 FillUnphysicalHEHFBins(RecHitPresentByDepth);
00888
00889 if (deadevt_ < minDeadEventCount_) return;
00890
00891 if (debug_>0)
00892 std::cout <<"<HcalDeadCellMonitor::fillNevents_energy> BELOW-ENERGY-THRESHOLD PLOTS"<<std::endl;
00893
00894 int ieta=0;
00895 int iphi=0;
00896
00897 int etabins=0;
00898 int phibins=0;
00899 for (unsigned int depth=0;depth<RecentMissingRecHitsByDepth.depth.size();++depth)
00900 {
00901 RecentMissingRecHitsByDepth.depth[depth]->setBinContent(0,0,ievt_);
00902 etabins=RecentMissingRecHitsByDepth.depth[depth]->getNbinsX();
00903 phibins=RecentMissingRecHitsByDepth.depth[depth]->getNbinsY();
00904 for (int eta=0;eta<etabins;++eta)
00905 {
00906 for (int subdet=1;subdet<=4;++subdet)
00907 {
00908 ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1);
00909 if (ieta==-9999) continue;
00910 for (int phi=0;phi<phibins;++phi)
00911 {
00912 iphi=phi+1;
00913 if (!validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))
00914 continue;
00915 if (recentoccupancy_rechit[eta][phi][depth]>0) continue;
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925 int zside=0;
00926 if (subdet==HcalForward)
00927 {
00928 ieta<0 ? zside=-1 : zside=+1;
00929 }
00930
00931 if (debug_>2)
00932 std::cout <<"DEAD CELL; BELOW ENERGY THRESHOLD; subdet = "<<subdet<<" ieta = "<<ieta<<", phi = "<<iphi<<" depth = "<<depth+1<<std::endl;
00933 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
00934 continue;
00935
00936 if (RecentMissingRecHitsByDepth.depth[depth]) RecentMissingRecHitsByDepth.depth[depth]->Fill(ieta+zside,iphi,deadevt_);
00937 }
00938 }
00939 }
00940 }
00941
00942 FillUnphysicalHEHFBins(RecentMissingRecHitsByDepth);
00943
00944 return;
00945 }
00946
00947
00948
00949 void HcalDeadCellMonitor::fillNevents_problemCells()
00950 {
00951
00952
00953 if (debug_>0)
00954 std::cout <<"<HcalDeadCellMonitor::fillNevents_problemCells> FILLING PROBLEM CELL PLOTS"<<std::endl;
00955
00956 int ieta=0;
00957 int iphi=0;
00958
00959
00960
00961 NumBadHB=0;
00962 NumBadHE=0;
00963 NumBadHO=0;
00964 NumBadHF=0;
00965 NumBadHFLUMI=0;
00966 NumBadHO0=0;
00967 NumBadHO12=0;
00968
00969 int knownBadHB=0;
00970 int knownBadHE=0;
00971 int knownBadHF=0;
00972 int knownBadHO=0;
00973 int knownBadHFLUMI=0;
00974 int knownBadHO0=0;
00975 int knownBadHO12=0;
00976
00977
00978 unsigned int neverpresentHB=0;
00979 unsigned int neverpresentHE=0;
00980 unsigned int neverpresentHO=0;
00981 unsigned int neverpresentHF=0;
00982
00983 unsigned int unoccupiedHB=0;
00984 unsigned int unoccupiedHE=0;
00985 unsigned int unoccupiedHO=0;
00986 unsigned int unoccupiedHF=0;
00987
00988 unsigned int belowenergyHB=0;
00989 unsigned int belowenergyHE=0;
00990 unsigned int belowenergyHO=0;
00991 unsigned int belowenergyHF=0;
00992
00993 unsigned int energyneverpresentHB=0;
00994 unsigned int energyneverpresentHE=0;
00995 unsigned int energyneverpresentHO=0;
00996 unsigned int energyneverpresentHF=0;
00997
00998 if (deadevt_>=minDeadEventCount_)
00999 Nevents->Fill(1,deadevt_);
01000
01001 int etabins=0;
01002 int phibins=0;
01003
01004
01005
01006
01007
01008 for (unsigned int depth=0;depth<DigiPresentByDepth.depth.size();++depth)
01009 {
01010 DigiPresentByDepth.depth[depth]->setBinContent(0,0,ievt_);
01011 etabins=DigiPresentByDepth.depth[depth]->getNbinsX();
01012 phibins=DigiPresentByDepth.depth[depth]->getNbinsY();
01013 for (int eta=0;eta<etabins;++eta)
01014 {
01015 for (int phi=0;phi<phibins;++phi)
01016 {
01017 iphi=phi+1;
01018 for (int subdet=1;subdet<=4;++subdet)
01019 {
01020 ieta=CalcIeta((HcalSubdetector)subdet,eta,depth+1);
01021 if (ieta==-9999) continue;
01022 if (!validDetId((HcalSubdetector)subdet, ieta, iphi, depth+1))
01023 continue;
01024
01025
01026
01027
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040 if ((present_digi[eta][phi][depth]==0) ||
01041 (deadmon_test_digis_ && recentoccupancy_digi[eta][phi][depth]==0 && (deadevt_>=minDeadEventCount_)) ||
01042 (deadmon_test_rechits_ && recentoccupancy_rechit[eta][phi][depth]==0 && (deadevt_>=minDeadEventCount_))
01043 )
01044 {
01045 HcalDetId TempID((HcalSubdetector)subdet, ieta, iphi, (int)depth+1);
01046 if (subdet==HcalBarrel)
01047 {
01048 ++NumBadHB;
01049 if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end())
01050 ++knownBadHB;
01051 }
01052 else if (subdet==HcalEndcap)
01053 {
01054 ++NumBadHE;
01055 if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end())
01056 ++knownBadHE;
01057 }
01058
01059 else if (subdet==HcalOuter)
01060 {
01061 ++NumBadHO;
01062 if (abs(ieta)<5) ++NumBadHO0;
01063 else ++NumBadHO12;
01064
01065 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01066 {
01067 --NumBadHO;
01068 --NumBadHO12;
01069 }
01070 if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end())
01071 {
01072 ++knownBadHO;
01073 if (abs(ieta)<5) ++knownBadHO0;
01074 else ++knownBadHO12;
01075
01076 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01077 {
01078 --knownBadHO;
01079 --knownBadHO12;
01080 }
01081 }
01082 }
01083 else if (subdet==HcalForward)
01084 {
01085 ++NumBadHF;
01086 if (depth==1 && (abs(ieta)==33 || abs(ieta)==34))
01087 ++NumBadHFLUMI;
01088 else if (depth==2 && (abs(ieta)==35 || abs(ieta)==36))
01089 ++NumBadHFLUMI;
01090 if (KnownBadCells_.find(TempID.rawId())!=KnownBadCells_.end())
01091 {
01092 ++knownBadHF;
01093 if (depth==1 && (abs(ieta)==33 || abs(ieta)==34))
01094 ++knownBadHFLUMI;
01095 else if (depth==2 && (abs(ieta)==35 || abs(ieta)==36))
01096 ++knownBadHFLUMI;
01097 }
01098 }
01099 }
01100 if (present_digi[eta][phi][depth]==0)
01101 {
01102 if (subdet==HcalBarrel) ++neverpresentHB;
01103 else if (subdet==HcalEndcap) ++neverpresentHE;
01104 else if (subdet==HcalOuter)
01105 {
01106 ++neverpresentHO;
01107 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01108 --neverpresentHO;
01109 }
01110 else if (subdet==HcalForward) ++neverpresentHF;
01111 }
01112
01113 if (deadmon_test_digis_ && recentoccupancy_digi[eta][phi][depth]==0 && (deadevt_>=minDeadEventCount_))
01114 {
01115 if (subdet==HcalBarrel) ++unoccupiedHB;
01116 else if (subdet==HcalEndcap) ++unoccupiedHE;
01117 else if (subdet==HcalOuter)
01118 {
01119 ++unoccupiedHO;
01120 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01121 --unoccupiedHO;
01122 }
01123 else if (subdet==HcalForward) ++unoccupiedHF;
01124 }
01125
01126 if (deadmon_test_rechits_)
01127 {
01128 if (present_rechit[eta][phi][depth]==0)
01129 {
01130 if (subdet==HcalBarrel) ++energyneverpresentHB;
01131 else if (subdet==HcalEndcap) ++energyneverpresentHE;
01132 else if (subdet==HcalOuter)
01133 {
01134 ++energyneverpresentHO;
01135 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01136 --energyneverpresentHO;
01137 }
01138 else if (subdet==HcalForward) ++energyneverpresentHF;
01139 }
01140 if (recentoccupancy_rechit[eta][phi][depth]==0 && (deadevt_>=minDeadEventCount_))
01141 {
01142 if (subdet==HcalBarrel) ++belowenergyHB;
01143 else if (subdet==HcalEndcap) ++belowenergyHE;
01144 else if (subdet==HcalOuter)
01145 {
01146 ++belowenergyHO;
01147 if (excludeHORing2_==true && abs(ieta)>10 && isSiPM(ieta,iphi,depth+1)==false)
01148 --belowenergyHO;
01149 }
01150 else if (subdet==HcalForward) ++belowenergyHF;
01151 }
01152 }
01153 }
01154 }
01155 }
01156 }
01157
01158
01159
01160
01161 NumberOfNeverPresentDigisHB->Fill(currentLS,neverpresentHB);
01162 NumberOfNeverPresentDigisHE->Fill(currentLS,neverpresentHE);
01163 NumberOfNeverPresentDigisHO->Fill(currentLS,neverpresentHO);
01164 NumberOfNeverPresentDigisHF->Fill(currentLS,neverpresentHF);
01165 NumberOfNeverPresentDigis->Fill(currentLS,neverpresentHB+neverpresentHE+neverpresentHO+neverpresentHF);
01166
01167 ProblemsVsLB_HB->Fill(currentLS,NumBadHB-knownBadHB);
01168 ProblemsVsLB_HE->Fill(currentLS,NumBadHE-knownBadHE);
01169 ProblemsVsLB_HO->Fill(currentLS,NumBadHO-knownBadHO);
01170 ProblemsVsLB_HF->Fill(currentLS,NumBadHF-knownBadHF);
01171 ProblemsVsLB_HBHEHF->Fill(currentLS,NumBadHB+NumBadHE+NumBadHF-knownBadHB-knownBadHE-knownBadHF);
01172 ProblemsVsLB->Fill(currentLS,NumBadHB+NumBadHE+NumBadHO+NumBadHF-knownBadHB-knownBadHE-knownBadHO-knownBadHF);
01173
01174 if (deadevt_<minDeadEventCount_)
01175 return;
01176
01177 if (deadmon_test_digis_)
01178 {
01179 NumberOfRecentMissingDigisHB->Fill(currentLS,unoccupiedHB);
01180 NumberOfRecentMissingDigisHE->Fill(currentLS,unoccupiedHE);
01181 NumberOfRecentMissingDigisHO->Fill(currentLS,unoccupiedHO);
01182 NumberOfRecentMissingDigisHF->Fill(currentLS,unoccupiedHF);
01183 NumberOfRecentMissingDigis->Fill(currentLS,unoccupiedHB+unoccupiedHE+unoccupiedHO+unoccupiedHF);
01184 }
01185
01186 if (deadmon_test_rechits_)
01187 {
01188 NumberOfNeverPresentRecHitsHB->Fill(currentLS,energyneverpresentHB);
01189 NumberOfNeverPresentRecHitsHE->Fill(currentLS,energyneverpresentHE);
01190 NumberOfNeverPresentRecHitsHO->Fill(currentLS,energyneverpresentHO);
01191 NumberOfNeverPresentRecHitsHF->Fill(currentLS,energyneverpresentHF);
01192 NumberOfNeverPresentRecHits->Fill(currentLS,energyneverpresentHB+energyneverpresentHE+energyneverpresentHO+energyneverpresentHF);
01193
01194 NumberOfRecentMissingRecHitsHB->Fill(currentLS,belowenergyHB);
01195 NumberOfRecentMissingRecHitsHE->Fill(currentLS,belowenergyHE);
01196 NumberOfRecentMissingRecHitsHO->Fill(currentLS,belowenergyHO);
01197 NumberOfRecentMissingRecHitsHF->Fill(currentLS,belowenergyHF);
01198 NumberOfRecentMissingRecHits->Fill(currentLS,belowenergyHB+belowenergyHE+belowenergyHO+belowenergyHF);
01199 }
01200
01201 return;
01202 }
01203
01204
01205 void HcalDeadCellMonitor::zeroCounters(bool resetpresent)
01206 {
01207
01208
01209
01210
01211 for (unsigned int i=0;i<85;++i)
01212 {
01213 for (unsigned int j=0;j<72;++j)
01214 {
01215 for (unsigned int k=0;k<4;++k)
01216 {
01217 if (resetpresent) present_digi[i][j][k]=false;
01218 if (resetpresent) present_rechit[i][j][k]=false;
01219 recentoccupancy_digi[i][j][k]=0;
01220 recentoccupancy_rechit[i][j][k]=0;
01221 }
01222 }
01223 }
01224
01225 return;
01226 }
01227
01228 DEFINE_FWK_MODULE(HcalDeadCellMonitor);