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  : DQTask(ps), hcalDbServiceToken_(esConsumes<HcalDbService, HcalDbRecord, edm::Transition::BeginRun>()) {
8  // tags and tokens
9  _tag1 = ps.getUntrackedParameter<edm::InputTag>("tag1", edm::InputTag("hcalDigis"));
10  _tag2 = ps.getUntrackedParameter<edm::InputTag>("tag2", edm::InputTag("vmeDigis"));
11  _tok1 = consumes<HcalTrigPrimDigiCollection>(_tag1);
12  _tok2 = consumes<HcalTrigPrimDigiCollection>(_tag2);
13 
14  // tmp flags
15  _skip1x1 = ps.getUntrackedParameter<bool>("skip1x1", true);
16 }
17 
19  edm::Run const& r,
20  edm::EventSetup const& es) {
22 
23  // GET WHAT YOU NEED
25  _emap = dbs->getHcalMapping();
26  if (_ptype != fOffline) { // hidefed2crate
27  std::vector<int> vFEDs = hcaldqm::utilities::getFEDList(_emap);
28  std::vector<int> vFEDsVME = hcaldqm::utilities::getFEDVMEList(_emap);
29  std::vector<int> vFEDsuTCA = hcaldqm::utilities::getFEDuTCAList(_emap);
30  }
31  std::vector<uint32_t> vhashVME;
32  std::vector<uint32_t> vhashuTCA;
33  vhashVME.push_back(
35  vhashuTCA.push_back(HcalElectronicsId(CRATE_uTCA_MIN, SLOT_uTCA_MIN, FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
38 
39  // INTIALIZE CONTAINERS
40  for (unsigned int i = 0; i < 4; i++) {
42  "Et",
47  0);
49  "FG",
54  0);
55  }
57  "Et",
62  0);
63 
64  if (_ptype != fOffline) { // hidefed2crate
66  "Missing",
71  0);
73  "Missing",
78  0);
80  "EtMsm",
85  0);
87  "EtMsm",
92  0);
94  "FGMsm",
99  0);
101  "FGMsm",
106  0);
107  }
108 
110  "Missing",
114  0);
116  "Missing",
120  0);
122  "EtMsm",
126  0);
128  "FGMsm",
132  0);
133 
134  char aux[20];
135  for (unsigned int i = 0; i < 4; i++) {
136  sprintf(aux, "TS%d", i);
139  }
141  if (_ptype != fOffline) { // hidefed2crate
148  }
149 
154 
157  // _ehashmap.print();
158  // _cMsn_depth.book(ib);
159  // _cEtMsm_depth.book(ib);
160  // _cFGMsm_depth.book(ib);
161 }
162 
163 /* virtual */ void TPComparisonTask::_resetMonitors(hcaldqm::UpdateFreq uf) { DQTask::_resetMonitors(uf); }
164 
165 /* virtual */ void TPComparisonTask::_process(edm::Event const& e, edm::EventSetup const& es) {
168 
169  if (!e.getByToken(_tok1, coll1))
170  _logger.dqmthrow("Collection HcalTrigPrimDigiCollection isn't available" + _tag1.label() + " " + _tag1.instance());
171  if (!e.getByToken(_tok2, coll2))
172  _logger.dqmthrow("Collection HcalTrigPrimDigiCollection isn't available" + _tag2.label() + " " + _tag2.instance());
173 
174  // assume always coll1 is primary (uTCA) and coll2 is secondary(VME)
175  for (HcalTrigPrimDigiCollection::const_iterator it1 = coll1->begin(); it1 != coll1->end(); ++it1) {
176  // iterate thru utca collection
177  // get the same detid digi from vme collection
178  // if missing - fill vme missing
179  // else correlate
180  // tmp
181  if (_skip1x1)
182  if (it1->id().version() > 0)
183  continue;
184  // \tmp
185 
186  HcalTrigTowerDetId tid = it1->id();
190 
191  if (it2 == coll2->end()) {
192  // missing from VME collection
193  _cMsnVME.fill(tid);
194  if (_ptype != fOffline) { // hidefed2crate
195  _cMsn_FEDVME.fill(eid2);
196  }
197  for (int i = 0; i < it1->size(); i++) {
198  _cEtall_TTSubdet.fill(tid, it1->sample(i).compressedEt(), -2);
199  _cEt_TTSubdet[i].fill(tid, it1->sample(i).compressedEt(), -2);
200  }
201  } else
202  for (int i = 0; i < it1->size(); i++) {
203  _cEtall_TTSubdet.fill(tid, it1->sample(i).compressedEt(), it2->sample(i).compressedEt());
204  _cEt_TTSubdet[i].fill(tid, it1->sample(i).compressedEt(), it2->sample(i).compressedEt());
205  _cFG_TTSubdet[i].fill(tid, it1->sample(i).fineGrain(), it2->sample(i).fineGrain());
206  if (it1->sample(i).compressedEt() != it2->sample(i).compressedEt()) {
207  if (_ptype != fOffline) { // hidefed2crate
208  _cEtMsm_FEDuTCA.fill(eid1);
209  _cEtMsm_FEDVME.fill(eid2);
210  }
211  _cEtMsm.fill(tid);
212  }
213  if (it1->sample(i).fineGrain() != it2->sample(i).fineGrain()) {
214  if (_ptype != fOffline) { // hidefed2crate
215  _cFGMsm_FEDuTCA.fill(eid1);
216  _cFGMsm_FEDVME.fill(eid2);
217  }
218  _cFGMsm.fill(tid);
219  }
220  }
221  }
222  for (HcalTrigPrimDigiCollection::const_iterator it2 = coll2->begin(); it2 != coll2->end(); ++it2) {
223  // itearte thru VME
224  // find utca tp digi by detid
225  // check if present of missing
226  HcalTrigTowerDetId tid = it2->id();
227  if (_skip1x1)
228  if (tid.version() > 0)
229  continue;
230 
232  if (it1 == coll1->end()) {
234  if (_ptype != fOffline) { // hidefed2crate
235  _cMsn_FEDuTCA.fill(eid1);
236  }
237  _cMsnuTCA.fill(tid);
238  for (int i = 0; i < it2->size(); i++) {
239  _cEtall_TTSubdet.fill(tid, -2, it2->sample(i).compressedEt());
240  _cEt_TTSubdet[i].fill(tid, -2, it2->sample(i).compressedEt());
241  }
242  }
243  }
244 }
245 
247  edm::EventSetup const& es) {
248  // in the end always
249  DQTask::globalEndLuminosityBlock(lb, es);
250 }
251 
hcaldqm::quantity::fFiberuTCATPFiberChuTCATP
Definition: ElectronicsQuantity.h:42
mps_fire.i
i
Definition: mps_fire.py:428
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
TPComparisonTask::_skip1x1
bool _skip1x1
Definition: TPComparisonTask.h:41
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:66
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:319
hcaldqm::hashfunctions::fElectronics
Definition: HashFunctions.h:154
edm
HLT enums.
Definition: AlignableModifier.h:19
hcaldqm
Definition: Constants.h:8
hcaldqm::quantity::fTTiphi
Definition: TrigTowerQuantity.h:14
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
hcaldqm::electronicsmap::ElectronicsMap::initialize
void initialize(HcalElectronicsMap const *, ElectronicsMapType etype=fHcalElectronicsMap)
Definition: ElectronicsMap.cc:6
TPComparisonTask::_cMsnVME
hcaldqm::ContainerSingle2D _cMsnVME
Definition: TPComparisonTask.h:68
hcaldqm::constants::SPIGOT_MIN
const int SPIGOT_MIN
Definition: Constants.h:118
TPComparisonTask::_cFG_TTSubdet
hcaldqm::Container2D _cFG_TTSubdet[4]
Definition: TPComparisonTask.h:63
TPComparisonTask::_cEtMsm_FEDVME
hcaldqm::Container2D _cEtMsm_FEDVME
Definition: TPComparisonTask.h:72
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:79
TPComparisonTask::_cEtall_TTSubdet
hcaldqm::Container2D _cEtall_TTSubdet
Definition: TPComparisonTask.h:60
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:145
hcaldqm::DQModule::_ptype
ProcessingType _ptype
Definition: DQModule.h:44
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
HcalDbService::getHcalMapping
const HcalElectronicsMap * getHcalMapping() const
Definition: HcalDbService.cc:343
TPComparisonTask::TPComparisonTask
TPComparisonTask(edm::ParameterSet const &)
Definition: TPComparisonTask.cc:6
TPComparisonTask::_ehashmapuTCA
hcaldqm::electronicsmap::ElectronicsMap _ehashmapuTCA
Definition: TPComparisonTask.h:44
hcaldqm::ContainerSingle2D::fill
virtual void fill(int, int)
Definition: ContainerSingle2D.cc:105
TPComparisonTask::_cEtMsm
hcaldqm::ContainerSingle2D _cEtMsm
Definition: TPComparisonTask.h:78
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
TPComparisonTask::_cMsnuTCA
hcaldqm::ContainerSingle2D _cMsnuTCA
Definition: TPComparisonTask.h:69
TPComparisonTask::_cEt_TTSubdet
hcaldqm::Container2D _cEt_TTSubdet[4]
Definition: TPComparisonTask.h:59
TPComparisonTask::_cEtMsm_FEDuTCA
hcaldqm::Container2D _cEtMsm_FEDuTCA
Definition: TPComparisonTask.h:73
hcaldqm::quantity::fTTieta
Definition: TrigTowerQuantity.h:15
TPComparisonTask::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: TPComparisonTask.cc:18
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
TPComparisonTask::_filter_uTCA
hcaldqm::filter::HashFilter _filter_uTCA
Definition: TPComparisonTask.h:52
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
TPComparisonTask::_ehashmapVME
hcaldqm::electronicsmap::ElectronicsMap _ehashmapVME
Definition: TPComparisonTask.h:45
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:42
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:165
hcaldqm::quantity::fN
Definition: ValueQuantity.h:11
Logger::dqmthrow
void dqmthrow(std::string const &msg) const
Definition: Logger.h:12
hcaldqm::hashfunctions::fTTSubdet
Definition: HashFunctions.h:157
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
hcaldqm::Container2D::book
void book(DQMStore::IBooker &, HcalElectronicsMap const *, std::string subsystem="Hcal", std::string aux="") override
Definition: Container2D.cc:567
hcaldqm::Container2D::fill
void fill(HcalDetId const &) override
Definition: Container2D.cc:52
TPComparisonTask::_cFGMsm_FEDVME
hcaldqm::Container2D _cFGMsm_FEDVME
Definition: TPComparisonTask.h:74
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:55
printConversionInfo.aux
aux
Definition: printConversionInfo.py:19
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
TPComparisonTask::_filter_VME
hcaldqm::filter::HashFilter _filter_VME
Definition: TPComparisonTask.h:51
TPComparisonTask::_resetMonitors
void _resetMonitors(hcaldqm::UpdateFreq) override
Definition: TPComparisonTask.cc:163
cuy.ib
ib
Definition: cuy.py:661
edm::EventSetup
Definition: EventSetup.h:58
hcaldqm::quantity::fSpigot
Definition: ElectronicsQuantity.h:23
TPComparisonTask::_cMsn_FEDuTCA
hcaldqm::Container2D _cMsn_FEDuTCA
Definition: TPComparisonTask.h:67
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TPComparisonTask::hcalDbServiceToken_
edm::ESGetToken< HcalDbService, HcalDbRecord > hcalDbServiceToken_
Definition: TPComparisonTask.h:38
hcaldqm::DQModule::_subsystem
std::string _subsystem
Definition: DQModule.h:49
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
HcalDbService
Definition: HcalDbService.h:23
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:81
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:246
dqm::implementation::IBooker
Definition: DQMStore.h:43
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:75
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
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
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