CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::TrigPrimTask Class Reference

#include <TrigPrimTask.h>

Inheritance diagram for ecaldqm::TrigPrimTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Types

enum  Constants { nBXBins = 15 }
 
- Public Types inherited from ecaldqm::DQWorkerTask
typedef EcalDCCHeaderBlock::EcalDCCEventSettings EventSettings
 

Public Member Functions

void addDependencies (DependencySet &) override
 
bool analyze (void const *, Collections) override
 
void beginEvent (edm::Event const &, edm::EventSetup const &) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
template<typename DigiCollection >
void runOnDigis (DigiCollection const &)
 
void runOnEmulTPs (EcalTrigPrimDigiCollection const &)
 
void runOnRealTPs (EcalTrigPrimDigiCollection const &)
 
void setTokens (edm::ConsumesCollector &) override
 
 TrigPrimTask ()
 
 ~TrigPrimTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
 DQWorkerTask ()
 
virtual void endEvent (edm::Event const &, edm::EventSetup const &)
 
virtual bool filterRunType (short const *)
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
 ~DQWorkerTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void bookMEs (DQMStore::IBooker &)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
std::string const & getName () const
 
bool onlineMode () const
 
virtual void releaseMEs ()
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setTime (time_t _t)
 
virtual ~DQWorker ()(false)
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

double bxBin_
 
std::array< int, nBXBins+1 > bxBinEdges_
 
edm::InputTag lhcStatusInfoCollectionTag_
 
edm::EDGetTokenT< TCDSRecordlhcStatusInfoRecordToken_
 
bool lhcStatusSet_
 
EcalTrigPrimDigiCollection const * realTps_
 
bool runOnEmul_
 
edm::ESHandle< EcalTPGStripStatusStripStatusRcd
 
std::map< uint32_t, unsigned > towerReadouts_
 
edm::ESHandle< EcalTPGTowerStatusTTStatusRcd
 

Additional Inherited Members

