CMS 3D CMS Logo

NoCQTask.cc
Go to the documentation of this file.
2 
3 using namespace hcaldqm;
4 using namespace hcaldqm::constants;
5 
7  _tagHBHE = ps.getUntrackedParameter<edm::InputTag>("tagHBHE", edm::InputTag("hcalDigis"));
8  _tagHO = ps.getUntrackedParameter<edm::InputTag>("tagHO", edm::InputTag("hcalDigis"));
9  _tagHF = ps.getUntrackedParameter<edm::InputTag>("tagHF", edm::InputTag("hcalDigis"));
10  _tagReport = ps.getUntrackedParameter<edm::InputTag>("tagReport", edm::InputTag("hcalDigis"));
11 
12  _tokHBHE = consumes<HBHEDigiCollection>(_tagHBHE);
13  _tokHO = consumes<HODigiCollection>(_tagHO);
14  _tokHF = consumes<HFDigiCollection>(_tagHF);
15  _tokReport = consumes<HcalUnpackerReport>(_tagReport);
16 
17  _cutSumQ_HBHE = ps.getUntrackedParameter<double>("cutSumQ_HBHE", 20);
18  _cutSumQ_HO = ps.getUntrackedParameter<double>("cutSumQ_HO", 20);
19  _cutSumQ_HF = ps.getUntrackedParameter<double>("cutSumQ_HF", 20);
20 }
21 
22 /* virtual */ void NoCQTask::bookHistograms(DQMStore::IBooker& ib, edm::Run const& r, edm::EventSetup const& es) {
23  DQTask::bookHistograms(ib, r, es);
24 
26  es.get<HcalDbRecord>().get(dbs);
27  _emap = dbs->getHcalMapping();
28 
30  "TimingCut",
35  0);
37  "Occupancy",
42  0);
44  "OccupancyCut",
49  0);
51  "BadQuality",
56  0);
57 
62 }
63 
64 /* virtual */ void NoCQTask::_resetMonitors(hcaldqm::UpdateFreq uf) { DQTask::_resetMonitors(uf); }
65 
66 /* virtual */ void NoCQTask::_process(edm::Event const& e, edm::EventSetup const&) {
71 
72  if (!e.getByToken(_tokHBHE, chbhe))
73  _logger.dqmthrow("Collection HBHEDigiCollection isn't available" + _tagHBHE.label() + " " + _tagHBHE.instance());
74  if (!e.getByToken(_tokHO, cho))
75  _logger.dqmthrow("Collection HODigiCollection isn't available" + _tagHO.label() + " " + _tagHO.instance());
76  if (!e.getByToken(_tokHF, chf))
77  _logger.dqmthrow("Collection HFDigiCollection isn't available" + _tagHF.label() + " " + _tagHF.instance());
78  if (!e.getByToken(_tokReport, creport))
79  _logger.dqmthrow("Collection HcalUnpackerReport isn't available" + _tagReport.label() + " " +
81 
82  // RAW Bad Quality
83  for (std::vector<DetId>::const_iterator it = creport->bad_quality_begin(); it != creport->bad_quality_end(); ++it) {
84  if (!HcalGenericDetId(*it).isHcalDetId())
85  continue;
86 
88  }
89 
90  // DIGI HBH, HO, HF
91  for (HBHEDigiCollection::const_iterator it = chbhe->begin(); it != chbhe->end(); ++it) {
92  double sumQ = hcaldqm::utilities::sumQ<HBHEDataFrame>(*it, 2.5, 0, it->size() - 1);
93  HcalDetId const& did = it->id();
94 
96  if (sumQ > _cutSumQ_HBHE) {
97  double timing = hcaldqm::utilities::aveTS<HBHEDataFrame>(*it, 2.5, 0, it->size() - 1);
99  _cTimingCut_depth.fill(did, timing);
100  }
101  }
102 
103  for (HODigiCollection::const_iterator it = cho->begin(); it != cho->end(); ++it) {
104  double sumQ = hcaldqm::utilities::sumQ<HODataFrame>(*it, 8.5, 0, it->size() - 1);
105  HcalDetId const& did = it->id();
106 
107  _cOccupancy_depth.fill(did);
108  if (sumQ > _cutSumQ_HO) {
109  double timing = hcaldqm::utilities::aveTS<HODataFrame>(*it, 8.5, 0, it->size() - 1);
111  _cTimingCut_depth.fill(did, timing);
112  }
113  }
114 
115  for (HFDigiCollection::const_iterator it = chf->begin(); it != chf->end(); ++it) {
116  double sumQ = hcaldqm::utilities::sumQ<HFDataFrame>(*it, 2.5, 0, it->size() - 1);
117  HcalDetId const& did = it->id();
118 
119  _cOccupancy_depth.fill(did);
120  if (sumQ > _cutSumQ_HF) {
121  double timing = hcaldqm::utilities::aveTS<HFDataFrame>(*it, 2.5, 0, it->size() - 1);
123  _cTimingCut_depth.fill(did, timing);
124  }
125  }
126 }
127 
128 /* virtual */ void NoCQTask::beginLuminosityBlock(edm::LuminosityBlock const& lb, edm::EventSetup const& es) {
129  DQTask::beginLuminosityBlock(lb, es);
130 }
131 
132 /* virtual */ void NoCQTask::endLuminosityBlock(edm::LuminosityBlock const& lb, edm::EventSetup const& es) {
133  DQTask::endLuminosityBlock(lb, es);
134 }
135 
T getUntrackedParameter(std::string const &, T const &) const
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: NoCQTask.cc:132
hcaldqm::Container2D _cOccupancy_depth
Definition: NoCQTask.h:44
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: NoCQTask.cc:128
void fill(HcalDetId const &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
UpdateFreq
Definition: DQTask.h:16
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: NoCQTask.cc:22
std::vector< T >::const_iterator const_iterator
edm::EDGetTokenT< HFDigiCollection > _tokHF
Definition: NoCQTask.h:36
edm::EDGetTokenT< HcalUnpackerReport > _tokReport
Definition: NoCQTask.h:37
void _resetMonitors(hcaldqm::UpdateFreq) override
Definition: NoCQTask.cc:64
void _process(edm::Event const &, edm::EventSetup const &) override
Definition: NoCQTask.cc:66
hcaldqm::ContainerProf2D _cTimingCut_depth
Definition: NoCQTask.h:43
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void dqmthrow(std::string const &msg) const
Definition: Logger.h:12
edm::EDGetTokenT< HODigiCollection > _tokHO
Definition: NoCQTask.h:35
edm::InputTag _tagHF
Definition: NoCQTask.h:32
DetIdVector::const_iterator bad_quality_begin() const
Logger _logger
Definition: DQModule.h:54
edm::InputTag _tagHBHE
Definition: NoCQTask.h:30
std::string _name
Definition: DQModule.h:41
HcalElectronicsMap const * _emap
Definition: DQTask.h:59
bool isHcalDetId() const
const_iterator end() const
edm::InputTag _tagReport
Definition: NoCQTask.h:33
double _cutSumQ_HF
Definition: NoCQTask.h:39
virtual void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: Container2D.cc:25
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fEnergy), int debug=0) override
hcaldqm::Container2D _cBadQuality_depth
Definition: NoCQTask.h:46
std::string const & label() const
Definition: InputTag.h:36
T get() const
Definition: EventSetup.h:71
void fill(HcalDetId const &) override
Definition: Container2D.cc:52
const HcalElectronicsMap * getHcalMapping() const
std::string _subsystem
Definition: DQModule.h:48
edm::InputTag _tagHO
Definition: NoCQTask.h:31
double _cutSumQ_HO
Definition: NoCQTask.h:39
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: Container2D.cc:558
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE
Definition: NoCQTask.h:34
std::string const & instance() const
Definition: InputTag.h:37
hcaldqm::Container2D _cOccupancyCut_depth
Definition: NoCQTask.h:45
NoCQTask(edm::ParameterSet const &)
Definition: NoCQTask.cc:6
const_iterator begin() const
double _cutSumQ_HBHE
Definition: NoCQTask.h:39
Definition: Run.h:45
DetIdVector::const_iterator bad_quality_end() const
ib
Definition: cuy.py:662
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:126