CMS 3D CMS Logo

TPComparisonTask.cc
Go to the documentation of this file.
1 
3 
4 using namespace hcaldqm;
5 using namespace hcaldqm::constants;
7  // tags and tokens
8  _tag1 = ps.getUntrackedParameter<edm::InputTag>("tag1", edm::InputTag("hcalDigis"));
9  _tag2 = ps.getUntrackedParameter<edm::InputTag>("tag2", edm::InputTag("vmeDigis"));
10  _tok1 = consumes<HcalTrigPrimDigiCollection>(_tag1);
11  _tok2 = consumes<HcalTrigPrimDigiCollection>(_tag2);
12 
13  // tmp flags
14  _skip1x1 = ps.getUntrackedParameter<bool>("skip1x1", true);
15 }
16 
17 /* virtual */ void TPComparisonTask::bookHistograms(DQMStore::IBooker& ib,
18  edm::Run const& r,
19  edm::EventSetup const& es) {
21 
22  // GET WHAT YOU NEED
24  es.get<HcalDbRecord>().get(dbs);
26  es.get<HcalElectronicsMapRcd>().get("full", item);
27  _emap = item.product();
28  if (_ptype != fOffline) { // hidefed2crate
29  std::vector<int> vFEDs = hcaldqm::utilities::getFEDList(_emap);
30  std::vector<int> vFEDsVME = hcaldqm::utilities::getFEDVMEList(_emap);
31  std::vector<int> vFEDsuTCA = hcaldqm::utilities::getFEDuTCAList(_emap);
32  }
33  std::vector<uint32_t> vhashVME;
34  std::vector<uint32_t> vhashuTCA;
35  vhashVME.push_back(
37  vhashuTCA.push_back(HcalElectronicsId(CRATE_uTCA_MIN, SLOT_uTCA_MIN, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
40 
41  // INTIALIZE CONTAINERS
42  for (unsigned int i = 0; i < 4; i++) {
44  "Et",
49  0);
51  "FG",
56  0);
57  }
59  "Et",
64  0);
65 
66  if (_ptype != fOffline) { // hidefed2crate
68  "Missing",
73  0);
75  "Missing",
80  0);
82  "EtMsm",
87  0);
89  "EtMsm",
94  0);
96  "FGMsm",
101  0);
103  "FGMsm",
108  0);
109  }
110 
112  "Missing",
116  0);
118  "Missing",
122  0);
124  "EtMsm",
128  0);
130  "FGMsm",
134  0);
135 
136  char aux[20];
137  for (unsigned int i = 0; i < 4; i++) {
138  sprintf(aux, "TS%d", i);
141  }
143  if (_ptype != fOffline) { // hidefed2crate
150  }
151 
156 
159  // _ehashmap.print();
160  // _cMsn_depth.book(ib);
161  // _cEtMsm_depth.book(ib);
162  // _cFGMsm_depth.book(ib);
163 }
164 
165 /* virtual */ void TPComparisonTask::_resetMonitors(hcaldqm::UpdateFreq uf) { DQTask::_resetMonitors(uf); }
166 
167 /* virtual */ void TPComparisonTask::_process(edm::Event const& e, edm::EventSetup const& es) {
170 
171  if (!e.getByToken(_tok1, coll1))
172  _logger.dqmthrow("Collection HcalTrigPrimDigiCollection isn't available" + _tag1.label() + " " + _tag1.instance());
173  if (!e.getByToken(_tok2, coll2))
174  _logger.dqmthrow("Collection HcalTrigPrimDigiCollection isn't available" + _tag2.label() + " " + _tag2.instance());
175 
176  // assume always coll1 is primary (uTCA) and coll2 is secondary(VME)
177  for (HcalTrigPrimDigiCollection::const_iterator it1 = coll1->begin(); it1 != coll1->end(); ++it1) {
178  // iterate thru utca collection
179  // get the same detid digi from vme collection
180  // if missing - fill vme missing
181  // else correlate
182  // tmp
183  if (_skip1x1)
184  if (it1->id().version() > 0)
185  continue;
186  // \tmp
187 
188  HcalTrigTowerDetId tid = it1->id();
192 
193  if (it2 == coll2->end()) {
194  // missing from VME collection
195  _cMsnVME.fill(tid);
196  if (_ptype != fOffline) { // hidefed2crate
197  _cMsn_FEDVME.fill(eid2);
198  }
199  for (int i = 0; i < it1->size(); i++) {
200  _cEtall_TTSubdet.fill(tid, it1->sample(i).compressedEt(), -2);
201  _cEt_TTSubdet[i].fill(tid, it1->sample(i).compressedEt(), -2);
202  }
203  } else
204  for (int i = 0; i < it1->size(); i++) {
205  _cEtall_TTSubdet.fill(tid, it1->sample(i).compressedEt(), it2->sample(i).compressedEt());
206  _cEt_TTSubdet[i].fill(tid, it1->sample(i).compressedEt(), it2->sample(i).compressedEt());
207  _cFG_TTSubdet[i].fill(tid, it1->sample(i).fineGrain(), it2->sample(i).fineGrain());
208  if (it1->sample(i).compressedEt() != it2->sample(i).compressedEt()) {
209  if (_ptype != fOffline) { // hidefed2crate
210  _cEtMsm_FEDuTCA.fill(eid1);
211  _cEtMsm_FEDVME.fill(eid2);
212  }
213  _cEtMsm.fill(tid);
214  }
215  if (it1->sample(i).fineGrain() != it2->sample(i).fineGrain()) {
216  if (_ptype != fOffline) { // hidefed2crate
217  _cFGMsm_FEDuTCA.fill(eid1);
218  _cFGMsm_FEDVME.fill(eid2);
219  }
220  _cFGMsm.fill(tid);
221  }
222  }
223  }
224  for (HcalTrigPrimDigiCollection::const_iterator it2 = coll2->begin(); it2 != coll2->end(); ++it2) {
225  // itearte thru VME
226  // find utca tp digi by detid
227  // check if present of missing
228  HcalTrigTowerDetId tid = it2->id();
229  if (_skip1x1)
230  if (tid.version() > 0)
231  continue;
232 
234  if (it1 == coll1->end()) {
236  if (_ptype != fOffline) { // hidefed2crate
237  _cMsn_FEDuTCA.fill(eid1);
238  }
239  _cMsnuTCA.fill(tid);
240  for (int i = 0; i < it2->size(); i++) {
241  _cEtall_TTSubdet.fill(tid, -2, it2->sample(i).compressedEt());
242  _cEt_TTSubdet[i].fill(tid, -2, it2->sample(i).compressedEt());
243  }
244  }
245  }
246 }
247 
249  edm::EventSetup const& es) {
250  // in the end always
251  DQTask::globalEndLuminosityBlock(lb, es);
252 }
253 
hcaldqm::quantity::fFiberuTCATPFiberChuTCATP
Definition: ElectronicsQuantity.h:42
mps_fire.i
i
Definition: mps_fire.py:355
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
hcaldqm::UpdateFreq
UpdateFreq
Definition: DQTask.h:32
TPComparisonTask::_skip1x1
bool _skip1x1
Definition: TPComparisonTask.h:40
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
TPComparisonTask::_tag2
edm::InputTag _tag2
Definition: TPComparisonTask.h:35
TPComparisonTask::_cMsn_FEDVME
hcaldqm::Container2D _cMsn_FEDVME
Definition: TPComparisonTask.h:65
edm::InputTag::instance
std::string const & instance() const
Definition: InputTag.h:37
HcalTrigTowerDetId::ieta
int ieta() const
get the tower ieta
Definition: HcalTrigTowerDetId.h:54
hcaldqm::quantity::fSlotuTCA
Definition: ElectronicsQuantity.h:21
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
hcaldqm::quantity::ValueQuantity
Definition: ValueQuantity.h:309
hcaldqm::hashfunctions::fElectronics
Definition: HashFunctions.h:145
hcaldqm
Definition: Constants.h:8
hcaldqm::quantity::fTTiphi
Definition: TrigTowerQuantity.h:14
hcaldqm::electronicsmap::ElectronicsMap::initialize
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
Definition: ElectronicsMap.cc:6
TPComparisonTask::_cMsnVME
hcaldqm::ContainerSingle2D _cMsnVME
Definition: TPComparisonTask.h:67
hcaldqm::constants::SPIGOT_MIN
const int SPIGOT_MIN
Definition: Constants.h:118
TPComparisonTask::_cFG_TTSubdet
hcaldqm::Container2D _cFG_TTSubdet[4]
Definition: TPComparisonTask.h:62
TPComparisonTask::_cEtMsm_FEDVME
hcaldqm::Container2D _cEtMsm_FEDVME
Definition: TPComparisonTask.h:71
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
TPComparisonTask::_cFGMsm
hcaldqm::ContainerSingle2D _cFGMsm
Definition: TPComparisonTask.h:78
TPComparisonTask::_cEtall_TTSubdet
hcaldqm::Container2D _cEtall_TTSubdet
Definition: TPComparisonTask.h:59
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
TPComparisonTask::_tag1
edm::InputTag _tag1
Definition: TPComparisonTask.h:34
hcaldqm::hashfunctions::fFED
Definition: HashFunctions.h:136
hcaldqm::DQModule::_ptype
ProcessingType _ptype
Definition: DQModule.h:43
TPComparisonTask::_tok2
edm::EDGetTokenT< HcalTrigPrimDigiCollection > _tok2
Definition: TPComparisonTask.h:37
edm::Handle
Definition: AssociativeIterator.h:50
hcaldqm::utilities::getFEDList
std::vector< int > getFEDList(HcalElectronicsMap const *)
Definition: Utilities.cc:83
hcaldqm::electronicsmap::fT2EHashMap
Definition: ElectronicsMap.h:26
TPComparisonTask::TPComparisonTask
TPComparisonTask(edm::ParameterSet const &)
Definition: TPComparisonTask.cc:6
TPComparisonTask::_ehashmapuTCA
hcaldqm::electronicsmap::ElectronicsMap _ehashmapuTCA
Definition: TPComparisonTask.h:43
hcaldqm::ContainerSingle2D::fill
virtual void fill(int, int)
Definition: ContainerSingle2D.cc:105
TPComparisonTask::_cEtMsm
hcaldqm::ContainerSingle2D _cEtMsm
Definition: TPComparisonTask.h:77
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
TPComparisonTask::_cMsnuTCA
hcaldqm::ContainerSingle2D _cMsnuTCA
Definition: TPComparisonTask.h:68
TPComparisonTask::_cEt_TTSubdet
hcaldqm::Container2D _cEt_TTSubdet[4]
Definition: TPComparisonTask.h:58
TPComparisonTask::_cEtMsm_FEDuTCA
hcaldqm::Container2D _cEtMsm_FEDuTCA
Definition: TPComparisonTask.h:72
hcaldqm::quantity::fTTieta
Definition: TrigTowerQuantity.h:15
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
TPComparisonTask::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: TPComparisonTask.cc:17
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
TPComparisonTask::_filter_uTCA
hcaldqm::filter::HashFilter _filter_uTCA
Definition: TPComparisonTask.h:51
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
TPComparisonTask::_ehashmapVME
hcaldqm::electronicsmap::ElectronicsMap _ehashmapVME
Definition: TPComparisonTask.h:44
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::quantity::fEtCorr_256
Definition: ValueQuantity.h:43
hcaldqm::DQModule::_name
std::string _name
Definition: DQModule.h:41
TPComparisonTask
Definition: TPComparisonTask.py:1
hcaldqm::constants::FIBERCH_MIN
const int FIBERCH_MIN
Definition: Constants.h:132
HcalTrigTowerDetId::version
int version() const
get the version code for the trigger tower
Definition: HcalTrigTowerDetId.h:60
TPComparisonTask::_tok1
edm::EDGetTokenT< HcalTrigPrimDigiCollection > _tok1
Definition: TPComparisonTask.h:36
TPComparisonTask::_process
void _process(edm::Event const &, edm::EventSetup const &) override
Definition: TPComparisonTask.cc:167
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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
hcaldqm::hashfunctions::fTTSubdet
Definition: HashFunctions.h:148
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
TPComparisonTask::_cFGMsm_FEDVME
hcaldqm::Container2D _cFGMsm_FEDVME
Definition: TPComparisonTask.h:73
hcaldqm::quantity::fFG
Definition: ValueQuantity.h:26
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
hcaldqm::DQModule::_logger
Logger _logger
Definition: DQModule.h:54
printConversionInfo.aux
aux
Definition: printConversionInfo.py:19
TPComparisonTask::_filter_VME
hcaldqm::filter::HashFilter _filter_VME
Definition: TPComparisonTask.h:50
TPComparisonTask::_resetMonitors
void _resetMonitors(hcaldqm::UpdateFreq) override
Definition: TPComparisonTask.cc:165
cuy.ib
ib
Definition: cuy.py:662
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::EventSetup
Definition: EventSetup.h:57
hcaldqm::quantity::fSpigot
Definition: ElectronicsQuantity.h:23
TPComparisonTask::_cMsn_FEDuTCA
hcaldqm::Container2D _cMsn_FEDuTCA
Definition: TPComparisonTask.h:66
get
#define get
hcaldqm::DQModule::_subsystem
std::string _subsystem
Definition: DQModule.h:48
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::SortedCollection::find
iterator find(key_type k)
Definition: SortedCollection.h:240
hcaldqm::quantity::ElectronicsQuantity
Definition: ElectronicsQuantity.h:333
HcalTrigTowerDetId::iphi
int iphi() const
get the tower iphi
Definition: HcalTrigTowerDetId.h:56
hcaldqm::quantity::TrigTowerQuantity
Definition: TrigTowerQuantity.h:70
hcaldqm::DQTask::_emap
const HcalElectronicsMap * _emap
Definition: DQTask.h:80
hcaldqm::ContainerSingle2D::book
virtual void book(DQMStore::IBooker &, std::string subsystem="Hcal", std::string aux="")
Definition: ContainerSingle2D.cc:68
hcaldqm::utilities::getFEDVMEList
std::vector< int > getFEDVMEList(HcalElectronicsMap const *)
Definition: Utilities.cc:101
TPComparisonTask::globalEndLuminosityBlock
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: TPComparisonTask.cc:248
TPComparisonTask.h
hcaldqm::DQTask
Definition: DQTask.h:33
hcaldqm::quantity::fSLBSLBCh
Definition: ElectronicsQuantity.h:37
HcalDbRecord
Definition: HcalDbRecord.h:30
TPComparisonTask::_cFGMsm_FEDuTCA
hcaldqm::Container2D _cFGMsm_FEDuTCA
Definition: TPComparisonTask.h:74
hcaldqm::ContainerSingle2D::initialize
virtual void initialize(std::string const &folder, quantity::Quantity *, quantity::Quantity *, quantity::Quantity *qz=new quantity::ValueQuantity(quantity::fN), int debug=0)
Definition: ContainerSingle2D.cc:46
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::fOffline
Definition: DQModule.h:26
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14