- Static Public Member Functions inherited from ecaldqm::DQWorkerTask
static void fillDescriptions (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 
- Protected Types inherited from ecaldqm::DQWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from ecaldqm::DQWorkerTask
void setME (edm::ParameterSet const &) final
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
virtual void setSource (edm::ParameterSet const &)
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 19 of file TrigPrimTask.h.

Member Enumeration Documentation

Enumerator
nBXBins 

Definition at line 39 of file TrigPrimTask.h.

Constructor & Destructor Documentation

ecaldqm::TrigPrimTask::TrigPrimTask ( )

Definition at line 16 of file TrigPrimTask.cc.

References bxBin_, lhcStatusInfoCollectionTag_, lhcStatusSet_, and towerReadouts_.

17  : DQWorkerTask(),
18  realTps_(nullptr),
19  runOnEmul_(false),
20  // HLTCaloPath_(""),
21  // HLTMuonPath_(""),
22  // HLTCaloBit_(false),
23  // HLTMuonBit_(false),
24  bxBinEdges_{{1, 271, 541, 892, 1162, 1432, 1783, 2053, 2323, 2674, 2944, 3214, 3446, 3490, 3491, 3565}},
25  bxBin_(0.),
28  lhcStatusSet_(false) {}
std::map< uint32_t, unsigned > towerReadouts_
Definition: TrigPrimTask.h:56
std::array< int, nBXBins+1 > bxBinEdges_
Definition: TrigPrimTask.h:53
EcalTrigPrimDigiCollection const * realTps_
Definition: TrigPrimTask.h:44
edm::InputTag lhcStatusInfoCollectionTag_
Definition: TrigPrimTask.h:61
ecaldqm::TrigPrimTask::~TrigPrimTask ( )
inlineoverride

Member Function Documentation

void ecaldqm::TrigPrimTask::addDependencies ( DependencySet _dependencies)
overridevirtual
bool ecaldqm::TrigPrimTask::analyze ( void const *  _p,
Collections  _collection 
)
inlineoverridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 66 of file TrigPrimTask.h.

References ecaldqm::kEBDigi, ecaldqm::kEEDigi, ecaldqm::kTrigPrimDigi, ecaldqm::kTrigPrimEmulDigi, runOnDigis(), runOnEmul_, runOnEmulTPs(), and runOnRealTPs().

Referenced by ~TrigPrimTask().

66  {
67  switch (_collection) {
68  case kTrigPrimDigi:
69  if (_p)
70  runOnRealTPs(*static_cast<EcalTrigPrimDigiCollection const*>(_p));
71  return true;
72  break;
73  case kTrigPrimEmulDigi:
74  if (_p && runOnEmul_)
75  runOnEmulTPs(*static_cast<EcalTrigPrimDigiCollection const*>(_p));
76  return runOnEmul_;
77  break;
78  case kEBDigi:
79  if (_p)
80  runOnDigis(*static_cast<EBDigiCollection const*>(_p));
81  return true;
82  break;
83  case kEEDigi:
84  if (_p)
85  runOnDigis(*static_cast<EEDigiCollection const*>(_p));
86  return true;
87  break;
88  default:
89  break;
90  }
91  return false;
92  }
void runOnEmulTPs(EcalTrigPrimDigiCollection const &)
void runOnDigis(DigiCollection const &)
void runOnRealTPs(EcalTrigPrimDigiCollection const &)
void ecaldqm::TrigPrimTask::beginEvent ( edm::Event const &  _evt,
edm::EventSetup const &  _es 
)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 66 of file TrigPrimTask.cc.

References edm::EventBase::bunchCrossing(), bxBin_, bxBinEdges_, ecaldqm::MESet::fill(), edm::EventSetup::get(), BSTRecord::getBeamMode(), TCDSRecord::getBST(), edm::Event::getByToken(), EcalTPGTowerStatus::getMap(), EcalTPGStripStatus::getMap(), edm::HandleBase::isValid(), lhcStatusInfoRecordToken_, lhcStatusSet_, ecaldqm::DQWorker::MEs_, muonRecoAnalyzer_cfi::pBin, edm::ESHandle< T >::product(), realTps_, and towerReadouts_.

Referenced by ~TrigPrimTask().

66  {
67  using namespace std;
68 
69  towerReadouts_.clear();
70 
71  if (!lhcStatusSet_) {
72  // Update LHC status once each LS
73  MESet& meLHCStatusByLumi(static_cast<MESet&>(MEs_.at("LHCStatusByLumi")));
74  edm::Handle<TCDSRecord> tcdsData;
75  _evt.getByToken(lhcStatusInfoRecordToken_, tcdsData);
76  if (tcdsData.isValid()) {
77  meLHCStatusByLumi.fill(double(tcdsData->getBST().getBeamMode()));
78  lhcStatusSet_ = true;
79  }
80  }
81 
82  realTps_ = nullptr;
83 
84  // HLTCaloBit_ = false;
85  // HLTMuonBit_ = false;
86 
87  int* pBin(std::upper_bound(bxBinEdges_.begin(), bxBinEdges_.end(), _evt.bunchCrossing()));
88  bxBin_ = static_cast<int>(pBin - bxBinEdges_.begin()) - 0.5;
89 
91  _es.get<EcalTPGTowerStatusRcd>().get(TTStatusRcd_);
92  const EcalTPGTowerStatus* TTStatus = TTStatusRcd_.product();
93  const EcalTPGTowerStatusMap& towerMap = TTStatus->getMap();
94 
95  edm::ESHandle<EcalTPGStripStatus> StripStatusRcd_;
96  _es.get<EcalTPGStripStatusRcd>().get(StripStatusRcd_);
97  const EcalTPGStripStatus* StripStatus = StripStatusRcd_.product();
98  const EcalTPGStripStatusMap& stripMap = StripStatus->getMap();
99 
100  MESet& meTTMaskMap(MEs_.at("TTMaskMap"));
101 
102  for (EcalTPGTowerStatusMap::const_iterator ttItr(towerMap.begin()); ttItr != towerMap.end(); ++ttItr) {
103  if ((*ttItr).second > 0) {
104  const EcalTrigTowerDetId ttid((*ttItr).first);
105  //if(ttid.subDet() == EcalBarrel)
106  meTTMaskMap.fill(ttid, 1);
107  } //masked
108  } //loop on towers
109 
110  for (EcalTPGStripStatusMap::const_iterator stItr(stripMap.begin()); stItr != stripMap.end(); ++stItr) {
111  if ((*stItr).second > 0) {
112  const EcalElectronicsId stid((*stItr).first);
113  //if(stid.subdet() == EcalEndcap);
114  meTTMaskMap.fill(stid, 1);
115  } //masked
116  } //loop on pseudo-strips
117 
118  // if(HLTCaloPath_.size() || HLTMuonPath_.size()){
119  // edm::TriggerResultsByName results(_evt.triggerResultsByName("HLT"));
120  // if(!results.isValid()) results = _evt.triggerResultsByName("RECO");
121  // if(results.isValid()){
122  // const vector<string>& pathNames(results.triggerNames());
123 
124  // size_t caloStar(HLTCaloPath_.find('*'));
125  // if(caloStar != string::npos){
126  // string caloSub(HLTCaloPath_.substr(0, caloStar));
127  // bool found(false);
128  // for(unsigned iP(0); iP < pathNames.size(); ++iP){
129  // if(pathNames[iP].substr(0, caloStar) == caloSub){
130  // HLTCaloPath_ = pathNames[iP];
131  // found = true;
132  // break;
133  // }
134  // }
135  // if(!found) HLTCaloPath_ = "";
136  // }
137 
138  // size_t muonStar(HLTMuonPath_.find('*'));
139  // if(muonStar != string::npos){
140  // string muonSub(HLTMuonPath_.substr(0, muonStar));
141  // bool found(false);
142  // for(unsigned iP(0); iP < pathNames.size(); ++iP){
143  // if(pathNames[iP].substr(0, muonStar) == muonSub){
144  // HLTMuonPath_ = pathNames[iP];
145  // found = true;
146  // break;
147  // }
148  // }
149  // if(!found) HLTMuonPath_ = "";
150  // }
151 
152  // if(HLTCaloPath_.size()){
153  // try{
154  // HLTCaloBit_ = results.accept(HLTCaloPath_);
155  // }
156  // catch(cms::Exception e){
157  // if(e.category() != "LogicError") throw e;
158  // HLTCaloPath_ = "";
159  // }
160  // }
161  // if(HLTMuonPath_.size()){
162  // try{
163  // HLTMuonBit_ = results.accept(HLTMuonPath_);
164  // }
165  // catch(cms::Exception e){
166  // if(e.category() != "LogicError") throw e;
167  // HLTMuonPath_ = "";
168  // }
169  // }
170  // }
171  // }
172  }
std::map< uint32_t, uint16_t > EcalTPGTowerStatusMap
const BSTRecord & getBST() const
Definition: TCDSRecord.h:100
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
std::map< uint32_t, unsigned > towerReadouts_
Definition: TrigPrimTask.h:56
const std::map< uint32_t, uint16_t > & getMap() const
uint16_t const getBeamMode() const
Definition: BSTRecord.h:70
edm::EDGetTokenT< TCDSRecord > lhcStatusInfoRecordToken_
Definition: TrigPrimTask.h:62
std::array< int, nBXBins+1 > bxBinEdges_
Definition: TrigPrimTask.h:53
bool isValid() const
Definition: HandleBase.h:70
EcalTrigPrimDigiCollection const * realTps_
Definition: TrigPrimTask.h:44
MESetCollection MEs_
Definition: DQWorker.h:78
const std::map< uint32_t, uint16_t > & getMap() const
std::map< uint32_t, uint16_t > EcalTPGStripStatusMap
T const * product() const
Definition: ESHandle.h:86
void ecaldqm::TrigPrimTask::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 56 of file TrigPrimTask.cc.

References lhcStatusSet_, and ecaldqm::DQWorker::MEs_.

Referenced by ~TrigPrimTask().

56  {
57  // Reset by LS plots at beginning of every LS
58  MEs_.at("EtSummaryByLumi").reset();
59  MEs_.at("TTFlags4ByLumi").reset();
60  MEs_.at("LHCStatusByLumi").reset(-1);
61 
62  // Reset lhcStatusSet_ to false at the beginning of each LS; when LHC status is set in some event this variable will be set to true
63  lhcStatusSet_ = false;
64  }
MESetCollection MEs_
Definition: DQWorker.h:78
void ecaldqm::TrigPrimTask::beginRun ( edm::Run const &  ,
edm::EventSetup const &  _es 
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 48 of file TrigPrimTask.cc.

References edm::EventSetup::get(), StripStatusRcd, and TTStatusRcd.

Referenced by ~TrigPrimTask().

48  {
49  // Read-in Status records:
50  // Status records stay constant over run so they are read-in only once here
51  // but filled by LS in runOnRealTPs() because MEs are not yet booked at beginRun()
52  _es.get<EcalTPGTowerStatusRcd>().get(TTStatusRcd);
53  _es.get<EcalTPGStripStatusRcd>().get(StripStatusRcd);
54  }
edm::ESHandle< EcalTPGTowerStatus > TTStatusRcd
Definition: TrigPrimTask.h:58
edm::ESHandle< EcalTPGStripStatus > StripStatusRcd
Definition: TrigPrimTask.h:59
template<typename DigiCollection >
void ecaldqm::TrigPrimTask::runOnDigis ( DigiCollection const &  _digis)

Definition at line 175 of file TrigPrimTask.cc.

References ecaldqm::getTrigTowerMap(), DetId::rawId(), and towerReadouts_.

Referenced by analyze(), and ~TrigPrimTask().

175  {
176  for (typename DigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr) {
177  EcalTrigTowerDetId ttid(getTrigTowerMap()->towerOf(digiItr->id()));
178  towerReadouts_[ttid.rawId()]++;
179  }
180  }
std::map< uint32_t, unsigned > towerReadouts_
Definition: TrigPrimTask.h:56
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
void ecaldqm::TrigPrimTask::runOnEmulTPs ( EcalTrigPrimDigiCollection const &  _tps)

Definition at line 287 of file TrigPrimTask.cc.

References edm::SortedCollection< T, SORT >::begin(), EcalTrigTowerConstituentsMap::constituentsOf(), DEFINE_ECALDQM_WORKER, edm::SortedCollection< T, SORT >::end(), EgHLTOffHistBins_cfi::et, edm::SortedCollection< T, SORT >::find(), ecaldqm::getTrigTowerMap(), match(), heavyionUCCDQM_cfi::maxEt, ecaldqm::DQWorker::MEs_, realTps_, and towerReadouts_.

Referenced by analyze(), and ~TrigPrimTask().

287  {
288  MESet& meEtMaxEmul(MEs_.at("EtMaxEmul"));
289  MESet& meEmulMaxIndex(MEs_.at("EmulMaxIndex"));
290  MESet& meMatchedIndex(MEs_.at("MatchedIndex"));
291  MESet& meEtEmulError(MEs_.at("EtEmulError"));
292  MESet& meFGEmulError(MEs_.at("FGEmulError"));
293  MESet& meRealvEmulEt(MEs_.at("RealvEmulEt"));
294 
295  for (EcalTrigPrimDigiCollection::const_iterator tpItr(_tps.begin()); tpItr != _tps.end(); ++tpItr) {
296  EcalTrigTowerDetId ttid(tpItr->id());
297 
298  int et(tpItr->compressedEt());
299 
300  float maxEt(0.);
301  int iMax(0);
302  for (int iDigi(0); iDigi < 5; iDigi++) {
303  float sampleEt((*tpItr)[iDigi].compressedEt());
304 
305  if (sampleEt > maxEt) {
306  maxEt = sampleEt;
307  iMax = iDigi + 1;
308  }
309  }
310 
311  meEtMaxEmul.fill(ttid, maxEt);
312  if (maxEt > 0.)
313  meEmulMaxIndex.fill(ttid, iMax);
314 
315  bool match(true);
316  bool matchFG(true);
317 
318  // Loop over real TPs and look for an emulated TP index with matching Et:
319  // If an Et match is found, return TP index correpsonding to BX of emulated TP where match was found
320  // Standard TPG comparison: { TP index:matched BX } = { no emul:No Et match, 0:BX-2, 1:BX-1, 2:in-time, 3:BX+1, 4:BX+2 }
322  if (realItr != realTps_->end()) {
323  int realEt(realItr->compressedEt());
324 
325  if (realEt > 0) {
326  int ttF(realItr->ttFlag());
327  if ((ttF == 1 || ttF == 3) &&
328  towerReadouts_[ttid.rawId()] == getTrigTowerMap()->constituentsOf(ttid).size()) {
329  if (et != realEt)
330  match = false;
331  if (tpItr->fineGrain() != realItr->fineGrain())
332  matchFG = false;
333 
334  // NOTE: matchedIndex comparison differs from Standard TPG comparison:
335  // { matchedIndex:TP index } = { 0:no emul, 1:BX-2, 2:BX-1, 3:in-time, 4:BX+1, 5:BX+2 }
336  std::vector<int> matchedIndex(0);
337  // iDigi only loops over explicit Et matches:
338  // { iDigi:TP index } = { 0:BX-2, 1:BX-1, 2:in-time, 3:BX+1, 4:BX+2 }
339  for (int iDigi(0); iDigi < 5; iDigi++) {
340  if ((*tpItr)[iDigi].compressedEt() == realEt) {
341  // matchedIndex = iDigi + 1
342  if (iDigi != 2) {
343  matchedIndex.push_back(iDigi + 1);
344  }
345  // If an in-time match is found, exit loop and clear out any other matches:
346  // Ensures multiple matches are not returned (e.g. during saturation)
347  else {
348  matchedIndex.clear();
349  matchedIndex.push_back(3); // Et match is to in-time emulated TP
350  break;
351  }
352  } // Et match found
353  } // iDigi
354  if (matchedIndex.empty())
355  matchedIndex.push_back(0); // no Et match found => no emul
356 
357  // Fill Real vs Emulated TP Et
358  meRealvEmulEt.fill(ttid, realEt, (*tpItr)[2].compressedEt()); // iDigi=2:in-time BX
359 
360  // Fill matchedIndex ME
361  for (std::vector<int>::iterator matchItr(matchedIndex.begin()); matchItr != matchedIndex.end();
362  ++matchItr) {
363  meMatchedIndex.fill(ttid, *matchItr + 0.5);
364 
365  // timing information is only within emulated TPs (real TPs have one time sample)
366  // if(HLTCaloBit_) MEs_[kTimingCalo].fill(ttid, float(*matchItr));
367  // if(HLTMuonBit_) MEs_[kTimingMuon].fill(ttid, float(*matchItr));
368  }
369  }
370  }
371  } else {
372  match = false;
373  matchFG = false;
374  }
375 
376  if (!match)
377  meEtEmulError.fill(ttid);
378  if (!matchFG)
379  meFGEmulError.fill(ttid);
380  }
381  }
std::vector< T >::const_iterator const_iterator
std::map< uint32_t, unsigned > towerReadouts_
Definition: TrigPrimTask.h:56
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
std::vector< DetId > constituentsOf(const EcalTrigTowerDetId &id) const
Get the constituent detids for this tower id.
const_iterator end() const
EcalTrigPrimDigiCollection const * realTps_
Definition: TrigPrimTask.h:44
MESetCollection MEs_
Definition: DQWorker.h:78
iterator find(key_type k)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
void ecaldqm::TrigPrimTask::runOnRealTPs ( EcalTrigPrimDigiCollection const &  _tps)

Definition at line 186 of file TrigPrimTask.cc.

References edm::SortedCollection< T, SORT >::begin(), bxBin_, EcalTrigTowerConstituentsMap::constituentsOf(), EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), EgHLTOffHistBins_cfi::et, ecaldqm::getElectronicsMap(), ecaldqm::getTrigTowerMap(), ecaldqm::DQWorker::MEs_, edm::ESHandle< T >::product(), realTps_, StripStatusRcd, EcalTriggerElectronicsId::tccId(), towerReadouts_, EcalTriggerElectronicsId::ttId(), and TTStatusRcd.

Referenced by analyze(), and ~TrigPrimTask().

186  {
187  MESet& meEtVsBx(MEs_.at("EtVsBx"));
188  MESet& meEtReal(MEs_.at("EtReal"));
189  MESet& meEtRealMap(MEs_.at("EtRealMap"));
190  MESet& meEtSummary(MEs_.at("EtSummary"));
191  MESet& meEtSummaryByLumi(MEs_.at("EtSummaryByLumi"));
192  MESet& meLowIntMap(MEs_.at("LowIntMap"));
193  MESet& meMedIntMap(MEs_.at("MedIntMap"));
194  MESet& meHighIntMap(MEs_.at("HighIntMap"));
195  MESet& meTTFlags(MEs_.at("TTFlags"));
196  MESet& meTTFlagsVsEt(MEs_.at("TTFlagsVsEt"));
197  MESet& meTTFlags4(MEs_.at("TTFlags4"));
198  MESet& meTTFlags4ByLumi(MEs_.at("TTFlags4ByLumi"));
199  MESet& meTTFMismatch(MEs_.at("TTFMismatch"));
200  MESet& meOccVsBx(MEs_.at("OccVsBx"));
201 
202  realTps_ = &_tps;
203 
204  double nTP[] = {0., 0., 0.};
205 
206  for (EcalTrigPrimDigiCollection::const_iterator tpItr(_tps.begin()); tpItr != _tps.end(); ++tpItr) {
207  EcalTrigTowerDetId ttid(tpItr->id());
208  float et(tpItr->compressedEt());
209 
210  if (et > 0.) {
211  if (ttid.subDet() == EcalBarrel)
212  nTP[0] += 1.;
213  else if (ttid.zside() < 0)
214  nTP[1] += 1.;
215  else
216  nTP[2] += 2.;
217  meEtVsBx.fill(ttid, bxBin_, et);
218  }
219 
220  meEtReal.fill(ttid, et);
221  meEtRealMap.fill(ttid, et);
222  meEtSummary.fill(ttid, et);
223  meEtSummaryByLumi.fill(ttid, et);
224 
225  int interest(tpItr->ttFlag() & 0x3);
226 
227  switch (interest) {
228  case 0:
229  meLowIntMap.fill(ttid);
230  break;
231  case 1:
232  meMedIntMap.fill(ttid);
233  break;
234  case 3:
235  meHighIntMap.fill(ttid);
236  break;
237  default:
238  break;
239  }
240 
241  // Fill TT Flag MEs
242  int ttF(tpItr->ttFlag());
243  meTTFlags.fill(ttid, 1.0 * ttF);
244  meTTFlagsVsEt.fill(ttid, et, 1.0 * ttF);
245  // Monitor occupancy of TTF=4
246  // which contains info about TT auto-masking
247  if (ttF >= 4) {
248  meTTFlags4.fill(ttid);
249  meTTFlags4ByLumi.fill(ttid);
250  }
251  if ((ttF == 1 || ttF == 3) && towerReadouts_[ttid.rawId()] != getTrigTowerMap()->constituentsOf(ttid).size())
252  meTTFMismatch.fill(ttid);
253  }
254 
255  meOccVsBx.fill(EcalBarrel, bxBin_, nTP[0]);
256  meOccVsBx.fill(-EcalEndcap, bxBin_, nTP[1]);
257  meOccVsBx.fill(EcalEndcap, bxBin_, nTP[2]);
258 
259  // Set TT/Strip Masking status in Ecal3P view
260  // Status Records are read-in at beginRun() but filled here
261  // Requestied by ECAL Trigger in addition to TTMaskMap plots in SM view
262  MESet& meTTMaskMapAll(MEs_.at("TTMaskMapAll"));
263 
264  // Fill from TT Status Rcd
265  const EcalTPGTowerStatus* TTStatus(TTStatusRcd.product());
266  const EcalTPGTowerStatusMap& TTStatusMap(TTStatus->getMap());
267  for (EcalTPGTowerStatusMap::const_iterator ttItr(TTStatusMap.begin()); ttItr != TTStatusMap.end(); ++ttItr) {
268  const EcalTrigTowerDetId ttid(ttItr->first);
269  if (ttItr->second > 0)
270  meTTMaskMapAll.setBinContent(ttid, 1); // TT is masked
271  } // TTs
272 
273  // Fill from Strip Status Rcd
274  const EcalTPGStripStatus* StripStatus(StripStatusRcd.product());
275  const EcalTPGStripStatusMap& StripStatusMap(StripStatus->getMap());
276  for (EcalTPGStripStatusMap::const_iterator stItr(StripStatusMap.begin()); stItr != StripStatusMap.end(); ++stItr) {
277  const EcalTriggerElectronicsId stid(stItr->first);
278  // Since ME has kTriggerTower binning, convert to EcalTrigTowerDetId first
279  // In principle, setBinContent() could be implemented for EcalTriggerElectronicsId class as well
280  const EcalTrigTowerDetId ttid(getElectronicsMap()->getTrigTowerDetId(stid.tccId(), stid.ttId()));
281  if (stItr->second > 0)
282  meTTMaskMapAll.setBinContent(ttid, 1); // PseudoStrip is masked
283  } // PseudoStrips
284 
285  } // TrigPrimTask::runOnRealTPs()
std::map< uint32_t, uint16_t > EcalTPGTowerStatusMap
EcalElectronicsMapping const * getElectronicsMap()
std::vector< T >::const_iterator const_iterator
edm::ESHandle< EcalTPGTowerStatus > TTStatusRcd
Definition: TrigPrimTask.h:58
std::map< uint32_t, unsigned > towerReadouts_
Definition: TrigPrimTask.h:56
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
std::vector< DetId > constituentsOf(const EcalTrigTowerDetId &id) const
Get the constituent detids for this tower id.
EcalTrigPrimDigiCollection const * realTps_
Definition: TrigPrimTask.h:44
edm::ESHandle< EcalTPGStripStatus > StripStatusRcd
Definition: TrigPrimTask.h:59
MESetCollection MEs_
Definition: DQWorker.h:78
std::map< uint32_t, uint16_t > EcalTPGStripStatusMap
T const * product() const
Definition: ESHandle.h:86
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
void ecaldqm::TrigPrimTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 30 of file TrigPrimTask.cc.

References edm::ParameterSet::getUntrackedParameter(), HLT_2018_cff::InputTag, lhcStatusInfoCollectionTag_, ecaldqm::DQWorker::MEs_, runOnEmul_, and AlCaHLTBitMon_QueryRunRegistry::string.

30  {
31  runOnEmul_ = _params.getUntrackedParameter<bool>("runOnEmul");
32  if (!runOnEmul_) {
33  MEs_.erase(std::string("EtMaxEmul"));
34  MEs_.erase(std::string("EmulMaxIndex"));
35  MEs_.erase(std::string("MatchedIndex"));
36  MEs_.erase(std::string("EtEmulError"));
37  MEs_.erase(std::string("FGEmulError"));
38  }
39  lhcStatusInfoCollectionTag_ = _params.getUntrackedParameter<edm::InputTag>(
40  "lhcStatusInfoCollectionTag", edm::InputTag("tcdsDigis", "tcdsRecord"));
41  }
MESetCollection MEs_
Definition: DQWorker.h:78
edm::InputTag lhcStatusInfoCollectionTag_
Definition: TrigPrimTask.h:61
void ecaldqm::TrigPrimTask::setTokens ( edm::ConsumesCollector _collector)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 182 of file TrigPrimTask.cc.

References edm::ConsumesCollector::consumes(), lhcStatusInfoCollectionTag_, and lhcStatusInfoRecordToken_.

Referenced by ~TrigPrimTask().

182  {
184  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Class to contain information from TCDS FED.
Definition: TCDSRecord.h:19
edm::EDGetTokenT< TCDSRecord > lhcStatusInfoRecordToken_
Definition: TrigPrimTask.h:62
edm::InputTag lhcStatusInfoCollectionTag_
Definition: TrigPrimTask.h:61

Member Data Documentation

double ecaldqm::TrigPrimTask::bxBin_
private

Definition at line 54 of file TrigPrimTask.h.

Referenced by beginEvent(), runOnRealTPs(), and TrigPrimTask().

std::array<int, nBXBins + 1> ecaldqm::TrigPrimTask::bxBinEdges_
private

Definition at line 53 of file TrigPrimTask.h.

Referenced by beginEvent().

edm::InputTag ecaldqm::TrigPrimTask::lhcStatusInfoCollectionTag_
private

Definition at line 61 of file TrigPrimTask.h.

Referenced by setParams(), setTokens(), and TrigPrimTask().

edm::EDGetTokenT<TCDSRecord> ecaldqm::TrigPrimTask::lhcStatusInfoRecordToken_
private

Definition at line 62 of file TrigPrimTask.h.

Referenced by beginEvent(), and setTokens().

bool ecaldqm::TrigPrimTask::lhcStatusSet_
private

Definition at line 63 of file TrigPrimTask.h.

Referenced by beginEvent(), beginLuminosityBlock(), and TrigPrimTask().

EcalTrigPrimDigiCollection const* ecaldqm::TrigPrimTask::realTps_
private

Definition at line 44 of file TrigPrimTask.h.

Referenced by beginEvent(), runOnEmulTPs(), and runOnRealTPs().

bool ecaldqm::TrigPrimTask::runOnEmul_
private

Definition at line 46 of file TrigPrimTask.h.

Referenced by addDependencies(), analyze(), and setParams().

edm::ESHandle<EcalTPGStripStatus> ecaldqm::TrigPrimTask::StripStatusRcd
private

Definition at line 59 of file TrigPrimTask.h.

Referenced by beginRun(), and runOnRealTPs().

std::map<uint32_t, unsigned> ecaldqm::TrigPrimTask::towerReadouts_
private

Definition at line 56 of file TrigPrimTask.h.

Referenced by beginEvent(), runOnDigis(), runOnEmulTPs(), runOnRealTPs(), and TrigPrimTask().

edm::ESHandle<EcalTPGTowerStatus> ecaldqm::TrigPrimTask::TTStatusRcd
private

Definition at line 58 of file TrigPrimTask.h.

Referenced by beginRun(), and runOnRealTPs().