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) {
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);
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);
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);
124  }
125  }
126 }
127 
128 std::shared_ptr<hcaldqm::Cache> NoCQTask::globalBeginLuminosityBlock(edm::LuminosityBlock const& lb,
129  edm::EventSetup const& es) const {
130  return DQTask::globalBeginLuminosityBlock(lb, es);
131 }
132 
134  DQTask::globalEndLuminosityBlock(lb, es);
135 }
136 
NoCQTask::globalEndLuminosityBlock
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: NoCQTask.cc:133
NoCQTask::_tokReport
edm::EDGetTokenT< HcalUnpackerReport > _tokReport
Definition: NoCQTask.h:38
NoCQTask::_tokHBHE
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE
Definition: NoCQTask.h:35
hcaldqm::constants
Definition: Constants.h:9
hcaldqm::Container2D::initialize
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
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
hcaldqm::UpdateFreq
UpdateFreq
Definition: DQTask.h:32
bookHistograms
example_stream void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
NoCQTask::_tokHO
edm::EDGetTokenT< HODigiCollection > _tokHO
Definition: NoCQTask.h:36
edm::InputTag::instance
std::string const & instance() const
Definition: InputTag.h:37
HcalGenericDetId
Definition: HcalGenericDetId.h:15
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
hcaldqm::ContainerProf2D::book
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: ContainerProf2D.cc:47
hcaldqm::quantity::ValueQuantity
Definition: ValueQuantity.h:309
NoCQTask::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: NoCQTask.cc:22
hcaldqm
Definition: Constants.h:8
HcalUnpackerReport::bad_quality_end
DetIdVector::const_iterator bad_quality_end() const
Definition: HcalUnpackerReport.h:43
NoCQTask.h
NoCQTask::_cutSumQ_HBHE
double _cutSumQ_HBHE
Definition: NoCQTask.h:40
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
hcaldqm::hashfunctions::fdepth
Definition: HashFunctions.h:131
NoCQTask::_cBadQuality_depth
hcaldqm::Container2D _cBadQuality_depth
Definition: NoCQTask.h:47
hcaldqm::utilities::sumQ
double sumQ(DIGI const &digi, double ped, int i=0, int j=3)
Definition: Utilities.h:126
HcalDbService::getHcalMapping
const HcalElectronicsMap * getHcalMapping() const
Definition: HcalDbService.cc:343
NoCQTask::_tagReport
edm::InputTag _tagReport
Definition: NoCQTask.h:34
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
NoCQTask::globalBeginLuminosityBlock
std::shared_ptr< hcaldqm::Cache > globalBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const override
Definition: NoCQTask.cc:128
hcaldqm::quantity::fieta
Definition: DetectorQuantity.h:15
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
NoCQTask::_tokHF
edm::EDGetTokenT< HFDigiCollection > _tokHF
Definition: NoCQTask.h:37
hcaldqm::quantity::fiphi
Definition: DetectorQuantity.h:14
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
hcaldqm::ContainerProf2D::initialize
void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fEnergy), int debug=0) override
Definition: ContainerProf2D.cc:22
edm::ESHandle< HcalDbService >
hcaldqm::DQModule::_name
std::string _name
Definition: DQModule.h:41
hcaldqm::quantity::DetectorQuantity
Definition: DetectorQuantity.h:59
hcaldqm::quantity::fN
Definition: ValueQuantity.h:11
Logger::dqmthrow
void dqmthrow(std::string const &msg) const
Definition: Logger.h:12
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
hcaldqm::Container2D::book
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: Container2D.cc:558
hcaldqm::Container2D::fill
void fill(HcalDetId const &) override
Definition: Container2D.cc:52
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
hcaldqm::DQModule::_logger
Logger _logger
Definition: DQModule.h:54
HcalDetId
Definition: HcalDetId.h:12
NoCQTask::_tagHF
edm::InputTag _tagHF
Definition: NoCQTask.h:33
hcaldqm::quantity::fTiming_TS200
Definition: ValueQuantity.h:22
cuy.ib
ib
Definition: cuy.py:662
NoCQTask::_cutSumQ_HF
double _cutSumQ_HF
Definition: NoCQTask.h:40
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
NoCQTask::_resetMonitors
void _resetMonitors(hcaldqm::UpdateFreq) override
Definition: NoCQTask.cc:64
hcaldqm::DQModule::_subsystem
std::string _subsystem
Definition: DQModule.h:48
alignCSCRings.r
r
Definition: alignCSCRings.py:93
hcaldqm::ContainerProf2D::fill
void fill(HcalDetId const &) override
Definition: ContainerProf2D.cc:228
ecalMatacq_cfi.timing
timing
Definition: ecalMatacq_cfi.py:26
HcalGenericDetId::isHcalDetId
bool isHcalDetId() const
Definition: HcalGenericDetId.cc:64
HcalUnpackerReport::bad_quality_begin
DetIdVector::const_iterator bad_quality_begin() const
Definition: HcalUnpackerReport.h:42
NoCQTask::_tagHO
edm::InputTag _tagHO
Definition: NoCQTask.h:32
NoCQTask::_cTimingCut_depth
hcaldqm::ContainerProf2D _cTimingCut_depth
Definition: NoCQTask.h:44
hcaldqm::DQTask::_emap
const HcalElectronicsMap * _emap
Definition: DQTask.h:80
NoCQTask::_cutSumQ_HO
double _cutSumQ_HO
Definition: NoCQTask.h:40
NoCQTask::_cOccupancyCut_depth
hcaldqm::Container2D _cOccupancyCut_depth
Definition: NoCQTask.h:46
hcaldqm::DQTask
Definition: DQTask.h:33
HcalDbRecord
Definition: HcalDbRecord.h:30
NoCQTask
Definition: NoCQTask.py:1
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
NoCQTask::NoCQTask
NoCQTask(edm::ParameterSet const &)
Definition: NoCQTask.cc:6
NoCQTask::_process
void _process(edm::Event const &, edm::EventSetup const &) override
Definition: NoCQTask.cc:66
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
NoCQTask::_cOccupancy_depth
hcaldqm::Container2D _cOccupancy_depth
Definition: NoCQTask.h:45
NoCQTask::_tagHBHE
edm::InputTag _tagHBHE
Definition: NoCQTask.h:31