CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
NoCQTask.cc
Go to the documentation of this file.
2 
3 using namespace hcaldqm;
4 using namespace hcaldqm::constants;
5 
7  DQTask(ps)
8 {
10  edm::InputTag("hcalDigis"));
12  edm::InputTag("hcalDigis"));
14  edm::InputTag("hcalDigis"));
16  edm::InputTag("hcalDigis"));
17 
18  _tokHBHE = consumes<HBHEDigiCollection>(_tagHBHE);
19  _tokHO = consumes<HODigiCollection>(_tagHO);
20  _tokHF = consumes<HFDigiCollection>(_tagHF);
21  _tokReport = consumes<HcalUnpackerReport>(_tagReport);
22 
23  _cutSumQ_HBHE = ps.getUntrackedParameter<double>("cutSumQ_HBHE", 20);
24  _cutSumQ_HO = ps.getUntrackedParameter<double>("cutSumQ_HO", 20);
25  _cutSumQ_HF = ps.getUntrackedParameter<double>("cutSumQ_HF", 20);
26 }
27 
29  edm::Run const& r, edm::EventSetup const& es)
30 {
31  DQTask::bookHistograms(ib, r, es);
32 
34  es.get<HcalDbRecord>().get(dbs);
35  _emap = dbs->getHcalMapping();
36 
37  _cTimingCut_depth.initialize(_name, "TimingCut",
42  _cOccupancy_depth.initialize(_name, "Occupancy",
47  _cOccupancyCut_depth.initialize(_name, "OccupancyCut",
52  _cBadQuality_depth.initialize(_name, "BadQuality",
57 
62 }
63 
65 {
66  DQTask::_resetMonitors(uf);
67 }
68 
69 /* virtual */ void NoCQTask::_process(edm::Event const& e,
70  edm::EventSetup const&)
71 {
76 
77  if (!e.getByToken(_tokHBHE, chbhe))
78  _logger.dqmthrow("Collection HBHEDigiCollection isn't available"
79  + _tagHBHE.label() + " " + _tagHBHE.instance());
80  if (!e.getByToken(_tokHO, cho))
81  _logger.dqmthrow("Collection HODigiCollection isn't available"
82  + _tagHO.label() + " " + _tagHO.instance());
83  if (!e.getByToken(_tokHF, chf))
84  _logger.dqmthrow("Collection HFDigiCollection isn't available"
85  + _tagHF.label() + " " + _tagHF.instance());
86  if (!e.getByToken(_tokReport, creport))
87  _logger.dqmthrow("Collection HcalUnpackerReport isn't available"+
89 
90  // RAW Bad Quality
91  for (std::vector<DetId>::const_iterator it=creport->bad_quality_begin();
92  it!=creport->bad_quality_end(); ++it)
93  {
94  if (!HcalGenericDetId(*it).isHcalDetId())
95  continue;
96 
98  }
99 
100  // DIGI HBH, HO, HF
101  for (HBHEDigiCollection::const_iterator it=chbhe->begin(); it!=chbhe->end();
102  ++it)
103  {
104  double sumQ = hcaldqm::utilities::sumQ<HBHEDataFrame>(*it, 2.5, 0, it->size()-1);
105  HcalDetId const& did = it->id();
106 
107  _cOccupancy_depth.fill(did);
108  if (sumQ>_cutSumQ_HBHE)
109  {
110  double timing = hcaldqm::utilities::aveTS<HBHEDataFrame>(*it, 2.5, 0,
111  it->size()-1);
113  _cTimingCut_depth.fill(did, timing);
114  }
115  }
116 
117  for (HODigiCollection::const_iterator it=cho->begin(); it!=cho->end();
118  ++it)
119  {
120  double sumQ = hcaldqm::utilities::sumQ<HODataFrame>(*it, 8.5, 0, it->size()-1);
121  HcalDetId const& did = it->id();
122 
123  _cOccupancy_depth.fill(did);
124  if (sumQ>_cutSumQ_HO)
125  {
126  double timing = hcaldqm::utilities::aveTS<HODataFrame>(*it, 8.5, 0,
127  it->size()-1);
129  _cTimingCut_depth.fill(did, timing);
130  }
131  }
132 
133  for (HFDigiCollection::const_iterator it=chf->begin(); it!=chf->end();
134  ++it)
135  {
136  double sumQ = hcaldqm::utilities::sumQ<HFDataFrame>(*it, 2.5, 0, it->size()-1);
137  HcalDetId const& did = it->id();
138 
139  _cOccupancy_depth.fill(did);
140  if (sumQ>_cutSumQ_HF)
141  {
142  double timing = hcaldqm::utilities::aveTS<HFDataFrame>(*it, 2.5, 0, it->size()-1);
144  _cTimingCut_depth.fill(did, timing);
145  }
146  }
147 }
148 
150  edm::LuminosityBlock const& lb, edm::EventSetup const& es)
151 {
152  DQTask::beginLuminosityBlock(lb, es);
153 }
154 
156  lb, edm::EventSetup const& es)
157 {
158  DQTask::endLuminosityBlock(lb, es);
159 }
160 
T getUntrackedParameter(std::string const &, T const &) const
int ib
Definition: cuy.py:660
hcaldqm::Container2D _cOccupancy_depth
Definition: NoCQTask.h:49
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
UpdateFreq
Definition: DQTask.h:17
std::vector< HBHEDataFrame >::const_iterator const_iterator
edm::EDGetTokenT< HFDigiCollection > _tokHF
Definition: NoCQTask.h:40
void bookHistograms(fwlite::EventContainer &eventCont)
edm::EDGetTokenT< HcalUnpackerReport > _tokReport
Definition: NoCQTask.h:41
HcalElectronicsMap const * _emap
Definition: NoCQTask.h:45
virtual void fill(HcalDetId const &)
Definition: Container2D.cc:59
virtual void _process(edm::Event const &, edm::EventSetup const &)
Definition: NoCQTask.cc:69
hcaldqm::ContainerProf2D _cTimingCut_depth
Definition: NoCQTask.h:48
void dqmthrow(std::string const &msg) const
Definition: Logger.h:15
virtual void initialize(std::string const &folder, hashfunctions::HashType, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fEnergy), int debug=0)
edm::EDGetTokenT< HODigiCollection > _tokHO
Definition: NoCQTask.h:39
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: NoCQTask.cc:149
edm::InputTag _tagHF
Definition: NoCQTask.h:36
virtual void initialize(std::string const &folder, hashfunctions::HashType, Quantity *, Quantity *, Quantity *qz=new ValueQuantity(quantity::fN), int debug=0)
Definition: Container2D.cc:32
Logger _logger
Definition: DQModule.h:70
edm::InputTag _tagHBHE
Definition: NoCQTask.h:34
std::string _name
Definition: DQModule.h:57
bool isHcalDetId() const
virtual void _resetMonitors(hcaldqm::UpdateFreq)
Definition: NoCQTask.cc:64
edm::InputTag _tagReport
Definition: NoCQTask.h:37
double _cutSumQ_HF
Definition: NoCQTask.h:43
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
Definition: Container2D.cc:895
const T & get() const
Definition: EventSetup.h:56
hcaldqm::Container2D _cBadQuality_depth
Definition: NoCQTask.h:51
std::string const & label() const
Definition: InputTag.h:36
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: NoCQTask.cc:155
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
Definition: NoCQTask.cc:28
std::string _subsystem
Definition: DQModule.h:64
edm::InputTag _tagHO
Definition: NoCQTask.h:35
double _cutSumQ_HO
Definition: NoCQTask.h:43
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE
Definition: NoCQTask.h:38
std::string const & instance() const
Definition: InputTag.h:37
hcaldqm::Container2D _cOccupancyCut_depth
Definition: NoCQTask.h:50
NoCQTask(edm::ParameterSet const &)
Definition: NoCQTask.cc:6
double _cutSumQ_HBHE
Definition: NoCQTask.h:43
Definition: Run.h:43
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:79