CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DigiComparisonTask Class Reference

#include <DigiComparisonTask.h>

Inheritance diagram for DigiComparisonTask:
hcaldqm::DQTask one::DQMEDAnalyzer< one::DQMLuminosityBlockElements > hcaldqm::DQModule one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 DigiComparisonTask (edm::ParameterSet const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 ~DigiComparisonTask () override
 
- Public Member Functions inherited from hcaldqm::DQTask
void analyze (edm::Event const &, edm::EventSetup const &) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQTask (edm::ParameterSet const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 ~DQTask () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< one::DQMLuminosityBlockElements >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule ()(false)
 

Protected Member Functions

void _process (edm::Event const &, edm::EventSetup const &) override
 
void _resetMonitors (hcaldqm::UpdateFreq) override
 
- Protected Member Functions inherited from hcaldqm::DQTask
virtual int _getCalibType (edm::Event const &)
 
virtual bool _isApplicable (edm::Event const &)
 

Protected Attributes

hcaldqm::Container2D _cADC_Subdet [10]
 
hcaldqm::Container2D _cADCall_Subdet
 
hcaldqm::Container1D _cADCMsnuTCA_Subdet
 
hcaldqm::Container1D _cADCMsnVME_Subdet
 
hcaldqm::Container2D _cMsm_depth
 
hcaldqm::Container2D _cMsm_FEDuTCA
 
hcaldqm::Container2D _cMsm_FEDVME
 
hcaldqm::Container2D _cMsn_FEDuTCA
 
hcaldqm::Container2D _cMsn_FEDVME
 
hcaldqm::Container2D _cMsnuTCA_depth
 
hcaldqm::Container2D _cMsnVME_depth
 
hcaldqm::electronicsmap::ElectronicsMap _ehashmapuTCA
 
hcaldqm::electronicsmap::ElectronicsMap _ehashmapVME
 
hcaldqm::filter::HashFilter _filter_uTCA
 
hcaldqm::filter::HashFilter _filter_VME
 
edm::InputTag _tagHBHE1
 
edm::InputTag _tagHBHE2
 
edm::EDGetTokenT< HBHEDigiCollection_tokHBHE1
 
edm::EDGetTokenT< HBHEDigiCollection_tokHBHE2
 
std::vector< uint32_t > _vhashFEDs
 
- Protected Attributes inherited from hcaldqm::DQTask
ContainerI _cEvsPerLS
 
ContainerI _cEvsTotal
 
ContainerS _cProcessingTypeName
 
ContainerS _cRunKeyName
 
ContainerI _cRunKeyVal
 
edm::ESHandle< HcalDbService_dbService
 
HcalElectronicsMap const * _emap
 
int _procLSs
 
edm::InputTag _tagRaw
 
edm::EDGetTokenT< FEDRawDataCollection_tokRaw
 
std::vector< uint32_t > _vcdaqEids
 
ContainerXXX< uint32_t > _xQuality
 
- Protected Attributes inherited from hcaldqm::DQModule
int _currentLS
 
int _debug
 
int _evsPerLS
 
int _evsTotal
 
Logger _logger
 
int _maxLS
 
ModuleType _mtype
 
std::string _name
 
ProcessingType _ptype
 
std::string _runkeyName
 
int _runkeyVal
 
std::string _subsystem
 

Detailed Description

file: DigiComparisonTask.h Author: Viktor Khristenko Date: 08.12.2015

Definition at line 19 of file DigiComparisonTask.h.

Constructor & Destructor Documentation

DigiComparisonTask::DigiComparisonTask ( edm::ParameterSet const &  ps)

Definition at line 7 of file DigiComparisonTask.cc.

References _tagHBHE1, _tagHBHE2, _tokHBHE1, _tokHBHE2, and edm::ParameterSet::getUntrackedParameter().

7  : DQTask(ps) {
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 }
DQTask(edm::ParameterSet const &)
Definition: DQTask.cc:5
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE2
edm::InputTag _tagHBHE1
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE1
edm::InputTag _tagHBHE2
DigiComparisonTask::~DigiComparisonTask ( )
inlineoverride

Definition at line 22 of file DigiComparisonTask.h.

References _process(), _resetMonitors(), bookHistograms(), and endLuminosityBlock().

22 {}

Member Function Documentation

void DigiComparisonTask::_process ( edm::Event const &  e,
edm::EventSetup const &  es 
)
overrideprotectedvirtual

Implements hcaldqm::DQTask.

Definition at line 146 of file DigiComparisonTask.cc.

References _cADC_Subdet, _cADCall_Subdet, _cADCMsnuTCA_Subdet, _cADCMsnVME_Subdet, _cMsm_depth, _cMsm_FEDuTCA, _cMsm_FEDVME, _cMsn_FEDuTCA, _cMsn_FEDVME, _cMsnVME_depth, _ehashmapuTCA, _ehashmapVME, hcaldqm::DQModule::_logger, hcaldqm::DQModule::_ptype, _tagHBHE1, _tagHBHE2, _tokHBHE1, _tokHBHE2, edm::SortedCollection< T, SORT >::begin(), Logger::dqmthrow(), edm::SortedCollection< T, SORT >::end(), hcaldqm::Container2D::fill(), hcaldqm::Container1D::fill(), edm::SortedCollection< T, SORT >::find(), hcaldqm::fOffline, edm::Event::getByToken(), mps_fire::i, edm::InputTag::instance(), edm::InputTag::label(), and hcaldqm::electronicsmap::ElectronicsMap::lookup().

Referenced by ~DigiComparisonTask().

146  {
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 }
hcaldqm::Container2D _cMsn_FEDuTCA
std::vector< T >::const_iterator const_iterator
hcaldqm::electronicsmap::ElectronicsMap _ehashmapuTCA
hcaldqm::Container2D _cMsm_FEDVME
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE2
edm::InputTag _tagHBHE1
hcaldqm::Container1D _cADCMsnuTCA_Subdet
hcaldqm::Container2D _cADCall_Subdet
edm::EDGetTokenT< HBHEDigiCollection > _tokHBHE1
ProcessingType _ptype
Definition: DQModule.h:43
virtual void fill(uint32_t)
Definition: Container1D.cc:73
void dqmthrow(std::string const &msg) const
Definition: Logger.h:12
hcaldqm::Container2D _cMsn_FEDVME
Logger _logger
Definition: DQModule.h:54
hcaldqm::Container2D _cMsm_depth
const_iterator end() const
hcaldqm::Container2D _cMsm_FEDuTCA
std::string const & label() const
Definition: InputTag.h:36
hcaldqm::Container2D _cMsnVME_depth
iterator find(key_type k)
hcaldqm::electronicsmap::ElectronicsMap _ehashmapVME
void fill(HcalDetId const &) override
Definition: Container2D.cc:52
edm::InputTag _tagHBHE2
hcaldqm::Container1D _cADCMsnVME_Subdet
hcaldqm::Container2D _cADC_Subdet[10]
Readout chain identification for Hcal.
std::string const & instance() const
Definition: InputTag.h:37
const_iterator begin() const
void DigiComparisonTask::_resetMonitors ( hcaldqm::UpdateFreq  uf)
overrideprotectedvirtual

Reimplemented from hcaldqm::DQTask.

Definition at line 144 of file DigiComparisonTask.cc.

Referenced by ~DigiComparisonTask().

144 { DQTask::_resetMonitors(uf); }
void DigiComparisonTask::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  r,
edm::EventSetup const &  es 
)
override

Definition at line 14 of file DigiComparisonTask.cc.

References _cADC_Subdet, _cADCall_Subdet, _cADCMsnuTCA_Subdet, _cADCMsnVME_Subdet, _cMsm_depth, _cMsm_FEDuTCA, _cMsm_FEDVME, _cMsn_FEDuTCA, _cMsn_FEDVME, _cMsnuTCA_depth, _cMsnVME_depth, _ehashmapuTCA, _ehashmapVME, hcaldqm::DQTask::_emap, _filter_uTCA, _filter_VME, hcaldqm::DQModule::_name, hcaldqm::DQModule::_ptype, hcaldqm::DQModule::_subsystem, printConversionInfo::aux, hcaldqm::Container2D::book(), hcaldqm::Container1D::book(), bookHistograms(), hcaldqm::constants::CRATE_uTCA_MIN, hcaldqm::constants::CRATE_VME_MIN, hcaldqm::quantity::fADC_128, hcaldqm::quantity::fADCCorr_128, hcaldqm::electronicsmap::fD2EHashMap, hcaldqm::quantity::fdepth, hcaldqm::hashfunctions::fElectronics, hcaldqm::quantity::fFED, hcaldqm::quantity::fFiberuTCAFiberCh, hcaldqm::quantity::fFiberVMEFiberCh, hcaldqm::filter::fFilter, hcaldqm::constants::FIBER_uTCA_MIN1, hcaldqm::constants::FIBER_VME_MIN, hcaldqm::constants::FIBERCH_MIN, hcaldqm::quantity::fieta, hcaldqm::quantity::fiphi, hcaldqm::quantity::fN, hcaldqm::fOffline, hcaldqm::quantity::fSlotuTCA, hcaldqm::quantity::fSpigot, hcaldqm::quantity::fSubdet, edm::EventSetup::get(), hcaldqm::utilities::getFEDList(), hcaldqm::utilities::getFEDuTCAList(), hcaldqm::utilities::getFEDVMEList(), mps_fire::i, hcaldqm::filter::HashFilter::initialize(), hcaldqm::Container2D::initialize(), hcaldqm::electronicsmap::ElectronicsMap::initialize(), hcaldqm::Container1D::initialize(), edm::ESHandle< T >::product(), hcaldqm::constants::SLOT_uTCA_MIN, hcaldqm::constants::SPIGOT_MIN, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~DigiComparisonTask().

16  {
17  DQTask::bookHistograms(ib, r, 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);
125  _cADC_Subdet[i].book(ib, _emap, _subsystem, aux);
126  }
133  if (_ptype != fOffline) { // hidefed2crate
138  }
139 
142 }
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
int const CRATE_VME_MIN
Definition: Constants.h:83
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
hcaldqm::Container2D _cMsn_FEDuTCA
int const SPIGOT_MIN
Definition: Constants.h:108
hcaldqm::electronicsmap::ElectronicsMap _ehashmapuTCA
hcaldqm::Container2D _cMsm_FEDVME
int const FIBER_VME_MIN
Definition: Constants.h:113
int const FIBERCH_MIN
Definition: Constants.h:122
std::vector< int > getFEDVMEList(HcalElectronicsMap const *)
Definition: Utilities.cc:101
hcaldqm::Container1D _cADCMsnuTCA_Subdet
hcaldqm::Container2D _cADCall_Subdet
ProcessingType _ptype
Definition: DQModule.h:43
hcaldqm::Container2D _cMsnuTCA_depth
hcaldqm::Container2D _cMsn_FEDVME
int const FIBER_uTCA_MIN1
Definition: Constants.h:116
std::string _name
Definition: DQModule.h:41
HcalElectronicsMap const * _emap
Definition: DQTask.h:59
hcaldqm::filter::HashFilter _filter_uTCA
int const CRATE_uTCA_MIN
Definition: Constants.h:88
hcaldqm::Container2D _cMsm_depth
virtual void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="")
Definition: Container1D.cc:592
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
hcaldqm::Container2D _cMsm_FEDuTCA
example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
hcaldqm::Container2D _cMsnVME_depth
hcaldqm::electronicsmap::ElectronicsMap _ehashmapVME
std::vector< int > getFEDList(HcalElectronicsMap const *)
Definition: Utilities.cc:83
std::vector< int > getFEDuTCAList(HcalElectronicsMap const *)
Definition: Utilities.cc:121
virtual void initialize(FilterType ftype, hashfunctions::HashType htype, std::vector< uint32_t > const &)
Definition: HashFilter.cc:17
std::string _subsystem
Definition: DQModule.h:48
hcaldqm::Container1D _cADCMsnVME_Subdet
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: Container2D.cc:558
hcaldqm::Container2D _cADC_Subdet[10]
T const * product() const
Definition: ESHandle.h:86
Readout chain identification for Hcal.
int const SLOT_uTCA_MIN
Definition: Constants.h:95
hcaldqm::filter::HashFilter _filter_VME
void DigiComparisonTask::endLuminosityBlock ( edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
override

Definition at line 214 of file DigiComparisonTask.cc.

References DEFINE_FWK_MODULE.

Referenced by ~DigiComparisonTask().

214  {
215  // in the end always
216  DQTask::endLuminosityBlock(lb, es);
217 }

Member Data Documentation

hcaldqm::Container2D DigiComparisonTask::_cADC_Subdet[10]
protected

Containers

Definition at line 54 of file DigiComparisonTask.h.

Referenced by _process(), and bookHistograms().

hcaldqm::Container2D DigiComparisonTask::_cADCall_Subdet
protected

Definition at line 55 of file DigiComparisonTask.h.

Referenced by _process(), and bookHistograms().

hcaldqm::Container1D DigiComparisonTask::_cADCMsnuTCA_Subdet
protected

Definition at line 63 of file DigiComparisonTask.h.

Referenced by _process(), and bookHistograms().

hcaldqm::Container1D DigiComparisonTask::_cADCMsnVME_Subdet
protected

Definition at line 64 of file DigiComparisonTask.h.

Referenced by _process(), and bookHistograms().

hcaldqm::Container2D DigiComparisonTask::_cMsm_depth
protected

Definition at line 60 of file DigiComparisonTask.h.

Referenced by _process(), and bookHistograms().

hcaldqm::Container2D DigiComparisonTask::_cMsm_FEDuTCA
protected

Definition at line 59 of file DigiComparisonTask.h.

Referenced by _process(), and bookHistograms().

hcaldqm::Container2D DigiComparisonTask::_cMsm_FEDVME
protected

Definition at line 58 of file DigiComparisonTask.h.

Referenced by _process(), and bookHistograms().

hcaldqm::Container2D DigiComparisonTask::_cMsn_FEDuTCA
protected

Definition at line 68 of file DigiComparisonTask.h.

Referenced by _process(), and bookHistograms().

hcaldqm::Container2D DigiComparisonTask::_cMsn_FEDVME
protected

Definition at line 67 of file DigiComparisonTask.h.

Referenced by _process(), and bookHistograms().

hcaldqm::Container2D DigiComparisonTask::_cMsnuTCA_depth
protected

Definition at line 66 of file DigiComparisonTask.h.

Referenced by bookHistograms().

hcaldqm::Container2D DigiComparisonTask::_cMsnVME_depth
protected

Definition at line 65 of file DigiComparisonTask.h.

Referenced by _process(), and bookHistograms().

hcaldqm::electronicsmap::ElectronicsMap DigiComparisonTask::_ehashmapuTCA
protected

Definition at line 39 of file DigiComparisonTask.h.

Referenced by _process(), and bookHistograms().

hcaldqm::electronicsmap::ElectronicsMap DigiComparisonTask::_ehashmapVME
protected

Definition at line 40 of file DigiComparisonTask.h.

Referenced by _process(), and bookHistograms().

hcaldqm::filter::HashFilter DigiComparisonTask::_filter_uTCA
protected

Definition at line 47 of file DigiComparisonTask.h.

Referenced by bookHistograms().

hcaldqm::filter::HashFilter DigiComparisonTask::_filter_VME
protected

Definition at line 46 of file DigiComparisonTask.h.

Referenced by bookHistograms().

edm::InputTag DigiComparisonTask::_tagHBHE1
protected

Definition at line 33 of file DigiComparisonTask.h.

Referenced by _process(), and DigiComparisonTask().

edm::InputTag DigiComparisonTask::_tagHBHE2
protected

Definition at line 34 of file DigiComparisonTask.h.

Referenced by _process(), and DigiComparisonTask().

edm::EDGetTokenT<HBHEDigiCollection> DigiComparisonTask::_tokHBHE1
protected

Definition at line 35 of file DigiComparisonTask.h.

Referenced by _process(), and DigiComparisonTask().

edm::EDGetTokenT<HBHEDigiCollection> DigiComparisonTask::_tokHBHE2
protected

Definition at line 36 of file DigiComparisonTask.h.

Referenced by _process(), and DigiComparisonTask().

std::vector<uint32_t> DigiComparisonTask::_vhashFEDs
protected

Definition at line 43 of file DigiComparisonTask.h.