From b93eb4495e185ef356c4273ace71ec37fbe77e00 Mon Sep 17 00:00:00 2001 From: Jeff Temple Date: Wed, 11 Nov 2009 20:54:34 +0000 Subject: [PATCH] --- yaml --- r: 77714 b: "refs/heads/CMSSW_7_1_X" c: b12ece9efc78bf0001871e7ad87ad9676810ce1d h: "refs/heads/CMSSW_7_1_X" v: v3 --- [refs] | 2 +- .../interface/HcalBeamClient.h | 8 +- .../interface/HcalMonitorClient.h | 2 + .../python/HcalMonitorClient_cfi.py | 9 +- .../src/HcalHotCellClient.cc | 24 +- .../src/HcalMonitorClient.cc | 100 +-- .../src/HcalSummaryClient.cc | 2 +- .../python/HcalMonitorModule_cfi.py | 56 +- .../python/hcal_dqm_sourceclient-file_cfg.py | 38 +- .../src/HcalMonitorModule.cc | 195 +++-- .../HcalMonitorModule/src/HcalMonitorModule.h | 11 +- .../interface/HcalBaseMonitor.h | 10 +- .../interface/HcalBeamMonitor.h | 23 +- .../interface/HcalDataFormatMonitor.h | 8 +- .../interface/HcalDeadCellMonitor.h | 9 +- .../interface/HcalDigiMonitor.h | 8 +- .../interface/HcalHotCellMonitor.h | 20 +- .../interface/HcalLaserMonitor.h | 8 +- .../interface/HcalPedestalMonitor.h | 7 +- .../interface/HcalRecHitMonitor.h | 9 +- .../interface/HcalTrigPrimMonitor.h | 12 +- .../HcalMonitorTasks/src/HcalBaseMonitor.cc | 17 +- .../HcalMonitorTasks/src/HcalBeamMonitor.cc | 537 ++++++++------ .../src/HcalDataFormatMonitor.cc | 671 +++++++++--------- .../src/HcalDeadCellMonitor.cc | 502 ++++++------- .../HcalMonitorTasks/src/HcalDigiMonitor.cc | 324 +++++---- .../src/HcalHotCellMonitor.cc | 366 +++++----- .../HcalMonitorTasks/src/HcalLaserMonitor.cc | 278 ++++---- .../src/HcalPedestalMonitor.cc | 155 ++-- .../HcalMonitorTasks/src/HcalRecHitMonitor.cc | 316 +++++---- .../src/HcalTrigPrimMonitor.cc | 332 +++++---- 31 files changed, 2192 insertions(+), 1867 deletions(-) diff --git a/[refs] b/[refs] index c0e62489b3925..37af356497494 100644 --- a/[refs] +++ b/[refs] @@ -1,3 +1,3 @@ --- refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e -"refs/heads/CMSSW_7_1_X": 228eba7142cc9c4bc802417dae2124ca7baf2cb0 +"refs/heads/CMSSW_7_1_X": b12ece9efc78bf0001871e7ad87ad9676810ce1d diff --git a/trunk/DQM/HcalMonitorClient/interface/HcalBeamClient.h b/trunk/DQM/HcalMonitorClient/interface/HcalBeamClient.h index 02bddd8bcb220..078331996f1be 100644 --- a/trunk/DQM/HcalMonitorClient/interface/HcalBeamClient.h +++ b/trunk/DQM/HcalMonitorClient/interface/HcalBeamClient.h @@ -20,18 +20,18 @@ class HcalBeamClient : public HcalBaseClient { void init(const edm::ParameterSet& ps, DQMStore* dbe, string clientName); - /// Analyze + /// Analyze void analyze(void); /// BeginJob - //void beginJob(const EventSetup& c); - void beginJob(); + void beginJob(void); /// EndJob void endJob(void); /// BeginRun - void beginRun(void); + //void beginRun(const EventSetup& c); + void beginRun(); /// EndRun void endRun(void); diff --git a/trunk/DQM/HcalMonitorClient/interface/HcalMonitorClient.h b/trunk/DQM/HcalMonitorClient/interface/HcalMonitorClient.h index 31b1f2a27eef6..6e269fdfd5ec9 100644 --- a/trunk/DQM/HcalMonitorClient/interface/HcalMonitorClient.h +++ b/trunk/DQM/HcalMonitorClient/interface/HcalMonitorClient.h @@ -118,6 +118,7 @@ class HcalMonitorClient : public EDAnalyzer{ private: void removeAllME(void); + void writeDBfile(); /********************************************************/ // The following member variables can be specified in // // the configuration input file for the process. // @@ -196,6 +197,7 @@ class HcalMonitorClient : public EDAnalyzer{ // myquality_ will store status values for each det ID I find bool dump2database_; + std::string databasedir_; std::map myquality_; HcalChannelQuality* chanquality_; diff --git a/trunk/DQM/HcalMonitorClient/python/HcalMonitorClient_cfi.py b/trunk/DQM/HcalMonitorClient/python/HcalMonitorClient_cfi.py index d3f63fd4e620d..ffda4ecce1ddd 100644 --- a/trunk/DQM/HcalMonitorClient/python/HcalMonitorClient_cfi.py +++ b/trunk/DQM/HcalMonitorClient/python/HcalMonitorClient_cfi.py @@ -7,7 +7,8 @@ runningStandalone = cms.untracked.bool(False), Online = cms.untracked.bool(False), - dump2database = cms.untracked.bool(False), # dumps channel status to text file + dump2database = cms.untracked.bool(False), # dumps channel status to text file + databasedir = cms.untracked.string(''), # maximum number of lumi blocks to appear in some histograms Nlumiblocks = cms.untracked.int32(1000), @@ -18,8 +19,8 @@ MonitorDaemon = cms.untracked.bool(True), # run actual client either every N events or M lumi blocks (or both) - diagnosticPrescaleEvt = cms.untracked.int32(200), - diagnosticPrescaleLS = cms.untracked.int32(-1), + diagnosticPrescaleEvt = cms.untracked.int32(-1), + diagnosticPrescaleLS = cms.untracked.int32(1), resetFreqEvents = cms.untracked.int32(-1), resetFreqLS = cms.untracked.int32(-1), @@ -120,7 +121,6 @@ def setHcalClientValuesFromMonitor(client, origmonitor, debug=False): client.Online = monitor.Online client.Nlumiblocks = monitor.Nlumiblocks - client.dump2database = monitor.dump2database # Beam Client client.BeamClient = monitor.BeamMonitor @@ -173,6 +173,7 @@ def setHcalClientValuesFromMonitor(client, origmonitor, debug=False): print "HcalMonitorClient values from HcalMonitorModule: " print "Debug = ", client.debug print "Online = ", client.Online + print "Dump to database ? ", client.dump2database print "Nlumiblocks = ", client.Nlumiblocks print "showTiming = ", client.showTiming print "PrescaleEvt = ", client.diagnosticPrescaleEvt diff --git a/trunk/DQM/HcalMonitorClient/src/HcalHotCellClient.cc b/trunk/DQM/HcalMonitorClient/src/HcalHotCellClient.cc index 6af67c3844961..fb12e5cfd0523 100644 --- a/trunk/DQM/HcalMonitorClient/src/HcalHotCellClient.cc +++ b/trunk/DQM/HcalMonitorClient/src/HcalHotCellClient.cc @@ -391,7 +391,7 @@ void HcalHotCellClient::analyze(void) void HcalHotCellClient::calculateProblems() { getHistograms(); - double totalevents=0; // total events processed thus far + if (ievt_<=0) return; int etabins=0, phibins=0, zside=0; double problemvalue=0; @@ -408,21 +408,7 @@ void HcalHotCellClient::calculateProblems() for (unsigned int d=0;dGetBinContent(0); - else if (hotclient_test_pedestal_ && AbovePedestalHotCellsByDepth[d]!=0) - totalevents=AbovePedestalHotCellsByDepth[d]->GetBinContent(0); - else if (hotclient_test_neighbor_ && AboveNeighborsHotCellsByDepth[d]!=0) - totalevents=AboveNeighborsHotCellsByDepth[d]->GetBinContent(0); - else if (hotclient_test_energy_ && AboveEnergyThresholdCellsByDepth[d]!=0) - totalevents=AboveEnergyThresholdCellsByDepth[d]->GetBinContent(0); - else - continue; - - if (totalevents==0) continue; + // get number of bins for problemcells etabins=(ProblemCellsByDepth.depth[d]->getTH2F())->GetNbinsX(); phibins=(ProblemCellsByDepth.depth[d]->getTH2F())->GetNbinsY(); @@ -441,7 +427,7 @@ void HcalHotCellClient::calculateProblems() problemvalue+=AboveNeighborsHotCellsByDepth[d]->GetBinContent(eta+1,phi+1); if (hotclient_test_energy_) problemvalue+=AboveEnergyThresholdCellsByDepth[d]->GetBinContent(eta+1,phi+1); - problemvalue = min(totalevents, problemvalue); + problemvalue = min((double)ievt_, problemvalue); if (problemvalue==0) continue; // no problem found zside=0; if (d<2) @@ -449,8 +435,8 @@ void HcalHotCellClient::calculateProblems() if (isHF(eta,d+1)) ieta<0 ? zside = -1 : zside= 1; } - ProblemCellsByDepth.depth[d]->Fill(ieta+zside,phi+1,problemvalue/totalevents); - ProblemCells->Fill(ieta+zside,phi+1,problemvalue/totalevents); + ProblemCellsByDepth.depth[d]->Fill(ieta+zside,phi+1,problemvalue/ievt_); + ProblemCells->Fill(ieta+zside,phi+1,problemvalue/ievt_); } // loop over phi } // loop over eta } //loop over d diff --git a/trunk/DQM/HcalMonitorClient/src/HcalMonitorClient.cc b/trunk/DQM/HcalMonitorClient/src/HcalMonitorClient.cc index 5132366807eee..1d432a3fc9693 100644 --- a/trunk/DQM/HcalMonitorClient/src/HcalMonitorClient.cc +++ b/trunk/DQM/HcalMonitorClient/src/HcalMonitorClient.cc @@ -95,6 +95,7 @@ void HcalMonitorClient::initialize(const ParameterSet& ps){ } dump2database_ = ps.getUntrackedParameter("dump2database",false); + databasedir_ = ps.getUntrackedParameter("databasedir",""); // clients' constructors if( ps.getUntrackedParameter("SummaryClient", true) ) @@ -270,7 +271,7 @@ void HcalMonitorClient::beginRun(const Run& r, const EventSetup& c) { if (debug_>0) std::cout << endl<<"HcalMonitorClient: Standard beginRun() for run " << r.id().run() << endl<beginRun(); if( dataformat_client_ ) dataformat_client_->beginRun(); if( digi_client_ ) digi_client_->beginRun(); @@ -290,7 +291,7 @@ void HcalMonitorClient::beginRun(const Run& r, const EventSetup& c) { ///////////////////////////////////////////////////////// if (!dump2database_) return; - + // Get current channel quality edm::ESHandle p; c.get().get(p); chanquality_= new HcalChannelQuality(*p.product()); @@ -356,48 +357,58 @@ void HcalMonitorClient::endRun(const Run& r, const EventSetup& c) { if( detdiaglas_client_ ) detdiaglas_client_->endRun(); ///////////////////////////////////////////////////////// if( summary_client_) summary_client_->endRun(); + + // dumping to database + + // need to add separate function to do this!!! - if (dump2database_) + writeDBfile(); + return; +} + +void HcalMonitorClient::writeDBfile() + +{ + if (!dump2database_) return; + if (debug_>0) std::cout <<" Writing file for database"< mydetids = chanquality_->getAllChannels(); + HcalChannelQuality* newChanQual = new HcalChannelQuality(); + for (unsigned int i=0;i0) std::cout <<" Writing file for database"< mydetids = chanquality_->getAllChannels(); - HcalChannelQuality* newChanQual = new HcalChannelQuality(); - for (unsigned int i=0;igetValues(mydetids[i]); + // make copy of status + HcalChannelStatus* mystatus=new HcalChannelStatus(origstatus->rawId(),origstatus->getValue()); + // loop over myquality flags + if (myquality_.find(id)!=myquality_.end()) { - if (mydetids[i].det()!=DetId::Hcal) continue; // not hcal - - HcalDetId id=mydetids[i]; - // get original channel status item - const HcalChannelStatus* origstatus=chanquality_->getValues(mydetids[i]); - // make copy of status - HcalChannelStatus* mystatus=new HcalChannelStatus(origstatus->rawId(),origstatus->getValue()); - // loop over myquality flags - if (myquality_.find(id)!=myquality_.end()) - { - - // check dead cells - if ((myquality_[id]>>HcalChannelStatus::HcalCellDead)&0x1) - mystatus->setBit(HcalChannelStatus::HcalCellDead); - else - mystatus->unsetBit(HcalChannelStatus::HcalCellDead); - // check hot cells - if ((myquality_[id]>>HcalChannelStatus::HcalCellHot)&0x1) - mystatus->setBit(HcalChannelStatus::HcalCellHot); - else - mystatus->unsetBit(HcalChannelStatus::HcalCellHot); - } // if (myquality_.find_...) - newChanQual->addValues(*mystatus); - } // for (unsigned int i=0;...) + + // check dead cells + if ((myquality_[id]>>HcalChannelStatus::HcalCellDead)&0x1) + mystatus->setBit(HcalChannelStatus::HcalCellDead); + else + mystatus->unsetBit(HcalChannelStatus::HcalCellDead); + // check hot cells + if ((myquality_[id]>>HcalChannelStatus::HcalCellHot)&0x1) + mystatus->setBit(HcalChannelStatus::HcalCellHot); + else + mystatus->unsetBit(HcalChannelStatus::HcalCellHot); + } // if (myquality_.find_...) + newChanQual->addValues(*mystatus); + } // for (unsigned int i=0;...) // Now dump out to text file - std::ostringstream file; - file <<"HcalDQMstatus_"<incrementCounters(); // All this does is increment a counter. - if ( runningStandalone_ || prescale()) return; - - else analyze(); + if (ievt_%50000==10000) writeDBfile(); // write to db every 50k events, starting with event 10000 -- add cfg values some day? + if ( runningStandalone_) return; + + // run if we want to check individual events, and if this event isn't prescaled + if (prescaleEvt_>0 && !prescale()) + analyze(); } @@ -475,8 +489,6 @@ void HcalMonitorClient::analyze(const Event& e, const edm::EventSetup& eventSetu void HcalMonitorClient::analyze(){ if (debug_>0) std::cout <<" Entered HcalMonitorClient::analyze()"<1) std::cout<<"\nHcal Monitor Client heartbeat...."<get(name.str().c_str()); if (!me && debug_>0) - std::cout <<" CAN'T FIND HISTOGRAM WITH NAME: "< CAN'T FIND HISTOGRAM WITH NAME: '"<getTH2F(); diff --git a/trunk/DQM/HcalMonitorModule/python/HcalMonitorModule_cfi.py b/trunk/DQM/HcalMonitorModule/python/HcalMonitorModule_cfi.py index 4aba43b18ca57..f10072853bff7 100644 --- a/trunk/DQM/HcalMonitorModule/python/HcalMonitorModule_cfi.py +++ b/trunk/DQM/HcalMonitorModule/python/HcalMonitorModule_cfi.py @@ -5,14 +5,10 @@ # GLOBAL VARIABLES debug = cms.untracked.int32(0), # make debug an int so that different values can trigger different levels of messaging - # If AnalyzeOrbitGap is on, only events identified as calibration will be used in DQM - AnalyzeOrbitGap = cms.untracked.bool(False), - # If skipCalibrationEvents is on (default), calibration events will not be used in DQM - # This is superceded by AnalyzeOrbitGap - # (If AnalyzeOrbitGap == True, only calib events used. - # If AnalyzeOrbitGap == False && skipCalibrationEvents == False, all events used.) - skipCalibrationEvents = cms.untracked.bool(True), + Online = cms.untracked.bool(False), # control online/offline differences in code + AllowedCalibTypes = cms.untracked.vint32(), # Allowed calibration types (empty vector means all types allowed) + # Calib Types defined in DataFormats/HcalDigi/interface/HcalCalibrationEventTypes.h periodicReset = cms.untracked.int32(-1), # eta runs from -43->+43 (-41 -> +41 for HCAL, plus ZDC, which we put at |eta|=43. @@ -44,13 +40,10 @@ minErrorFlag = cms.untracked.double(0.05), # Turn on/off timing diagnostic info - diagnosticPrescaleLS = cms.untracked.int32(-1), + diagnosticPrescaleLS = cms.untracked.int32(-1), diagnosticPrescaleEvt = cms.untracked.int32(-1), - diagnosticPrescaleTime = cms.untracked.int32(-1), - diagnosticPrescaleUpdate = cms.untracked.int32(-1), - + showTiming = cms.untracked.bool(False), # shows time taken by each process - dump2database = cms.untracked.bool(False), # dumps channel status to text file # Make expert-level diagnostic plots (enabling this may drastically slow code!) makeDiagnosticPlots = cms.untracked.bool(False), @@ -81,7 +74,8 @@ ReferencePedestalMonitor_checkNevents = cms.untracked.int32(1000), ReferencePedestalMonitor_minEntriesPerPed = cms.untracked.uint32(100), ReferencePedestalMonitor_makeDiagnosticPlots = cms.untracked.bool(False), - + ReferencePedestalMonitor_AllowedCalibTypes = cms.untracked.vint32(1), # Allowed calibration types (empty vector means all types allowed) + # DEAD CELL MONITOR DeadCellMonitor = cms.untracked.bool(True), DeadCellMonitor_makeDiagnosticPlots = cms.untracked.bool(False), @@ -98,7 +92,7 @@ DeadCellMonitor_HF_energyThreshold = cms.untracked.double(-1.), DeadCellMonitor_minErrorFlag = cms.untracked.double(0.05), - + DeadCellMonitor_AllowedCalibTypes = cms.untracked.vint32(), # Allowed calibration types (empty vector means all types allowed) # HOT CELL MONITOR HotCellMonitor = cms.untracked.bool(True), HotCellMonitor_makeDiagnosticPlots = cms.untracked.bool(False), @@ -168,6 +162,7 @@ HotCellMonitor_HF_neighbor_HotEnergyFrac = cms.untracked.double(.02), HotCellMonitor_minErrorFlag = cms.untracked.double(0.05), + HotCellMonitor_AllowedCalibTypes = cms.untracked.vint32(), # Allowed calibration types (empty vector means all types allowed) # DIGI MONITOR DigiMonitor = cms.untracked.bool(True), @@ -182,10 +177,10 @@ # ADC counts must be above the threshold values below for appropriate histograms to be filled DigiMonitor_shapeThresh = cms.untracked.int32(-1), DigiMonitor_ADCsumThresh = cms.untracked.int32(-1), - DigMonitor_makeDiagnosticPlots = cms.untracked.bool(False), # doesn't do anything yet + DigiMonitor_makeDiagnosticPlots = cms.untracked.bool(False), DigiMonitor_DigisPerChannel = cms.untracked.bool(False), # not currently used DigiMonitor_ExpectedOrbitMessageTime =cms.untracked.int32(-1), - + DigiMonitor_AllowedCalibTypes = cms.untracked.vint32(), # Allowed calibration types (empty vector means all types allowed) # RECHIT MONITOR RecHitMonitor = cms.untracked.bool(True), RecHitMonitor_checkNevents = cms.untracked.int32(1000), @@ -197,24 +192,24 @@ RecHitMonitor_HE_energyThreshold = cms.untracked.double(2.), RecHitMonitor_HF_energyThreshold = cms.untracked.double(2.), RecHitMonitor_ZDC_energyThreshold = cms.untracked.double(2.), - + RecHitMonitor_AllowedCalibTypes = cms.untracked.vint32(), # Allowed calibration types (empty vector means all types allowed) # BEAM MONITOR BeamMonitor = cms.untracked.bool(True), BeamMonitor_checkNevents = cms.untracked.int32(1000), BeamMonitor_minErrorFlag = cms.untracked.double(0.), BeamMonitor_makeDiagnosticPlots = cms.untracked.bool(False), BeamMonitor_lumiprescale = cms.untracked.int32(1), # set number of bins in Lumi-section plots -- divide Nlumiblocks by this prescale + BeamMonitor_AllowedCalibTypes = cms.untracked.vint32(), # Allowed calibration types (empty vector means all types allowed) # DATA FORMAT MONITOR DataFormatMonitor = cms.untracked.bool(True), DataFormatMonitor_checkNevents = cms.untracked.int32(1000), dfPrtLvl = cms.untracked.int32(0), # this seems similar to the debug int we have; deprecate this? - + DataFormatMonitor_AllowedCalibTypes = cms.untracked.vint32(), # Allowed calibration types (empty vector means all types allowed) # ZDC MONITOR ZDCMonitor = cms.untracked.bool(False), ZDCMonitor_checkNevents = cms.untracked.int32(1000), ZDCMonitor_deadthresholdrate = cms.untracked.double(0.), - - + # DATA INTEGRITY TASK DataIntegrityTask = cms.untracked.bool(False), @@ -228,19 +223,20 @@ TrigPrimMonitor_checkNevents = cms.untracked.int32(1000), TrigPrimMonitor_makeDiagnostics = cms.untracked.bool(False), TrigPrimMonitor_ZSAlarmThreshold = cms.untracked.int32(12), + TrigPrimMonitor_AllowedCalibTypes = cms.untracked.vint32(), # Allowed calibration types (empty vector means all types allowed) gtLabel = cms.InputTag("l1GtUnpack"), # LED MONITOR LEDMonitor = cms.untracked.bool(False), LED_ADC_Thresh = cms.untracked.double(-1000.0), LEDPerChannel = cms.untracked.bool(True), - + LEDMonitor_AllowedCalibTypes = cms.untracked.vint32(), # Allowed calibration types (empty vector means all types allowed) # Not yet in use #LASER MONITOR LaserMonitor = cms.untracked.bool(False), Laser_ADC_Thresh = cms.untracked.double(-1000.0), LaserPerChannel = cms.untracked.bool(True), - + LaserMonitor_AllowedCalibTypes = cms.untracked.vint32(2,3,4,5), # Allowed calibration types (empty vector means all types allowed) # SPECIALIZED (EXPERT-USE) MONITORS # EXPERT MONITOR (should generally be turned off) @@ -303,15 +299,13 @@ def setHcalTaskValues(process): # Insidious python-ness: You need to make a copy of the process.minErrorFlag, etc. variables, # or future changes to PedestalMonitor_minErrorFlag will also change minErrorFlag! - # set minimum error value - minErrorFlag = deepcopy(process.minErrorFlag) - process.BeamMonitor_minErrorFlag = minErrorFlag - process.DeadCellMonitor_minErrorFlag = minErrorFlag - process.HotCellMonitor_minErrorFlag = minErrorFlag - process.ReferencePedestalMonitor_minErrorFlag = minErrorFlag - process.RecHitMonitor_minErrorFlag = minErrorFlag - - # create a minErrorFlag for DigiMonitor? I think we want the DigiMonitor errors to appear whenever an error exists, even if it's at a low rate. + # set minimum error value -- we may want to keep them assigned explicitly as above + #minErrorFlag = deepcopy(process.minErrorFlag) + #process.BeamMonitor_minErrorFlag = minErrorFlag + #process.DeadCellMonitor_minErrorFlag = minErrorFlag + #process.HotCellMonitor_minErrorFlag = minErrorFlag + #process.ReferencePedestalMonitor_minErrorFlag = minErrorFlag + #process.RecHitMonitor_minErrorFlag = minErrorFlag # set checkNevents checkNevents = deepcopy(process.checkNevents) diff --git a/trunk/DQM/HcalMonitorModule/python/hcal_dqm_sourceclient-file_cfg.py b/trunk/DQM/HcalMonitorModule/python/hcal_dqm_sourceclient-file_cfg.py index 5323374b19096..5bdcc4e1ec229 100644 --- a/trunk/DQM/HcalMonitorModule/python/hcal_dqm_sourceclient-file_cfg.py +++ b/trunk/DQM/HcalMonitorModule/python/hcal_dqm_sourceclient-file_cfg.py @@ -9,13 +9,14 @@ # variables used in multiple places #----------------------------------- -maxevents = 5000 # maximum number of events to process -checkNevents = 1000 # histograms are filled 'every checkNevents' events -debuglevel = 0 # specify amount of debug info to display +maxevents = 2000 # maximum number of events to process +checkNevents = 1000 # histograms are filled 'every checkNevents' events +debuglevel = 0 # larger value means more debug messages (0=no debug) +dump2database = False # turn on to dump out channel status in form DB can use subsystem="Hcal" # specify subsystem name (default is "Hcal") source = "PoolSource" # specify source type (PoolSource, NewEventStreamFileReader, HcalTBSource) -memcheck=False # Dump out memeroy usage information +memcheck=False # Dump out memory usage information process.load("FWCore.MessageLogger.MessageLogger_cfi") # Reduce frequency of MessageLogger event output messages @@ -41,9 +42,9 @@ fileNames = cms.untracked.vstring ( # A (relatively) recent run - #'/store/data/Commissioning09/Calo/RAW/v3/000/118/962/127CDC23-8FC5-DE11-B66D-000423D991D4.root', + '/store/data/Commissioning09/Calo/RAW/v3/000/118/962/127CDC23-8FC5-DE11-B66D-000423D991D4.root', # Calibration triggers only - '/store/data/Commissioning09/TestEnables/RAW/v3/000/118/074/84ED101B-03C0-DE11-B33C-000423D94E70.root', + #'/store/data/Commissioning09/TestEnables/RAW/v3/000/118/074/84ED101B-03C0-DE11-B33C-000423D94E70.root', # cosmics run with known hot cell in HF #'/store/data/Commissioning08/Cosmics/RAW/v1/000/067/838/006945C8-40A5-DD11-BD7E-001617DBD556.root', #'/store/data/Commissioning08/Cosmics/RAW/v1/000/067/838/FEEE9F50-61A5-DD11-835E-000423D98DD4.root', @@ -60,7 +61,9 @@ fileNames = cms.untracked.vstring( #'/store/data/GlobalCruzet3MW33/A/000/056/416/GlobalCruzet3MW33.00056416.0001.A.storageManager.0.0000.dat' # example file from online (cmsusr0) directory (lookarea_SM) - 'file:/lookarea_SM/MWGR_40_2009.00116136.0036.A.storageManager.07.0000.dat', + #'file:/lookarea_SM/MWGR_40_2009.00116136.0036.A.storageManager.07.0000.dat', + #'/store/streamer/RunPrep09/A/000/120/325/RunPrep09.00120325.0002.A.storageManager.06.0001.dat', + '/store/streamer/RunPrep09/A/000/120/331/RunPrep09.00120331.0196.A.storageManager.04.0000.dat' ) ) @@ -110,7 +113,8 @@ # lxplus process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") -process.GlobalTag.globaltag = "GR09_31X_V6P::All" # tags listed at SWGuideFrontierConditions twiki +#process.GlobalTag.globaltag = "GR09_31X_V6P::All" # tags listed at SWGuideFrontierConditions twiki +process.GlobalTag.globaltag = "GR09_P_V4::All" process.es_prefer_GlobalTag = cms.ESPrefer('PoolDBESSource','GlobalTag') process.prefer("GlobalTag") @@ -270,8 +274,7 @@ process.hcalMonitor.showTiming = False process.hcalMonitor.checkNevents = checkNevents -process.hcalMonitor.dump2database = False -process.hcalMonitor.AnalyzeOrbitGap = False +#process.hcalMonitor.DeadCellMonitor_test_rechits = True #-------------------------------------------- # Turn on/off individual hcalMonitor modules @@ -279,7 +282,6 @@ process.hcalMonitor.subSystemFolder = subsystem process.hcalMonitor.DataFormatMonitor = True -process.hcalMonitor.DataIntegrityTask = True process.hcalMonitor.DigiMonitor = True process.hcalMonitor.RecHitMonitor = True process.hcalMonitor.TrigPrimMonitor = True @@ -287,13 +289,16 @@ process.hcalMonitor.HotCellMonitor = True process.hcalMonitor.BeamMonitor = True process.hcalMonitor.ReferencePedestalMonitor = True +process.hcalMonitor.LaserMonitor = False -process.hcalMonitor.DetDiagNoiseMonitor = True -process.hcalMonitor.DetDiagTimingMonitor = True +process.hcalMonitor.DetDiagNoiseMonitor = False +process.hcalMonitor.DetDiagTimingMonitor = False process.hcalMonitor.DetDiagLEDMonitor = False process.hcalMonitor.DetDiagLaserMonitor = False process.hcalMonitor.DetDiagPedestalMonitor = False +process.hcalMonitor.DataIntegrityTask = False + # This takes the default cfg values from the hcalMonitor base class and applies them to the subtasks. setHcalTaskValues(process.hcalMonitor) @@ -303,9 +308,9 @@ #(otherwise they will remain set to the values specified for the hcalMonitor.) # Loosen HF hot cell thresholds when using cosmic reconstruction -hcalMonitor.HotCellMonitor_HF_energyThreshold = 20 -hcalMonitor.HotCellMonitor_HF_persistentThreshold = 10 - +process.hcalMonitor.HotCellMonitor_HF_energyThreshold = 20 +process.hcalMonitor.HotCellMonitor_HF_persistentThreshold = 10 +process.hcalMonitor.ReferencePedestalMonitor_makeDiagnosticPlots = True #----------------------------- # Hcal DQM Client #----------------------------- @@ -322,6 +327,7 @@ # Set client settings to the same as monitor. At the moment, this doesn't affect the client minErrorFlag # Summary Client is also unaffected +process.hcalClient.dump2database = dump2database setHcalClientValuesFromMonitor(process.hcalClient,process.hcalMonitor, debug=debuglevel) # Keep Summary Client turned on diff --git a/trunk/DQM/HcalMonitorModule/src/HcalMonitorModule.cc b/trunk/DQM/HcalMonitorModule/src/HcalMonitorModule.cc index 04f6d5e19c8a2..d2c757216f90a 100644 --- a/trunk/DQM/HcalMonitorModule/src/HcalMonitorModule.cc +++ b/trunk/DQM/HcalMonitorModule/src/HcalMonitorModule.cc @@ -4,8 +4,8 @@ /* * \file HcalMonitorModule.cc * - * $Date: 2009/11/10 14:10:15 $ - * $Revision: 1.145 $ + * $Date: 2009/11/10 21:03:12 $ + * $Revision: 1.146 $ * \author W Fisher * \author J Temple * @@ -19,8 +19,8 @@ HcalMonitorModule::HcalMonitorModule(const edm::ParameterSet& ps){ irun_=0; ilumisec_=0; ievent_=0; itime_=0; - meStatus_=0; meRunType_=0; - meEvtMask_=0; meFEDS_=0; + meStatus_=0; + meFEDS_=0; meLatency_=0; meQuality_=0; fedsListed_ = false; digiMon_ = 0; dfMon_ = 0; @@ -62,10 +62,6 @@ HcalMonitorModule::HcalMonitorModule(const edm::ParameterSet& ps){ checkHE_=ps.getUntrackedParameter("checkHE", 1); checkHO_=ps.getUntrackedParameter("checkHO", 1); checkHF_=ps.getUntrackedParameter("checkHF", 1); - - AnalyzeOrbGapCT_=ps.getUntrackedParameter("AnalyzeOrbitGap", 0); - skipCalib_ = ps.getUntrackedParameter("SkipCalibrationEvents",true); - evtSel_ = new HcalMonitorSelector(ps); dbe_ = Service().operator->(); @@ -78,8 +74,6 @@ HcalMonitorModule::HcalMonitorModule(const edm::ParameterSet& ps){ FEDRawDataCollection_ = ps.getUntrackedParameter("FEDRawDataCollection",edm::InputTag("source","")); - // Valgrind complained when the test was simply: if ( ps.getUntrackedParameter("DataFormatMonitor", false)) - // try assigning value to bool first? bool taskOn = ps.getUntrackedParameter("DataFormatMonitor", false); if (taskOn) { if(debug_>0) std::cout << "HcalMonitorModule: DataFormat monitor flag is on...." << std::endl; @@ -336,8 +330,6 @@ HcalMonitorModule::~HcalMonitorModule() } //////////////////////////////////////////// - if (evtSel_!=0) {delete evtSel_; evtSel_ = 0; - } } //void HcalMonitorModule::~HcalMonitorModule() //-------------------------------------------------------- @@ -379,8 +371,6 @@ void HcalMonitorModule::beginRun(const edm::Run& run, const edm::EventSetup& c) meIEVTDIGI_->Fill(ievt_digi_); meIEVTRECHIT_->Fill(ievt_rechit_); meStatus_ = dbe_->bookInt("STATUS"); - meRunType_ = dbe_->bookInt("RUN TYPE"); - meEvtMask_ = dbe_->bookInt("EVT MASK"); meFEDS_ = dbe_->book1D("FEDs Unpacked","FEDs Unpacked",100,700,799); // process latency was (200,0,1), but that gave overflows @@ -392,8 +382,6 @@ void HcalMonitorModule::beginRun(const edm::Run& run, const edm::EventSetup& c) meHO_ = dbe_->bookInt("HOpresent"); meHF_ = dbe_->bookInt("HFpresent"); meStatus_->Fill(0); - meRunType_->Fill(-1); - meEvtMask_->Fill(-1); // Should fill with 0 to start meHB_->Fill(HBpresent_); @@ -402,6 +390,23 @@ void HcalMonitorModule::beginRun(const edm::Run& run, const edm::EventSetup& c) meHF_->Fill(HFpresent_); } + // Create histograms for individual Tasks + if (digiMon_) digiMon_->beginRun(); + if (pedMon_) pedMon_->beginRun(); + if (rhMon_) rhMon_->beginRun(); + if (beamMon_) beamMon_->beginRun(c); // pass in event setup to get list of bad channel quality cells + if (expertMon_) expertMon_->beginRun(); + if (pedMon_) pedMon_->beginRun(); + if (ledMon_) ledMon_->beginRun(); + if (laserMon_) laserMon_->beginRun(); + if (mtccMon_) mtccMon_->beginRun(); + if (hotMon_) hotMon_->beginRun(); + if (deadMon_) deadMon_->beginRun(); + if (ctMon_) ctMon_->beginRun(); + if (tpMon_) tpMon_->beginRun(); + if (zdcMon_) zdcMon_->beginRun(); + if (eeusMon_) eeusMon_->beginRun(); + edm::ESHandle pSetup; c.get().get( pSetup ); @@ -440,10 +445,10 @@ void HcalMonitorModule::beginRun(const edm::Run& run, const edm::EventSetup& c) hcaldetid_); } // if (!detid_.null()) } - + //get conditions c.get().get(conditions_); - + // fill reference pedestals with database values if (pedMon_!=NULL) pedMon_->fillDBValues(*conditions_); @@ -452,10 +457,11 @@ void HcalMonitorModule::beginRun(const edm::Run& run, const edm::EventSetup& c) if (hotMon_!=NULL) hotMon_->createMaps(*conditions_); - + // get channel quality edm::ESHandle p; c.get().get(p); chanquality_= new HcalChannelQuality(*p.product()); + return; } @@ -521,7 +527,7 @@ void HcalMonitorModule::endRun(const edm::Run& r, const edm::EventSetup& context deadMon_->endLuminosityBlock(); if (hotMon_!=NULL) - hotMon_->fillHotHistosAtEndRun(); + hotMon_->endLuminosityBlock(); // Digi monitor doesn't require any persistent issues (dead for N events, etc) // to mark bad channels; we can simply call the 'fill_Nevents' method at the end of the run. @@ -623,7 +629,7 @@ void HcalMonitorModule::analyze(const edm::Event& e, const edm::EventSetup& even if (debug_>1) std::cout << "HcalMonitorModule: evts: "<< nevt_ << ", run: " << irun_ << ", LS: " << e.luminosityBlock() << ", evt: " << ievent_ << ", time: " << itime_ << std::endl <<"\t counter = "<::const_iterator i=fedss.begin();i!=fedss.end(); i++) { - const FEDRawData& fed = (*rawraw).FEDData(*i); - if (fed.size()<12) continue; //At least the size of headers and trailers of a DCC. - // get the DCC header - const HcalDCCHeader* dccHeader=(const HcalDCCHeader*)(fed.data()); - if(!dccHeader) continue; - // All FEDS should report the same CalibType within the event. - if ( (i!=fedss.begin()) && - (CalibType != dccHeader-> getCalibType()) ) { - if (debug_) std::cout << "Inconsistent CalibTypes" << (int) CalibType << " and " << dccHeader->getCalibType() < getCalibType(); - //Expedient only while testing: Skip non-calibration events. - } // for (vector::const_iterator i=fedss.begin()...) - - if (AnalyzeOrbGapCT_) - { - if (CalibType == hc_Null) return; - } - - else - { - if (debug_>0) std::cout <<" CALIB TYPE = "<1 && CalibType!=hc_Null && skipCalib_==true) std::cout <<"\t CALIBRATION EVENT FOUND; SKIPPING!"<0 && prescale()) return; if (rawOK_==true) ++ievt_rawdata_; - if (!InconsistentCalibTypes && AnalyzeOrbGapCT_) - { - // If we're doing the Orbit Gap DQM, set the right evtMask for - // the Calibration Event Type. - evtMask = DO_HCAL_DFMON; - switch (CalibType) { - case hc_Null: - break; - case hc_Pedestal: - evtMask |= DO_HCAL_PED_CALIBMON; - break; - case hc_RADDAM: - case hc_HBHEHPD: - case hc_HOHPD: - case hc_HFPMT: - evtMask |= DO_HCAL_LASER_CALIBMON; - break; - default: - break; - } - } // try to get digis edm::Handle hbhe_digi; @@ -796,12 +765,12 @@ void HcalMonitorModule::analyze(const edm::Event& e, const edm::EventSetup& even if (!(e.getByLabel(inputLabelDigi_,zdc_digi))) { digiOK_=false; - if (debug_>0) std::cout <<" COULDN'T GET ZDC DIGI"<1) std::cout <<" COULDN'T GET ZDC DIGI"<0) std::cout <<" DIGI OK FAILED FOR ZDC"<1) std::cout <<" DIGI OK FAILED FOR ZDC"<processEvent(*rawraw,*report,*readoutMap_); + dfMon_->processEvent(*rawraw,*report,*readoutMap_,calibType); } if (showTiming_) { @@ -972,7 +941,7 @@ void HcalMonitorModule::analyze(const edm::Event& e, const edm::EventSetup& even cpu_timer.reset(); cpu_timer.start(); } - if ((diTask_ != NULL) && (evtMask&DO_HCAL_DFMON) && rawOK_) + if ((diTask_ != NULL) && rawOK_) { diTask_->processEvent(*rawraw,*report,*readoutMap_); } @@ -984,11 +953,11 @@ void HcalMonitorModule::analyze(const edm::Event& e, const edm::EventSetup& even } // Digi monitor task - if((digiMon_!=NULL) && (evtMask&DO_HCAL_DIGIMON) && digiOK_ && report.isValid()) + if((digiMon_!=NULL) && digiOK_ && report.isValid()) { digiMon_->setSubDetectors(HBpresent_, HEpresent_, HOpresent_, HFpresent_ ); digiMon_->processEvent(*hbhe_digi,*ho_digi,*hf_digi, - *conditions_,*report); + calibType,*conditions_,*report); } if (showTiming_) { @@ -997,9 +966,9 @@ void HcalMonitorModule::analyze(const edm::Event& e, const edm::EventSetup& even cpu_timer.reset(); cpu_timer.start(); } // Pedestal monitor task - if((pedMon_!=NULL) && (evtMask&DO_HCAL_PED_CALIBMON) && digiOK_) + if((pedMon_!=NULL) && digiOK_) { - pedMon_->processEvent(*hbhe_digi,*ho_digi,*hf_digi,*conditions_); + pedMon_->processEvent(*hbhe_digi,*ho_digi,*hf_digi,calibType,*conditions_); } if (showTiming_) { @@ -1009,7 +978,7 @@ void HcalMonitorModule::analyze(const edm::Event& e, const edm::EventSetup& even } // LED monitor task - if((ledMon_!=NULL) && (evtMask&DO_HCAL_LED_CALIBMON) && digiOK_) + if(ledMon_!=NULL && digiOK_) { ledMon_->processEvent(*hbhe_digi,*ho_digi,*hf_digi,*conditions_); } @@ -1021,9 +990,9 @@ void HcalMonitorModule::analyze(const edm::Event& e, const edm::EventSetup& even } // Laser monitor task - if((laserMon_!=NULL) && (evtMask&DO_HCAL_LASER_CALIBMON) && digiOK_ && laserOK_) + if((laserMon_!=NULL) && digiOK_ && laserOK_) { - laserMon_->processEvent(*hbhe_digi,*ho_digi,*hf_digi,*laser_digi,*conditions_); + laserMon_->processEvent(*hbhe_digi,*ho_digi,*hf_digi,*laser_digi,*conditions_,calibType); } if (showTiming_) { @@ -1033,9 +1002,9 @@ void HcalMonitorModule::analyze(const edm::Event& e, const edm::EventSetup& even } // Rec Hit monitor task - if((rhMon_ != NULL) && (evtMask&DO_HCAL_RECHITMON) && rechitOK_) + if((rhMon_ != NULL) && rechitOK_) { - rhMon_->processEvent(*hb_hits,*ho_hits,*hf_hits); + rhMon_->processEvent(*hb_hits,*ho_hits,*hf_hits,calibType); } if (showTiming_) { @@ -1045,23 +1014,22 @@ void HcalMonitorModule::analyze(const edm::Event& e, const edm::EventSetup& even } // Beam Monitor task - if ((beamMon_ != NULL) && (evtMask&DO_HCAL_RECHITMON) && rechitOK_) + if ((beamMon_ != NULL) && rechitOK_) { - beamMon_->processEvent(*hb_hits,*ho_hits,*hf_hits,*hf_digi); + beamMon_->processEvent(*hb_hits,*ho_hits,*hf_hits,*hf_digi,calibType); } if (showTiming_) { cpu_timer.stop(); - if (beamMon_!=NULL) std::cout <<"TIMER:: BEAM MONITOR ->"<"<processEvent(*hb_hits,*ho_hits,*hf_hits, - *conditions_); + *conditions_, calibType); //hotMon_->setSubDetectors(HBpresent_,HEpresent_, HOpresent_, HFpresent_); } if (showTiming_) @@ -1071,12 +1039,12 @@ void HcalMonitorModule::analyze(const edm::Event& e, const edm::EventSetup& even cpu_timer.reset(); cpu_timer.start(); } // Dead Cell monitor task -- may end up using both rec hits and digis? - if((deadMon_ != NULL) && (evtMask&DO_HCAL_RECHITMON) && rechitOK_ && digiOK_) + if((deadMon_ != NULL) && rechitOK_ && digiOK_) { //deadMon_->setSubDetectors(HBpresent_,HEpresent_, HOpresent_, HFpresent_); deadMon_->processEvent(*hb_hits,*ho_hits,*hf_hits, - *hbhe_digi,*ho_digi,*hf_digi); - //*conditions_); + *hbhe_digi,*ho_digi,*hf_digi,calibType); + } if (showTiming_) { @@ -1104,7 +1072,8 @@ void HcalMonitorModule::analyze(const edm::Event& e, const edm::EventSetup& even { tpMon_->processEvent(*hb_hits,*ho_hits,*hf_hits, *hbhe_digi,*ho_digi,*hf_digi, - *tp_digi, *emultp_digi, *rawraw, *readoutMap_); + *tp_digi, *emultp_digi, *rawraw, *readoutMap_, + calibType); } if (showTiming_) diff --git a/trunk/DQM/HcalMonitorModule/src/HcalMonitorModule.h b/trunk/DQM/HcalMonitorModule/src/HcalMonitorModule.h index 2f97106b317b2..e3474f527fac9 100644 --- a/trunk/DQM/HcalMonitorModule/src/HcalMonitorModule.h +++ b/trunk/DQM/HcalMonitorModule/src/HcalMonitorModule.h @@ -5,8 +5,8 @@ * \file HcalMonitorModule.h * - * $Date: 2009/11/09 18:46:43 $ - * $Revision: 1.54 $ + * $Date: 2009/11/10 14:10:15 $ + * $Revision: 1.55 $ * \author W. Fisher * */ @@ -212,13 +212,10 @@ class HcalMonitorModule : public EDAnalyzer{ MonitorElement* meFEDS_; MonitorElement* meStatus_; - MonitorElement* meRunType_; - MonitorElement* meEvtMask_; MonitorElement* meTrigger_; MonitorElement* meLatency_; MonitorElement* meQuality_; - HcalMonitorSelector* evtSel_; HcalDigiMonitor* digiMon_; HcalDataFormatMonitor* dfMon_; HcalDataIntegrityTask* diTask_; @@ -250,10 +247,6 @@ class HcalMonitorModule : public EDAnalyzer{ ofstream m_logFile; - // Running on the Orbit Gap Calibration events? - bool AnalyzeOrbGapCT_; - bool skipCalib_; - // Decide whether individual subdetectors should be checked bool checkHB_; bool checkHE_; diff --git a/trunk/DQM/HcalMonitorTasks/interface/HcalBaseMonitor.h b/trunk/DQM/HcalMonitorTasks/interface/HcalBaseMonitor.h index f8c4ffa938acd..c405df55b5000 100644 --- a/trunk/DQM/HcalMonitorTasks/interface/HcalBaseMonitor.h +++ b/trunk/DQM/HcalMonitorTasks/interface/HcalBaseMonitor.h @@ -39,8 +39,8 @@ using namespace std; /** \class HcalBaseMonitor * - * $Date: 2009/11/10 14:10:55 $ - * $Revision: 1.35 $ + * $Date: 2009/11/10 21:03:13 $ + * $Revision: 1.36 $ * \author W. Fisher - FNAL */ class HcalBaseMonitor { @@ -49,6 +49,7 @@ class HcalBaseMonitor { virtual ~HcalBaseMonitor(); virtual void setup(const edm::ParameterSet& ps, DQMStore* dbe); + virtual void beginRun(); virtual void done(); virtual void clearME(); virtual void periodicReset(); @@ -117,9 +118,8 @@ class HcalBaseMonitor { string rootFolder_; string baseFolder_; - //static const int binmapd2[]; - //static const int binmapd3[]; - + vector AllowedCalibTypes_; + // Eventually, remove these -- problem cells get processed in client MonitorElement* ProblemCells; EtaPhiHists ProblemCellsByDepth; diff --git a/trunk/DQM/HcalMonitorTasks/interface/HcalBeamMonitor.h b/trunk/DQM/HcalMonitorTasks/interface/HcalBeamMonitor.h index fb9e29e85241c..f5b01bead6c0f 100644 --- a/trunk/DQM/HcalMonitorTasks/interface/HcalBeamMonitor.h +++ b/trunk/DQM/HcalMonitorTasks/interface/HcalBeamMonitor.h @@ -4,6 +4,10 @@ #include "DQM/HcalMonitorTasks/interface/HcalBaseMonitor.h" #include "DQMServices/Core/interface/DQMStore.h" #include "DQMServices/Core/interface/MonitorElement.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "CondFormats/HcalObjects/interface/HcalChannelQuality.h" +#include "FWCore/Framework/interface/ESHandle.h" // Use for stringstream #include @@ -12,8 +16,8 @@ /** \class HcalBeamMonitor * - * $Date: 2009/10/21 11:25:46 $ - * $Revision: 1.11 $ + * $Date: 2009/11/10 21:03:13 $ + * $Revision: 1.12 $ * \author J. Temple - Univ. of Maryland */ @@ -23,11 +27,12 @@ class HcalBeamMonitor: public HcalBaseMonitor { ~HcalBeamMonitor(); void setup(const edm::ParameterSet& ps, DQMStore* dbe); + void beginRun(const edm::EventSetup& c); void processEvent(const HBHERecHitCollection& hbHits, - const HORecHitCollection& hoHits, - const HFRecHitCollection& hfHits, - const HFDigiCollection& hf - //const ZDCRecHitCollection& zdcHits + const HORecHitCollection& hoHits, + const HFRecHitCollection& hfHits, + const HFDigiCollection& hf, + int CalibType ); void reset(); void clearME(); @@ -101,6 +106,12 @@ class HcalBeamMonitor: public HcalBaseMonitor { MonitorElement* HFlumi_total_hotcells; MonitorElement* HFlumi_total_deadcells; + MonitorElement* HFlumi_Ring1Status_vs_LS; + MonitorElement* HFlumi_Ring2Status_vs_LS; + std::map BadCells_; + + int ring1totalchannels_; + int ring2totalchannels_; const int ETA_OFFSET_HB; const int ETA_OFFSET_HE; diff --git a/trunk/DQM/HcalMonitorTasks/interface/HcalDataFormatMonitor.h b/trunk/DQM/HcalMonitorTasks/interface/HcalDataFormatMonitor.h index 56d7768672031..304f070276268 100644 --- a/trunk/DQM/HcalMonitorTasks/interface/HcalDataFormatMonitor.h +++ b/trunk/DQM/HcalMonitorTasks/interface/HcalDataFormatMonitor.h @@ -33,8 +33,8 @@ /** \class Hcaldataformatmonitor * - * $Date: 2009/10/25 22:34:11 $ - * $Revision: 1.53 $ + * $Date: 2009/11/03 16:28:16 $ + * $Revision: 1.54 $ * \author W. Fisher - FNAL * \author J. St. John - Boston University */ @@ -45,10 +45,12 @@ class HcalDataFormatMonitor: public HcalBaseMonitor { void setup(const edm::ParameterSet& ps, DQMStore* dbe); void processEvent(const FEDRawDataCollection& rawraw, const - HcalUnpackerReport& report, const HcalElectronicsMap& emap); + HcalUnpackerReport& report, const HcalElectronicsMap& emap, + int CalibType); void unpack(const FEDRawData& raw, const HcalElectronicsMap& emap); void clearME(); void reset(); + //void beginRun(); void HTRPrint(const HcalHTRData& htr,int prtlvl); void labelHTRBits(MonitorElement* mePlot,unsigned int axisType); diff --git a/trunk/DQM/HcalMonitorTasks/interface/HcalDeadCellMonitor.h b/trunk/DQM/HcalMonitorTasks/interface/HcalDeadCellMonitor.h index 514dc96bc196c..c626b683a7cde 100644 --- a/trunk/DQM/HcalMonitorTasks/interface/HcalDeadCellMonitor.h +++ b/trunk/DQM/HcalMonitorTasks/interface/HcalDeadCellMonitor.h @@ -14,8 +14,8 @@ /** \class HcalDeadCellMonitor * - * $Date: 2009/10/18 15:10:08 $ - * $Revision: 1.37 $ + * $Date: 2009/11/10 21:03:13 $ + * $Revision: 1.38 $ * \author J. Temple - Univ. of Maryland */ @@ -27,6 +27,7 @@ class HcalDeadCellMonitor: public HcalBaseMonitor { ~HcalDeadCellMonitor(); void setup(const edm::ParameterSet& ps, DQMStore* dbe); + void beginRun(); void clearME(); // overrides base class function void reset(); @@ -36,8 +37,8 @@ class HcalDeadCellMonitor: public HcalBaseMonitor { //const ZDCRecHitCollection& zdcHits, const HBHEDigiCollection& hbhedigi, const HODigiCollection& hodigi, - const HFDigiCollection& hfdigi - //const ZDCDigiCollection& zdcdigi, + const HFDigiCollection& hfdigi, + int calibType ); void periodicReset(); diff --git a/trunk/DQM/HcalMonitorTasks/interface/HcalDigiMonitor.h b/trunk/DQM/HcalMonitorTasks/interface/HcalDigiMonitor.h index 24976b655960d..31488a8d6825d 100644 --- a/trunk/DQM/HcalMonitorTasks/interface/HcalDigiMonitor.h +++ b/trunk/DQM/HcalMonitorTasks/interface/HcalDigiMonitor.h @@ -13,8 +13,8 @@ /** \class HcalDigiMonitor * - * $Date: 2009/10/18 15:10:08 $ - * $Revision: 1.51 $ + * $Date: 2009/11/10 21:03:13 $ + * $Revision: 1.52 $ * \author W. Fisher - FNAL * \author J. Temple - Univ. of Maryland */ @@ -62,10 +62,12 @@ class HcalDigiMonitor: public HcalBaseMonitor { ~HcalDigiMonitor(); void setup(const edm::ParameterSet& ps, DQMStore* dbe); + void beginRun(); + void clearME(); void processEvent(const HBHEDigiCollection& hbhe, const HODigiCollection& ho, const HFDigiCollection& hf, - //const ZDCDigiCollection& zdc, + int calibType, const HcalDbService& cond, const HcalUnpackerReport& report); void reset(); diff --git a/trunk/DQM/HcalMonitorTasks/interface/HcalHotCellMonitor.h b/trunk/DQM/HcalMonitorTasks/interface/HcalHotCellMonitor.h index 39fb8c0b05e32..8f8e4b36444a3 100644 --- a/trunk/DQM/HcalMonitorTasks/interface/HcalHotCellMonitor.h +++ b/trunk/DQM/HcalMonitorTasks/interface/HcalHotCellMonitor.h @@ -14,8 +14,8 @@ /** \class HcalHotCellMonitor * - * $Date: 2009/10/18 15:10:08 $ - * $Revision: 1.34 $ + * $Date: 2009/11/10 14:10:56 $ + * $Revision: 1.35 $ * \author J. Temple - Univ. of Maryland */ @@ -37,6 +37,7 @@ class HcalHotCellMonitor: public HcalBaseMonitor { ~HcalHotCellMonitor(); void setup(const edm::ParameterSet& ps, DQMStore* dbe); + void beginRun(); void setupNeighborParams(const edm::ParameterSet& ps, hotNeighborParams& N, std::string type); void done(); void clearME(); // overrides base class function @@ -47,12 +48,8 @@ class HcalHotCellMonitor: public HcalBaseMonitor { void processEvent(const HBHERecHitCollection& hbHits, const HORecHitCollection& hoHits, const HFRecHitCollection& hfHits, - //const ZDCRecHitCollection& zdcHits, - //const HBHEDigiCollection& hbhedigi, - //const HODigiCollection& hodigi, - //const HFDigiCollection& hfdigi, - //const ZDCDigiCollection& zdcdigi, - const HcalDbService& cond + const HcalDbService& cond, + int CalibType ); void processEvent_rechitenergy( const HBHERecHitCollection& hbheHits, @@ -62,7 +59,8 @@ class HcalHotCellMonitor: public HcalBaseMonitor { void processEvent_rechitneighbors( const HBHERecHitCollection& hbheHits, const HORecHitCollection& hoHits, const HFRecHitCollection& hfHits); - void fillHotHistosAtEndRun(); + void beginLuminosityBlock(int lb); + void endLuminosityBlock(); void periodicReset(); private: @@ -74,14 +72,12 @@ class HcalHotCellMonitor: public HcalBaseMonitor { void zeroCounters(); bool hotmon_makeDiagnostics_; - + int hotmon_minEvents_; // minimum # of events in a lumi block before persistent test will be checked // Booleans to control which of the three hot cell checking routines are used bool hotmon_test_neighbor_; bool hotmon_test_energy_; bool hotmon_test_persistent_; - int hotmon_checkNevents_; // specify how often to check is cell is hot - double energyThreshold_, HBenergyThreshold_, HEenergyThreshold_, HOenergyThreshold_, HFenergyThreshold_, ZDCenergyThreshold_; double persistentThreshold_, HBpersistentThreshold_, HEpersistentThreshold_, HOpersistentThreshold_, HFpersistentThreshold_, ZDCpersistentThreshold_; diff --git a/trunk/DQM/HcalMonitorTasks/interface/HcalLaserMonitor.h b/trunk/DQM/HcalMonitorTasks/interface/HcalLaserMonitor.h index 912226d42cf55..a92bc4781b926 100644 --- a/trunk/DQM/HcalMonitorTasks/interface/HcalLaserMonitor.h +++ b/trunk/DQM/HcalMonitorTasks/interface/HcalLaserMonitor.h @@ -9,8 +9,8 @@ /** \class HcalLaserMonitor * - * $Date: 2008/10/08 12:31:44 $ - * $Revision: 1.2 $ + * $Date: 2009/01/08 19:34:07 $ + * $Revision: 1.3 $ * \author L. Lebolo - FIU */ static const float adc2fc_[128] = { -0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, @@ -46,9 +46,11 @@ class HcalLaserMonitor: public HcalBaseMonitor { ~HcalLaserMonitor(); void setup( const edm::ParameterSet&, DQMStore* ); + void beginRun(); void processEvent( const HBHEDigiCollection&, const HODigiCollection&, const HFDigiCollection&, const HcalLaserDigi&, - const HcalDbService& ); + const HcalDbService&, + int CalibType); void reset(); void done(); diff --git a/trunk/DQM/HcalMonitorTasks/interface/HcalPedestalMonitor.h b/trunk/DQM/HcalMonitorTasks/interface/HcalPedestalMonitor.h index d93a9224c7022..1d6fffe3a9f2d 100644 --- a/trunk/DQM/HcalMonitorTasks/interface/HcalPedestalMonitor.h +++ b/trunk/DQM/HcalMonitorTasks/interface/HcalPedestalMonitor.h @@ -10,8 +10,8 @@ /** \class HcalPedestalMonitor * - * $Date: 2009/07/21 11:02:48 $ - * $Revision: 1.28 $ + * $Date: 2009/11/09 18:47:58 $ + * $Revision: 1.29 $ * \author W. Fisher - FNAL */ @@ -22,10 +22,11 @@ class HcalPedestalMonitor: public HcalBaseMonitor { ~HcalPedestalMonitor(); void setup(const edm::ParameterSet& ps, DQMStore* dbe); - + void beginRun(); void processEvent(const HBHEDigiCollection& hbhe, const HODigiCollection& ho, const HFDigiCollection& hf, + int calibType, const HcalDbService& cond); void done(); void reset(); diff --git a/trunk/DQM/HcalMonitorTasks/interface/HcalRecHitMonitor.h b/trunk/DQM/HcalMonitorTasks/interface/HcalRecHitMonitor.h index 99620d3d71b23..b860352ba1c49 100644 --- a/trunk/DQM/HcalMonitorTasks/interface/HcalRecHitMonitor.h +++ b/trunk/DQM/HcalMonitorTasks/interface/HcalRecHitMonitor.h @@ -13,8 +13,8 @@ /** \class HcalRecHitMonitor * - * $Date: 2009/11/10 14:10:57 $ - * $Revision: 1.33 $ + * $Date: 2009/11/10 21:03:13 $ + * $Revision: 1.34 $ * \author J. Temple - Univ. of Maryland */ @@ -27,6 +27,7 @@ class HcalRecHitMonitor: public HcalBaseMonitor { ~HcalRecHitMonitor(); void setup(const edm::ParameterSet& ps, DQMStore* dbe); + void beginRun(); void done(); void clearME(); // overrides base class function void reset(); @@ -34,8 +35,8 @@ class HcalRecHitMonitor: public HcalBaseMonitor { void processEvent(const HBHERecHitCollection& hbHits, const HORecHitCollection& hoHits, - const HFRecHitCollection& hfHits - //const ZDCRecHitCollection& zdcHits, + const HFRecHitCollection& hfHits, + int CalibType ); void processEvent_rechit( const HBHERecHitCollection& hbheHits, diff --git a/trunk/DQM/HcalMonitorTasks/interface/HcalTrigPrimMonitor.h b/trunk/DQM/HcalMonitorTasks/interface/HcalTrigPrimMonitor.h index 1039d5fdf6181..f969ae8336461 100644 --- a/trunk/DQM/HcalMonitorTasks/interface/HcalTrigPrimMonitor.h +++ b/trunk/DQM/HcalMonitorTasks/interface/HcalTrigPrimMonitor.h @@ -12,8 +12,8 @@ /** \class HcalTrigPrimMonitor * - * $Date: 2009/10/12 15:10:05 $ - * $Revision: 1.19 $ + * $Date: 2009/10/30 17:11:07 $ + * $Revision: 1.20 $ * \author W. Fisher - FNAL */ @@ -31,11 +31,13 @@ class HcalTrigPrimMonitor: public HcalBaseMonitor { const HFDigiCollection& hfdigi, const HcalTrigPrimDigiCollection& tpDigis, const HcalTrigPrimDigiCollection& emultpDigis, - const FEDRawDataCollection& rawraw, - const HcalElectronicsMap& emap); + const FEDRawDataCollection& rawraw, + const HcalElectronicsMap& emap, + int CalibType + ); void clearME(); void reset(); - + void beginRun(); private: diff --git a/trunk/DQM/HcalMonitorTasks/src/HcalBaseMonitor.cc b/trunk/DQM/HcalMonitorTasks/src/HcalBaseMonitor.cc index dd880f1dfcdae..4af2719e355dc 100644 --- a/trunk/DQM/HcalMonitorTasks/src/HcalBaseMonitor.cc +++ b/trunk/DQM/HcalMonitorTasks/src/HcalBaseMonitor.cc @@ -6,17 +6,7 @@ #define PHIMAX 73.5 #define PHIMIN -0.5 -// This stores the eta binning for depth 2 histograms (with gaps between -15 -> +15) -/* -const int HcalBaseMonitor::binmapd2[]={-42,-41,-40,-39,-38,-37,-36,-35,-34,-33,-32,-31,-30, - -29,-28,-27,-26,-25,-24,-23,-22,-21,-20,-19,-18,-17, - -16,-15,-9999, 15,16,17,18,19,20,21,22,23,24,25,26,27,28,29, - 30,31,32,33,34,35,36,37,38,39,40,41,42}; -// This stores eta binning in depth 3 (where HE is only present at a few ieta values) - -const int HcalBaseMonitor::binmapd3[]={-28,-27,-9999,-16,-9999,16,-9999,27,28}; -*/ HcalBaseMonitor::HcalBaseMonitor() { fVerbosity = 0; badCells_.clear(); @@ -26,13 +16,17 @@ HcalBaseMonitor::HcalBaseMonitor() { HcalBaseMonitor::~HcalBaseMonitor() {} +void HcalBaseMonitor::beginRun(){ievt_=0;levt_=0;LBprocessed_=false;} + void HcalBaseMonitor::setup(const edm::ParameterSet& ps, DQMStore* dbe){ m_dbe = NULL; if(dbe != NULL) m_dbe = dbe; Online_ = ps.getUntrackedParameter("Online",false); badCells_ = ps.getUntrackedParameter >( "BadCells" ); + AllowedCalibTypes_ = ps.getUntrackedParameter > ("AllowedCalibTypes"); + // Base folder for the contents of this job string subsystemname = ps.getUntrackedParameter("subSystemFolder", "Hcal") ; rootFolder_ = subsystemname + "/"; @@ -182,7 +176,7 @@ void HcalBaseMonitor::clearME(){ if(m_dbe){ m_dbe->setCurrentFolder(baseFolder_); m_dbe->removeContents(); - + /* m_dbe->setCurrentFolder(baseFolder_+"/HB"); m_dbe->removeContents(); @@ -194,6 +188,7 @@ void HcalBaseMonitor::clearME(){ m_dbe->setCurrentFolder(baseFolder_+"/HF"); m_dbe->removeContents(); + */ } return; } // void HcalBaseMonitor::clearME(); diff --git a/trunk/DQM/HcalMonitorTasks/src/HcalBeamMonitor.cc b/trunk/DQM/HcalMonitorTasks/src/HcalBeamMonitor.cc index 269213b4c47c6..026994fa87f90 100644 --- a/trunk/DQM/HcalMonitorTasks/src/HcalBeamMonitor.cc +++ b/trunk/DQM/HcalMonitorTasks/src/HcalBeamMonitor.cc @@ -59,240 +59,307 @@ void HcalBeamMonitor::setup(const edm::ParameterSet& ps, DQMStore* dbe) beammon_checkNevents_ = ps.getUntrackedParameter("BeamMonitor_checkNevents",checkNevents_); beammon_minErrorFlag_ = ps.getUntrackedParameter("BeamMonitor_minErrorFlag",0.); beammon_lumiprescale_ = ps.getUntrackedParameter("BeamMonitor_lumiprescale",1); + AllowedCalibTypes_ = ps.getUntrackedParameter >("BeamMonitor_AllowedCalibTypes",AllowedCalibTypes_); - if (m_dbe) + return; +} + +void HcalBeamMonitor::beginRun(const edm::EventSetup& c) +{ + HcalBaseMonitor::beginRun(); // increment counters + + // Default number of expected good channels in the run + + ring1totalchannels_=144; + ring2totalchannels_=144; + BadCells_.clear(); // remove any old maps + // Get Channel quality info for the run + // Exclude bad channels from overall calculation + edm::ESHandle p; + c.get().get(p); + HcalChannelQuality* chanquality = new HcalChannelQuality(*p.product()); + std::vector mydetids = chanquality->getAllChannels(); + + for (unsigned int i=0;isetCurrentFolder(baseFolder_); - meEVT_ = m_dbe->bookInt("BeamMonitor Event Number"); + if (id.subdet()!=HcalForward) continue; + if ((id.depth()==1 && (abs(id.ieta())==33 || abs(id.ieta())==34)) || + (id.depth()==2 && (abs(id.ieta())==35 || abs(id.ieta())==36))) + { + const HcalChannelStatus* origstatus=chanquality->getValues(id); + HcalChannelStatus* mystatus=new HcalChannelStatus(origstatus->rawId(),origstatus->getValue()); + if (mystatus->isBitSet(HcalChannelStatus::HcalCellHot)) + BadCells_[id]=HcalChannelStatus::HcalCellHot; + else if (mystatus->isBitSet(HcalChannelStatus::HcalCellDead)) + BadCells_[id]=HcalChannelStatus::HcalCellDead; + if (mystatus->isBitSet(HcalChannelStatus::HcalCellHot) || + mystatus->isBitSet(HcalChannelStatus::HcalCellDead)) + { + if (id.depth()==1) --ring1totalchannels_; + else if (id.depth()==2) --ring2totalchannels_; + } + } + } - //jason's - m_dbe->setCurrentFolder(baseFolder_); - CenterOfEnergyRadius = m_dbe->book1D("CenterOfEnergyRadius", - "Center Of Energy radius", - 200,0,1); + if (!m_dbe) return; + + m_dbe->setCurrentFolder(baseFolder_); + meEVT_ = m_dbe->bookInt("BeamMonitor Event Number"); + + //jason's + m_dbe->setCurrentFolder(baseFolder_); + CenterOfEnergyRadius = m_dbe->book1D("CenterOfEnergyRadius", + "Center Of Energy radius", + 200,0,1); - CenterOfEnergyRadius->setAxisTitle("(normalized) radius",1); + CenterOfEnergyRadius->setAxisTitle("(normalized) radius",1); - CenterOfEnergy = m_dbe->book2D("CenterOfEnergy", - "Center of Energy", - 40,-1,1, - 40,-1,1); - CenterOfEnergy->setAxisTitle("normalized x coordinate",1); - CenterOfEnergy->setAxisTitle("normalized y coordinate",2); - - COEradiusVSeta = m_dbe->bookProfile("COEradiusVSeta", - "Center of Energy radius vs i#eta", - 172,-43,43, - 20,0,1); - COEradiusVSeta->setAxisTitle("i#eta",1); - COEradiusVSeta->setAxisTitle("(normalized) radius",2); + CenterOfEnergy = m_dbe->book2D("CenterOfEnergy", + "Center of Energy", + 40,-1,1, + 40,-1,1); + CenterOfEnergy->setAxisTitle("normalized x coordinate",1); + CenterOfEnergy->setAxisTitle("normalized y coordinate",2); + + COEradiusVSeta = m_dbe->bookProfile("COEradiusVSeta", + "Center of Energy radius vs i#eta", + 172,-43,43, + 20,0,1); + COEradiusVSeta->setAxisTitle("i#eta",1); + COEradiusVSeta->setAxisTitle("(normalized) radius",2); - std::stringstream histname; - std::stringstream histtitle; - m_dbe->setCurrentFolder(baseFolder_+"/HB"); - HBCenterOfEnergyRadius = m_dbe->book1D("HBCenterOfEnergyRadius", - "HB Center Of Energy radius", - 200,0,1); - HBCenterOfEnergy = m_dbe->book2D("HBCenterOfEnergy", - "HB Center of Energy", - 40,-1,1, - 40,-1,1); - if (beammon_makeDiagnostics_) + std::stringstream histname; + std::stringstream histtitle; + m_dbe->setCurrentFolder(baseFolder_+"/HB"); + HBCenterOfEnergyRadius = m_dbe->book1D("HBCenterOfEnergyRadius", + "HB Center Of Energy radius", + 200,0,1); + HBCenterOfEnergy = m_dbe->book2D("HBCenterOfEnergy", + "HB Center of Energy", + 40,-1,1, + 40,-1,1); + if (beammon_makeDiagnostics_) + { + for (int i=-16;i<=16;++i) { - for (int i=-16;i<=16;++i) - { - if (i==0) continue; - histname.str(""); - histtitle.str(""); - histname<<"HB_CenterOfEnergyRadius_ieta"<book1D("HECenterOfEnergyRadius", - "HE Center Of Energy radius", - 200,0,1); - HECenterOfEnergy = m_dbe->book2D("HECenterOfEnergy", - "HE Center of Energy", - 40,-1,1, - 40,-1,1); - - if (beammon_makeDiagnostics_) + if (i==0) continue; + histname.str(""); + histtitle.str(""); + histname<<"HB_CenterOfEnergyRadius_ieta"<book1D("HECenterOfEnergyRadius", + "HE Center Of Energy radius", + 200,0,1); + HECenterOfEnergy = m_dbe->book2D("HECenterOfEnergy", + "HE Center of Energy", + 40,-1,1, + 40,-1,1); + + if (beammon_makeDiagnostics_) + { + for (int i=-29;i<=29;++i) { - for (int i=-29;i<=29;++i) - { - if (abs(i)book1D("HOCenterOfEnergyRadius", - "HO Center Of Energy radius", - 200,0,1); - HOCenterOfEnergy = m_dbe->book2D("HOCenterOfEnergy", - "HO Center of Energy", - 40,-1,1, - 40,-1,1); - if (beammon_makeDiagnostics_) + if (abs(i)book1D("HOCenterOfEnergyRadius", + "HO Center Of Energy radius", + 200,0,1); + HOCenterOfEnergy = m_dbe->book2D("HOCenterOfEnergy", + "HO Center of Energy", + 40,-1,1, + 40,-1,1); + if (beammon_makeDiagnostics_) + { + for (int i=-15;i<=15;++i) { - for (int i=-15;i<=15;++i) - { - if (i==0) continue; - histname.str(""); - histtitle.str(""); - histname<<"HO_CenterOfEnergyRadius_ieta"<book1D("HFCenterOfEnergyRadius", - "HF Center Of Energy radius", - 200,0,1); - HFCenterOfEnergy = m_dbe->book2D("HFCenterOfEnergy", - "HF Center of Energy", - 40,-1,1, - 40,-1,1); - if (beammon_makeDiagnostics_) + if (i==0) continue; + histname.str(""); + histtitle.str(""); + histname<<"HO_CenterOfEnergyRadius_ieta"<book1D("HFCenterOfEnergyRadius", + "HF Center Of Energy radius", + 200,0,1); + HFCenterOfEnergy = m_dbe->book2D("HFCenterOfEnergy", + "HF Center of Energy", + 40,-1,1, + 40,-1,1); + if (beammon_makeDiagnostics_) + { + for (int i=-41;i<=41;++i) { - for (int i=-41;i<=41;++i) - { - if (abs(i)setCurrentFolder(baseFolder_+"/Lumi"); + // Wenhan's + // reducing bins from ",200,0,2000" to ",40,0,800" - float radiusbins[13]={169,201,240,286,340,406,483,576,686,818,975,1162,1300}; - float phibins[71]={-3.5,-3.4,-3.3,-3.2,-3.1, - -3.0,-2.9,-2.8,-2.7,-2.6,-2.5,-2.4,-2.3,-2.2,-2.1, - -2.0,-1.9,-1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1, - -1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1, - 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, - 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, - 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, - 3.0, 3.1, 3.2, 3.3, 3.4, 3.5}; - Etsum_eta_L=m_dbe->bookProfile("Et Sum vs Eta Long Fiber","Et Sum per Area vs Eta Long Fiber",27,0,27,100,0,100); - Etsum_eta_S=m_dbe->bookProfile("Et Sum vs Eta Short Fiber","Et Sum per Area vs Eta Short Fiber",27,0,27,100,0,100); - Etsum_phi_L=m_dbe->bookProfile("Et Sum vs Phi Long Fiber","Et Sum per Area vs Phi Long Fiber",36,0.5,72.5,100,0,100); - Etsum_phi_S=m_dbe->bookProfile("Et Sum vs Phi Short Fiber","Et Sum per Area crossing vs Phi Short Fiber",36,0.5,72.5,100,0,100); - - Etsum_ratio_p=m_dbe->book1D("Occ vs PMT events HF+","Energy difference of Long and Short Fiber HF+ in PMT events",105,0.,1.05); - Energy_Occ=m_dbe->book1D("Occ vs Energy","Occupancy vs Energy",200,0,2000); - Etsum_ratio_m=m_dbe->book1D("Occ vs PMT events HF-","Energy difference of Long and Short Fiber HF- in PMT events",105,0.,1.05); - Etsum_map_L=m_dbe->book2D("EtSum 2D phi and eta Long Fiber","Et Sum 2D phi and eta Long Fiber",27,0,27,36,0.5,72.5); - Etsum_map_S=m_dbe->book2D("EtSum 2D phi and eta Short Fiber","Et Sum 2D phi and eta Short Fiber",27,0,27,36,0.5,72.5); - - Etsum_rphi_S=m_dbe->book2D("EtSum 2D phi and radius Short Fiber","Et Sum 2D phi and radius Short Fiber",12, radiusbins, 70, phibins); - Etsum_rphi_L=m_dbe->book2D("EtSum 2D phi and radius Long Fiber","Et Sum 2D phi and radius Long Fiber",12, radiusbins, 70, phibins); - - Etsum_ratio_map=m_dbe->book2D("Abnormal PMT events","Abnormal PMT events", - 8,0,8,36, 0.5,72.5); - SetEtaLabels(Etsum_ratio_map); - - HFlumi_occ_LS = m_dbe->book2D("HFlumi_occ_LS","HFlumi occupancy for current LS", - 8,0,8,36, 0.5,72.5); - SetEtaLabels(HFlumi_occ_LS); + float radiusbins[13]={169,201,240,286,340,406,483,576,686,818,975,1162,1300}; + float phibins[71]={-3.5,-3.4,-3.3,-3.2,-3.1, + -3.0,-2.9,-2.8,-2.7,-2.6,-2.5,-2.4,-2.3,-2.2,-2.1, + -2.0,-1.9,-1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1, + -1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1, + 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, + 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, + 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, + 3.0, 3.1, 3.2, 3.3, 3.4, 3.5}; + Etsum_eta_L=m_dbe->bookProfile("Et Sum vs Eta Long Fiber","Et Sum per Area vs Eta Long Fiber",27,0,27,100,0,100); + Etsum_eta_S=m_dbe->bookProfile("Et Sum vs Eta Short Fiber","Et Sum per Area vs Eta Short Fiber",27,0,27,100,0,100); + Etsum_phi_L=m_dbe->bookProfile("Et Sum vs Phi Long Fiber","Et Sum per Area vs Phi Long Fiber",36,0.5,72.5,100,0,100); + Etsum_phi_S=m_dbe->bookProfile("Et Sum vs Phi Short Fiber","Et Sum per Area crossing vs Phi Short Fiber",36,0.5,72.5,100,0,100); + + Etsum_ratio_p=m_dbe->book1D("Occ vs PMT events HF+","Energy difference of Long and Short Fiber HF+ in PMT events",105,0.,1.05); + Energy_Occ=m_dbe->book1D("Occ vs Energy","Occupancy vs Energy",200,0,2000); + Etsum_ratio_m=m_dbe->book1D("Occ vs PMT events HF-","Energy difference of Long and Short Fiber HF- in PMT events",105,0.,1.05); + Etsum_map_L=m_dbe->book2D("EtSum 2D phi and eta Long Fiber","Et Sum 2D phi and eta Long Fiber",27,0,27,36,0.5,72.5); + Etsum_map_S=m_dbe->book2D("EtSum 2D phi and eta Short Fiber","Et Sum 2D phi and eta Short Fiber",27,0,27,36,0.5,72.5); + + Etsum_rphi_S=m_dbe->book2D("EtSum 2D phi and radius Short Fiber","Et Sum 2D phi and radius Short Fiber",12, radiusbins, 70, phibins); + Etsum_rphi_L=m_dbe->book2D("EtSum 2D phi and radius Long Fiber","Et Sum 2D phi and radius Long Fiber",12, radiusbins, 70, phibins); + + Etsum_ratio_map=m_dbe->book2D("Abnormal PMT events","Abnormal PMT events", + 8,0,8,36, 0.5,72.5); + SetEtaLabels(Etsum_ratio_map); + + HFlumi_occ_LS = m_dbe->book2D("HFlumi_occ_LS","HFlumi occupancy for current LS", + 8,0,8,36, 0.5,72.5); + SetEtaLabels(HFlumi_occ_LS); - HFlumi_total_deadcells = m_dbe->book2D("HFlumi_total_deadcells","# of times each HFlumi cell was dead for 1 full LS", - 8,0,8,36,0.5,72.5); - SetEtaLabels(HFlumi_total_deadcells); - HFlumi_total_hotcells = m_dbe->book2D("HFlumi_total_hotcells","# of times each HFlumi cell was hot for 1 full LS", - 8,0,8,36,0.5,72.5); - SetEtaLabels(HFlumi_total_hotcells); - - - Occ_rphi_S=m_dbe->book2D("Occ 2D phi and radius Short Fiber","Occupancy 2D phi and radius Short Fiber",12, radiusbins, 70, phibins); - Occ_rphi_L=m_dbe->book2D("Occ 2D phi and radius Long Fiber","Occupancy 2D phi and radius Long Fiber",12, radiusbins, 70, phibins); - Occ_eta_S=m_dbe->bookProfile("Occ vs iEta Short Fiber","Occ per Bunch crossing vs iEta Short Fiber",27,0,27,40,0,800); - Occ_eta_L=m_dbe->bookProfile("Occ vs iEta Long Fiber","Occ per Bunch crossing vs iEta Long Fiber",27,0,27,40,0,800); + HFlumi_total_deadcells = m_dbe->book2D("HFlumi_total_deadcells","# of times each HFlumi cell was dead for 1 full LS", + 8,0,8,36,0.5,72.5); + SetEtaLabels(HFlumi_total_deadcells); + HFlumi_total_hotcells = m_dbe->book2D("HFlumi_total_hotcells","# of times each HFlumi cell was hot for 1 full LS", + 8,0,8,36,0.5,72.5); + SetEtaLabels(HFlumi_total_hotcells); + + + Occ_rphi_S=m_dbe->book2D("Occ 2D phi and radius Short Fiber","Occupancy 2D phi and radius Short Fiber",12, radiusbins, 70, phibins); + Occ_rphi_L=m_dbe->book2D("Occ 2D phi and radius Long Fiber","Occupancy 2D phi and radius Long Fiber",12, radiusbins, 70, phibins); + Occ_eta_S=m_dbe->bookProfile("Occ vs iEta Short Fiber","Occ per Bunch crossing vs iEta Short Fiber",27,0,27,40,0,800); + Occ_eta_L=m_dbe->bookProfile("Occ vs iEta Long Fiber","Occ per Bunch crossing vs iEta Long Fiber",27,0,27,40,0,800); - Occ_phi_L=m_dbe->bookProfile("Occ vs iPhi Long Fiber","Occ per Bunch crossing vs iPhi Long Fiber",36,0.5,72.5,40,0,800); + Occ_phi_L=m_dbe->bookProfile("Occ vs iPhi Long Fiber","Occ per Bunch crossing vs iPhi Long Fiber",36,0.5,72.5,40,0,800); - Occ_phi_S=m_dbe->bookProfile("Occ vs iPhi Short Fiber","Occ per Bunch crossing vs iPhi Short Fiber",36,0.5,72.5,40,0,800); + Occ_phi_S=m_dbe->bookProfile("Occ vs iPhi Short Fiber","Occ per Bunch crossing vs iPhi Short Fiber",36,0.5,72.5,40,0,800); - Occ_map_L=m_dbe->book2D("Occ_map Long Fiber","Occ Map long Fiber (above threshold)",27,0,27,36,0.5,72.5); - Occ_map_S=m_dbe->book2D("Occ_map Short Fiber","Occ Map Short Fiber (above threshold)",27,0,27,36,0.5,72.5); + Occ_map_L=m_dbe->book2D("Occ_map Long Fiber","Occ Map long Fiber (above threshold)",27,0,27,36,0.5,72.5); + Occ_map_S=m_dbe->book2D("Occ_map Short Fiber","Occ Map Short Fiber (above threshold)",27,0,27,36,0.5,72.5); - stringstream binlabel; - for (int zz=0;zz<27;++zz) - { - if (zz<13) - binlabel<setBinLabel(zz+1,binlabel.str().c_str()); - Occ_eta_L->setBinLabel(zz+1,binlabel.str().c_str()); - Occ_map_S->setBinLabel(zz+1,binlabel.str().c_str()); - Occ_map_L->setBinLabel(zz+1,binlabel.str().c_str()); - Etsum_eta_S->setBinLabel(zz+1,binlabel.str().c_str()); - Etsum_eta_L->setBinLabel(zz+1,binlabel.str().c_str()); - Etsum_map_S->setBinLabel(zz+1,binlabel.str().c_str()); - Etsum_map_L->setBinLabel(zz+1,binlabel.str().c_str()); - binlabel.str(""); - } + stringstream binlabel; + for (int zz=0;zz<27;++zz) + { + if (zz<13) + binlabel<setBinLabel(zz+1,binlabel.str().c_str()); + Occ_eta_L->setBinLabel(zz+1,binlabel.str().c_str()); + Occ_map_S->setBinLabel(zz+1,binlabel.str().c_str()); + Occ_map_L->setBinLabel(zz+1,binlabel.str().c_str()); + Etsum_eta_S->setBinLabel(zz+1,binlabel.str().c_str()); + Etsum_eta_L->setBinLabel(zz+1,binlabel.str().c_str()); + Etsum_map_S->setBinLabel(zz+1,binlabel.str().c_str()); + Etsum_map_L->setBinLabel(zz+1,binlabel.str().c_str()); + binlabel.str(""); + } - //HFlumi plots - HFlumi_ETsum_perwedge = m_dbe->book1D("HF lumi ET-sum per wedge","HF lumi ET-sum per wedge;wedge",36,1,37); + //HFlumi plots + HFlumi_ETsum_perwedge = m_dbe->book1D("HF lumi ET-sum per wedge","HF lumi ET-sum per wedge;wedge",36,1,37); - HFlumi_Occupancy_above_thr_r1 = m_dbe->book1D("HF lumi Occupancy above threshold ring1","HF lumi Occupancy above threshold ring1;wedge",36,1,37); - HFlumi_Occupancy_between_thrs_r1 = m_dbe->book1D("HF lumi Occupancy between thresholds ring1","HF lumi Occupancy between thresholds ring1;wedge",36,1,37); - HFlumi_Occupancy_below_thr_r1 = m_dbe->book1D("HF lumi Occupancy below threshold ring1","HF lumi Occupancy below threshold ring1;wedge",36,1,37); - HFlumi_Occupancy_above_thr_r2 = m_dbe->book1D("HF lumi Occupancy above threshold ring2","HF lumi Occupancy above threshold ring2;wedge",36,1,37); - HFlumi_Occupancy_between_thrs_r2 = m_dbe->book1D("HF lumi Occupancy between thresholds ring2","HF lumi Occupancy between thresholds ring2;wedge",36,1,37); - HFlumi_Occupancy_below_thr_r2 = m_dbe->book1D("HF lumi Occupancy below threshold ring2","HF lumi Occupancy below threshold ring2;wedge",36,1,37); + HFlumi_Occupancy_above_thr_r1 = m_dbe->book1D("HF lumi Occupancy above threshold ring1","HF lumi Occupancy above threshold ring1;wedge",36,1,37); + HFlumi_Occupancy_between_thrs_r1 = m_dbe->book1D("HF lumi Occupancy between thresholds ring1","HF lumi Occupancy between thresholds ring1;wedge",36,1,37); + HFlumi_Occupancy_below_thr_r1 = m_dbe->book1D("HF lumi Occupancy below threshold ring1","HF lumi Occupancy below threshold ring1;wedge",36,1,37); + HFlumi_Occupancy_above_thr_r2 = m_dbe->book1D("HF lumi Occupancy above threshold ring2","HF lumi Occupancy above threshold ring2;wedge",36,1,37); + HFlumi_Occupancy_between_thrs_r2 = m_dbe->book1D("HF lumi Occupancy between thresholds ring2","HF lumi Occupancy between thresholds ring2;wedge",36,1,37); + HFlumi_Occupancy_below_thr_r2 = m_dbe->book1D("HF lumi Occupancy below threshold ring2","HF lumi Occupancy below threshold ring2;wedge",36,1,37); - HFlumi_Occupancy_per_channel_vs_lumiblock_RING1 = m_dbe->bookProfile("HFlumi Occupancy per channel vs lumi-block (RING 1)","HFlumi Occupancy per channel vs lumi-block (RING 1);LS; -ln(empty fraction)",Nlumiblocks_/beammon_lumiprescale_,0.5,Nlumiblocks_+0.5,100,0,10000); - HFlumi_Occupancy_per_channel_vs_lumiblock_RING2 = m_dbe->bookProfile("HFlumi Occupancy per channel vs lumi-block (RING 2)","HFlumi Occupancy per channel vs lumi-block (RING 2);LS; -ln(empty fraction)",Nlumiblocks_/beammon_lumiprescale_,0.5,Nlumiblocks_+0.5,100,0,10000); + HFlumi_Occupancy_per_channel_vs_lumiblock_RING1 = m_dbe->bookProfile("HFlumi Occupancy per channel vs lumi-block (RING 1)","HFlumi Occupancy per channel vs lumi-block (RING 1);LS; -ln(empty fraction)",Nlumiblocks_/beammon_lumiprescale_,0.5,Nlumiblocks_+0.5,100,0,10000); + HFlumi_Occupancy_per_channel_vs_lumiblock_RING2 = m_dbe->bookProfile("HFlumi Occupancy per channel vs lumi-block (RING 2)","HFlumi Occupancy per channel vs lumi-block (RING 2);LS; -ln(empty fraction)",Nlumiblocks_/beammon_lumiprescale_,0.5,Nlumiblocks_+0.5,100,0,10000); - HFlumi_Et_per_channel_vs_lumiblock = m_dbe->bookProfile("HFlumi Et per channel vs lumi-block","HFlumi Et per channel vs lumi-block;LS;ET",Nlumiblocks_/beammon_lumiprescale_,0.5,Nlumiblocks_+0.5,100,0,10000); + HFlumi_Et_per_channel_vs_lumiblock = m_dbe->bookProfile("HFlumi Et per channel vs lumi-block","HFlumi Et per channel vs lumi-block;LS;ET",Nlumiblocks_/beammon_lumiprescale_,0.5,Nlumiblocks_+0.5,100,0,10000); - HFlumi_Occupancy_per_channel_vs_lumiblock_RING1->getTProfile()->SetMarkerStyle(20); - HFlumi_Occupancy_per_channel_vs_lumiblock_RING2->getTProfile()->SetMarkerStyle(20); - HFlumi_Et_per_channel_vs_lumiblock->getTProfile()->SetMarkerStyle(20); - } // if (m_dbe) + HFlumi_Occupancy_per_channel_vs_lumiblock_RING1->getTProfile()->SetMarkerStyle(20); + HFlumi_Occupancy_per_channel_vs_lumiblock_RING2->getTProfile()->SetMarkerStyle(20); + HFlumi_Et_per_channel_vs_lumiblock->getTProfile()->SetMarkerStyle(20); + + HFlumi_Ring1Status_vs_LS = m_dbe->bookProfile("HFlumi_Ring1Status_vs_LS","Fraction of good Ring 1 channels vs LS;LS; Fraction of Good Channels",Nlumiblocks_/beammon_lumiprescale_,0.5,Nlumiblocks_+0.5,100,0,10000); + HFlumi_Ring2Status_vs_LS = m_dbe->bookProfile("HFlumi_Ring2Status_vs_LS","Fraction of good Ring 2 channels vs LS;LS; Fraction of Good Channels",Nlumiblocks_/beammon_lumiprescale_,0.5,Nlumiblocks_+0.5,100,0,10000); + HFlumi_Ring1Status_vs_LS->getTProfile()->SetMarkerStyle(20); + HFlumi_Ring2Status_vs_LS->getTProfile()->SetMarkerStyle(20); return; -} // void HcalBeamMonitor::setup() +} // void HcalBeamMonitor::beginRun(const EventSetup& c) void HcalBeamMonitor::processEvent(const HBHERecHitCollection& hbheHits, const HORecHitCollection& hoHits, const HFRecHitCollection& hfHits, - const HFDigiCollection& hf - // const ZDCRecHitCollection & zdcHits // include this once we see ZDC rec hits read out + const HFDigiCollection& hf, + int CalibType ) -{ //processEvent loop +{ + //processEvent loop if (!m_dbe) { if (fVerbosity) std::cout <<"HcalBeamMonitor::processEvent DQMStore not instantiated!!!"<0) std::cout <<" calibType = "<=33 && abs(ieta)<=36) // luminosity ring check - (HFiter->id().depth()==1) ? --ZStowersRing1 : --ZStowersRing2; + { + // don't subtract away cells that have already been removed as bad + if (BadCells_.find(HFiter->id())==BadCells_.end()) + { + if ((abs(ieta)<35) && HFiter->id().depth()==1) --ZStowersRing1; + else if ((abs(ieta)>34) && HFiter->id().depth()==2) -- ZStowersRing2; + } + } if (HFiter->energy()<0) continue; // don't include negative-energy cells? @@ -552,8 +626,12 @@ void HcalBeamMonitor::processEvent(const HBHERecHitCollection& hbheHits, et=HFiter->energy()/cosh(eta)/area[abs(ieta)-29]; if (abs(ieta)>=33 && abs(ieta)<=36) // Luminosity ring check { - if (et>=occThresh_) // minimum ET threshold - (HFiter->id().depth()==1) ? --emptytowersRing1 : --emptytowersRing2; + // don't count cells that are below threshold, or that have been marked bad in Chan Stat DB + if (et>=occThresh_ && BadCells_.find(HFiter->id())==BadCells_.end() ) // minimum ET threshold + { + if ((abs(ieta)<35) && HFiter->id().depth()==1) --emptytowersRing1; + else if ((abs(ieta)>34) && HFiter->id().depth()==2) -- emptytowersRing2; + } } r=radius[abs(ieta)-29]; if(HFiter->id().iphi()<37) @@ -669,14 +747,15 @@ void HcalBeamMonitor::processEvent(const HBHERecHitCollection& hbheHits, // Check Ring 1 double logvalue=0; - int ring1totalchannels=144; - int ring2totalchannels=144; - if (emptytowersRing1>0) - logvalue=-1.*log(emptytowersRing1/ring1totalchannels); + + if (emptytowersRing1>0 && ring1totalchannels_>0) + logvalue=-1.*log(emptytowersRing1/ring1totalchannels_); HFlumi_Occupancy_per_channel_vs_lumiblock_RING1->Fill(lumiblock,logvalue); // Check Ring 2 - emptytowersRing2>0 ? logvalue=-1.*log(emptytowersRing2/ring2totalchannels) : logvalue = 0; + logvalue=0; + if (emptytowersRing2>0 && ring2totalchannels_>0) + logvalue=-1.*log(emptytowersRing2/ring2totalchannels_); HFlumi_Occupancy_per_channel_vs_lumiblock_RING2->Fill(lumiblock,logvalue); int hfeta=ETA_OFFSET_HF; @@ -913,11 +992,33 @@ void HcalBeamMonitor::endLuminosityBlock() HFlumi_total_deadcells->Fill(-1,-1,1); // counts good lumi sections in underflow bin HFlumi_total_hotcells->Fill(-1,-1,1); + // ADD IETA MAP + int ietamap[8]={-36,-35,-34,-33,33,34,35,36}; + int ieta=-1, iphi = -1, depth=-1; + int badring1=0; + int badring2=0; for (int x=1;x<=HFlumi_occ_LS->getTH2F()->GetNbinsX();++x) { for (int y=1;y<=HFlumi_occ_LS->getTH2F()->GetNbinsY();++y) { - if (HFlumi_occ_LS->getBinContent(x,y)==0) + + // Skip over channels that are flagged as bad + if (x<8) + ieta=ietamap[x-1]; + else + ieta=-1; + iphi=2*y-1; + if (abs(ieta)==33 || abs(ieta)==34) depth=1; + else if (abs(ieta)==35 || abs(ieta)==36) depth =2; + else depth = -1; + if (depth !=-1 && ieta!=1) + { + HcalDetId thisID(HcalForward, ieta, iphi, depth); + if (BadCells_.find(thisID)==BadCells_.end()) + continue; + } + double Ncellhits=HFlumi_occ_LS->getBinContent(x,y); + if (Ncellhits==0) { // One new luminosity section found with no entries for the cell in question // Add protection requiring a minimum number of entries before counting as dead? @@ -925,12 +1026,28 @@ void HcalBeamMonitor::endLuminosityBlock() } // dead cell check // hot if present in more than 25% of events in the LS - if (HFlumi_occ_LS->getBinContent(x,y)>0.25*Nentries) + if (Ncellhits>0.25*Nentries) { HFlumi_total_hotcells->Fill(x-1,2*y-1,1); } // hot cell check + + if (Ncellhits==0 || Ncellhits>0.25*Nentries) // cell was either hot or dead + { + if (depth==1) badring1++; + else if (depth==2) badring2++; + } } // loop over y } // loop over x + + // Fill fraction of bad channels found in this LS + if (ring1totalchannels_!=0) + HFlumi_Ring1Status_vs_LS->Fill(lumiblock,1-1.*badring1/ring1totalchannels_); + else + HFlumi_Ring1Status_vs_LS->Fill(lumiblock,0); + if (ring2totalchannels_!=0) + HFlumi_Ring2Status_vs_LS->Fill(lumiblock,1-1.*badring2/ring2totalchannels_); + else + HFlumi_Ring2Status_vs_LS->Fill(lumiblock,0); LBprocessed_=true; return; } diff --git a/trunk/DQM/HcalMonitorTasks/src/HcalDataFormatMonitor.cc b/trunk/DQM/HcalMonitorTasks/src/HcalDataFormatMonitor.cc index 59c8a11b99b21..7c428b7c72b17 100644 --- a/trunk/DQM/HcalMonitorTasks/src/HcalDataFormatMonitor.cc +++ b/trunk/DQM/HcalMonitorTasks/src/HcalDataFormatMonitor.cc @@ -95,341 +95,362 @@ void HcalDataFormatMonitor::setup(const edm::ParameterSet& ps, prtlvl_ = ps.getUntrackedParameter("dfPrtLvl"); dfmon_checkNevents = ps.getUntrackedParameter("DataFormatMonitor_checkNevents",checkNevents_); + AllowedCalibTypes_ = ps.getUntrackedParameter >("DataFormatMonitor_AllowedCalibTypes",AllowedCalibTypes_); - if ( m_dbe ) { - std::string type; - m_dbe->setCurrentFolder(baseFolder_); - - ProblemCells=m_dbe->book2D(" HardwareWatchCells", - " Hardware Watch Cells for HCAL", - 85,-42.5,42.5, - 72,0.5,72.5); - ProblemCells->setAxisTitle("i#eta",1); - ProblemCells->setAxisTitle("i#phi",2); - SetEtaPhiLabels(ProblemCells); - SetupEtaPhiHists(ProblemCellsByDepth," Hardware Watch Cells", ""); - - //Initialize maps "problemcount" and "problemfound" before first event. - unsigned int etabins=0; - unsigned int phibins=0; - for (unsigned int depth=0; depth<4; ++depth) - { - etabins=ProblemCellsByDepth.depth[depth]->getNbinsX(); - phibins=ProblemCellsByDepth.depth[depth]->getNbinsY(); - for (unsigned int eta=0; etabookInt("Data Format Task Event Number"); - meEVT_->Fill(ievt_); - meTOTALEVT_ = m_dbe->bookInt("Data Format Total Events Processed"); - meTOTALEVT_->Fill(tevt_); - - m_dbe->setCurrentFolder(baseFolder_ + "/Corruption"); /// Below, "Corruption" FOLDER - type = "01 Common Data Format violations"; - meCDFErrorFound_ = m_dbe->book2D(type,type,32,699.5,731.5,9,0.5,9.5); - meCDFErrorFound_->setAxisTitle("HCAL FED ID", 1); - meCDFErrorFound_->setBinLabel(1, "Hdr1BitUnset", 2); - meCDFErrorFound_->setBinLabel(2, "FmtNumChange", 2); - meCDFErrorFound_->setBinLabel(3, "BOE not '0x5'", 2); - meCDFErrorFound_->setBinLabel(4, "Hdr2Bit Set", 2); - meCDFErrorFound_->setBinLabel(5, "Hdr1 36-55", 2); - meCDFErrorFound_->setBinLabel(6, "BOE not 0", 2); - meCDFErrorFound_->setBinLabel(7, "Trlr1Bit Set", 2); - meCDFErrorFound_->setBinLabel(8, "Size Error", 2); - meCDFErrorFound_->setBinLabel(9, "TrailerBad", 2); - - type = "02 DCC Event Format violation"; - meDCCEventFormatError_ = m_dbe->book2D(type,type,32,699.5,731.5,6,0.5,6.5); - meDCCEventFormatError_->setAxisTitle("HCAL FED ID", 1); - meDCCEventFormatError_->setBinLabel(1, "FmtVers Changed", 2); - meDCCEventFormatError_->setBinLabel(2, "StrayBits Changed", 2); - meDCCEventFormatError_->setBinLabel(3, "HTRStatusPad", 2); - meDCCEventFormatError_->setBinLabel(4, "32bitPadErr", 2); - meDCCEventFormatError_->setBinLabel(5, "Number Mismatch Bit Miscalc", 2); - meDCCEventFormatError_->setBinLabel(6, "Low 8 HTR Status Bits Miscopy", 2); - - type = "04 HTR BCN when OrN Diff"; - meBCNwhenOrNDiff_ = m_dbe->book1D(type,type,3564,-0.5,3563.5); - meBCNwhenOrNDiff_->setAxisTitle("BCN",1); - meBCNwhenOrNDiff_->setAxisTitle("# of Entries",2); - - type = "03 OrN Difference HTR - DCC"; - meOrNCheck_ = m_dbe->book1D(type,type,65,-32.5,32.5); - meOrNCheck_->setAxisTitle("htr OrN - dcc OrN",1); - - type = "03 OrN Inconsistent - HTR vs DCC"; - meOrNSynch_= m_dbe->book2D(type,type,32,0,32, 15,0,15); - meOrNSynch_->setAxisTitle("FED #",1); - meOrNSynch_->setAxisTitle("Spigot #",2); - - type = "05 BCN Difference HTR - DCC"; - meBCNCheck_ = m_dbe->book1D(type,type,501,-250.5,250.5); - meBCNCheck_->setAxisTitle("htr BCN - dcc BCN",1); - - type = "05 BCN Inconsistent - HTR vs DCC"; - meBCNSynch_= m_dbe->book2D(type,type,32,0,32, 15,0,15); - meBCNSynch_->setAxisTitle("FED #",1); - meBCNSynch_->setAxisTitle("Slot #",2); - - type = "06 EvN Difference HTR - DCC"; - meEvtNCheck_ = m_dbe->book1D(type,type,601,-300.5,300.5); - meEvtNCheck_->setAxisTitle("htr Evt # - dcc Evt #",1); - - type = "06 EvN Inconsistent - HTR vs DCC"; - meEvtNumberSynch_= m_dbe->book2D(type,type,32,0,32, 15,0,15); - meEvtNumberSynch_->setAxisTitle("FED #",1); - meEvtNumberSynch_->setAxisTitle("Slot #",2); - - // ---------------- - // | E!P | UE | TR | - // ----| ND | OV | ID | - // | T | CRC | ST | ODD| - // -------------------- - type="07 LRB Data Corruption Indicators"; - meLRBDataCorruptionIndicators_= m_dbe->book2D(type,type, - THREE_FED,0,THREE_FED, - THREE_SPG,0,THREE_SPG); - label_xFEDs (meLRBDataCorruptionIndicators_, 4); // 3 bins + 1 margin per ch. - label_ySpigots(meLRBDataCorruptionIndicators_, 4); // 3 bins + 1 margin each spgt - - // ---------------- - // | CT | BE | LW | - // | HM | 15 | WW | (Wrong Wordcount) - // | TM | CK | IW | (Illegal Wordcount) - // ---------------- - type="08 Half-HTR Data Corruption Indicators"; - meHalfHTRDataCorruptionIndicators_= m_dbe->book2D(type,type, - THREE_FED,0,THREE_FED, - THREE_SPG,0,THREE_SPG); - label_xFEDs (meHalfHTRDataCorruptionIndicators_, 4); // 3 bins + 1 margin per ch. - label_ySpigots(meHalfHTRDataCorruptionIndicators_, 4); // 3 bins + 1 margin each spgt - - // ------------ - // | !DV | Er | - // | NTS | Cap | - // ------------ - type = "09 Channel Integrity Summarized by Spigot"; - meChannSumm_DataIntegrityCheck_= m_dbe->book2D(type,type, - TWO___FED,0,TWO___FED, - TWO__SPGT,0,TWO__SPGT); - label_xFEDs (meChannSumm_DataIntegrityCheck_, 3); // 2 bins + 1 margin per ch. - label_ySpigots(meChannSumm_DataIntegrityCheck_, 3); // 2 bins + 1 margin per spgt - - m_dbe->setCurrentFolder(baseFolder_ + "/Corruption/Channel Data Integrity"); - char label[10]; - for (int f=0; fbook2D(label,label, - TWO_CHANN,0,TWO_CHANN, - TWO__SPGT,0,TWO__SPGT); - label_xChanns (meChann_DataIntegrityCheck_[f], 3); // 2 bins + 1 margin per ch. - label_ySpigots(meChann_DataIntegrityCheck_[f], 3); // 2 bins + 1 margin per spgt - ;} - - m_dbe->setCurrentFolder(baseFolder_ + "/Data Flow"); ////Below, "Data Flow" FOLDER - type="DCC Event Counts"; - mefedEntries_ = m_dbe->book1D(type,type,32,699.5,731.5); - - type = "BCN from DCCs"; - medccBCN_ = m_dbe->book1D(type,type,3564,-0.5,3563.5); - medccBCN_->setAxisTitle("BCN",1); - medccBCN_->setAxisTitle("# of Entries",2); - - type = "BCN from HTRs"; - meBCN_ = m_dbe->book1D(type,type,3564,-0.5,3563.5); - meBCN_->setAxisTitle("BCN",1); - meBCN_->setAxisTitle("# of Entries",2); - - type = "DCC Data Block Size Distribution"; - meFEDRawDataSizes_=m_dbe->book1D(type,type,1200,-0.5,12000.5); - meFEDRawDataSizes_->setAxisTitle("# of bytes",1); - meFEDRawDataSizes_->setAxisTitle("# of Data Blocks",2); - - type = "DCC Data Block Size Profile"; - meEvFragSize_ = m_dbe->bookProfile(type,type,32,699.5,731.5,100,-1000.0,12000.0,""); - type = "DCC Data Block Size Each FED"; - meEvFragSize2_ = m_dbe->book2D(type,type,64,699.5,731.5, 240,0,12000); - - // ------------ - // | OW | OFW | "Two Caps HTR; Three Caps FED." - // | BZ | BSY | - // | EE | RL | - // ---------------- - // | CE | (corrected error, Hamming code) - // ------ - type = "01 Data Flow Indicators"; - meDataFlowInd_= m_dbe->book2D(type,type, - TWO___FED,0,TWO___FED, - THREE_SPG,0,THREE_SPG); - label_xFEDs (meDataFlowInd_, 3); // 2 bins + 1 margin per ch. - label_ySpigots(meDataFlowInd_, 4); // 3 bins + 1 margin each spgt - - m_dbe->setCurrentFolder(baseFolder_ + "/Diagnostics"); ////Below, "Diagnostics" FOLDER - - type = "DCC Firmware Version"; - meDCCVersion_ = m_dbe->bookProfile(type,type, 32, 699.5, 731.5, 256, -0.5, 255.5); - meDCCVersion_ ->setAxisTitle("FED ID", 1); - - type = "HTR Status Word HBHE"; - HTR_StatusWd_HBHE = m_dbe->book1D(type,type,16,-0.5,15.5); - labelHTRBits(HTR_StatusWd_HBHE,1); - - type = "HTR Status Word HF"; - HTR_StatusWd_HF = m_dbe->book1D(type,type,16,-0.5,15.5); - labelHTRBits(HTR_StatusWd_HF,1); - - type = "HTR Status Word HO"; - HTR_StatusWd_HO = m_dbe->book1D(type,type,16,-0.5,15.5); - labelHTRBits(HTR_StatusWd_HO,1); - - int maxbits = 16;//Look at all 16 bits of the Error Words - type = "HTR Status Word by Crate"; - meErrWdCrate_ = m_dbe->book2D(type,type,18,-0.5,17.5,maxbits,-0.5,maxbits-0.5); - meErrWdCrate_ -> setAxisTitle("Crate #",1); - labelHTRBits(meErrWdCrate_,2); - - type = "Unpacking - HcalHTRData check failures"; - meInvHTRData_= m_dbe->book2D(type,type,16,-0.5,15.5,32,699.5,731.5); - meInvHTRData_->setAxisTitle("Spigot #",1); - meInvHTRData_->setAxisTitle("DCC #",2); - - type = "HTR Fiber Orbit Message BCN"; - meFibBCN_ = m_dbe->book1D(type,type,3564,-0.5,3563.5); - meFibBCN_->setAxisTitle("BCN of Fib Orb Msg",1); - - type = "HTR Status Word - Crate 0"; - meCrate0HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate0HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate0HTRErr_,2); - - type = "HTR Status Word - Crate 1"; - meCrate1HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate1HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate1HTRErr_,2); - - type = "HTR Status Word - Crate 2"; - meCrate2HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate2HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate2HTRErr_,2); - - type = "HTR Status Word - Crate 3"; - meCrate3HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate3HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate3HTRErr_,2); - - type = "HTR Status Word - Crate 4"; - meCrate4HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate4HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate4HTRErr_,2); - - type = "HTR Status Word - Crate 5"; - meCrate5HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate5HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate5HTRErr_,2); - - type = "HTR Status Word - Crate 6"; - meCrate6HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate6HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate6HTRErr_,2); - - type = "HTR Status Word - Crate 7"; - meCrate7HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate7HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate7HTRErr_,2); - - type = "HTR Status Word - Crate 9"; - meCrate9HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate9HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate9HTRErr_,2); - - type = "HTR Status Word - Crate 10"; - meCrate10HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate10HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate10HTRErr_,2); - - type = "HTR Status Word - Crate 11"; - meCrate11HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate11HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate11HTRErr_,2); - - type = "HTR Status Word - Crate 12"; - meCrate12HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate12HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate12HTRErr_,2); - - type = "HTR Status Word - Crate 13"; - meCrate13HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate13HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate13HTRErr_,2); - - type = "HTR Status Word - Crate 14"; - meCrate14HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate14HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate14HTRErr_,2); - - type = "HTR Status Word - Crate 15"; - meCrate15HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate15HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate15HTRErr_,2); - - type = "HTR Status Word - Crate 17"; - meCrate17HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); - meCrate17HTRErr_ ->setAxisTitle("Slot #",1); - labelHTRBits(meCrate17HTRErr_,2); - - type = "HTR UnSuppressed Event Fractions"; - meUSFractSpigs_ = m_dbe->book1D(type,type,481,0,481); - for(int f=0; fsetBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label); - for(int s=1; ssetBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}} - - // Firmware version - type = "HTR Firmware Version"; - // Maybe change to Profile histo eventually - //meHTRFWVersion_ = m_dbe->bookProfile(type,type,18,-0.5,17.5,245,10.0,255.0,""); - meHTRFWVersion_ = m_dbe->book2D(type,type ,18,-0.5,17.5,180,75.5,255.5); - meHTRFWVersion_->setAxisTitle("Crate #",1); - meHTRFWVersion_->setAxisTitle("HTR Firmware Version",2); - - type = "HTR Fiber 1 Orbit Message BCNs"; - meFib1OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); - type = "HTR Fiber 2 Orbit Message BCNs"; - meFib2OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); - type = "HTR Fiber 3 Orbit Message BCNs"; - meFib3OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); - type = "HTR Fiber 4 Orbit Message BCNs"; - meFib4OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); - type = "HTR Fiber 5 Orbit Message BCNs"; - meFib5OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); - type = "HTR Fiber 6 Orbit Message BCNs"; - meFib6OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); - type = "HTR Fiber 7 Orbit Message BCNs"; - meFib7OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); - type = "HTR Fiber 8 Orbit Message BCNs"; - meFib8OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); - - } - + if (m_dbe) + { + std::string type; + m_dbe->setCurrentFolder(baseFolder_); + + ProblemCells=m_dbe->book2D(" HardwareWatchCells", + " Hardware Watch Cells for HCAL", + 85,-42.5,42.5, + 72,0.5,72.5); + ProblemCells->setAxisTitle("i#eta",1); + ProblemCells->setAxisTitle("i#phi",2); + SetEtaPhiLabels(ProblemCells); + SetupEtaPhiHists(ProblemCellsByDepth," Hardware Watch Cells", ""); + + //Initialize maps "problemcount" and "problemfound" before first event. + unsigned int etabins=0; + unsigned int phibins=0; + for (unsigned int depth=0; depth<4; ++depth) + { + etabins=ProblemCellsByDepth.depth[depth]->getNbinsX(); + phibins=ProblemCellsByDepth.depth[depth]->getNbinsY(); + for (unsigned int eta=0; etabookInt("Data Format Task Event Number"); + meEVT_->Fill(ievt_); + meTOTALEVT_ = m_dbe->bookInt("Data Format Total Events Processed"); + meTOTALEVT_->Fill(tevt_); + + m_dbe->setCurrentFolder(baseFolder_ + "/Corruption"); /// Below, "Corruption" FOLDER + type = "01 Common Data Format violations"; + meCDFErrorFound_ = m_dbe->book2D(type,type,32,699.5,731.5,9,0.5,9.5); + meCDFErrorFound_->setAxisTitle("HCAL FED ID", 1); + meCDFErrorFound_->setBinLabel(1, "Hdr1BitUnset", 2); + meCDFErrorFound_->setBinLabel(2, "FmtNumChange", 2); + meCDFErrorFound_->setBinLabel(3, "BOE not '0x5'", 2); + meCDFErrorFound_->setBinLabel(4, "Hdr2Bit Set", 2); + meCDFErrorFound_->setBinLabel(5, "Hdr1 36-55", 2); + meCDFErrorFound_->setBinLabel(6, "BOE not 0", 2); + meCDFErrorFound_->setBinLabel(7, "Trlr1Bit Set", 2); + meCDFErrorFound_->setBinLabel(8, "Size Error", 2); + meCDFErrorFound_->setBinLabel(9, "TrailerBad", 2); + + type = "02 DCC Event Format violation"; + meDCCEventFormatError_ = m_dbe->book2D(type,type,32,699.5,731.5,6,0.5,6.5); + meDCCEventFormatError_->setAxisTitle("HCAL FED ID", 1); + meDCCEventFormatError_->setBinLabel(1, "FmtVers Changed", 2); + meDCCEventFormatError_->setBinLabel(2, "StrayBits Changed", 2); + meDCCEventFormatError_->setBinLabel(3, "HTRStatusPad", 2); + meDCCEventFormatError_->setBinLabel(4, "32bitPadErr", 2); + meDCCEventFormatError_->setBinLabel(5, "Number Mismatch Bit Miscalc", 2); + meDCCEventFormatError_->setBinLabel(6, "Low 8 HTR Status Bits Miscopy", 2); + + type = "04 HTR BCN when OrN Diff"; + meBCNwhenOrNDiff_ = m_dbe->book1D(type,type,3564,-0.5,3563.5); + meBCNwhenOrNDiff_->setAxisTitle("BCN",1); + meBCNwhenOrNDiff_->setAxisTitle("# of Entries",2); + + type = "03 OrN Difference HTR - DCC"; + meOrNCheck_ = m_dbe->book1D(type,type,65,-32.5,32.5); + meOrNCheck_->setAxisTitle("htr OrN - dcc OrN",1); + + type = "03 OrN Inconsistent - HTR vs DCC"; + meOrNSynch_= m_dbe->book2D(type,type,32,0,32, 15,0,15); + meOrNSynch_->setAxisTitle("FED #",1); + meOrNSynch_->setAxisTitle("Spigot #",2); + + type = "05 BCN Difference HTR - DCC"; + meBCNCheck_ = m_dbe->book1D(type,type,501,-250.5,250.5); + meBCNCheck_->setAxisTitle("htr BCN - dcc BCN",1); + + type = "05 BCN Inconsistent - HTR vs DCC"; + meBCNSynch_= m_dbe->book2D(type,type,32,0,32, 15,0,15); + meBCNSynch_->setAxisTitle("FED #",1); + meBCNSynch_->setAxisTitle("Slot #",2); + + type = "06 EvN Difference HTR - DCC"; + meEvtNCheck_ = m_dbe->book1D(type,type,601,-300.5,300.5); + meEvtNCheck_->setAxisTitle("htr Evt # - dcc Evt #",1); + + type = "06 EvN Inconsistent - HTR vs DCC"; + meEvtNumberSynch_= m_dbe->book2D(type,type,32,0,32, 15,0,15); + meEvtNumberSynch_->setAxisTitle("FED #",1); + meEvtNumberSynch_->setAxisTitle("Slot #",2); + + // ---------------- + // | E!P | UE | TR | + // ----| ND | OV | ID | + // | T | CRC | ST | ODD| + // -------------------- + type="07 LRB Data Corruption Indicators"; + meLRBDataCorruptionIndicators_= m_dbe->book2D(type,type, + THREE_FED,0,THREE_FED, + THREE_SPG,0,THREE_SPG); + label_xFEDs (meLRBDataCorruptionIndicators_, 4); // 3 bins + 1 margin per ch. + label_ySpigots(meLRBDataCorruptionIndicators_, 4); // 3 bins + 1 margin each spgt + + // ---------------- + // | CT | BE | LW | + // | HM | 15 | WW | (Wrong Wordcount) + // | TM | CK | IW | (Illegal Wordcount) + // ---------------- + type="08 Half-HTR Data Corruption Indicators"; + meHalfHTRDataCorruptionIndicators_= m_dbe->book2D(type,type, + THREE_FED,0,THREE_FED, + THREE_SPG,0,THREE_SPG); + label_xFEDs (meHalfHTRDataCorruptionIndicators_, 4); // 3 bins + 1 margin per ch. + label_ySpigots(meHalfHTRDataCorruptionIndicators_, 4); // 3 bins + 1 margin each spgt + + // ------------ + // | !DV | Er | + // | NTS | Cap | + // ------------ + type = "09 Channel Integrity Summarized by Spigot"; + meChannSumm_DataIntegrityCheck_= m_dbe->book2D(type,type, + TWO___FED,0,TWO___FED, + TWO__SPGT,0,TWO__SPGT); + label_xFEDs (meChannSumm_DataIntegrityCheck_, 3); // 2 bins + 1 margin per ch. + label_ySpigots(meChannSumm_DataIntegrityCheck_, 3); // 2 bins + 1 margin per spgt + + m_dbe->setCurrentFolder(baseFolder_ + "/Corruption/Channel Data Integrity"); + char label[10]; + for (int f=0; fbook2D(label,label, + TWO_CHANN,0,TWO_CHANN, + TWO__SPGT,0,TWO__SPGT); + label_xChanns (meChann_DataIntegrityCheck_[f], 3); // 2 bins + 1 margin per ch. + label_ySpigots(meChann_DataIntegrityCheck_[f], 3); // 2 bins + 1 margin per spgt + ;} + + m_dbe->setCurrentFolder(baseFolder_ + "/Data Flow"); ////Below, "Data Flow" FOLDER + type="DCC Event Counts"; + mefedEntries_ = m_dbe->book1D(type,type,32,699.5,731.5); + + type = "BCN from DCCs"; + medccBCN_ = m_dbe->book1D(type,type,3564,-0.5,3563.5); + medccBCN_->setAxisTitle("BCN",1); + medccBCN_->setAxisTitle("# of Entries",2); + + type = "BCN from HTRs"; + meBCN_ = m_dbe->book1D(type,type,3564,-0.5,3563.5); + meBCN_->setAxisTitle("BCN",1); + meBCN_->setAxisTitle("# of Entries",2); + + type = "DCC Data Block Size Distribution"; + meFEDRawDataSizes_=m_dbe->book1D(type,type,1200,-0.5,12000.5); + meFEDRawDataSizes_->setAxisTitle("# of bytes",1); + meFEDRawDataSizes_->setAxisTitle("# of Data Blocks",2); + + type = "DCC Data Block Size Profile"; + meEvFragSize_ = m_dbe->bookProfile(type,type,32,699.5,731.5,100,-1000.0,12000.0,""); + type = "DCC Data Block Size Each FED"; + meEvFragSize2_ = m_dbe->book2D(type,type,64,699.5,731.5, 240,0,12000); + + // ------------ + // | OW | OFW | "Two Caps HTR; Three Caps FED." + // | BZ | BSY | + // | EE | RL | + // ---------------- + // | CE | (corrected error, Hamming code) + // ------ + type = "01 Data Flow Indicators"; + meDataFlowInd_= m_dbe->book2D(type,type, + TWO___FED,0,TWO___FED, + THREE_SPG,0,THREE_SPG); + label_xFEDs (meDataFlowInd_, 3); // 2 bins + 1 margin per ch. + label_ySpigots(meDataFlowInd_, 4); // 3 bins + 1 margin each spgt + + m_dbe->setCurrentFolder(baseFolder_ + "/Diagnostics"); ////Below, "Diagnostics" FOLDER + + type = "DCC Firmware Version"; + meDCCVersion_ = m_dbe->bookProfile(type,type, 32, 699.5, 731.5, 256, -0.5, 255.5); + meDCCVersion_ ->setAxisTitle("FED ID", 1); + + type = "HTR Status Word HBHE"; + HTR_StatusWd_HBHE = m_dbe->book1D(type,type,16,-0.5,15.5); + labelHTRBits(HTR_StatusWd_HBHE,1); + + type = "HTR Status Word HF"; + HTR_StatusWd_HF = m_dbe->book1D(type,type,16,-0.5,15.5); + labelHTRBits(HTR_StatusWd_HF,1); + + type = "HTR Status Word HO"; + HTR_StatusWd_HO = m_dbe->book1D(type,type,16,-0.5,15.5); + labelHTRBits(HTR_StatusWd_HO,1); + + int maxbits = 16;//Look at all 16 bits of the Error Words + type = "HTR Status Word by Crate"; + meErrWdCrate_ = m_dbe->book2D(type,type,18,-0.5,17.5,maxbits,-0.5,maxbits-0.5); + meErrWdCrate_ -> setAxisTitle("Crate #",1); + labelHTRBits(meErrWdCrate_,2); + + type = "Unpacking - HcalHTRData check failures"; + meInvHTRData_= m_dbe->book2D(type,type,16,-0.5,15.5,32,699.5,731.5); + meInvHTRData_->setAxisTitle("Spigot #",1); + meInvHTRData_->setAxisTitle("DCC #",2); + + type = "HTR Fiber Orbit Message BCN"; + meFibBCN_ = m_dbe->book1D(type,type,3564,-0.5,3563.5); + meFibBCN_->setAxisTitle("BCN of Fib Orb Msg",1); + + type = "HTR Status Word - Crate 0"; + meCrate0HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate0HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate0HTRErr_,2); + + type = "HTR Status Word - Crate 1"; + meCrate1HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate1HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate1HTRErr_,2); + + type = "HTR Status Word - Crate 2"; + meCrate2HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate2HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate2HTRErr_,2); + + type = "HTR Status Word - Crate 3"; + meCrate3HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate3HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate3HTRErr_,2); + + type = "HTR Status Word - Crate 4"; + meCrate4HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate4HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate4HTRErr_,2); + + type = "HTR Status Word - Crate 5"; + meCrate5HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate5HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate5HTRErr_,2); + + type = "HTR Status Word - Crate 6"; + meCrate6HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate6HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate6HTRErr_,2); + + type = "HTR Status Word - Crate 7"; + meCrate7HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate7HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate7HTRErr_,2); + + type = "HTR Status Word - Crate 9"; + meCrate9HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate9HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate9HTRErr_,2); + + type = "HTR Status Word - Crate 10"; + meCrate10HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate10HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate10HTRErr_,2); + + type = "HTR Status Word - Crate 11"; + meCrate11HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate11HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate11HTRErr_,2); + + type = "HTR Status Word - Crate 12"; + meCrate12HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate12HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate12HTRErr_,2); + + type = "HTR Status Word - Crate 13"; + meCrate13HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate13HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate13HTRErr_,2); + + type = "HTR Status Word - Crate 14"; + meCrate14HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate14HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate14HTRErr_,2); + + type = "HTR Status Word - Crate 15"; + meCrate15HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate15HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate15HTRErr_,2); + + type = "HTR Status Word - Crate 17"; + meCrate17HTRErr_ = m_dbe->book2D(type,type,40,-0.25,19.75,maxbits,-0.5,maxbits-0.5); + meCrate17HTRErr_ ->setAxisTitle("Slot #",1); + labelHTRBits(meCrate17HTRErr_,2); + + type = "HTR UnSuppressed Event Fractions"; + meUSFractSpigs_ = m_dbe->book1D(type,type,481,0,481); + for(int f=0; fsetBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label); + for(int s=1; ssetBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}} + + // Firmware version + type = "HTR Firmware Version"; + // Maybe change to Profile histo eventually + //meHTRFWVersion_ = m_dbe->bookProfile(type,type,18,-0.5,17.5,245,10.0,255.0,""); + meHTRFWVersion_ = m_dbe->book2D(type,type ,18,-0.5,17.5,180,75.5,255.5); + meHTRFWVersion_->setAxisTitle("Crate #",1); + meHTRFWVersion_->setAxisTitle("HTR Firmware Version",2); + + type = "HTR Fiber 1 Orbit Message BCNs"; + meFib1OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); + type = "HTR Fiber 2 Orbit Message BCNs"; + meFib2OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); + type = "HTR Fiber 3 Orbit Message BCNs"; + meFib3OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); + type = "HTR Fiber 4 Orbit Message BCNs"; + meFib4OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); + type = "HTR Fiber 5 Orbit Message BCNs"; + meFib5OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); + type = "HTR Fiber 6 Orbit Message BCNs"; + meFib6OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); + type = "HTR Fiber 7 Orbit Message BCNs"; + meFib7OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); + type = "HTR Fiber 8 Orbit Message BCNs"; + meFib8OrbMsgBCN_= m_dbe->book2D(type,type,40,-0.25,19.75,18,-0.5,17.5); + } // if (m_dbe) return; } void HcalDataFormatMonitor::processEvent(const FEDRawDataCollection& rawraw, const HcalUnpackerReport& report, - const HcalElectronicsMap& emap){ + const HcalElectronicsMap& emap, + int CalibType){ + if(!m_dbe) { printf("HcalDataFormatMonitor::processEvent DQMStore not instantiated!!!\n"); return;} + bool processevent=false; + if (AllowedCalibTypes_.size()==0) + processevent=true; + else + { + for (unsigned int i=0;i1) std::cout <<" calibType = "<("DeadCellMonitor_HO_energyThreshold",energyThreshold_); HFenergyThreshold_ = ps.getUntrackedParameter("DeadCellMonitor_HF_energyThreshold",energyThreshold_); - zeroCounters(true); // zero all counters, including never-present ccounters + // Set allowed types of events for running through rechitmon + AllowedCalibTypes_ = ps.getUntrackedParameter >("DeadCellMonitor_AllowedCalibTypes",AllowedCalibTypes_); + + if (showTiming) + { + cpu_timer.stop(); std::cout <<"TIMER:: HcalDeadCellMonitor SETUP -> "<1) - std::cout <<" Setting up histograms"<setCurrentFolder(baseFolder_); - meEVT_ = m_dbe->bookInt("Dead Cell Task Event Number"); - meEVT_->Fill(ievt_); - meTOTALEVT_ = m_dbe->bookInt("Dead Cell Total Events Processed"); - meTOTALEVT_->Fill(tevt_); - - // 1D plots count number of bad cells vs. luminoisty block - ProblemsVsLB=m_dbe->bookProfile("TotalDeadCells_HCAL_vs_LS", - "Total Number of Dead Hcal Cells vs lumi section;Lumi Section;Dead Cells", - Nlumiblocks_,0.5,Nlumiblocks_+0.5, - 100,0,10000); - ProblemsVsLB_HB=m_dbe->bookProfile("TotalDeadCells_HB_vs_LS", - "Total Number of Dead HB Cells vs lumi section;Lumi Section;Dead Cells", - Nlumiblocks_,0.5,Nlumiblocks_+0.5, - 100,0,10000); - ProblemsVsLB_HE=m_dbe->bookProfile("TotalDeadCells_HE_vs_LS", - "Total Number of Dead HE Cells vs lumi section;Lumi Section;Dead Cells", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - ProblemsVsLB_HO=m_dbe->bookProfile("TotalDeadCells_HO_vs_LS", - "Total Number of Dead HO Cells vs lumi section;Lumi Section;Dead Cells", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - ProblemsVsLB_HF=m_dbe->bookProfile("TotalDeadCells_HF_vs_LS", - "Total Number of Dead HF Cells vs lumi section;Lumi Section;Dead Cells", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - (ProblemsVsLB->getTProfile())->SetMarkerStyle(20); - (ProblemsVsLB_HB->getTProfile())->SetMarkerStyle(20); - (ProblemsVsLB_HE->getTProfile())->SetMarkerStyle(20); - (ProblemsVsLB_HO->getTProfile())->SetMarkerStyle(20); - (ProblemsVsLB_HF->getTProfile())->SetMarkerStyle(20); - - // ProblemCells plots are in HcalDeadCellClient! + cpu_timer.reset(); cpu_timer.start(); + } + if (fVerbosity>1) + std::cout <<" Setting up histograms"<setCurrentFolder(baseFolder_); + //clearME(); + meEVT_ = m_dbe->bookInt("Dead Cell Task Event Number"); + meEVT_->Fill(ievt_); + meTOTALEVT_ = m_dbe->bookInt("Dead Cell Total Events Processed"); + meTOTALEVT_->Fill(tevt_); + // 1D plots count number of bad cells vs. luminosity block + ProblemsVsLB=m_dbe->bookProfile("TotalDeadCells_HCAL_vs_LS", + "Total Number of Dead Hcal Cells vs lumi section;Lumi Section;Dead Cells", + Nlumiblocks_,0.5,Nlumiblocks_+0.5, + 100,0,10000); + ProblemsVsLB_HB=m_dbe->bookProfile("TotalDeadCells_HB_vs_LS", + "Total Number of Dead HB Cells vs lumi section;Lumi Section;Dead Cells", + Nlumiblocks_,0.5,Nlumiblocks_+0.5, + 100,0,10000); + ProblemsVsLB_HE=m_dbe->bookProfile("TotalDeadCells_HE_vs_LS", + "Total Number of Dead HE Cells vs lumi section;Lumi Section;Dead Cells", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + ProblemsVsLB_HO=m_dbe->bookProfile("TotalDeadCells_HO_vs_LS", + "Total Number of Dead HO Cells vs lumi section;Lumi Section;Dead Cells", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + ProblemsVsLB_HF=m_dbe->bookProfile("TotalDeadCells_HF_vs_LS", + "Total Number of Dead HF Cells vs lumi section;Lumi Section;Dead Cells", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + (ProblemsVsLB->getTProfile())->SetMarkerStyle(20); + (ProblemsVsLB_HB->getTProfile())->SetMarkerStyle(20); + (ProblemsVsLB_HE->getTProfile())->SetMarkerStyle(20); + (ProblemsVsLB_HO->getTProfile())->SetMarkerStyle(20); + (ProblemsVsLB_HF->getTProfile())->SetMarkerStyle(20); + + // ProblemCells plots are in HcalDeadCellClient! - // Set up plots for each failure mode of dead cells - stringstream units; // We'll need to set the titles individually, rather than passing units to SetupEtaPhiHists (since this also would affect the name of the histograms) - stringstream name; - - // Never-present test will always be called, by definition of dead cell - - m_dbe->setCurrentFolder(baseFolder_+"/dead_digi_never_present"); - SetupEtaPhiHists(DigiPresentByDepth, - "Digi Present At Least Once",""); - // 1D plots count number of bad cells - NumberOfNeverPresentDigis=m_dbe->bookProfile("Problem_NeverPresentDigis_HCAL_vs_LS", - "Total Number of Never-Present Hcal Cells vs LS;Lumi Section;Dead Cells", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + // Set up plots for each failure mode of dead cells + stringstream units; // We'll need to set the titles individually, rather than passing units to SetupEtaPhiHists (since this also would affect the name of the histograms) + stringstream name; + + // Never-present test will always be called, by definition of dead cell + + m_dbe->setCurrentFolder(baseFolder_+"/dead_digi_never_present"); + SetupEtaPhiHists(DigiPresentByDepth, + "Digi Present At Least Once",""); + // 1D plots count number of bad cells + NumberOfNeverPresentDigis=m_dbe->bookProfile("Problem_NeverPresentDigis_HCAL_vs_LS", + "Total Number of Never-Present Hcal Cells vs LS;Lumi Section;Dead Cells", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - NumberOfNeverPresentDigisHB=m_dbe->bookProfile("Problem_NeverPresentDigis_HB_vs_LS", - "Total Number of Never-Present HB Cells vs LS;Lumi Section;Dead Cells", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + NumberOfNeverPresentDigisHB=m_dbe->bookProfile("Problem_NeverPresentDigis_HB_vs_LS", + "Total Number of Never-Present HB Cells vs LS;Lumi Section;Dead Cells", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - NumberOfNeverPresentDigisHE=m_dbe->bookProfile("Problem_NeverPresentDigis_HE_vs_LS", - "Total Number of Never-Present HE Cells vs LS;Lumi Section;Dead Cells", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + NumberOfNeverPresentDigisHE=m_dbe->bookProfile("Problem_NeverPresentDigis_HE_vs_LS", + "Total Number of Never-Present HE Cells vs LS;Lumi Section;Dead Cells", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - NumberOfNeverPresentDigisHO=m_dbe->bookProfile("Problem_NeverPresentDigis_HO_vs_LS", - "Total Number of Never-Present HO Cells vs LS;Lumi Section;Dead Cells", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + NumberOfNeverPresentDigisHO=m_dbe->bookProfile("Problem_NeverPresentDigis_HO_vs_LS", + "Total Number of Never-Present HO Cells vs LS;Lumi Section;Dead Cells", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - NumberOfNeverPresentDigisHF=m_dbe->bookProfile("Problem_NeverPresentDigis_HF_vs_LS", - "Total Number of Never-Present HF Cells vs LS;Lumi Section;Dead Cells", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - (NumberOfNeverPresentDigis->getTProfile())->SetMarkerStyle(20); - (NumberOfNeverPresentDigisHB->getTProfile())->SetMarkerStyle(20); - (NumberOfNeverPresentDigisHE->getTProfile())->SetMarkerStyle(20); - (NumberOfNeverPresentDigisHO->getTProfile())->SetMarkerStyle(20); - (NumberOfNeverPresentDigisHF->getTProfile())->SetMarkerStyle(20); + NumberOfNeverPresentDigisHF=m_dbe->bookProfile("Problem_NeverPresentDigis_HF_vs_LS", + "Total Number of Never-Present HF Cells vs LS;Lumi Section;Dead Cells", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + (NumberOfNeverPresentDigis->getTProfile())->SetMarkerStyle(20); + (NumberOfNeverPresentDigisHB->getTProfile())->SetMarkerStyle(20); + (NumberOfNeverPresentDigisHE->getTProfile())->SetMarkerStyle(20); + (NumberOfNeverPresentDigisHO->getTProfile())->SetMarkerStyle(20); + (NumberOfNeverPresentDigisHF->getTProfile())->SetMarkerStyle(20); - for (unsigned int depth=0;depthReset(); + for (unsigned int depth=0;depthReset(); - FillUnphysicalHEHFBins(DigiPresentByDepth); + FillUnphysicalHEHFBins(DigiPresentByDepth); - if (deadmon_test_digis_) - { - m_dbe->setCurrentFolder(baseFolder_+"/dead_digi_often_missing"); - //units<<"("<setTitle(name.str().c_str()); - - name.str(""); - name<<"HB HE HF Depth 2 Dead Cells with No Digis for 1 Full Luminosity Block"; - RecentMissingDigisByDepth.depth[1]->setTitle(name.str().c_str()); - - name.str(""); - name<<"HE Depth 3 Dead Cells with No Digis for 1 Full Luminosity Block"; - RecentMissingDigisByDepth.depth[2]->setTitle(name.str().c_str()); - - name.str(""); - name<<"HO Depth 4 Dead Cells with No Digis for 1 Full Luminosity Block"; - RecentMissingDigisByDepth.depth[3]->setTitle(name.str().c_str()); - name.str(""); - - // 1D plots count number of bad cells - name<<"Total Number of Hcal Digis Unoccupied for 1 Full Luminosity Block"; - NumberOfRecentMissingDigis=m_dbe->bookProfile("Problem_RecentMissingDigis_HCAL_vs_LS", - name.str(), - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - name.str(""); - name<<"Total Number of HB Digis Unoccupied for 1 Full LS vs LS;Lumi Section; Dead Cells"; - NumberOfRecentMissingDigisHB=m_dbe->bookProfile("Problem_RecentMissingDigis_HB_vs_LS", - name.str(), - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - name.str(""); - name<<"Total Number of HE Digis Unoccupied for 1 Full LS vs LS;Lumi Section; Dead Cells"; - NumberOfRecentMissingDigisHE=m_dbe->bookProfile("Problem_RecentMissingDigis_HE_vs_LS", - name.str(), - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - name.str(""); - name<<"Total Number of HO Digis Unoccupied for 1 Full LS vs LS;Lumi Section; Dead Cells"; - NumberOfRecentMissingDigisHO=m_dbe->bookProfile("Problem_RecentMissingDigis_HO_vs_LS", - name.str(), - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - name.str(""); - name<<"Total Number of HF Digis Unoccupied for 1 Full LS vs LS;Lumi Section; Dead Cells"; - NumberOfRecentMissingDigisHF=m_dbe->bookProfile("Problem_RecentMissingDigis_HF_vs_LS", - name.str(), - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - (NumberOfRecentMissingDigis->getTProfile())->SetMarkerStyle(20); - (NumberOfRecentMissingDigisHB->getTProfile())->SetMarkerStyle(20); - (NumberOfRecentMissingDigisHE->getTProfile())->SetMarkerStyle(20); - (NumberOfRecentMissingDigisHO->getTProfile())->SetMarkerStyle(20); - (NumberOfRecentMissingDigisHF->getTProfile())->SetMarkerStyle(20); + if (deadmon_test_digis_) + { + m_dbe->setCurrentFolder(baseFolder_+"/dead_digi_often_missing"); + //units<<"("<setTitle(name.str().c_str()); + + name.str(""); + name<<"HB HE HF Depth 2 Dead Cells with No Digis for 1 Full Luminosity Block"; + RecentMissingDigisByDepth.depth[1]->setTitle(name.str().c_str()); + + name.str(""); + name<<"HE Depth 3 Dead Cells with No Digis for 1 Full Luminosity Block"; + RecentMissingDigisByDepth.depth[2]->setTitle(name.str().c_str()); + + name.str(""); + name<<"HO Depth 4 Dead Cells with No Digis for 1 Full Luminosity Block"; + RecentMissingDigisByDepth.depth[3]->setTitle(name.str().c_str()); + name.str(""); - } + // 1D plots count number of bad cells + name<<"Total Number of Hcal Digis Unoccupied for 1 Full Luminosity Block"; + NumberOfRecentMissingDigis=m_dbe->bookProfile("Problem_RecentMissingDigis_HCAL_vs_LS", + name.str(), + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + name.str(""); + name<<"Total Number of HB Digis Unoccupied for 1 Full LS vs LS;Lumi Section; Dead Cells"; + NumberOfRecentMissingDigisHB=m_dbe->bookProfile("Problem_RecentMissingDigis_HB_vs_LS", + name.str(), + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + name.str(""); + name<<"Total Number of HE Digis Unoccupied for 1 Full LS vs LS;Lumi Section; Dead Cells"; + NumberOfRecentMissingDigisHE=m_dbe->bookProfile("Problem_RecentMissingDigis_HE_vs_LS", + name.str(), + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + name.str(""); + name<<"Total Number of HO Digis Unoccupied for 1 Full LS vs LS;Lumi Section; Dead Cells"; + NumberOfRecentMissingDigisHO=m_dbe->bookProfile("Problem_RecentMissingDigis_HO_vs_LS", + name.str(), + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + name.str(""); + name<<"Total Number of HF Digis Unoccupied for 1 Full LS vs LS;Lumi Section; Dead Cells"; + NumberOfRecentMissingDigisHF=m_dbe->bookProfile("Problem_RecentMissingDigis_HF_vs_LS", + name.str(), + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + (NumberOfRecentMissingDigis->getTProfile())->SetMarkerStyle(20); + (NumberOfRecentMissingDigisHB->getTProfile())->SetMarkerStyle(20); + (NumberOfRecentMissingDigisHE->getTProfile())->SetMarkerStyle(20); + (NumberOfRecentMissingDigisHO->getTProfile())->SetMarkerStyle(20); + (NumberOfRecentMissingDigisHF->getTProfile())->SetMarkerStyle(20); + + } - if (deadmon_test_rechits_) - { - // test 1: energy never above threshold - m_dbe->setCurrentFolder(baseFolder_+"/dead_rechit_neverpresent"); - SetupEtaPhiHists(RecHitPresentByDepth,"RecHit Above Threshold At Least Once",""); - // set more descriptive titles for threshold plots - units.str(""); - units<<"Cells Above Energy Threshold At Least Once: Depth 1 -- HB >="<= "<="<setTitle(units.str().c_str()); - units.str(""); - units<<"Cells Above Energy Threshold At Least Once: Depth 2 -- HB >="<= "<="<setTitle(units.str().c_str()); - units.str(""); - units<<"Cells Above Energy Threshold At Least Once: Depth 3 -- HE >="<setTitle(units.str().c_str()); - units.str(""); - units<<"Cells Above Energy Threshold At Least Once: Depth 4 -- HO >="<setTitle(units.str().c_str()); - units.str(""); - - // 1D plots count number of bad cells - NumberOfNeverPresentRecHits=m_dbe->bookProfile("Problem_RecHitsNeverPresent_HCAL_vs_LS", - "Total Number of Hcal Rechits with Low Energy;Lumi Section;Dead Cells", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - name.str(""); - name<<"Total Number of HB RecHits with Energy Never >= "<bookProfile("Problem_RecHitsNeverPresent_HB_vs_LS", - name.str(), - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - name.str(""); - name<<"Total Number of HE RecHits with Energy Never >= "<bookProfile("Problem_RecHitsNeverPresent_HE_vs_LS", - name.str(), - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - name.str(""); - name<<"Total Number of HO RecHits with Energy Never >= "<bookProfile("Problem_RecHitsNeverPresent_HO_vs_LS", - name.str(), - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - name.str(""); - name<<"Total Number of HF RecHits with Energy Never >= "<bookProfile("Problem_RecHitsNeverPresent_HF_vs_LS", - name.str(), - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - (NumberOfNeverPresentRecHits->getTProfile())->SetMarkerStyle(20); - (NumberOfNeverPresentRecHitsHB->getTProfile())->SetMarkerStyle(20); - (NumberOfNeverPresentRecHitsHE->getTProfile())->SetMarkerStyle(20); - (NumberOfNeverPresentRecHitsHO->getTProfile())->SetMarkerStyle(20); - (NumberOfNeverPresentRecHitsHF->getTProfile())->SetMarkerStyle(20); + if (deadmon_test_rechits_) + { + // test 1: energy never above threshold + m_dbe->setCurrentFolder(baseFolder_+"/dead_rechit_neverpresent"); + SetupEtaPhiHists(RecHitPresentByDepth,"RecHit Above Threshold At Least Once",""); + // set more descriptive titles for threshold plots + units.str(""); + units<<"Cells Above Energy Threshold At Least Once: Depth 1 -- HB >="<= "<="<setTitle(units.str().c_str()); + units.str(""); + units<<"Cells Above Energy Threshold At Least Once: Depth 2 -- HB >="<= "<="<setTitle(units.str().c_str()); + units.str(""); + units<<"Cells Above Energy Threshold At Least Once: Depth 3 -- HE >="<setTitle(units.str().c_str()); + units.str(""); + units<<"Cells Above Energy Threshold At Least Once: Depth 4 -- HO >="<setTitle(units.str().c_str()); + units.str(""); + + // 1D plots count number of bad cells + NumberOfNeverPresentRecHits=m_dbe->bookProfile("Problem_RecHitsNeverPresent_HCAL_vs_LS", + "Total Number of Hcal Rechits with Low Energy;Lumi Section;Dead Cells", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + name.str(""); + name<<"Total Number of HB RecHits with Energy Never >= "<bookProfile("Problem_RecHitsNeverPresent_HB_vs_LS", + name.str(), + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + name.str(""); + name<<"Total Number of HE RecHits with Energy Never >= "<bookProfile("Problem_RecHitsNeverPresent_HE_vs_LS", + name.str(), + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + name.str(""); + name<<"Total Number of HO RecHits with Energy Never >= "<bookProfile("Problem_RecHitsNeverPresent_HO_vs_LS", + name.str(), + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + name.str(""); + name<<"Total Number of HF RecHits with Energy Never >= "<bookProfile("Problem_RecHitsNeverPresent_HF_vs_LS", + name.str(), + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + (NumberOfNeverPresentRecHits->getTProfile())->SetMarkerStyle(20); + (NumberOfNeverPresentRecHitsHB->getTProfile())->SetMarkerStyle(20); + (NumberOfNeverPresentRecHitsHE->getTProfile())->SetMarkerStyle(20); + (NumberOfNeverPresentRecHitsHO->getTProfile())->SetMarkerStyle(20); + (NumberOfNeverPresentRecHitsHF->getTProfile())->SetMarkerStyle(20); - m_dbe->setCurrentFolder(baseFolder_+"/dead_rechit_often_missing"); - SetupEtaPhiHists(RecentMissingRecHitsByDepth,"RecHits Failing Energy Threshold Test",""); - // set more descriptive titles for threshold plots - units.str(""); - units<<"RecHits with Consistent Low Energy Depth 1 -- HB <"<setTitle(units.str().c_str()); - units.str(""); - units<<"RecHits with Consistent Low Energy Depth 2 -- HB <"<setTitle(units.str().c_str()); - units.str(""); - units<<"RecHits with Consistent Low Energy Depth 3 -- HE <"<setTitle(units.str().c_str()); - units.str(""); - units<<"RecHits with Consistent Low Energy Depth 4 -- HO <"<setTitle(units.str().c_str()); - units.str(""); - - - // 1D plots count number of bad cells - name<<"Total Number of Hcal RecHits with Consistent Low Energy;Lumi Section;Dead Cells"; - NumberOfRecentMissingRecHits=m_dbe->bookProfile("Problem_BelowEnergyRecHits_HCAL_vs_LS", + m_dbe->setCurrentFolder(baseFolder_+"/dead_rechit_often_missing"); + SetupEtaPhiHists(RecentMissingRecHitsByDepth,"RecHits Failing Energy Threshold Test",""); + // set more descriptive titles for threshold plots + units.str(""); + units<<"RecHits with Consistent Low Energy Depth 1 -- HB <"<setTitle(units.str().c_str()); + units.str(""); + units<<"RecHits with Consistent Low Energy Depth 2 -- HB <"<setTitle(units.str().c_str()); + units.str(""); + units<<"RecHits with Consistent Low Energy Depth 3 -- HE <"<setTitle(units.str().c_str()); + units.str(""); + units<<"RecHits with Consistent Low Energy Depth 4 -- HO <"<setTitle(units.str().c_str()); + units.str(""); + + + // 1D plots count number of bad cells + name<<"Total Number of Hcal RecHits with Consistent Low Energy;Lumi Section;Dead Cells"; + NumberOfRecentMissingRecHits=m_dbe->bookProfile("Problem_BelowEnergyRecHits_HCAL_vs_LS", name.str(), Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - name.str(""); - name<<"Total Number of HB RecHits with Consistent Low Energy < "<bookProfile("Problem_BelowEnergyRecHits_HB_vs_LS", + name.str(""); + name<<"Total Number of HB RecHits with Consistent Low Energy < "<bookProfile("Problem_BelowEnergyRecHits_HB_vs_LS", name.str(), Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - name.str(""); - name<<"Total Number of HE RecHits with Consistent Low Energy < "<bookProfile("Problem_BelowEnergyRecHits_HE_vs_LS", + name.str(""); + name<<"Total Number of HE RecHits with Consistent Low Energy < "<bookProfile("Problem_BelowEnergyRecHits_HE_vs_LS", name.str(), Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - name.str(""); - name<<"Total Number of HO RecHits with Consistent Low Energy < "<bookProfile("Problem_BelowEnergyRecHits_HO_vs_LS", + name.str(""); + name<<"Total Number of HO RecHits with Consistent Low Energy < "<bookProfile("Problem_BelowEnergyRecHits_HO_vs_LS", name.str(), Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - name.str(""); - name<<"Total Number of HF RecHits with Consistent Low Energy < "<bookProfile("Problem_BelowEnergyRecHits_HF_vs_LS", + name.str(""); + name<<"Total Number of HF RecHits with Consistent Low Energy < "<bookProfile("Problem_BelowEnergyRecHits_HF_vs_LS", name.str(), Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - (NumberOfRecentMissingRecHits->getTProfile())->SetMarkerStyle(20); - (NumberOfRecentMissingRecHitsHB->getTProfile())->SetMarkerStyle(20); - (NumberOfRecentMissingRecHitsHE->getTProfile())->SetMarkerStyle(20); - (NumberOfRecentMissingRecHitsHO->getTProfile())->SetMarkerStyle(20); - (NumberOfRecentMissingRecHitsHF->getTProfile())->SetMarkerStyle(20); - - } + (NumberOfRecentMissingRecHits->getTProfile())->SetMarkerStyle(20); + (NumberOfRecentMissingRecHitsHB->getTProfile())->SetMarkerStyle(20); + (NumberOfRecentMissingRecHitsHE->getTProfile())->SetMarkerStyle(20); + (NumberOfRecentMissingRecHitsHO->getTProfile())->SetMarkerStyle(20); + (NumberOfRecentMissingRecHitsHF->getTProfile())->SetMarkerStyle(20); - } // if (m_dbe) + } // if (deadmon_test_rechits) + if (showTiming) + { + cpu_timer.stop(); std::cout <<"TIMER:: HcalDeadCellMonitor BEGINRUN -> "<setCurrentFolder(baseFolder_); m_dbe->removeContents(); + if(m_dbe->dirExists("Collector")) + m_dbe->rmdir(""); } return; } // void HcalDeadCellMonitor::clearME() @@ -350,11 +369,30 @@ void HcalDeadCellMonitor::processEvent(const HBHERecHitCollection& hbHits, //const ZDCRecHitCollection& zdcHits, const HBHEDigiCollection& hbhedigi, const HODigiCollection& hodigi, - const HFDigiCollection& hfdigi - //const ZDCDigiCollection& zdcdigi + const HFDigiCollection& hfdigi, + int CalibType ) { + // Check that event is of proper calibration type + bool processevent=false; + if (AllowedCalibTypes_.size()==0) + processevent=true; + else + { + for (unsigned int i=0;i1) std::cout <<" calibType = "<0) { - std::cout <<"DEAD CELL; NO OCCUPANCY: subdet = "<Fill(ieta+zside,iphi,levt_); @@ -897,11 +933,6 @@ void HcalDeadCellMonitor::fillNevents_problemCells() else if (subdet==HcalEndcap) ++energyneverpresentHE; else if (subdet==HcalOuter) ++energyneverpresentHO; else if (subdet==HcalForward) ++energyneverpresentHF; - if (subdet==HcalForward) - { - cout <<"SHITHEAD! eta = "< >("DigiMonitor_AllowedCalibTypes",AllowedCalibTypes_); - /******* Set up all histograms ********/ - - if (m_dbe) + if (showTiming) { - ostringstream name; - m_dbe->setCurrentFolder(baseFolder_); - meEVT_ = m_dbe->bookInt("Digi Task Event Number"); - meEVT_->Fill(ievt_); - meTOTALEVT_ = m_dbe->bookInt("Digi Task Total Events Processed"); - meTOTALEVT_->Fill(tevt_); - - MonitorElement* ExpectedOrbit = m_dbe->bookInt("ExpectedOrbitMessageTime"); - ExpectedOrbit->Fill(DigiMonitor_ExpectedOrbitMessageTime_); - - MonitorElement* occT = m_dbe->bookInt("DigiOccThresh"); - occT->Fill(occThresh_); - MonitorElement* shapeT = m_dbe->bookInt("DigiShapeThresh"); - shapeT->Fill(shapeThresh_); - - m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/bad_digi_occupancy"); - SetupEtaPhiHists(DigiErrorsByDepth,"Bad Digi Map",""); - m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/1D_digi_plots"); - ProblemsVsLB=m_dbe->bookProfile("BadDigisVsLB","# Bad Digis vs Luminosity block;Lumi block;# of Bad digis", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,0,10000); - ProblemsVsLB_HB=m_dbe->bookProfile("HB Bad Quality Digis vs LB","HB Bad Quality Digis vs Luminosity Block", - Nlumiblocks_,0.5,Nlumiblocks_+0.5, - 0,10000); - ProblemsVsLB_HE=m_dbe->bookProfile("HE Bad Quality Digis vs LB","HE Bad Quality Digis vs Luminosity Block", - Nlumiblocks_,0.5,Nlumiblocks_+0.5, - 0,10000); - ProblemsVsLB_HO=m_dbe->bookProfile("HO Bad Quality Digis vs LB","HO Bad Quality Digis vs Luminosity Block", - Nlumiblocks_,0.5,Nlumiblocks_+0.5, - 0,10000); - ProblemsVsLB_HF=m_dbe->bookProfile("HF Bad Quality Digis vs LB","HF Bad Quality Digis vs Luminosity Block", - Nlumiblocks_,0.5,Nlumiblocks_+0.5, - 0,10000); - - - if (makeDiagnostics) - { - m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/badcapID"); - SetupEtaPhiHists(DigiErrorsBadCapID," Digis with Bad Cap ID Rotation", ""); - m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/data_invalid_error"); - SetupEtaPhiHists(DigiErrorsDVErr," Digis with Data Invalid or Error Bit Set", ""); - } + cpu_timer.stop(); std::cout <<"TIMER:: HcalDigiMonitor SETUP -> "<setCurrentFolder(baseFolder_+"/bad_digis/bad_reportUnpackerErrors"); - SetupEtaPhiHists(DigiErrorsUnpacker," Bad Unpacker Digis", ""); + return; +} // void HcalDigiMonitor::setup(...) - m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/baddigisize"); - SetupEtaPhiHists(DigiErrorsBadDigiSize," Digis with Bad Size", ""); +void HcalDigiMonitor::beginRun() +{ + HcalBaseMonitor::beginRun(); + zeroCounters(); - m_dbe->setCurrentFolder(baseFolder_+"/digi_info"); - DigiSize = m_dbe->book2D("Digi Size", "Digi Size",4,0,4,20,-0.5,19.5); - DigiSize->setBinLabel(1,"HB",1); - DigiSize->setBinLabel(2,"HE",1); - DigiSize->setBinLabel(3,"HO",1); - DigiSize->setBinLabel(4,"HF",1); - DigiSize->setAxisTitle("Subdetector",1); - DigiSize->setAxisTitle("Digi Size",2); + if (!m_dbe) return; - m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/badfibBCNoff"); - SetupEtaPhiHists(DigiErrorsBadFibBCNOff," Digis with non-zero Fiber Orbit Msg Idle BCN Offsets", ""); + if (showTiming) + { + cpu_timer.reset(); cpu_timer.start(); + } - m_dbe->setCurrentFolder(baseFolder_+"/good_digis/1D_digi_plots"); - HBocc_vs_LB=m_dbe->bookProfile("HBoccVsLB","HB digi occupancy vs Luminosity Block;Lumi block;# of Good digis", + /******* Set up all histograms ********/ + if (fVerbosity>1) + std::cout <<" Setting up histograms"<setCurrentFolder(baseFolder_); + meEVT_ = m_dbe->bookInt("Digi Task Event Number"); + meEVT_->Fill(ievt_); + meTOTALEVT_ = m_dbe->bookInt("Digi Task Total Events Processed"); + meTOTALEVT_->Fill(tevt_); + + MonitorElement* ExpectedOrbit = m_dbe->bookInt("ExpectedOrbitMessageTime"); + ExpectedOrbit->Fill(DigiMonitor_ExpectedOrbitMessageTime_); + + MonitorElement* occT = m_dbe->bookInt("DigiOccThresh"); + occT->Fill(occThresh_); + MonitorElement* shapeT = m_dbe->bookInt("DigiShapeThresh"); + shapeT->Fill(shapeThresh_); + + m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/bad_digi_occupancy"); + SetupEtaPhiHists(DigiErrorsByDepth,"Bad Digi Map",""); + m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/1D_digi_plots"); + ProblemsVsLB=m_dbe->bookProfile("BadDigisVsLB","# Bad Digis vs Luminosity block;Lumi block;# of Bad digis", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,0,10000); + ProblemsVsLB_HB=m_dbe->bookProfile("HB Bad Quality Digis vs LB","HB Bad Quality Digis vs Luminosity Block", Nlumiblocks_,0.5,Nlumiblocks_+0.5, - 0,2600); - HEocc_vs_LB=m_dbe->bookProfile("HEoccVsLB","HE digi occupancy vs Luminosity Block;Lumi block;# of Good digis", + 0,10000); + ProblemsVsLB_HE=m_dbe->bookProfile("HE Bad Quality Digis vs LB","HE Bad Quality Digis vs Luminosity Block", Nlumiblocks_,0.5,Nlumiblocks_+0.5, - 0,2600); - HOocc_vs_LB=m_dbe->bookProfile("HOoccVsLB","HO digi occupancy vs Luminosity Block;Lumi block;# of Good digis", + 0,10000); + ProblemsVsLB_HO=m_dbe->bookProfile("HO Bad Quality Digis vs LB","HO Bad Quality Digis vs Luminosity Block", Nlumiblocks_,0.5,Nlumiblocks_+0.5, - 0,2200); - HFocc_vs_LB=m_dbe->bookProfile("HFoccVsLB","HF digi occupancy vs Luminosity Block;Lumi block;# of Good digis", + 0,10000); + ProblemsVsLB_HF=m_dbe->bookProfile("HF Bad Quality Digis vs LB","HF Bad Quality Digis vs Luminosity Block", Nlumiblocks_,0.5,Nlumiblocks_+0.5, - 0,1800); - - m_dbe->setCurrentFolder(baseFolder_+"/good_digis/digi_occupancy"); - SetupEtaPhiHists(DigiOccupancyByDepth," Digi Eta-Phi Occupancy Map",""); - DigiOccupancyPhi= m_dbe->book1D("Digi Phi Occupancy Map", - "Digi Phi Occupancy Map;i#phi;# of Events", - 72,0.5,72.5); - DigiOccupancyEta= m_dbe->book1D("Digi Eta Occupancy Map", - "Digi Eta Occupancy Map;i#eta;# of Events", - 83,-41.5,41.5); - DigiOccupancyVME = m_dbe->book2D("Digi VME Occupancy Map", - "Digi VME Occupancy Map;HTR Slot;VME Crate Id", - 40,-0.25,19.75,18,-0.5,17.5); - - DigiOccupancySpigot = m_dbe->book2D("Digi Spigot Occupancy Map", - "Digi Spigot Occupancy Map;Spigot;DCC Id", - HcalDCCHeader::SPIGOT_COUNT,-0.5,HcalDCCHeader::SPIGOT_COUNT-0.5, - 36,-0.5,35.5); - - m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/bad_digi_occupancy"); - - DigiErrorVME = m_dbe->book2D("Digi VME Error Map", - "Digi VME Error Map", - 40,-0.25,19.75,18,-0.5,17.5); - DigiErrorVME -> setAxisTitle("HTR Slot",1); - DigiErrorVME -> setAxisTitle("VME Crate Id",2); - - DigiErrorSpigot = m_dbe->book2D("Digi Spigot Error Map", + 0,10000); + + + if (makeDiagnostics) + { + m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/badcapID"); + SetupEtaPhiHists(DigiErrorsBadCapID," Digis with Bad Cap ID Rotation", ""); + m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/data_invalid_error"); + SetupEtaPhiHists(DigiErrorsDVErr," Digis with Data Invalid or Error Bit Set", ""); + } + + m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/bad_reportUnpackerErrors"); + SetupEtaPhiHists(DigiErrorsUnpacker," Bad Unpacker Digis", ""); + + m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/baddigisize"); + SetupEtaPhiHists(DigiErrorsBadDigiSize," Digis with Bad Size", ""); + + m_dbe->setCurrentFolder(baseFolder_+"/digi_info"); + DigiSize = m_dbe->book2D("Digi Size", "Digi Size",4,0,4,20,-0.5,19.5); + DigiSize->setBinLabel(1,"HB",1); + DigiSize->setBinLabel(2,"HE",1); + DigiSize->setBinLabel(3,"HO",1); + DigiSize->setBinLabel(4,"HF",1); + DigiSize->setAxisTitle("Subdetector",1); + DigiSize->setAxisTitle("Digi Size",2); + + m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/badfibBCNoff"); + SetupEtaPhiHists(DigiErrorsBadFibBCNOff," Digis with non-zero Fiber Orbit Msg Idle BCN Offsets", ""); + + m_dbe->setCurrentFolder(baseFolder_+"/good_digis/1D_digi_plots"); + HBocc_vs_LB=m_dbe->bookProfile("HBoccVsLB","HB digi occupancy vs Luminosity Block;Lumi block;# of Good digis", + Nlumiblocks_,0.5,Nlumiblocks_+0.5, + 0,2600); + HEocc_vs_LB=m_dbe->bookProfile("HEoccVsLB","HE digi occupancy vs Luminosity Block;Lumi block;# of Good digis", + Nlumiblocks_,0.5,Nlumiblocks_+0.5, + 0,2600); + HOocc_vs_LB=m_dbe->bookProfile("HOoccVsLB","HO digi occupancy vs Luminosity Block;Lumi block;# of Good digis", + Nlumiblocks_,0.5,Nlumiblocks_+0.5, + 0,2200); + HFocc_vs_LB=m_dbe->bookProfile("HFoccVsLB","HF digi occupancy vs Luminosity Block;Lumi block;# of Good digis", + Nlumiblocks_,0.5,Nlumiblocks_+0.5, + 0,1800); + + m_dbe->setCurrentFolder(baseFolder_+"/good_digis/digi_occupancy"); + SetupEtaPhiHists(DigiOccupancyByDepth," Digi Eta-Phi Occupancy Map",""); + DigiOccupancyPhi= m_dbe->book1D("Digi Phi Occupancy Map", + "Digi Phi Occupancy Map;i#phi;# of Events", + 72,0.5,72.5); + DigiOccupancyEta= m_dbe->book1D("Digi Eta Occupancy Map", + "Digi Eta Occupancy Map;i#eta;# of Events", + 83,-41.5,41.5); + DigiOccupancyVME = m_dbe->book2D("Digi VME Occupancy Map", + "Digi VME Occupancy Map;HTR Slot;VME Crate Id", + 40,-0.25,19.75,18,-0.5,17.5); + + DigiOccupancySpigot = m_dbe->book2D("Digi Spigot Occupancy Map", + "Digi Spigot Occupancy Map;Spigot;DCC Id", + HcalDCCHeader::SPIGOT_COUNT,-0.5,HcalDCCHeader::SPIGOT_COUNT-0.5, + 36,-0.5,35.5); + + m_dbe->setCurrentFolder(baseFolder_+"/bad_digis/bad_digi_occupancy"); + + DigiErrorVME = m_dbe->book2D("Digi VME Error Map", + "Digi VME Error Map", + 40,-0.25,19.75,18,-0.5,17.5); + DigiErrorVME -> setAxisTitle("HTR Slot",1); + DigiErrorVME -> setAxisTitle("VME Crate Id",2); + + DigiErrorSpigot = m_dbe->book2D("Digi Spigot Error Map", "Digi Spigot Error Map", HcalDCCHeader::SPIGOT_COUNT,-0.5,HcalDCCHeader::SPIGOT_COUNT-0.5, 36,-0.5,35.5); - DigiErrorSpigot -> setAxisTitle("Spigot",1); - DigiErrorSpigot -> setAxisTitle("DCC Id",2); - - - m_dbe->setCurrentFolder(baseFolder_+"/bad_digis"); - - DigiBQ = m_dbe->book1D("# Bad Qual Digis","# Bad Qual Digis within Digi Collection",148, bins_cellcount); - // Can't set until histogram drawn? - //(DigiBQ->getTH1F())->LabelsOption("v"); - DigiBQFrac = m_dbe->book1D("Bad Digi Fraction","Bad Digi Fraction", - 1118, bins_fraccount); - //DIGI_BQ_FRAC_NBINS,(0-0.5/(DIGI_BQ_FRAC_NBINS-1)),1+0.5/(DIGI_BQ_FRAC_NBINS-1)); - DigiBQFrac -> setAxisTitle("Bad Quality Digi Fraction for digis in Digi Collection",1); - DigiBQFrac -> setAxisTitle("# of Events",2); - - DigiUnpackerErrorCount = m_dbe->book1D("Unpacker Error Count", "Number of Bad Digis from Unpacker; Bad Unpacker Digis; # of Events",148, bins_cellcount); - DigiUnpackerErrorFrac = m_dbe->book1D("Unpacker Bad Digi Fraction", - "Bad Digis From Unpacker/ (Bad Digis From Unpacker + Good Digis); Bad Unpacker Fraction; # of Events", - 1118,bins_fraccount); - - m_dbe->setCurrentFolder(baseFolder_+"/good_digis/"); - DigiNum = m_dbe->book1D("# of Good Digis","# of Digis",DIGI_NUM+1,-0.5,DIGI_NUM+1-0.5); - DigiNum -> setAxisTitle("# of Good Digis",1); - DigiNum -> setAxisTitle("# of Events",2); - // Can't set until histogram drawn? - //(DigiNum->getTH1F())->LabelsOption("v"); - - setupSubdetHists(hbHists,"HB"); - setupSubdetHists(heHists,"HE"); - setupSubdetHists(hoHists,"HO"); - setupSubdetHists(hfHists,"HF"); - - } // if (m_dbe) // ends histogram setup + DigiErrorSpigot -> setAxisTitle("Spigot",1); + DigiErrorSpigot -> setAxisTitle("DCC Id",2); + + + m_dbe->setCurrentFolder(baseFolder_+"/bad_digis"); + + DigiBQ = m_dbe->book1D("# Bad Qual Digis","# Bad Qual Digis within Digi Collection",148, bins_cellcount); + // Can't set until histogram drawn? + //(DigiBQ->getTH1F())->LabelsOption("v"); + DigiBQFrac = m_dbe->book1D("Bad Digi Fraction","Bad Digi Fraction", + 1118, bins_fraccount); + //DIGI_BQ_FRAC_NBINS,(0-0.5/(DIGI_BQ_FRAC_NBINS-1)),1+0.5/(DIGI_BQ_FRAC_NBINS-1)); + DigiBQFrac -> setAxisTitle("Bad Quality Digi Fraction for digis in Digi Collection",1); + DigiBQFrac -> setAxisTitle("# of Events",2); + + DigiUnpackerErrorCount = m_dbe->book1D("Unpacker Error Count", "Number of Bad Digis from Unpacker; Bad Unpacker Digis; # of Events",148, bins_cellcount); + DigiUnpackerErrorFrac = m_dbe->book1D("Unpacker Bad Digi Fraction", + "Bad Digis From Unpacker/ (Bad Digis From Unpacker + Good Digis); Bad Unpacker Fraction; # of Events", + 1118,bins_fraccount); + + m_dbe->setCurrentFolder(baseFolder_+"/good_digis/"); + DigiNum = m_dbe->book1D("# of Good Digis","# of Digis",DIGI_NUM+1,-0.5,DIGI_NUM+1-0.5); + DigiNum -> setAxisTitle("# of Good Digis",1); + DigiNum -> setAxisTitle("# of Events",2); + + setupSubdetHists(hbHists,"HB"); + setupSubdetHists(heHists,"HE"); + setupSubdetHists(hoHists,"HO"); + setupSubdetHists(hfHists,"HF"); + if (showTiming) { - cpu_timer.stop(); std::cout <<"TIMER:: HcalDigiMonitor Setup -> "< "<1) std::cout <<" calibType = "< DetIdVector; diff --git a/trunk/DQM/HcalMonitorTasks/src/HcalHotCellMonitor.cc b/trunk/DQM/HcalMonitorTasks/src/HcalHotCellMonitor.cc index 974d679350863..7c9092fa50a5b 100644 --- a/trunk/DQM/HcalMonitorTasks/src/HcalHotCellMonitor.cc +++ b/trunk/DQM/HcalMonitorTasks/src/HcalHotCellMonitor.cc @@ -1,7 +1,6 @@ #include "DQM/HcalMonitorTasks/interface/HcalHotCellMonitor.h" #define OUT if(fverbosity_)std::cout -#define BITSHIFT 6 using namespace std; @@ -41,12 +40,12 @@ void HcalHotCellMonitor::setup(const edm::ParameterSet& ps, if (fVerbosity>1) std::cout <<" Getting variable values from cfg files"< >("HotCellMonitor_AllowedCalibTypes",AllowedCalibTypes_); + // hotmon_makeDiagnostics_ will take on base task value unless otherwise specified hotmon_makeDiagnostics_ = ps.getUntrackedParameter("HotCellMonitor_makeDiagnosticPlots",makeDiagnostics); - - // Set checkNevents values - hotmon_checkNevents_ = ps.getUntrackedParameter("HotCellMonitor_checkNevents",checkNevents_); - + hotmon_minEvents_ = ps.getUntrackedParameter("HotCellMonitor_minEvents",500); + // Set which hot cell checks will be performed hotmon_test_persistent_ = ps.getUntrackedParameter("HotCellMonitor_test_persistent",true); hotmon_test_neighbor_ = ps.getUntrackedParameter("HotCellMonitor_test_neighbor",false); // deprecated right now @@ -89,131 +88,144 @@ void HcalHotCellMonitor::setup(const edm::ParameterSet& ps, setupNeighborParams(ps,ZDCNeighborParams_,"ZDC"); HFNeighborParams_.DeltaIphi*=2; // HF cell segmentation is 10 degrees, not 5 (mostly). Need to multiply by 2 to convert from cell range to degree format + if (showTiming) + { + cpu_timer.stop(); std::cout <<"TIMER:: HcalHotCellMonitor SETUP -> "<1) + std::cout <<" Setting up histograms"<setCurrentFolder(baseFolder_); + meEVT_ = m_dbe->bookInt("Hot Cell Task Event Number"); + meEVT_->Fill(ievt_); + meTOTALEVT_ = m_dbe->bookInt("Hot Cell Task Total Events Processed"); + meTOTALEVT_->Fill(tevt_); + + // Create plots of problems vs LB + + + // 1D plots count number of bad cells vs. luminoisty block + ProblemsVsLB=m_dbe->bookProfile("TotalHotCells_HCAL_vs_LS", + "Total Number of Hot Hcal Cells vs lumi section", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + ProblemsVsLB_HB=m_dbe->bookProfile("TotalHotCells_HB_vs_LS", + "Total Number of Hot HB Cells vs lumi section", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + ProblemsVsLB_HE=m_dbe->bookProfile("TotalHotCells_HE_vs_LS", + "Total Number of Hot HE Cells vs lumi section", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + ProblemsVsLB_HO=m_dbe->bookProfile("TotalHotCells_HO_vs_LS", + "Total Number of Hot HO Cells vs lumi section", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + ProblemsVsLB_HF=m_dbe->bookProfile("TotalHotCells_HF_vs_LS", + "Total Number of Hot HF Cells vs lumi section", + Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); + + ProblemsVsLB->getTProfile()->SetMarkerStyle(20); + ProblemsVsLB_HB->getTProfile()->SetMarkerStyle(20); + ProblemsVsLB_HE->getTProfile()->SetMarkerStyle(20); + ProblemsVsLB_HO->getTProfile()->SetMarkerStyle(20); + ProblemsVsLB_HF->getTProfile()->SetMarkerStyle(20); + + // Set up plots for each failure mode of hot cells + stringstream units; // We'll need to set the titles individually, rather than passing units to SetupEtaPhiHists (since this also would affect the name of the histograms) - // Set up histograms - if (m_dbe) + if (hotmon_test_energy_) { - if (fVerbosity>1) - std::cout <<" Setting up histograms"<setCurrentFolder(baseFolder_+"/hot_rechit_above_threshold"); + SetupEtaPhiHists(AboveEnergyThresholdCellsByDepth, + "Hot Cells Above Energy Threshold",""); + //setMinMaxHists2D(AboveEnergyThresholdCellsByDepth,0.,1.); + + // set more descriptive titles for plots + units.str(""); + units<<"Hot Cells: Depth 1 -- HB > "< "< "<setTitle(units.str().c_str()); + units.str(""); + units<<"Hot Cells: Depth 2 -- HB > "< "< "<setTitle(units.str().c_str()); + units.str(""); + units<<"Hot Cells: Depth 3 -- HE > "<setTitle(units.str().c_str()); + units.str(""); + units<<"Hot Cells: HO > "<setTitle(units.str().c_str()); + units.str(""); + } - m_dbe->setCurrentFolder(baseFolder_); - meEVT_ = m_dbe->bookInt("Hot Cell Task Event Number"); - meEVT_->Fill(ievt_); - meTOTALEVT_ = m_dbe->bookInt("Hot Cell Task Total Events Processed"); - meTOTALEVT_->Fill(tevt_); - - // Create plots of problems vs LB - - - // 1D plots count number of bad cells vs. luminoisty block - ProblemsVsLB=m_dbe->bookProfile("TotalHotCells_HCAL_vs_LS", - "Total Number of Hot Hcal Cells vs lumi section", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - ProblemsVsLB_HB=m_dbe->bookProfile("TotalHotCells_HB_vs_LS", - "Total Number of Hot HB Cells vs lumi section", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - ProblemsVsLB_HE=m_dbe->bookProfile("TotalHotCells_HE_vs_LS", - "Total Number of Hot HE Cells vs lumi section", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - ProblemsVsLB_HO=m_dbe->bookProfile("TotalHotCells_HO_vs_LS", - "Total Number of Hot HO Cells vs lumi section", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - ProblemsVsLB_HF=m_dbe->bookProfile("TotalHotCells_HF_vs_LS", - "Total Number of Hot HF Cells vs lumi section", - Nlumiblocks_,0.5,Nlumiblocks_+0.5,100,0,10000); - - ProblemsVsLB->getTProfile()->SetMarkerStyle(20); - ProblemsVsLB_HB->getTProfile()->SetMarkerStyle(20); - ProblemsVsLB_HE->getTProfile()->SetMarkerStyle(20); - ProblemsVsLB_HO->getTProfile()->SetMarkerStyle(20); - ProblemsVsLB_HF->getTProfile()->SetMarkerStyle(20); - - // Set up plots for each failure mode of hot cells - stringstream units; // We'll need to set the titles individually, rather than passing units to SetupEtaPhiHists (since this also would affect the name of the histograms) - - if (hotmon_test_energy_) - { - m_dbe->setCurrentFolder(baseFolder_+"/hot_rechit_above_threshold"); - SetupEtaPhiHists(AboveEnergyThresholdCellsByDepth, - "Hot Cells Above Energy Threshold",""); - //setMinMaxHists2D(AboveEnergyThresholdCellsByDepth,0.,1.); + if (hotmon_test_persistent_) + { + m_dbe->setCurrentFolder(baseFolder_+"/hot_rechit_always_above_threshold"); + SetupEtaPhiHists(AbovePersistentThresholdCellsByDepth, + "Hot Cells Persistently Above Energy Threshold",""); + //setMinMaxHists2D(AbovePersistentThresholdCellsByDepth,0.,1.); - // set more descriptive titles for plots - units.str(""); - units<<"Hot Cells: Depth 1 -- HB > "< "< "<setTitle(units.str().c_str()); - units.str(""); - units<<"Hot Cells: Depth 2 -- HB > "< "< "<setTitle(units.str().c_str()); - units.str(""); - units<<"Hot Cells: Depth 3 -- HE > "<setTitle(units.str().c_str()); - units.str(""); - units<<"Hot Cells: HO > "<setTitle(units.str().c_str()); - units.str(""); - } + // set more descriptive titles for plots + units.str(""); + units<<"Hot Cells: Depth 1 -- HB > "< "< "<setTitle(units.str().c_str()); + units.str(""); + units<<"Hot Cells: Depth 2 -- HB > "< "< "<setTitle(units.str().c_str()); + units.str(""); + units<<"Hot Cells: Depth 3 -- HE > "<setTitle(units.str().c_str()); + units.str(""); + units<<"Hot Cells: HO > "<setTitle(units.str().c_str()); + units.str(""); + } - if (hotmon_test_persistent_) + if (hotmon_test_neighbor_) + { + m_dbe->setCurrentFolder(baseFolder_+"/hot_neighbortest"); + SetupEtaPhiHists(AboveNeighborsHotCellsByDepth,"Hot Cells Failing Neighbor Test",""); + //setMinMaxHists2D(AboveNeighborsHotCellsByDepth,0.,1.); + } + + // The 1D energy plots are already made in the rechit monitor. + // Energy vs Neighbor plots might be useful for trying to set up the neighbor-identification hot cell algorithm + if (hotmon_makeDiagnostics_) + { + if (hotmon_test_energy_ || hotmon_test_persistent_) { - m_dbe->setCurrentFolder(baseFolder_+"/hot_rechit_always_above_threshold"); - SetupEtaPhiHists(AbovePersistentThresholdCellsByDepth, - "Hot Cells Persistently Above Energy Threshold",""); - //setMinMaxHists2D(AbovePersistentThresholdCellsByDepth,0.,1.); - - // set more descriptive titles for plots - units.str(""); - units<<"Hot Cells: Depth 1 -- HB > "< "< "<setTitle(units.str().c_str()); - units.str(""); - units<<"Hot Cells: Depth 2 -- HB > "< "< "<setTitle(units.str().c_str()); - units.str(""); - units<<"Hot Cells: Depth 3 -- HE > "<setTitle(units.str().c_str()); - units.str(""); - units<<"Hot Cells: HO > "<setTitle(units.str().c_str()); - units.str(""); + m_dbe->setCurrentFolder(baseFolder_+"/diagnostics/rechitenergy"); + d_HBrechitenergy=m_dbe->book1D("HB_rechitenergy","HB rechit energy",1500,-10,140); + d_HErechitenergy=m_dbe->book1D("HE_rechitenergy","HE rechit energy",1500,-10,140); + d_HOrechitenergy=m_dbe->book1D("HO_rechitenergy","HO rechit energy",1500,-10,140); + d_HFrechitenergy=m_dbe->book1D("HF_rechitenergy","HF rechit energy",1500,-10,140); + SetupEtaPhiHists(d_avgrechitenergymap, + "Rec hit energy per cell",""); + SetupEtaPhiHists(d_avgrechitoccupancymap,"Rec hit occupancy per cell",""); } - if (hotmon_test_neighbor_) { - m_dbe->setCurrentFolder(baseFolder_+"/hot_neighbortest"); - SetupEtaPhiHists(AboveNeighborsHotCellsByDepth,"Hot Cells Failing Neighbor Test",""); - //setMinMaxHists2D(AboveNeighborsHotCellsByDepth,0.,1.); + m_dbe->setCurrentFolder(baseFolder_+"/diagnostics/neighborcells"); + d_HBenergyVsNeighbor=m_dbe->book2D("HB_energyVsNeighbor","HB #Sigma Neighbors vs. rec hit energy",100,-5,15,100,0,25); + d_HEenergyVsNeighbor=m_dbe->book2D("HE_energyVsNeighbor","HE #Sigma Neighbors vs. rec hit energy",100,-5,15,100,0,25); + d_HOenergyVsNeighbor=m_dbe->book2D("HO_energyVsNeighbor","HO #Sigma Neighbors vs. rec hit energy",100,-5,15,100,0,25); + d_HFenergyVsNeighbor=m_dbe->book2D("HF_energyVsNeighbor","HF #Sigma Neighbors vs. rec hit energy",100,-5,15,100,0,25); } + } // if (hotmon_makeDiagnostics_) - // The 1D energy plots are already made in the rechit monitor. - // Energy vs Neighbor plots might be useful for trying to set up the neighbor-identification hot cell algorithm - if (hotmon_makeDiagnostics_) - { - if (hotmon_test_energy_ || hotmon_test_persistent_) - { - m_dbe->setCurrentFolder(baseFolder_+"/diagnostics/rechitenergy"); - d_HBrechitenergy=m_dbe->book1D("HB_rechitenergy","HB rechit energy",1500,-10,140); - d_HErechitenergy=m_dbe->book1D("HE_rechitenergy","HE rechit energy",1500,-10,140); - d_HOrechitenergy=m_dbe->book1D("HO_rechitenergy","HO rechit energy",1500,-10,140); - d_HFrechitenergy=m_dbe->book1D("HF_rechitenergy","HF rechit energy",1500,-10,140); - SetupEtaPhiHists(d_avgrechitenergymap, - "Rec hit energy per cell",""); - SetupEtaPhiHists(d_avgrechitoccupancymap,"Rec hit occupancy per cell",""); - } - if (hotmon_test_neighbor_) - { - m_dbe->setCurrentFolder(baseFolder_+"/diagnostics/neighborcells"); - d_HBenergyVsNeighbor=m_dbe->book2D("HB_energyVsNeighbor","HB #Sigma Neighbors vs. rec hit energy",100,-5,15,100,0,25); - d_HEenergyVsNeighbor=m_dbe->book2D("HE_energyVsNeighbor","HE #Sigma Neighbors vs. rec hit energy",100,-5,15,100,0,25); - d_HOenergyVsNeighbor=m_dbe->book2D("HO_energyVsNeighbor","HO #Sigma Neighbors vs. rec hit energy",100,-5,15,100,0,25); - d_HFenergyVsNeighbor=m_dbe->book2D("HF_energyVsNeighbor","HF #Sigma Neighbors vs. rec hit energy",100,-5,15,100,0,25); - } - } // if (hotmon_makeDiagnostics_) - } // if (m_dbe) - + if (showTiming) + { + cpu_timer.stop(); std::cout <<"TIMER:: HcalHotCellMonitor BEGINRUN -> "< "<1) std::cout <<" calibType = "< "< threshold), but do not fill persistent plots - */ - - if (hotmon_test_neighbor_) - fillNevents_neighbor(); - - if (hotmon_test_energy_) - fillNevents_energy(); - - fillNevents_problemCells(); - return; -} /* --------------------------------------- */ @@ -584,19 +615,6 @@ void HcalHotCellMonitor::processEvent_rechitenergy( const HBHERecHitCollection& AboveEnergyThresholdCellsByDepth.depth[i]->setBinContent(0,0,ievt_); for (unsigned int i=0;isetBinContent(0,0,ievt_); - - - // Fill histograms - if (ievt_%hotmon_checkNevents_==0 && hotmon_test_energy_) - { - if (fVerbosity) std::cout <<" Filling HotCell Energy plots"< Filling HotCell Persistent Energy plots"<setBinContent(0,0,ievt_); - // Fill histograms - if (ievt_%hotmon_checkNevents_==0) - { - if (fVerbosity) std::cout <<" Filling HotCell Neighbor plots"< "< some threshold for N consecutive events + if (levt_( "LaserPerChannel", false ); - printf( "Laser Monitor per channel set to %s\n", doPerChannel_ ? "true" : "false" ); + AllowedCalibTypes_ = iConfig.getUntrackedParameter >("LaserMonitor_AllowedCalibTypes",AllowedCalibTypes_); + + if (fVerbosity) printf( "Laser Monitor per channel set to %s\n", doPerChannel_ ? "true" : "false" ); etaMax_ = iConfig.getUntrackedParameter( "MaxEta", 41.5 ); etaMin_ = iConfig.getUntrackedParameter( "MinEta", -41.5 ); etaBins_ = (int)(etaMax_ - etaMin_); - cout << "Laser Monitor eta min/max set to " << etaMin_ << "/" << etaMax_ << endl; + if (fVerbosity) std::cout << "Laser Monitor eta min/max set to " << etaMin_ << "/" << etaMax_ << std::endl; phiMax_ = iConfig.getUntrackedParameter( "MaxPhi", 73 ); phiMin_ = iConfig.getUntrackedParameter( "MinPhi", 0 ); phiBins_ = (int)(phiMax_ - phiMin_); - cout << "Laser Monitor phi min/max set to " << phiMin_ << "/" << phiMax_ << endl; + if (fVerbosity) std::cout << "Laser Monitor phi min/max set to " << phiMin_ << "/" << phiMax_ << std::endl; sigS0_ = iConfig.getUntrackedParameter( "FirstSignalBin", 0 ); sigS1_ = iConfig.getUntrackedParameter( "LastSignalBin", 9 ); if( sigS0_ < 0 ) { - printf( "HcalLaserMonitor::setup, illegal range for first sample: %d\n", sigS0_ ); + if (fVerbosity) printf( "HcalLaserMonitor::setup, illegal range for first sample: %d\n", sigS0_ ); sigS0_ = 0; } if( sigS1_ > 9 ) { - printf( "HcalLaserMonitor::setup, illegal range for last sample: %d\n", sigS1_ ); + if (fVerbosity) printf( "HcalLaserMonitor::setup, illegal range for last sample: %d\n", sigS1_ ); sigS1_ = 9; } if( sigS0_ > sigS1_ ) { - printf( "HcalLaserMonitor::setup, illegal range for first/last sample: %d/%d\n", sigS0_, sigS1_ ); + if (fVerbosity) printf( "HcalLaserMonitor::setup, illegal range for first/last sample: %d/%d\n", sigS0_, sigS1_ ); sigS0_ = 0; sigS1_ = 9; } - cout << "Laser Monitor signal window set to " << sigS0_ << "-" << sigS1_ << endl; + if (fVerbosity) std::cout << "Laser Monitor signal window set to " << sigS0_ << "-" << sigS1_ << std::endl; adcThresh_ = iConfig.getUntrackedParameter( "Laser_ADC_Thresh", -10000 ); - cout << "Laser Monitor threshold set to " << adcThresh_ << endl; - - printf( "====================================================\n" ); - - - if( m_dbe ) { - m_dbe->setCurrentFolder( baseFolder_ ); - meEVT_ = m_dbe->bookInt( "Laser Task Event Number" ); - meEVT_->Fill( ievt_ ); - meTOTALEVT_ = m_dbe->bookInt("Laser Total Events Processed"); - meTOTALEVT_->Fill(tevt_); - - MEAN_MAP_TIME_L1_ = m_dbe->book2D( "Laser Mean Time Depth 1", "Laser Mean Time Depth 1", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - MEAN_MAP_TIME_L2_ = m_dbe->book2D( "Laser Mean Time Depth 2", "Laser Mean Time Depth 2", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - MEAN_MAP_TIME_L3_ = m_dbe->book2D( "Laser Mean Time Depth 3", "Laser Mean Time Depth 3", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - MEAN_MAP_TIME_L4_ = m_dbe->book2D( "Laser Mean Time Depth 4", "Laser Mean Time Depth 4", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - RMS_MAP_TIME_L1_ = m_dbe->book2D( "Laser RMS Time Depth 1", "Laser RMS Time Depth 1", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - RMS_MAP_TIME_L2_ = m_dbe->book2D( "Laser RMS Time Depth 2", "Laser RMS Time Depth 2", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - RMS_MAP_TIME_L3_ = m_dbe->book2D( "Laser RMS Time Depth 3", "Laser RMS Time Depth 3", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - RMS_MAP_TIME_L4_ = m_dbe->book2D( "Laser RMS Time Depth 4", "Laser RMS Time Depth 4", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - - MEAN_MAP_ENERGY_L1_ = m_dbe->book2D( "Laser Mean Energy Depth 1", "Laser Mean Energy Depth 1", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - MEAN_MAP_ENERGY_L2_ = m_dbe->book2D( "Laser Mean Energy Depth 2", "Laser Mean Energy Depth 2", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - MEAN_MAP_ENERGY_L3_ = m_dbe->book2D( "Laser Mean Energy Depth 3", "Laser Mean Energy Depth 3", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - MEAN_MAP_ENERGY_L4_ = m_dbe->book2D( "Laser Mean Energy Depth 4", "Laser Mean Energy Depth 4", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - RMS_MAP_ENERGY_L1_ = m_dbe->book2D( "Laser RMS Energy Depth 1", "Laser RMS Energy Depth 1", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - RMS_MAP_ENERGY_L2_ = m_dbe->book2D( "Laser RMS Energy Depth 2", "Laser RMS Energy Depth 2", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - RMS_MAP_ENERGY_L3_ = m_dbe->book2D( "Laser RMS Energy Depth 3", "Laser RMS Energy Depth 3", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - RMS_MAP_ENERGY_L4_ = m_dbe->book2D( "Laser RMS Energy Depth 4", "Laser RMS Energy Depth 4", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - - m_dbe->setCurrentFolder( baseFolder_ + "/2DShape" ); - MEAN_MAP_SHAPE_L1_ = m_dbe->book2D( "Laser Mean Shape Depth 1", "Laser Mean Shape Depth 1", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - MEAN_MAP_SHAPE_L2_ = m_dbe->book2D( "Laser Mean Shape Depth 2", "Laser Mean Shape Depth 2", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - MEAN_MAP_SHAPE_L3_ = m_dbe->book2D( "Laser Mean Shape Depth 3", "Laser Mean Shape Depth 3", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - MEAN_MAP_SHAPE_L4_ = m_dbe->book2D( "Laser Mean Shape Depth 4", "Laser Mean Shape Depth 4", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - RMS_MAP_SHAPE_L1_ = m_dbe->book2D( "Laser RMS Shape Depth 1", "Laser RMS Shape Depth 1", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - RMS_MAP_SHAPE_L2_ = m_dbe->book2D( "Laser RMS Shape Depth 2", "Laser RMS Shape Depth 2", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - RMS_MAP_SHAPE_L3_ = m_dbe->book2D( "Laser RMS Shape Depth 3", "Laser RMS Shape Depth 3", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - RMS_MAP_SHAPE_L4_ = m_dbe->book2D( "Laser RMS Shape Depth 4", "Laser RMS Shape Depth 4", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); - - m_dbe->setCurrentFolder( baseFolder_ + "/HB" ); - hbHists.allShapePedSub_ = m_dbe->book1D( "HB Ped Subtracted Pulse Shape", "HB Ped Subtracted Pulse Shape", 10, -0.5, 9.5 ); - //hbHists.allShape_ = m_dbe->book1D( "HB Average Pulse Shape", "HB Average Pulse Shape", 10, -0.5, 9.5 ); - hbHists.rms_shape_ = m_dbe->book1D( "HB Laser Shape RMS Values", "HB Laser Shape RMS Values", 25, 0, 3 ); - hbHists.mean_shape_ = m_dbe->book1D( "HB Laser Shape Mean Values", "HB Laser Shape Mean Values", 100, -0.5, 9.5 ); - - hbHists.allTime_ = m_dbe->book1D( "HB Average Pulse Time", "HB Average Pulse Time", 100, -0.5, 9.5 ); - hbHists.rms_time_ = m_dbe->book1D( "HB Laser Time RMS Values", "HB Laser Time RMS Values", 25, 0, 3 ); - hbHists.mean_time_ = m_dbe->book1D( "HB Laser Time Mean Values", "HB Laser Time Mean Values", 100, -0.5, 9.5 ); - - hbHists.allEnergy_ = m_dbe->book1D( "HB Average Pulse Energy", "HB Average Pulse Energy", 1000, 0, 10000 ); - hbHists.rms_energy_ = m_dbe->book1D( "HB Laser Energy RMS Values", "HB Laser Energy RMS Values", 100, 0, 400 ); - hbHists.mean_energy_ = m_dbe->book1D( "HB Laser Energy Mean Values", "HB Laser Energy Mean Values", 300, 0, 10000 ); - - m_dbe->setCurrentFolder( baseFolder_+ "/HE" ); - heHists.allShapePedSub_ = m_dbe->book1D( "HE Ped Subtracted Pulse Shape", "HE Ped Subtracted Pulse Shape", 10, -0.5, 9.5 ); - //heHists.allShape_ = m_dbe->book1D( "HE Average Pulse Shape", "HE Average Pulse Shape", 10, -0.5, 9.5 ); - heHists.rms_shape_ = m_dbe->book1D( "HE Laser Shape RMS Values", "HE Laser Shape RMS Values", 25, 0, 3 ); - heHists.mean_shape_ = m_dbe->book1D( "HE Laser Shape Mean Values", "HE Laser Shape Mean Values", 100, -0.5, 9.5 ); - - heHists.allTime_ = m_dbe->book1D( "HE Average Pulse Time", "HE Average Pulse Time", 100, -0.5, 9.5 ); - heHists.rms_time_ = m_dbe->book1D( "HE Laser Time RMS Values", "HE Laser Time RMS Values", 25, 0, 3 ); - heHists.mean_time_ = m_dbe->book1D( "HE Laser Time Mean Values", "HE Laser Time Mean Values", 100, -0.5, 9.5 ); - - heHists.allEnergy_ = m_dbe->book1D( "HE Average Pulse Energy", "HE Average Pulse Energy", 1000, 0, 10000 ); - heHists.rms_energy_ = m_dbe->book1D( "HE Laser Energy RMS Values", "HE Laser Energy RMS Values", 100, 0, 400 ); - heHists.mean_energy_ = m_dbe->book1D( "HE Laser Energy Mean Values", "HE Laser Energy Mean Values", 300, 0, 10000 ); - - m_dbe->setCurrentFolder( baseFolder_+ "/HO" ); - hoHists.allShapePedSub_ = m_dbe->book1D( "HO Ped Subtracted Pulse Shape", "HO Ped Subtracted Pulse Shape", 10, -0.5, 9.5 ); - //hoHists.allShape_ = m_dbe->book1D( "HO Average Pulse Shape", "HO Average Pulse Shape", 10, -0.5, 9.5 ); - hoHists.rms_shape_ = m_dbe->book1D( "HO Laser Shape RMS Values", "HO Laser Shape RMS Values", 25, 0, 3 ); - hoHists.mean_shape_ = m_dbe->book1D( "HO Laser Shape Mean Values", "HO Laser Shape Mean Values", 100, -0.5, 9.5 ); - - hoHists.allTime_ = m_dbe->book1D( "HO Average Pulse Time", "HO Average Pulse Time", 100, -0.5, 9.5 ); - hoHists.rms_time_ = m_dbe->book1D( "HO Laser Time RMS Values", "HO Laser Time RMS Values", 25, 0, 3 ); - hoHists.mean_time_ = m_dbe->book1D( "HO Laser Time Mean Values", "HO Laser Time Mean Values", 100, -0.5, 9.5 ); - - hoHists.allEnergy_ = m_dbe->book1D( "HO Average Pulse Energy", "HO Average Pulse Energy", 1000, 0, 10000 ); - hoHists.rms_energy_ = m_dbe->book1D( "HO Laser Energy RMS Values", "HO Laser Energy RMS Values", 100, 0, 400 ); - hoHists.mean_energy_ = m_dbe->book1D( "HO Laser Energy Mean Values", "HO Laser Energy Mean Values", 300, 0, 10000 ); - - m_dbe->setCurrentFolder( baseFolder_ + "/HF" ); - hfHists.allShapePedSub_ = m_dbe->book1D( "HF Ped Subtracted Pulse Shape", "HF Ped Subtracted Pulse Shape", 10, -0.5, 9.5 ); - //hfHists.allShape_ = m_dbe->book1D( "HF Average Pulse Shape", "HF Average Pulse Shape", 10, -0.5, 9.5 ); - hfHists.rms_shape_ = m_dbe->book1D( "HF Laser Shape RMS Values", "HF Laser Shape RMS Values", 25, 0, 3 ); - hfHists.mean_shape_ = m_dbe->book1D( "HF Laser Shape Mean Values", "HF Laser Shape Mean Values", 100, -0.5, 9.5 ); - - hfHists.allTime_ = m_dbe->book1D( "HF Average Pulse Time", "HF Average Pulse Time", 100, -0.5, 9.5 ); - hfHists.rms_time_ = m_dbe->book1D( "HF Laser Time RMS Values", "HF Laser Time RMS Values", 25, 0, 3 ); - hfHists.mean_time_ = m_dbe->book1D( "HF Laser Time Mean Values", "HF Laser Time Mean Values", 100, -0.5, 9.5 ); - - hfHists.allEnergy_ = m_dbe->book1D( "HF Average Pulse Energy", "HF Average Pulse Energy", 1000, 0, 10000 ); - hfHists.rms_energy_ = m_dbe->book1D( "HF Laser Energy RMS Values", "HF Laser Energy RMS Values", 100, 0, 400 ); - hfHists.mean_energy_ = m_dbe->book1D( "HF Laser Energy Mean Values", "HF Laser Energy Mean Values", 300, 0, 10000 ); - - m_dbe->setCurrentFolder( baseFolder_ + "/QADCTDC" ); - TDCHists.numChannels_ = m_dbe->book1D( "TDC Number of Channels", "TDC Number of Channels", 4, -0.5, 3.5 ); - - TDCHists.trigger_ = m_dbe->book1D( "TDC Trigger", "TDC Trigger", 25, 12700, 12800 ); - TDCHists.clockOptosync_ = m_dbe->book1D( "TDC Clock Optosync", "TDC Clock Optosync", 50, 13900, 14100 ); - TDCHists.rawOptosync_ = m_dbe->book1D( "TDC Raw Optosync", "TDC Raw Optosync", 50, 13800, 14000 ); - - TDCHists.rawOptosync_Trigger_ = m_dbe->book1D( "TDC Raw Optosync Minus Trigger", "TDC Raw Optosync Minus Trigger", 50, 1050, 1250 ); - - char temp[128]; - for( int i = 0; i < 32; i++ ) { - sprintf( temp,"QDC %02d", i ); - QADC_[i] = m_dbe->book1D( temp, temp, 41, 0, 4100 ); - } + if (fVerbosity) std::cout << "Laser Monitor threshold set to " << adcThresh_ << endl; + + if (fVerbosity) printf( "====================================================\n" ); + return; +} // void HcalLaserMonitor::setup(...) + +void HcalLaserMonitor::beginRun() +{ + HcalBaseMonitor::beginRun(); + + if (!m_dbe) return; + m_dbe->setCurrentFolder( baseFolder_ ); + meEVT_ = m_dbe->bookInt( "Laser Task Event Number" ); + meEVT_->Fill( ievt_ ); + meTOTALEVT_ = m_dbe->bookInt("Laser Total Events Processed"); + meTOTALEVT_->Fill(tevt_); + + MEAN_MAP_TIME_L1_ = m_dbe->book2D( "Laser Mean Time Depth 1", "Laser Mean Time Depth 1", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + MEAN_MAP_TIME_L2_ = m_dbe->book2D( "Laser Mean Time Depth 2", "Laser Mean Time Depth 2", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + MEAN_MAP_TIME_L3_ = m_dbe->book2D( "Laser Mean Time Depth 3", "Laser Mean Time Depth 3", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + MEAN_MAP_TIME_L4_ = m_dbe->book2D( "Laser Mean Time Depth 4", "Laser Mean Time Depth 4", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + RMS_MAP_TIME_L1_ = m_dbe->book2D( "Laser RMS Time Depth 1", "Laser RMS Time Depth 1", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + RMS_MAP_TIME_L2_ = m_dbe->book2D( "Laser RMS Time Depth 2", "Laser RMS Time Depth 2", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + RMS_MAP_TIME_L3_ = m_dbe->book2D( "Laser RMS Time Depth 3", "Laser RMS Time Depth 3", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + RMS_MAP_TIME_L4_ = m_dbe->book2D( "Laser RMS Time Depth 4", "Laser RMS Time Depth 4", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + + MEAN_MAP_ENERGY_L1_ = m_dbe->book2D( "Laser Mean Energy Depth 1", "Laser Mean Energy Depth 1", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + MEAN_MAP_ENERGY_L2_ = m_dbe->book2D( "Laser Mean Energy Depth 2", "Laser Mean Energy Depth 2", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + MEAN_MAP_ENERGY_L3_ = m_dbe->book2D( "Laser Mean Energy Depth 3", "Laser Mean Energy Depth 3", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + MEAN_MAP_ENERGY_L4_ = m_dbe->book2D( "Laser Mean Energy Depth 4", "Laser Mean Energy Depth 4", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + RMS_MAP_ENERGY_L1_ = m_dbe->book2D( "Laser RMS Energy Depth 1", "Laser RMS Energy Depth 1", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + RMS_MAP_ENERGY_L2_ = m_dbe->book2D( "Laser RMS Energy Depth 2", "Laser RMS Energy Depth 2", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + RMS_MAP_ENERGY_L3_ = m_dbe->book2D( "Laser RMS Energy Depth 3", "Laser RMS Energy Depth 3", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + RMS_MAP_ENERGY_L4_ = m_dbe->book2D( "Laser RMS Energy Depth 4", "Laser RMS Energy Depth 4", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + + m_dbe->setCurrentFolder( baseFolder_ + "/2DShape" ); + MEAN_MAP_SHAPE_L1_ = m_dbe->book2D( "Laser Mean Shape Depth 1", "Laser Mean Shape Depth 1", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + MEAN_MAP_SHAPE_L2_ = m_dbe->book2D( "Laser Mean Shape Depth 2", "Laser Mean Shape Depth 2", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + MEAN_MAP_SHAPE_L3_ = m_dbe->book2D( "Laser Mean Shape Depth 3", "Laser Mean Shape Depth 3", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + MEAN_MAP_SHAPE_L4_ = m_dbe->book2D( "Laser Mean Shape Depth 4", "Laser Mean Shape Depth 4", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + RMS_MAP_SHAPE_L1_ = m_dbe->book2D( "Laser RMS Shape Depth 1", "Laser RMS Shape Depth 1", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + RMS_MAP_SHAPE_L2_ = m_dbe->book2D( "Laser RMS Shape Depth 2", "Laser RMS Shape Depth 2", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + RMS_MAP_SHAPE_L3_ = m_dbe->book2D( "Laser RMS Shape Depth 3", "Laser RMS Shape Depth 3", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + RMS_MAP_SHAPE_L4_ = m_dbe->book2D( "Laser RMS Shape Depth 4", "Laser RMS Shape Depth 4", etaBins_, etaMin_, etaMax_, phiBins_, phiMin_, phiMax_ ); + + m_dbe->setCurrentFolder( baseFolder_ + "/HB" ); + hbHists.allShapePedSub_ = m_dbe->book1D( "HB Ped Subtracted Pulse Shape", "HB Ped Subtracted Pulse Shape", 10, -0.5, 9.5 ); + //hbHists.allShape_ = m_dbe->book1D( "HB Average Pulse Shape", "HB Average Pulse Shape", 10, -0.5, 9.5 ); + hbHists.rms_shape_ = m_dbe->book1D( "HB Laser Shape RMS Values", "HB Laser Shape RMS Values", 25, 0, 3 ); + hbHists.mean_shape_ = m_dbe->book1D( "HB Laser Shape Mean Values", "HB Laser Shape Mean Values", 100, -0.5, 9.5 ); + + hbHists.allTime_ = m_dbe->book1D( "HB Average Pulse Time", "HB Average Pulse Time", 100, -0.5, 9.5 ); + hbHists.rms_time_ = m_dbe->book1D( "HB Laser Time RMS Values", "HB Laser Time RMS Values", 25, 0, 3 ); + hbHists.mean_time_ = m_dbe->book1D( "HB Laser Time Mean Values", "HB Laser Time Mean Values", 100, -0.5, 9.5 ); + + hbHists.allEnergy_ = m_dbe->book1D( "HB Average Pulse Energy", "HB Average Pulse Energy", 1000, 0, 10000 ); + hbHists.rms_energy_ = m_dbe->book1D( "HB Laser Energy RMS Values", "HB Laser Energy RMS Values", 100, 0, 400 ); + hbHists.mean_energy_ = m_dbe->book1D( "HB Laser Energy Mean Values", "HB Laser Energy Mean Values", 300, 0, 10000 ); + + m_dbe->setCurrentFolder( baseFolder_+ "/HE" ); + heHists.allShapePedSub_ = m_dbe->book1D( "HE Ped Subtracted Pulse Shape", "HE Ped Subtracted Pulse Shape", 10, -0.5, 9.5 ); + //heHists.allShape_ = m_dbe->book1D( "HE Average Pulse Shape", "HE Average Pulse Shape", 10, -0.5, 9.5 ); + heHists.rms_shape_ = m_dbe->book1D( "HE Laser Shape RMS Values", "HE Laser Shape RMS Values", 25, 0, 3 ); + heHists.mean_shape_ = m_dbe->book1D( "HE Laser Shape Mean Values", "HE Laser Shape Mean Values", 100, -0.5, 9.5 ); + + heHists.allTime_ = m_dbe->book1D( "HE Average Pulse Time", "HE Average Pulse Time", 100, -0.5, 9.5 ); + heHists.rms_time_ = m_dbe->book1D( "HE Laser Time RMS Values", "HE Laser Time RMS Values", 25, 0, 3 ); + heHists.mean_time_ = m_dbe->book1D( "HE Laser Time Mean Values", "HE Laser Time Mean Values", 100, -0.5, 9.5 ); + + heHists.allEnergy_ = m_dbe->book1D( "HE Average Pulse Energy", "HE Average Pulse Energy", 1000, 0, 10000 ); + heHists.rms_energy_ = m_dbe->book1D( "HE Laser Energy RMS Values", "HE Laser Energy RMS Values", 100, 0, 400 ); + heHists.mean_energy_ = m_dbe->book1D( "HE Laser Energy Mean Values", "HE Laser Energy Mean Values", 300, 0, 10000 ); + + m_dbe->setCurrentFolder( baseFolder_+ "/HO" ); + hoHists.allShapePedSub_ = m_dbe->book1D( "HO Ped Subtracted Pulse Shape", "HO Ped Subtracted Pulse Shape", 10, -0.5, 9.5 ); + //hoHists.allShape_ = m_dbe->book1D( "HO Average Pulse Shape", "HO Average Pulse Shape", 10, -0.5, 9.5 ); + hoHists.rms_shape_ = m_dbe->book1D( "HO Laser Shape RMS Values", "HO Laser Shape RMS Values", 25, 0, 3 ); + hoHists.mean_shape_ = m_dbe->book1D( "HO Laser Shape Mean Values", "HO Laser Shape Mean Values", 100, -0.5, 9.5 ); + + hoHists.allTime_ = m_dbe->book1D( "HO Average Pulse Time", "HO Average Pulse Time", 100, -0.5, 9.5 ); + hoHists.rms_time_ = m_dbe->book1D( "HO Laser Time RMS Values", "HO Laser Time RMS Values", 25, 0, 3 ); + hoHists.mean_time_ = m_dbe->book1D( "HO Laser Time Mean Values", "HO Laser Time Mean Values", 100, -0.5, 9.5 ); + + hoHists.allEnergy_ = m_dbe->book1D( "HO Average Pulse Energy", "HO Average Pulse Energy", 1000, 0, 10000 ); + hoHists.rms_energy_ = m_dbe->book1D( "HO Laser Energy RMS Values", "HO Laser Energy RMS Values", 100, 0, 400 ); + hoHists.mean_energy_ = m_dbe->book1D( "HO Laser Energy Mean Values", "HO Laser Energy Mean Values", 300, 0, 10000 ); + + m_dbe->setCurrentFolder( baseFolder_ + "/HF" ); + hfHists.allShapePedSub_ = m_dbe->book1D( "HF Ped Subtracted Pulse Shape", "HF Ped Subtracted Pulse Shape", 10, -0.5, 9.5 ); + //hfHists.allShape_ = m_dbe->book1D( "HF Average Pulse Shape", "HF Average Pulse Shape", 10, -0.5, 9.5 ); + hfHists.rms_shape_ = m_dbe->book1D( "HF Laser Shape RMS Values", "HF Laser Shape RMS Values", 25, 0, 3 ); + hfHists.mean_shape_ = m_dbe->book1D( "HF Laser Shape Mean Values", "HF Laser Shape Mean Values", 100, -0.5, 9.5 ); + + hfHists.allTime_ = m_dbe->book1D( "HF Average Pulse Time", "HF Average Pulse Time", 100, -0.5, 9.5 ); + hfHists.rms_time_ = m_dbe->book1D( "HF Laser Time RMS Values", "HF Laser Time RMS Values", 25, 0, 3 ); + hfHists.mean_time_ = m_dbe->book1D( "HF Laser Time Mean Values", "HF Laser Time Mean Values", 100, -0.5, 9.5 ); + + hfHists.allEnergy_ = m_dbe->book1D( "HF Average Pulse Energy", "HF Average Pulse Energy", 1000, 0, 10000 ); + hfHists.rms_energy_ = m_dbe->book1D( "HF Laser Energy RMS Values", "HF Laser Energy RMS Values", 100, 0, 400 ); + hfHists.mean_energy_ = m_dbe->book1D( "HF Laser Energy Mean Values", "HF Laser Energy Mean Values", 300, 0, 10000 ); + + m_dbe->setCurrentFolder( baseFolder_ + "/QADCTDC" ); + TDCHists.numChannels_ = m_dbe->book1D( "TDC Number of Channels", "TDC Number of Channels", 4, -0.5, 3.5 ); + + TDCHists.trigger_ = m_dbe->book1D( "TDC Trigger", "TDC Trigger", 25, 12700, 12800 ); + TDCHists.clockOptosync_ = m_dbe->book1D( "TDC Clock Optosync", "TDC Clock Optosync", 50, 13900, 14100 ); + TDCHists.rawOptosync_ = m_dbe->book1D( "TDC Raw Optosync", "TDC Raw Optosync", 50, 13800, 14000 ); + + TDCHists.rawOptosync_Trigger_ = m_dbe->book1D( "TDC Raw Optosync Minus Trigger", "TDC Raw Optosync Minus Trigger", 50, 1050, 1250 ); + + char temp[128]; + for( int i = 0; i < 32; i++ ) { + sprintf( temp,"QDC %02d", i ); + QADC_[i] = m_dbe->book1D( temp, temp, 41, 0, 4100 ); } + return; } //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void HcalLaserMonitor::processEvent( const HBHEDigiCollection& hbhe, const HODigiCollection& ho, const HFDigiCollection& hf, const HcalLaserDigi& laserDigi, const HcalDbService& cond ) { +void HcalLaserMonitor::processEvent( const HBHEDigiCollection& hbhe, + const HODigiCollection& ho, + const HFDigiCollection& hf, + const HcalLaserDigi& laserDigi, + const HcalDbService& cond, + int CalibType) +{ if( fVerbosity )std::cout<< "-=-=-=-=-=HcalLaserMonitor processEvent=-=-=-=-=-\n"<1) std::cout <<" calibType = "<& tEnergy, const string baseFolder ) { MonitorElement* _me; if( m_dbe == NULL ) { - std::cout<< "HcalLaserMonitor::perChanHists - Null MonitorElement!\n"<second; if( _me == NULL ) { - std::cout<< "HcalLaserAnalysis::perChanHists - This histo is NULL!!??"<("ReferencePedestalMonitor_startingTimeSlice",0); endingTimeSlice_ = ps.getUntrackedParameter("ReferencePedestalMonitor_endingTimeSlice" ,1); + AllowedCalibTypes_ = ps.getUntrackedParameter >("PedestalMonitor_AllowedCalibTypes",AllowedCalibTypes_); + ievt_=0; - if ( m_dbe ) + if (showTiming) { - m_dbe->setCurrentFolder(baseFolder_); - meEVT_ = m_dbe->bookInt("Pedestal Task Event Number"); - meEVT_->Fill(ievt_); - ProblemCells=m_dbe->book2D(" ProblemReferencePedestals", - " Problem Reference Pedestal Rate for all HCAL;i#eta;i#phi", - 85,-42.5,42.5, - 72,0.5,72.5); - SetEtaPhiLabels(ProblemCells); - - m_dbe->setCurrentFolder(baseFolder_+"/reference_pedestals/adc"); - SetupEtaPhiHists(ADC_PedestalFromDBByDepth, - "Pedestal Values from DataBase","ADC"); - SetupEtaPhiHists(ADC_WidthFromDBByDepth, - "Pedestal Widths from DataBase","ADC"); - setupDepthHists1D(ADC_1D_PedestalFromDBByDepth, "1D Reference Pedestal Values", - "ADC",0,15,120); - setupDepthHists1D(ADC_1D_WidthFromDBByDepth, "1D Reference Pedestal Widths", - "ADC",0,5,40); - - m_dbe->setCurrentFolder(baseFolder_+"/reference_pedestals/fc"); - SetupEtaPhiHists(fC_PedestalFromDBByDepth, - "Pedestal Values from DataBase","fC"); - - SetupEtaPhiHists(fC_WidthFromDBByDepth, - "Pedestal Widths from DataBase","fC"); - setupDepthHists1D(fC_1D_PedestalFromDBByDepth, "1D Reference Pedestal Values", - "fC",-5,20,250); - setupDepthHists1D(fC_1D_WidthFromDBByDepth, "1D Reference Pedestal Widths", - "fC",0,5,100); + cpu_timer.stop(); std::cout <<"TIMER:: HcalPedestalMonitor SETUP -> "<setCurrentFolder(baseFolder_+"/problem_referencepedestals"); - SetupEtaPhiHists(ProblemCellsByDepth, " Problem Reference Pedestal Rate",""); - zeroCounters(); + return; +} // void HcalPedestalMonitor::setup() - if (!makeDiagnostics) - return; - m_dbe->setCurrentFolder(baseFolder_); - SetupEtaPhiHists(MeanMapByDepth,"Pedestal Mean Map", "ADC"); - SetupEtaPhiHists(RMSMapByDepth, "Pedestal RMS Map", "ADC"); - - m_dbe->setCurrentFolder(baseFolder_+"/adc/unsubtracted"); - SetupEtaPhiHists(ADCPedestalMean, "Pedestal Values Map","ADC"); - SetupEtaPhiHists( ADCPedestalRMS, "Pedestal Widths Map","ADC"); - setupDepthHists1D(ADCPedestalMean_1D, "1D Pedestal Values", - "ADC",0,15,200); - setupDepthHists1D(ADCPedestalRMS_1D, "1D Pedestal Widths", - "ADC",0,5,40); - - m_dbe->setCurrentFolder(baseFolder_+"/fc/unsubtracted"); - SetupEtaPhiHists(fCPedestalMean, "Pedestal Values Map", - "fC"); - SetupEtaPhiHists(fCPedestalRMS, "Pedestal Widths Map", - "fC"); - setupDepthHists1D(fCPedestalMean_1D, "1D Pedestal Values", - "fC",-5,20,200); - setupDepthHists1D(fCPedestalRMS_1D, "1D Pedestal Widths", +void HcalPedestalMonitor::beginRun() +{ + HcalBaseMonitor::beginRun(); + zeroCounters(); + if (!m_dbe) return; //Set up histograms at beginning of run + if (showTiming) + { + cpu_timer.reset(); cpu_timer.start(); + } + + m_dbe->setCurrentFolder(baseFolder_); + meEVT_ = m_dbe->bookInt("Pedestal Task Event Number"); + meEVT_->Fill(ievt_); + ProblemCells=m_dbe->book2D(" ProblemReferencePedestals", + " Problem Reference Pedestal Rate for all HCAL;i#eta;i#phi", + 85,-42.5,42.5, + 72,0.5,72.5); + SetEtaPhiLabels(ProblemCells); + + m_dbe->setCurrentFolder(baseFolder_+"/reference_pedestals/adc"); + SetupEtaPhiHists(ADC_PedestalFromDBByDepth, + "Pedestal Values from DataBase","ADC"); + SetupEtaPhiHists(ADC_WidthFromDBByDepth, + "Pedestal Widths from DataBase","ADC"); + setupDepthHists1D(ADC_1D_PedestalFromDBByDepth, "1D Reference Pedestal Values", + "ADC",0,15,120); + setupDepthHists1D(ADC_1D_WidthFromDBByDepth, "1D Reference Pedestal Widths", + "ADC",0,5,40); + + m_dbe->setCurrentFolder(baseFolder_+"/reference_pedestals/fc"); + SetupEtaPhiHists(fC_PedestalFromDBByDepth, + "Pedestal Values from DataBase","fC"); + + SetupEtaPhiHists(fC_WidthFromDBByDepth, + "Pedestal Widths from DataBase","fC"); + setupDepthHists1D(fC_1D_PedestalFromDBByDepth, "1D Reference Pedestal Values", + "fC",-5,20,250); + setupDepthHists1D(fC_1D_WidthFromDBByDepth, "1D Reference Pedestal Widths", + "fC",0,5,100); + + // Overall Problem plot appears in main directory; plots by depth appear in subdirectory + m_dbe->setCurrentFolder(baseFolder_+"/problem_referencepedestals"); + SetupEtaPhiHists(ProblemCellsByDepth, " Problem Reference Pedestal Rate",""); + + if (!makeDiagnostics) + return; + m_dbe->setCurrentFolder(baseFolder_); + SetupEtaPhiHists(MeanMapByDepth,"Pedestal Mean Map", "ADC"); + SetupEtaPhiHists(RMSMapByDepth, "Pedestal RMS Map", "ADC"); + + m_dbe->setCurrentFolder(baseFolder_+"/adc/unsubtracted"); + SetupEtaPhiHists(ADCPedestalMean, "Pedestal Values Map","ADC"); + SetupEtaPhiHists( ADCPedestalRMS, "Pedestal Widths Map","ADC"); + setupDepthHists1D(ADCPedestalMean_1D, "1D Pedestal Values", + "ADC",0,15,200); + setupDepthHists1D(ADCPedestalRMS_1D, "1D Pedestal Widths", + "ADC",0,5,40); + + m_dbe->setCurrentFolder(baseFolder_+"/fc/unsubtracted"); + SetupEtaPhiHists(fCPedestalMean, "Pedestal Values Map", + "fC"); + SetupEtaPhiHists(fCPedestalRMS, "Pedestal Widths Map", + "fC"); + setupDepthHists1D(fCPedestalMean_1D, "1D Pedestal Values", + "fC",-5,20,200); + setupDepthHists1D(fCPedestalRMS_1D, "1D Pedestal Widths", "fC",0,5,100); - } // if (m_dbe) - if (showTiming) { - cpu_timer.stop(); std::cout <<"TIMER:: HcalPedestalMonitor SETUP -> "< "<1) std::cout <<" calibType = "<("RecHitMonitor_HF_energyThreshold", -999); ZDCenergyThreshold_ = ps.getUntrackedParameter("RecHitMonitor_ZDC_energyThreshold", -999); - // zero all counters + // Set allowed types of events for running through rechitmon + AllowedCalibTypes_ = ps.getUntrackedParameter >("RecHitMonitor_AllowedCalibTypes",AllowedCalibTypes_); - zeroCounters(); + if (showTiming) + { + cpu_timer.stop(); std::cout <<"TIMER:: HcalRecHitMonitor SETUP -> "<1) - std::cout <<" Setting up histograms"<setCurrentFolder(baseFolder_); - meEVT_ = m_dbe->bookInt("RecHit Task Event Number"); - meTOTALEVT_ = m_dbe->bookInt("RecHit Task Total Events Processed"); + if (fVerbosity>1) + std::cout <<" Setting up histograms"<setCurrentFolder(baseFolder_+"/rechit_info"); - SetupEtaPhiHists(OccupancyByDepth,"RecHit Occupancy","");; + m_dbe->setCurrentFolder(baseFolder_); + meEVT_ = m_dbe->bookInt("RecHit Task Event Number"); + meTOTALEVT_ = m_dbe->bookInt("RecHit Task Total Events Processed"); - m_dbe->setCurrentFolder(baseFolder_+"/rechit_info/sumplots"); - SetupEtaPhiHists(SumEnergyByDepth,"RecHit Summed Energy","GeV"); - SetupEtaPhiHists(SqrtSumEnergy2ByDepth,"RecHit Sqrt Summed Energy2","GeV"); - SetupEtaPhiHists(SumTimeByDepth,"RecHit Summed Time","nS"); - - m_dbe->setCurrentFolder(baseFolder_+"/rechit_info_threshold"); - SetupEtaPhiHists(OccupancyThreshByDepth,"Above Threshold RecHit Occupancy",""); - - m_dbe->setCurrentFolder(baseFolder_+"/rechit_info_threshold/sumplots"); - SetupEtaPhiHists(SumEnergyThreshByDepth,"Above Threshold RecHit Summed Energy","GeV"); - SetupEtaPhiHists(SumTimeThreshByDepth,"Above Threshold RecHit Summed Time","nS"); - - m_dbe->setCurrentFolder(baseFolder_+"/AnomalousCellFlags");// HB Flag Histograms - h_HBflagcounter=m_dbe->book1D("HBflags","HB flags",32,-0.5,31.5); - h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHEHpdHitMultiplicity, "HpdHitMult",1); - h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHEPulseShape, "PulseShape",1); - h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_R1R2, "HSCP R1R2",1); - h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_FracLeader, "HSCP FracLeader",1); - h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_OuterEnergy, "HSCP OuterEnergy",1); - h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_ExpFit, "HSCP ExpFit",1); - // 2-bit timing counter - h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHETimingTrustBits,"TimingTrust1",1); - h_HBflagcounter->setBinLabel(2+HcalCaloFlagLabels::HBHETimingTrustBits,"TimingTrust2",1); - //3-bit timing shape cut - h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHETimingShapedCutsBits,"TimingShape1",1); - h_HBflagcounter->setBinLabel(2+HcalCaloFlagLabels::HBHETimingShapedCutsBits,"TimingShape2",1); - h_HBflagcounter->setBinLabel(3+HcalCaloFlagLabels::HBHETimingShapedCutsBits,"TimingShape3",1); - - // common flags - h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingSubtractedBit, "Subtracted",1); - h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingAddedBit, "Added",1); - h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingErrorBit, "TimingError",1); - h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::ADCSaturationBit, "Saturation",1); - - // HE Flag Histograms - h_HEflagcounter=m_dbe->book1D("HEflags","HE flags",32,-0.5,31.5); - h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHEHpdHitMultiplicity, "HpdHitMult",1); - h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHEPulseShape, "PulseShape",1); - h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_R1R2, "HSCP R1R2",1); - h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_FracLeader, "HSCP FracLeader",1); - h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_OuterEnergy, "HSCP OuterEnergy",1); - h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_ExpFit, "HSCP ExpFit",1); - // 2-bit timing counter - h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHETimingTrustBits,"TimingTrust1",1); - h_HEflagcounter->setBinLabel(2+HcalCaloFlagLabels::HBHETimingTrustBits,"TimingTrust2",1); - //3-bit timing shape cut - h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHETimingShapedCutsBits,"TimingShape1",1); - h_HEflagcounter->setBinLabel(2+HcalCaloFlagLabels::HBHETimingShapedCutsBits,"TimingShape2",1); - h_HEflagcounter->setBinLabel(3+HcalCaloFlagLabels::HBHETimingShapedCutsBits,"TimingShape3",1); - - h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingSubtractedBit, "Subtracted",1); - h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingAddedBit, "Added",1); - h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingErrorBit, "TimingError",1); - h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::ADCSaturationBit, "Saturation",1); - - // HO Flag Histograms - h_HOflagcounter=m_dbe->book1D("HOflags","HO flags",32,-0.5,31.5); - h_HOflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingSubtractedBit, "Subtracted",1); - h_HOflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingAddedBit, "Added",1); - h_HOflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingErrorBit, "TimingError",1); - h_HOflagcounter->setBinLabel(1+HcalCaloFlagLabels::ADCSaturationBit, "Saturation",1); + m_dbe->setCurrentFolder(baseFolder_+"/rechit_info"); + SetupEtaPhiHists(OccupancyByDepth,"RecHit Occupancy","");; + + m_dbe->setCurrentFolder(baseFolder_+"/rechit_info/sumplots"); + SetupEtaPhiHists(SumEnergyByDepth,"RecHit Summed Energy","GeV"); + SetupEtaPhiHists(SqrtSumEnergy2ByDepth,"RecHit Sqrt Summed Energy2","GeV"); + SetupEtaPhiHists(SumTimeByDepth,"RecHit Summed Time","nS"); + + m_dbe->setCurrentFolder(baseFolder_+"/rechit_info_threshold"); + SetupEtaPhiHists(OccupancyThreshByDepth,"Above Threshold RecHit Occupancy",""); + + m_dbe->setCurrentFolder(baseFolder_+"/rechit_info_threshold/sumplots"); + SetupEtaPhiHists(SumEnergyThreshByDepth,"Above Threshold RecHit Summed Energy","GeV"); + SetupEtaPhiHists(SumTimeThreshByDepth,"Above Threshold RecHit Summed Time","nS"); + + m_dbe->setCurrentFolder(baseFolder_+"/AnomalousCellFlags");// HB Flag Histograms + h_HBflagcounter=m_dbe->book1D("HBflags","HB flags",32,-0.5,31.5); + h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHEHpdHitMultiplicity, "HpdHitMult",1); + h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHEPulseShape, "PulseShape",1); + h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_R1R2, "HSCP R1R2",1); + h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_FracLeader, "HSCP FracLeader",1); + h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_OuterEnergy, "HSCP OuterEnergy",1); + h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_ExpFit, "HSCP ExpFit",1); + // 2-bit timing counter + h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHETimingTrustBits,"TimingTrust1",1); + h_HBflagcounter->setBinLabel(2+HcalCaloFlagLabels::HBHETimingTrustBits,"TimingTrust2",1); + //3-bit timing shape cut + h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHETimingShapedCutsBits,"TimingShape1",1); + h_HBflagcounter->setBinLabel(2+HcalCaloFlagLabels::HBHETimingShapedCutsBits,"TimingShape2",1); + h_HBflagcounter->setBinLabel(3+HcalCaloFlagLabels::HBHETimingShapedCutsBits,"TimingShape3",1); + + // common flags + h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingSubtractedBit, "Subtracted",1); + h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingAddedBit, "Added",1); + h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingErrorBit, "TimingError",1); + h_HBflagcounter->setBinLabel(1+HcalCaloFlagLabels::ADCSaturationBit, "Saturation",1); + + // HE Flag Histograms + h_HEflagcounter=m_dbe->book1D("HEflags","HE flags",32,-0.5,31.5); + h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHEHpdHitMultiplicity, "HpdHitMult",1); + h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHEPulseShape, "PulseShape",1); + h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_R1R2, "HSCP R1R2",1); + h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_FracLeader, "HSCP FracLeader",1); + h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_OuterEnergy, "HSCP OuterEnergy",1); + h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HSCP_ExpFit, "HSCP ExpFit",1); + // 2-bit timing counter + h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHETimingTrustBits,"TimingTrust1",1); + h_HEflagcounter->setBinLabel(2+HcalCaloFlagLabels::HBHETimingTrustBits,"TimingTrust2",1); + //3-bit timing shape cut + h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::HBHETimingShapedCutsBits,"TimingShape1",1); + h_HEflagcounter->setBinLabel(2+HcalCaloFlagLabels::HBHETimingShapedCutsBits,"TimingShape2",1); + h_HEflagcounter->setBinLabel(3+HcalCaloFlagLabels::HBHETimingShapedCutsBits,"TimingShape3",1); + + h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingSubtractedBit, "Subtracted",1); + h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingAddedBit, "Added",1); + h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingErrorBit, "TimingError",1); + h_HEflagcounter->setBinLabel(1+HcalCaloFlagLabels::ADCSaturationBit, "Saturation",1); + + // HO Flag Histograms + h_HOflagcounter=m_dbe->book1D("HOflags","HO flags",32,-0.5,31.5); + h_HOflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingSubtractedBit, "Subtracted",1); + h_HOflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingAddedBit, "Added",1); + h_HOflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingErrorBit, "TimingError",1); + h_HOflagcounter->setBinLabel(1+HcalCaloFlagLabels::ADCSaturationBit, "Saturation",1); + + // HF Flag Histograms + h_HFflagcounter=m_dbe->book1D("HFflags","HF flags",32,-0.5,31.5); + h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::HFLongShort, "LongShort",1); + h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::HFDigiTime, "DigiTime",1); + h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::HFTimingTrustBits,"TimingTrust1",1); + h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingSubtractedBit, "Subtracted",1); + h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingAddedBit, "Added",1); + h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingErrorBit, "TimingError",1); + h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::ADCSaturationBit, "Saturation",1); + + h_HBflagcounter->getTH1F()->LabelsOption("v"); + h_HEflagcounter->getTH1F()->LabelsOption("v"); + h_HOflagcounter->getTH1F()->LabelsOption("v"); + h_HFflagcounter->getTH1F()->LabelsOption("v"); - // HF Flag Histograms - h_HFflagcounter=m_dbe->book1D("HFflags","HF flags",32,-0.5,31.5); - h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::HFLongShort, "LongShort",1); - h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::HFDigiTime, "DigiTime",1); - h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::HFTimingTrustBits,"TimingTrust1",1); - h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingSubtractedBit, "Subtracted",1); - h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingAddedBit, "Added",1); - h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::TimingErrorBit, "TimingError",1); - h_HFflagcounter->setBinLabel(1+HcalCaloFlagLabels::ADCSaturationBit, "Saturation",1); - - h_HBflagcounter->getTH1F()->LabelsOption("v"); - h_HEflagcounter->getTH1F()->LabelsOption("v"); - h_HOflagcounter->getTH1F()->LabelsOption("v"); - h_HFflagcounter->getTH1F()->LabelsOption("v"); + if (rechit_makeDiagnostics_) + { + // hb + m_dbe->setCurrentFolder(baseFolder_+"/diagnostics/hb"); + h_HBEnergy=m_dbe->book1D("HB_energy","HB RecHit Energy",200,-5,5); + h_HBThreshEnergy=m_dbe->book1D("HB_energy_thresh", "HB RecHit Energy Above Threshold",200,-5,5); + h_HBTotalEnergy=m_dbe->book1D("HB_total_energy","HB RecHit Total Energy",200,-200,200); + h_HBThreshTotalEnergy=m_dbe->book1D("HB_total_energy_thresh", "HB RecHit Total Energy Above Threshold",200,-200,200); + h_HBTime=m_dbe->book1D("HB_time","HB RecHit Time",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); + h_HBThreshTime=m_dbe->book1D("HB_time_thresh", "HB RecHit Time Above Threshold",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); + h_HBOccupancy=m_dbe->book1D("HB_occupancy","HB RecHit Occupancy",2593,-0.5,2592.5); + h_HBThreshOccupancy=m_dbe->book1D("HB_occupancy_thresh","HB RecHit Occupancy Above Threshold",2593,-0.5,2592.5); - if (rechit_makeDiagnostics_) - { - // hb - m_dbe->setCurrentFolder(baseFolder_+"/diagnostics/hb"); - h_HBEnergy=m_dbe->book1D("HB_energy","HB RecHit Energy",200,-5,5); - h_HBThreshEnergy=m_dbe->book1D("HB_energy_thresh", "HB RecHit Energy Above Threshold",200,-5,5); - h_HBTotalEnergy=m_dbe->book1D("HB_total_energy","HB RecHit Total Energy",200,-200,200); - h_HBThreshTotalEnergy=m_dbe->book1D("HB_total_energy_thresh", "HB RecHit Total Energy Above Threshold",200,-200,200); - h_HBTime=m_dbe->book1D("HB_time","HB RecHit Time",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); - h_HBThreshTime=m_dbe->book1D("HB_time_thresh", "HB RecHit Time Above Threshold",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); - h_HBOccupancy=m_dbe->book1D("HB_occupancy","HB RecHit Occupancy",2593,-0.5,2592.5); - h_HBThreshOccupancy=m_dbe->book1D("HB_occupancy_thresh","HB RecHit Occupancy Above Threshold",2593,-0.5,2592.5); - - //he - m_dbe->setCurrentFolder(baseFolder_+"/diagnostics/he"); - h_HEEnergy=m_dbe->book1D("HE_energy","HE RecHit Energy",200,-5,5); - h_HEThreshEnergy=m_dbe->book1D("HE_energy_thresh", "HE RecHit Energy Above Threshold",200,-5,5); - h_HETotalEnergy=m_dbe->book1D("HE_total_energy","HE RecHit Total Energy",200,-200,200); - h_HEThreshTotalEnergy=m_dbe->book1D("HE_total_energy_thresh", "HE RecHit Total Energy Above Threshold",200,-200,200); - h_HETime=m_dbe->book1D("HE_time","HE RecHit Time",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); - h_HEThreshTime=m_dbe->book1D("HE_time_thresh", "HE RecHit Time Above Threshold",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); - h_HEOccupancy=m_dbe->book1D("HE_occupancy","HE RecHit Occupancy",2593,-0.5,2592.5); - h_HEThreshOccupancy=m_dbe->book1D("HE_occupancy_thresh","HE RecHit Occupancy Above Threshold",2593,-0.5,2592.5); - - // ho - m_dbe->setCurrentFolder(baseFolder_+"/diagnostics/ho"); - h_HOEnergy=m_dbe->book1D("HO_energy","HO RecHit Energy",200,-5,5); - h_HOThreshEnergy=m_dbe->book1D("HO_energy_thresh", "HO RecHit Energy Above Threshold",200,-5,5); - h_HOTotalEnergy=m_dbe->book1D("HO_total_energy","HO RecHit Total Energy",200,-200,200); - h_HOThreshTotalEnergy=m_dbe->book1D("HO_total_energy_thresh", "HO RecHit Total Energy Above Threshold",200,-200,200); - h_HOTime=m_dbe->book1D("HO_time","HO RecHit Time",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); - h_HOThreshTime=m_dbe->book1D("HO_time_thresh", "HO RecHit Time Above Threshold",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); - h_HOOccupancy=m_dbe->book1D("HO_occupancy","HO RecHit Occupancy",2161,-0.5,2160.5); - h_HOThreshOccupancy=m_dbe->book1D("HO_occupancy_thresh","HO RecHit Occupancy Above Threshold",2161,-0.5,2160.5); - - // hf - m_dbe->setCurrentFolder(baseFolder_+"/diagnostics/hf"); - h_HFEnergy=m_dbe->book1D("HF_energy","HF RecHit Energy",200,-5,5); - h_HFThreshEnergy=m_dbe->book1D("HF_energy_thresh", "HF RecHit Energy Above Threshold",200,-5,5); - h_HFTotalEnergy=m_dbe->book1D("HF_total_energy","HF RecHit Total Energy",200,-200,200); - h_HFThreshTotalEnergy=m_dbe->book1D("HF_total_energy_thresh", "HF RecHit Total Energy Above Threshold",200,-200,200); - h_HFTime=m_dbe->book1D("HF_time","HF RecHit Time",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); - h_HFThreshTime=m_dbe->book1D("HF_time_thresh", "HF RecHit Time Above Threshold",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); - h_HFOccupancy=m_dbe->book1D("HF_occupancy","HF RecHit Occupancy",1729,-0.5,1728.5); - h_HFThreshOccupancy=m_dbe->book1D("HF_occupancy_thresh","HF RecHit Occupancy Above Threshold",1729,-0.5,1728.5); - } // if (rechit_Diagnostics_) - } // if (m_dbe) - + //he + m_dbe->setCurrentFolder(baseFolder_+"/diagnostics/he"); + h_HEEnergy=m_dbe->book1D("HE_energy","HE RecHit Energy",200,-5,5); + h_HEThreshEnergy=m_dbe->book1D("HE_energy_thresh", "HE RecHit Energy Above Threshold",200,-5,5); + h_HETotalEnergy=m_dbe->book1D("HE_total_energy","HE RecHit Total Energy",200,-200,200); + h_HEThreshTotalEnergy=m_dbe->book1D("HE_total_energy_thresh", "HE RecHit Total Energy Above Threshold",200,-200,200); + h_HETime=m_dbe->book1D("HE_time","HE RecHit Time",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); + h_HEThreshTime=m_dbe->book1D("HE_time_thresh", "HE RecHit Time Above Threshold",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); + h_HEOccupancy=m_dbe->book1D("HE_occupancy","HE RecHit Occupancy",2593,-0.5,2592.5); + h_HEThreshOccupancy=m_dbe->book1D("HE_occupancy_thresh","HE RecHit Occupancy Above Threshold",2593,-0.5,2592.5); + + // ho + m_dbe->setCurrentFolder(baseFolder_+"/diagnostics/ho"); + h_HOEnergy=m_dbe->book1D("HO_energy","HO RecHit Energy",200,-5,5); + h_HOThreshEnergy=m_dbe->book1D("HO_energy_thresh", "HO RecHit Energy Above Threshold",200,-5,5); + h_HOTotalEnergy=m_dbe->book1D("HO_total_energy","HO RecHit Total Energy",200,-200,200); + h_HOThreshTotalEnergy=m_dbe->book1D("HO_total_energy_thresh", "HO RecHit Total Energy Above Threshold",200,-200,200); + h_HOTime=m_dbe->book1D("HO_time","HO RecHit Time",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); + h_HOThreshTime=m_dbe->book1D("HO_time_thresh", "HO RecHit Time Above Threshold",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); + h_HOOccupancy=m_dbe->book1D("HO_occupancy","HO RecHit Occupancy",2161,-0.5,2160.5); + h_HOThreshOccupancy=m_dbe->book1D("HO_occupancy_thresh","HO RecHit Occupancy Above Threshold",2161,-0.5,2160.5); + + // hf + m_dbe->setCurrentFolder(baseFolder_+"/diagnostics/hf"); + h_HFEnergy=m_dbe->book1D("HF_energy","HF RecHit Energy",200,-5,5); + h_HFThreshEnergy=m_dbe->book1D("HF_energy_thresh", "HF RecHit Energy Above Threshold",200,-5,5); + h_HFTotalEnergy=m_dbe->book1D("HF_total_energy","HF RecHit Total Energy",200,-200,200); + h_HFThreshTotalEnergy=m_dbe->book1D("HF_total_energy_thresh", "HF RecHit Total Energy Above Threshold",200,-200,200); + h_HFTime=m_dbe->book1D("HF_time","HF RecHit Time",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); + h_HFThreshTime=m_dbe->book1D("HF_time_thresh", "HF RecHit Time Above Threshold",int(TIME_MAX-TIME_MIN),TIME_MIN,TIME_MAX); + h_HFOccupancy=m_dbe->book1D("HF_occupancy","HF RecHit Occupancy",1729,-0.5,1728.5); + h_HFThreshOccupancy=m_dbe->book1D("HF_occupancy_thresh","HF RecHit Occupancy Above Threshold",1729,-0.5,1728.5); + } // if (rechit_Diagnostics_) + if (showTiming) + { + cpu_timer.stop(); std::cout <<"TIMER:: HcalRecHitMonitor BEGINRUN -> "<1) std::cout <<" calibType = "<0) HOpresent_=true; if (hfHits.size()>0) HFpresent_=true; @@ -266,7 +301,10 @@ void HcalRecHitMonitor::processEvent(const HBHERecHitCollection& hbHits, { fill_Nevents(); } - + if (showTiming) + { + cpu_timer.stop(); std::cout <<"TIMER:: HcalRecHitMonitor PROCESSEVENT -> "<("TrigPrimMonitor_ZSAlarmThreshold", 0); + AllowedCalibTypes_ = ps.getUntrackedParameter >("TrigPrimMonitor_AllowedCalibTypes",AllowedCalibTypes_); - if ( m_dbe !=NULL ) { - - std::string type; - m_dbe->setCurrentFolder(baseFolder_); + return; +} - //------------- Summary ------------------------- - type = "TrigPrim Event Number"; - meEVT_ = m_dbe->bookInt(type); - meEVT_->Fill(ievt_); - meTOTALEVT_ = m_dbe->bookInt("TrigPrim Total Events Processed"); - meTOTALEVT_->Fill(tevt_); +void HcalTrigPrimMonitor::beginRun() +{ + HcalBaseMonitor::beginRun(); + if (m_dbe==NULL) return; + + std::string type; + m_dbe->setCurrentFolder(baseFolder_); + + //------------- Summary ------------------------- + type = "TrigPrim Event Number"; + meEVT_ = m_dbe->bookInt(type); + meEVT_->Fill(ievt_); + meTOTALEVT_ = m_dbe->bookInt("TrigPrim Total Events Processed"); + meTOTALEVT_->Fill(tevt_); - type = "Summary"; - Summary_ = m_dbe->book2D(type, type, 2, 0, 2, 2, 0, 2); - Summary_->setBinLabel(1, "Good"); - Summary_->setBinLabel(2, "Bad"); - Summary_->setBinLabel(1, "HBHE", 2); - Summary_->setBinLabel(2, "HF", 2); - - type = "Summary for ZS run"; - SummaryZS_ = m_dbe->book2D(type, type, 2, 0, 2, 2, 0, 2); - SummaryZS_->setBinLabel(1, "Good"); - SummaryZS_->setBinLabel(2, "Bad"); - SummaryZS_->setBinLabel(1, "HBHE", 2); - SummaryZS_->setBinLabel(2, "HF", 2); - - type = "Error Flag"; - ErrorFlagSummary_ = m_dbe->book2D(type, type, kNErrorFlag, 0, kNErrorFlag, 2, 0, 2); - ErrorFlagSummary_->setBinLabel(1, "Matched"); - ErrorFlagSummary_->setBinLabel(2, "Mismatched E"); - ErrorFlagSummary_->setBinLabel(3, "Mismatched FG"); - ErrorFlagSummary_->setBinLabel(4, "Data Only"); - ErrorFlagSummary_->setBinLabel(5, "Emul Only"); - ErrorFlagSummary_->setBinLabel(6, "Missing Data"); - ErrorFlagSummary_->setBinLabel(7, "Missing Emul"); - ErrorFlagSummary_->setBinLabel(1, "HBHE", 2); - ErrorFlagSummary_->setBinLabel(2, "HF", 2); - - type = "Error Flag for ZS run"; - ErrorFlagSummaryZS_ = m_dbe->book2D(type, type, kNErrorFlag, 0, kNErrorFlag, 2, 0, 2); - ErrorFlagSummaryZS_->setBinLabel(1, "Matched"); - ErrorFlagSummaryZS_->setBinLabel(2, "Mismatched E"); - ErrorFlagSummaryZS_->setBinLabel(3, "Mismatched FG"); - ErrorFlagSummaryZS_->setBinLabel(4, "Data Only"); - ErrorFlagSummaryZS_->setBinLabel(5, "Emul Only"); - ErrorFlagSummaryZS_->setBinLabel(6, "Missing Data"); - ErrorFlagSummaryZS_->setBinLabel(7, "Missing Emul"); - ErrorFlagSummaryZS_->setBinLabel(1, "HBHE", 2); - ErrorFlagSummaryZS_->setBinLabel(2, "HF", 2); - - type = "EtCorr HBHE"; - EtCorr_[0] = m_dbe->book2D(type,type,50,0,256,50,0,256); - - type = "EtCorr HF"; - EtCorr_[1] = m_dbe->book2D(type,type,50,0,256,50,0,256); - - type = "FGCorr HBHE"; - FGCorr_[0] = m_dbe->book2D(type,type,2,0,2,2,0,2); - - type = "FGCorr HF"; - FGCorr_[1] = m_dbe->book2D(type,type,2,0,2,2,0,2); - - //--------------------------------------------- - - //-------------- TP Occupancy ---------------- - m_dbe->setCurrentFolder(baseFolder_ + "/TP Map"); - - type = "TP Occupancy"; - TPOccupancy_= m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); - type = "Non Zero TP"; - TPOccupancyEta_ = m_dbe->book1D("TPOccupancyVsEta","TP Occupancy Vs. Eta", etaBins_,etaMin_,etaMax_); - TPOccupancyPhi_ = m_dbe->book1D("TPOccupancyVsPhi","TP Occupancy Vs. Phi", phiBins_,phiMin_,phiMax_); - NonZeroTP_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); - type = "Matched TP"; - MatchedTP_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); - type = "Mismatched Et"; - MismatchedEt_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); - type = "Mismatched FG"; - MismatchedFG_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); - type = "Data Only"; - DataOnly_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); - type = "Emul Only"; - EmulOnly_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); - type = "Missing Data"; - MissingData_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); - type = "Missing Emul"; - MissingEmul_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); - //--------------------------------------------- - - //-------------- TP Occupancy for ZS---------------- - m_dbe->setCurrentFolder(baseFolder_ + "/TP Map for ZS"); - - type = "Mismatched Et ZS"; - MismatchedEtZS_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); - type = "Missing Data ZS"; - MissingDataZS_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); - type = "Missing Emul ZS"; - MissingEmulZS_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); - //--------------------------------------------- - - //------------ Energy Plots ------------------ - // HBHE - m_dbe->setCurrentFolder(baseFolder_ + "/Energy Plots/HBHE"); - - type = "Energy HBHE - All Data"; - EnergyPlotsAllData_[0] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HBHE - All Emul"; - EnergyPlotsAllEmul_[0] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HBHE - Mismatched FG"; - EnergyPlotsMismatchedFG_[0] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HBHE - Data Only"; - EnergyPlotsDataOnly_[0] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HBHE - Emul Only"; - EnergyPlotsEmulOnly_[0] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HBHE - Missing Data"; - EnergyPlotsMissingData_[0] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HBHE - Missing Emul"; - EnergyPlotsMissingEmul_[0] = m_dbe->book1D(type, type, 256, 0, 256); - - // HF - m_dbe->setCurrentFolder(baseFolder_ + "/Energy Plots/HF"); - - type = "Energy HF - All Data"; - EnergyPlotsAllData_[1] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HF - All Emul"; - EnergyPlotsAllEmul_[1] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HF - Mismatched FG"; - EnergyPlotsMismatchedFG_[1] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HF - Data Only"; - EnergyPlotsDataOnly_[1] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HF - Emul Only"; - EnergyPlotsEmulOnly_[1] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HF - Missing Data"; - EnergyPlotsMissingData_[1] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HF - Missing Emul"; - EnergyPlotsMissingEmul_[1] = m_dbe->book1D(type, type, 256, 0, 256); - - // ZS - m_dbe->setCurrentFolder(baseFolder_ + "/Energy Plots for ZS"); - - type = "Energy HBHE - Missing Data - ZS"; - EnergyPlotsMissingDataZS_[0] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HBHE - Missing Emul - ZS"; - EnergyPlotsMissingEmulZS_[0] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HF - Missing Data - ZS"; - EnergyPlotsMissingDataZS_[1] = m_dbe->book1D(type, type, 256, 0, 256); - type = "Energy HF - Missing Emul - ZS"; - EnergyPlotsMissingEmulZS_[1] = m_dbe->book1D(type, type, 256, 0, 256); - - } + type = "Summary"; + Summary_ = m_dbe->book2D(type, type, 2, 0, 2, 2, 0, 2); + Summary_->setBinLabel(1, "Good"); + Summary_->setBinLabel(2, "Bad"); + Summary_->setBinLabel(1, "HBHE", 2); + Summary_->setBinLabel(2, "HF", 2); + + type = "Summary for ZS run"; + SummaryZS_ = m_dbe->book2D(type, type, 2, 0, 2, 2, 0, 2); + SummaryZS_->setBinLabel(1, "Good"); + SummaryZS_->setBinLabel(2, "Bad"); + SummaryZS_->setBinLabel(1, "HBHE", 2); + SummaryZS_->setBinLabel(2, "HF", 2); + + type = "Error Flag"; + ErrorFlagSummary_ = m_dbe->book2D(type, type, kNErrorFlag, 0, kNErrorFlag, 2, 0, 2); + ErrorFlagSummary_->setBinLabel(1, "Matched"); + ErrorFlagSummary_->setBinLabel(2, "Mismatched E"); + ErrorFlagSummary_->setBinLabel(3, "Mismatched FG"); + ErrorFlagSummary_->setBinLabel(4, "Data Only"); + ErrorFlagSummary_->setBinLabel(5, "Emul Only"); + ErrorFlagSummary_->setBinLabel(6, "Missing Data"); + ErrorFlagSummary_->setBinLabel(7, "Missing Emul"); + ErrorFlagSummary_->setBinLabel(1, "HBHE", 2); + ErrorFlagSummary_->setBinLabel(2, "HF", 2); + + type = "Error Flag for ZS run"; + ErrorFlagSummaryZS_ = m_dbe->book2D(type, type, kNErrorFlag, 0, kNErrorFlag, 2, 0, 2); + ErrorFlagSummaryZS_->setBinLabel(1, "Matched"); + ErrorFlagSummaryZS_->setBinLabel(2, "Mismatched E"); + ErrorFlagSummaryZS_->setBinLabel(3, "Mismatched FG"); + ErrorFlagSummaryZS_->setBinLabel(4, "Data Only"); + ErrorFlagSummaryZS_->setBinLabel(5, "Emul Only"); + ErrorFlagSummaryZS_->setBinLabel(6, "Missing Data"); + ErrorFlagSummaryZS_->setBinLabel(7, "Missing Emul"); + ErrorFlagSummaryZS_->setBinLabel(1, "HBHE", 2); + ErrorFlagSummaryZS_->setBinLabel(2, "HF", 2); + + type = "EtCorr HBHE"; + EtCorr_[0] = m_dbe->book2D(type,type,50,0,256,50,0,256); + + type = "EtCorr HF"; + EtCorr_[1] = m_dbe->book2D(type,type,50,0,256,50,0,256); + + type = "FGCorr HBHE"; + FGCorr_[0] = m_dbe->book2D(type,type,2,0,2,2,0,2); + + type = "FGCorr HF"; + FGCorr_[1] = m_dbe->book2D(type,type,2,0,2,2,0,2); + + //--------------------------------------------- + + //-------------- TP Occupancy ---------------- + m_dbe->setCurrentFolder(baseFolder_ + "/TP Map"); + + type = "TP Occupancy"; + TPOccupancy_= m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); + type = "Non Zero TP"; + TPOccupancyEta_ = m_dbe->book1D("TPOccupancyVsEta","TP Occupancy Vs. Eta", etaBins_,etaMin_,etaMax_); + TPOccupancyPhi_ = m_dbe->book1D("TPOccupancyVsPhi","TP Occupancy Vs. Phi", phiBins_,phiMin_,phiMax_); + NonZeroTP_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); + type = "Matched TP"; + MatchedTP_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); + type = "Mismatched Et"; + MismatchedEt_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); + type = "Mismatched FG"; + MismatchedFG_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); + type = "Data Only"; + DataOnly_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); + type = "Emul Only"; + EmulOnly_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); + type = "Missing Data"; + MissingData_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); + type = "Missing Emul"; + MissingEmul_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); + //--------------------------------------------- + + //-------------- TP Occupancy for ZS---------------- + m_dbe->setCurrentFolder(baseFolder_ + "/TP Map for ZS"); + + type = "Mismatched Et ZS"; + MismatchedEtZS_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); + type = "Missing Data ZS"; + MissingDataZS_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); + type = "Missing Emul ZS"; + MissingEmulZS_ = m_dbe->book2D(type,type,etaBins_,etaMin_,etaMax_,phiBins_,phiMin_,phiMax_); + //--------------------------------------------- + + //------------ Energy Plots ------------------ + // HBHE + m_dbe->setCurrentFolder(baseFolder_ + "/Energy Plots/HBHE"); + + type = "Energy HBHE - All Data"; + EnergyPlotsAllData_[0] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HBHE - All Emul"; + EnergyPlotsAllEmul_[0] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HBHE - Mismatched FG"; + EnergyPlotsMismatchedFG_[0] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HBHE - Data Only"; + EnergyPlotsDataOnly_[0] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HBHE - Emul Only"; + EnergyPlotsEmulOnly_[0] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HBHE - Missing Data"; + EnergyPlotsMissingData_[0] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HBHE - Missing Emul"; + EnergyPlotsMissingEmul_[0] = m_dbe->book1D(type, type, 256, 0, 256); + + // HF + m_dbe->setCurrentFolder(baseFolder_ + "/Energy Plots/HF"); + + type = "Energy HF - All Data"; + EnergyPlotsAllData_[1] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HF - All Emul"; + EnergyPlotsAllEmul_[1] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HF - Mismatched FG"; + EnergyPlotsMismatchedFG_[1] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HF - Data Only"; + EnergyPlotsDataOnly_[1] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HF - Emul Only"; + EnergyPlotsEmulOnly_[1] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HF - Missing Data"; + EnergyPlotsMissingData_[1] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HF - Missing Emul"; + EnergyPlotsMissingEmul_[1] = m_dbe->book1D(type, type, 256, 0, 256); + + // ZS + m_dbe->setCurrentFolder(baseFolder_ + "/Energy Plots for ZS"); + + type = "Energy HBHE - Missing Data - ZS"; + EnergyPlotsMissingDataZS_[0] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HBHE - Missing Emul - ZS"; + EnergyPlotsMissingEmulZS_[0] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HF - Missing Data - ZS"; + EnergyPlotsMissingDataZS_[1] = m_dbe->book1D(type, type, 256, 0, 256); + type = "Energy HF - Missing Emul - ZS"; + EnergyPlotsMissingEmulZS_[1] = m_dbe->book1D(type, type, 256, 0, 256); return; -} // void HcalTrigPrimMonitor::setup(...) +} // void HcalTrigPrimMonitor::beginRun() void HcalTrigPrimMonitor::processEvent(const HBHERecHitCollection& hbHits, const HORecHitCollection& hoHits, @@ -184,10 +189,11 @@ void HcalTrigPrimMonitor::processEvent(const HBHERecHitCollection& hbHits, const HBHEDigiCollection& hbhedigi, const HODigiCollection& hodigi, const HFDigiCollection& hfdigi, - const HcalTrigPrimDigiCollection& tpDigis, - const HcalTrigPrimDigiCollection& emultpDigis, - const FEDRawDataCollection& rawraw, - const HcalElectronicsMap& emap + const HcalTrigPrimDigiCollection& tpDigis, + const HcalTrigPrimDigiCollection& emultpDigis, + const FEDRawDataCollection& rawraw, + const HcalElectronicsMap& emap, + int CalibType ) { @@ -196,6 +202,26 @@ void HcalTrigPrimMonitor::processEvent(const HBHERecHitCollection& hbHits, return; } + // Check that event is of proper calibration type + bool processevent=false; + if (AllowedCalibTypes_.size()==0) + processevent=true; + else + { + for (unsigned int i=0;i1) std::cout <<" calibType = "<