CMS 3D CMS Logo

DigiComparisonTask.cc
Go to the documentation of this file.
1 
3 
4 using namespace hcaldqm;
5 using namespace hcaldqm::constants;
6 
8  // tags and tokens
9  _tagHBHE1 = ps.getUntrackedParameter<edm::InputTag>("tagHBHE1", edm::InputTag("hcalDigis"));
10  _tagHBHE2 = ps.getUntrackedParameter<edm::InputTag>("tagHBHE2", edm::InputTag("vmeDigis"));
11  _tokHBHE1 = consumes<HBHEDigiCollection>(_tagHBHE1);
12  _tokHBHE2 = consumes<HBHEDigiCollection>(_tagHBHE2);
13 }
14 /* virtual */ void DigiComparisonTask::bookHistograms(DQMStore::IBooker& ib,
15  edm::Run const& r,
16  edm::EventSetup const& es) {
18 
19  // GET WHAT YOU NEED
21  es.get<HcalDbRecord>().get(dbs);
23  es.get<HcalElectronicsMapRcd>().get("full", item);
24  _emap = item.product();
25  if (_ptype != fOffline) { // hidefed2crate
26  std::vector<int> vFEDs = utilities::getFEDList(_emap);
27  std::vector<int> vFEDsVME = utilities::getFEDVMEList(_emap);
28  std::vector<int> vFEDsuTCA = utilities::getFEDuTCAList(_emap);
29  }
30  std::vector<uint32_t> vhashVME;
31  std::vector<uint32_t> vhashuTCA;
32  vhashVME.push_back(
34  vhashuTCA.push_back(HcalElectronicsId(CRATE_uTCA_MIN, SLOT_uTCA_MIN, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
37 
38  // INITIALIZE
39  for (unsigned int i = 0; i < 10; i++) {
41  "ADC",
46  0);
47  }
49  "ADC",
54  0);
56  "ADCMsnuTCA",
60  0);
62  "ADCMsnVME",
66  0);
68  "Mismatched",
73  0);
74  if (_ptype != fOffline) { // hidefed2crate
76  "Mismatched",
81  0);
83  "Mismatched",
88  0);
89  }
91  "Missing",
96  0);
98  "Missing",
103  0);
104  if (_ptype != fOffline) { // hidefed2crate
106  "Missing",
111  0);
113  "Missing",
118  0);
119  }
120 
121  // BOOK
122  char aux[20];
123  for (unsigned int i = 0; i < 10; i++) {
124  sprintf(aux, "TS%d", i);
126  }
133  if (_ptype != fOffline) { // hidefed2crate
138  }
139 
142 }
143 
144 /* virtual */ void DigiComparisonTask::_resetMonitors(hcaldqm::UpdateFreq uf) { DQTask::_resetMonitors(uf); }
145 
146 /* virtual */ void DigiComparisonTask::_process(edm::Event const& e, edm::EventSetup const& es) {
149 
150  if (!e.getByToken(_tokHBHE1, chbhe1))
151  _logger.dqmthrow("Collection HBHEDigiCollection isn't available" + _tagHBHE1.label() + " " + _tagHBHE1.instance());
152  if (!e.getByToken(_tokHBHE2, chbhe2))
153  _logger.dqmthrow("Collection HBHEDigiCollection isn't available" + _tagHBHE2.label() + " " + _tagHBHE2.instance());
154 
155  // assume that coll1 is primary(uTCA) and coll2 is secondary(VME)
156  // uTCA is X and VME is Y axis
157  for (HBHEDigiCollection::const_iterator it1 = chbhe1->begin(); it1 != chbhe1->end(); ++it1) {
158  // iterate thru the utca collection
159  // get the same detid digi from vme collection
160  // if missing - fill vme missing
161  // else correlate
162  HcalDetId did = it1->id();
163  HcalElectronicsId eid1 = it1->elecId();
164  HBHEDigiCollection::const_iterator it2 = chbhe2->find(did);
165 
166  // get the eid for vme by did
168  if (it2 == chbhe2->end()) {
169  // fill the depth plot
170  _cMsnVME_depth.fill(did);
171  if (_ptype != fOffline) { // hidefed2crate
172  _cMsn_FEDVME.fill(eid2);
173  }
174  for (int i = 0; i < it1->size(); i++) {
175  _cADCMsnVME_Subdet.fill(did, it1->sample(i).adc());
176  _cADCall_Subdet.fill(did, it1->sample(i).adc(), -2);
177  _cADC_Subdet[i].fill(did, it1->sample(i).adc(), -2);
178  }
179  } else
180  for (int i = 0; i < it1->size(); i++) {
181  _cADCall_Subdet.fill(did, double(it1->sample(i).adc()), double(it2->sample(i).adc()));
182  _cADC_Subdet[i].fill(did, double(it1->sample(i).adc()), double(it2->sample(i).adc()));
183  if (it1->sample(i).adc() != it2->sample(i).adc()) {
184  // fill depth, uTCA and VME as well for which guys
185  // mismatches happen
186  _cMsm_depth.fill(did);
187  if (_ptype != fOffline) { // hidefed2crate
188  _cMsm_FEDVME.fill(eid2);
189  _cMsm_FEDuTCA.fill(eid1);
190  }
191  }
192  }
193  }
194  for (HBHEDigiCollection::const_iterator it2 = chbhe2->begin(); it2 != chbhe2->end(); ++it2) {
195  // itearte thru VME
196  // find utca digi by detid
197  // check if present or missing
198  HcalDetId did = it2->id();
199  HBHEDigiCollection::const_iterator it1 = chbhe1->find(did);
200  if (it1 == chbhe1->end()) {
202  if (_ptype != fOffline) { // hidefed2crate
203  _cMsn_FEDuTCA.fill(eid1);
204  }
205  for (int i = 0; i < it2->size(); i++) {
206  _cADCMsnuTCA_Subdet.fill(did, it2->sample(i).adc());
207  _cADCall_Subdet.fill(did, -2, it2->sample(i).adc());
208  _cADC_Subdet[i].fill(did, -2, it2->sample(i).adc());
209  }
210  }
211  }
212 }
213 
215  edm::EventSetup const& es) {
216  // in the end always
217  DQTask::globalEndLuminosityBlock(lb, es);
218 }
219 
hcaldqm::quantity::fADC_128
Definition: ValueQuantity.h:15
mps_fire.i
i
Definition: mps_fire.py:355
DigiComparisonTask::_cMsn_FEDuTCA
hcaldqm::Container2D _cMsn_FEDuTCA
Definition: DigiComparisonTask.h:68
hcaldqm::constants
Definition: Constants.h:9
HcalElectronicsMapRcd
Definition: HcalElectronicsMapRcd.h:8
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
DigiComparisonTask::_ehashmapVME
hcaldqm::electronicsmap::ElectronicsMap _ehashmapVME
Definition: DigiComparisonTask.h:40
hcaldqm::UpdateFreq
UpdateFreq
Definition: DQTask.h:32
hcaldqm::electronicsmap::ElectronicsMap::lookup
uint32_t lookup(DetId const &)
Definition: ElectronicsMap.cc:122
bookHistograms
example_stream void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
DigiComparisonTask::globalEndLuminosityBlock
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: DigiComparisonTask.cc:214
DigiComparisonTask::_filter_VME
hcaldqm::filter::HashFilter _filter_VME
Definition: DigiComparisonTask.h:46
edm::InputTag::instance
std::string const & instance() const
Definition: InputTag.h:37
hcaldqm::quantity::fSlotuTCA
Definition: ElectronicsQuantity.h:21
DigiComparisonTask::_cADCall_Subdet
hcaldqm::Container2D _cADCall_Subdet
Definition: DigiComparisonTask.h:55
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
DigiComparisonTask.h
hcaldqm::quantity::ValueQuantity
Definition: ValueQuantity.h:309
hcaldqm::hashfunctions::fElectronics
Definition: HashFunctions.h:145
hcaldqm
Definition: Constants.h:8
DigiComparisonTask::_tokHBHE2
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE2
Definition: DigiComparisonTask.h:36
hcaldqm::quantity::fdepth
Definition: DetectorQuantity.h:16
hcaldqm::quantity::fADCCorr_128
Definition: ValueQuantity.h:44
hcaldqm::electronicsmap::ElectronicsMap::initialize
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
Definition: ElectronicsMap.cc:6
hcaldqm::constants::SPIGOT_MIN
const int SPIGOT_MIN
Definition: Constants.h:118
hcaldqm::constants::SLOT_uTCA_MIN
const int SLOT_uTCA_MIN
Definition: Constants.h:105
hcaldqm::constants::FIBER_uTCA_MIN1
const int FIBER_uTCA_MIN1
Definition: Constants.h:126
DigiComparisonTask::_tokHBHE1
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE1
Definition: DigiComparisonTask.h:35
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
hcaldqm::DQModule::_ptype
ProcessingType _ptype
Definition: DQModule.h:43
edm::Handle
Definition: AssociativeIterator.h:50
hcaldqm::utilities::getFEDList
std::vector< int > getFEDList(HcalElectronicsMap const *)
Definition: Utilities.cc:83
DigiComparisonTask::_resetMonitors
void _resetMonitors(hcaldqm::UpdateFreq) override
Definition: DigiComparisonTask.cc:144
DigiComparisonTask::_filter_uTCA
hcaldqm::filter::HashFilter _filter_uTCA
Definition: DigiComparisonTask.h:47
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
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
hcaldqm::quantity::fiphi
Definition: DetectorQuantity.h:14
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
DigiComparisonTask::_cMsm_depth
hcaldqm::Container2D _cMsm_depth
Definition: DigiComparisonTask.h:60
hcaldqm::constants::CRATE_uTCA_MIN
const int CRATE_uTCA_MIN
Definition: Constants.h:98
hcaldqm::filter::HashFilter::initialize
virtual void initialize(FilterType ftype, hashfunctions::HashType htype, std::vector< uint32_t > const &)
Definition: HashFilter.cc:17
hcaldqm::constants::FIBER_VME_MIN
const int FIBER_VME_MIN
Definition: Constants.h:123
edm::ESHandle< HcalDbService >
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
hcaldqm::DQModule::_name
std::string _name
Definition: DQModule.h:41
DigiComparisonTask::_cMsm_FEDVME
hcaldqm::Container2D _cMsm_FEDVME
Definition: DigiComparisonTask.h:58
DigiComparisonTask::DigiComparisonTask
DigiComparisonTask(edm::ParameterSet const &)
Definition: DigiComparisonTask.cc:7
hcaldqm::constants::FIBERCH_MIN
const int FIBERCH_MIN
Definition: Constants.h:132
DigiComparisonTask::_process
void _process(edm::Event const &, edm::EventSetup const &) override
Definition: DigiComparisonTask.cc:146
hcaldqm::quantity::DetectorQuantity
Definition: DetectorQuantity.h:59
DigiComparisonTask::_ehashmapuTCA
hcaldqm::electronicsmap::ElectronicsMap _ehashmapuTCA
Definition: DigiComparisonTask.h:39
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hcaldqm::quantity::fSubdet
Definition: DetectorQuantity.h:17
hcaldqm::quantity::fN
Definition: ValueQuantity.h:11
DigiComparisonTask::_tagHBHE1
edm::InputTag _tagHBHE1
Definition: DigiComparisonTask.h:33
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
DigiComparisonTask::_cMsnuTCA_depth
hcaldqm::Container2D _cMsnuTCA_depth
Definition: DigiComparisonTask.h:66
hcaldqm::quantity::fFED
Definition: ElectronicsQuantity.h:15
hcaldqm::Container1D::fill
virtual void fill(uint32_t)
Definition: Container1D.cc:73
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
DigiComparisonTask::_tagHBHE2
edm::InputTag _tagHBHE2
Definition: DigiComparisonTask.h:34
hcaldqm::DQModule::_logger
Logger _logger
Definition: DQModule.h:54
printConversionInfo.aux
aux
Definition: printConversionInfo.py:19
HcalDetId
Definition: HcalDetId.h:12
DigiComparisonTask::_cADCMsnuTCA_Subdet
hcaldqm::Container1D _cADCMsnuTCA_Subdet
Definition: DigiComparisonTask.h:63
cuy.ib
ib
Definition: cuy.py:662
DigiComparisonTask::_cADCMsnVME_Subdet
hcaldqm::Container1D _cADCMsnVME_Subdet
Definition: DigiComparisonTask.h:64
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::EventSetup
Definition: EventSetup.h:57
DigiComparisonTask::_cADC_Subdet
hcaldqm::Container2D _cADC_Subdet[10]
Definition: DigiComparisonTask.h:54
hcaldqm::quantity::fSpigot
Definition: ElectronicsQuantity.h:23
get
#define get
hcaldqm::DQModule::_subsystem
std::string _subsystem
Definition: DQModule.h:48
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DigiComparisonTask::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: DigiComparisonTask.cc:14
edm::SortedCollection::find
iterator find(key_type k)
Definition: SortedCollection.h:240
hcaldqm::quantity::ElectronicsQuantity
Definition: ElectronicsQuantity.h:333
hcaldqm::electronicsmap::fD2EHashMap
Definition: ElectronicsMap.h:25
DigiComparisonTask::_cMsn_FEDVME
hcaldqm::Container2D _cMsn_FEDVME
Definition: DigiComparisonTask.h:67
hcaldqm::quantity::fFiberuTCAFiberCh
Definition: ElectronicsQuantity.h:31
hcaldqm::quantity::fFiberVMEFiberCh
Definition: ElectronicsQuantity.h:32
hcaldqm::DQTask::_emap
const HcalElectronicsMap * _emap
Definition: DQTask.h:80
hcaldqm::utilities::getFEDVMEList
std::vector< int > getFEDVMEList(HcalElectronicsMap const *)
Definition: Utilities.cc:101
hcaldqm::DQTask
Definition: DQTask.h:33
DigiComparisonTask::_cMsnVME_depth
hcaldqm::Container2D _cMsnVME_depth
Definition: DigiComparisonTask.h:65
HcalDbRecord
Definition: HcalDbRecord.h:30
hcaldqm::Container1D::initialize
virtual void initialize(std::string const &folder, hashfunctions::HashType, quantity::Quantity *, quantity::Quantity *qy=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: Container1D.cc:33
DigiComparisonTask::_cMsm_FEDuTCA
hcaldqm::Container2D _cMsm_FEDuTCA
Definition: DigiComparisonTask.h:59
edm::Event
Definition: Event.h:73
hcaldqm::utilities::getFEDuTCAList
std::vector< int > getFEDuTCAList(HcalElectronicsMap const *)
Definition: Utilities.cc:121
edm::InputTag
Definition: InputTag.h:15
hcaldqm::constants::CRATE_VME_MIN
const int CRATE_VME_MIN
Definition: Constants.h:93
hcaldqm::filter::fFilter
Definition: HashFilter.h:19
hcaldqm::Container1D::book
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
Definition: Container1D.cc:592
DigiComparisonTask
Definition: DigiComparisonTask.py:1
hcaldqm::fOffline
Definition: DQModule.h:26
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37