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 &, bool const &, bool &) 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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void bookMEs (DQMStore::IBooker &)
 
bool checkElectronicsMap (bool=true)
 
bool checkGeometry (bool=true)
 
bool checkTopology (bool=true)
 
bool checkTrigTowerMap (bool=true)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
EcalDQMSetupObjects const getEcalDQMSetupObjects ()
 
EcalElectronicsMapping const * GetElectronicsMap ()
 
CaloGeometry const * GetGeometry ()
 
std::string const & getName () const
 
CaloTopology const * GetTopology ()
 
EcalTrigTowerConstituentsMap const * GetTrigTowerMap ()
 
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 setSetupObjects (edm::EventSetup const &)
 
void setSetupObjectsEndLumi (edm::EventSetup const &)
 
void setTime (time_t _t)
 
void setTokens (edm::ConsumesCollector &)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

double bxBin_
 
std::vector< int > bxBinEdges_
 
std::vector< int > bxBinEdgesFine_
 
double bxBinFine_
 
edm::InputTag lhcStatusInfoCollectionTag_
 
edm::EDGetTokenT< TCDSRecordlhcStatusInfoRecordToken_
 
EcalTrigPrimDigiCollection const * realTps_
 
bool runOnEmul_
 
const EcalTPGStripStatusStripStatus
 
edm::ESGetToken< EcalTPGStripStatus, EcalTPGStripStatusRcdStripStatusRcd_
 
std::map< uint32_t, unsigned > towerReadouts_
 
const EcalTPGTowerStatusTTStatus
 
edm::ESGetToken< EcalTPGTowerStatus, EcalTPGTowerStatusRcdTTStatusRcd_
 

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)
 
- Public Attributes inherited from ecaldqm::DQWorker
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandle
 
edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcdelecMapHandleEndLumi
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandle
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomHandleEndLumi
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandle
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordtopoHandleEndLumi
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandle
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordttMapHandleEndLumi
 
- 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 21 of file TrigPrimTask.h.

Member Enumeration Documentation

◆ Constants

Enumerator
nBXBins 

Definition at line 40 of file TrigPrimTask.h.

Constructor & Destructor Documentation

◆ TrigPrimTask()

ecaldqm::TrigPrimTask::TrigPrimTask ( )

Definition at line 13 of file TrigPrimTask.cc.

14  : DQWorkerTask(),
15  realTps_(nullptr),
16  runOnEmul_(false),
17  // HLTCaloPath_(""),
18  // HLTMuonPath_(""),
19  // HLTCaloBit_(false),
20  // HLTMuonBit_(false),
21  bxBinEdges_(),
23  bxBin_(0.),
24  bxBinFine_(0.),
std::vector< int > bxBinEdgesFine_
Definition: TrigPrimTask.h:55
std::map< uint32_t, unsigned > towerReadouts_
Definition: TrigPrimTask.h:59
EcalTrigPrimDigiCollection const * realTps_
Definition: TrigPrimTask.h:45
std::vector< int > bxBinEdges_
Definition: TrigPrimTask.h:54
edm::InputTag lhcStatusInfoCollectionTag_
Definition: TrigPrimTask.h:66

◆ ~TrigPrimTask()

ecaldqm::TrigPrimTask::~TrigPrimTask ( )
inlineoverride

Definition at line 24 of file TrigPrimTask.h.

24 {}

Member Function Documentation

◆ addDependencies()

void ecaldqm::TrigPrimTask::addDependencies ( DependencySet _dependencies)
overridevirtual

◆ analyze()

bool ecaldqm::TrigPrimTask::analyze ( void const *  _p,
Collections  _collection 
)
inlineoverridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 70 of file TrigPrimTask.h.

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

70  {
71  switch (_collection) {
72  case kTrigPrimDigi:
73  if (_p)
74  runOnRealTPs(*static_cast<EcalTrigPrimDigiCollection const*>(_p));
75  return true;
76  break;
77  case kTrigPrimEmulDigi:
78  if (_p && runOnEmul_)
79  runOnEmulTPs(*static_cast<EcalTrigPrimDigiCollection const*>(_p));
80  return runOnEmul_;
81  break;
82  case kEBDigi:
83  if (_p)
84  runOnDigis(*static_cast<EBDigiCollection const*>(_p));
85  return true;
86  break;
87  case kEEDigi:
88  if (_p)
89  runOnDigis(*static_cast<EEDigiCollection const*>(_p));
90  return true;
91  break;
92  default:
93  break;
94  }
95  return false;
96  }
void runOnEmulTPs(EcalTrigPrimDigiCollection const &)
void runOnDigis(DigiCollection const &)
void runOnRealTPs(EcalTrigPrimDigiCollection const &)

◆ beginEvent()

void ecaldqm::TrigPrimTask::beginEvent ( edm::Event const &  _evt,
edm::EventSetup const &  _es,
bool const &  ByLumiResetSwitch,
bool &  lhcStatusSet 
)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 57 of file TrigPrimTask.cc.

References ecaldqm::MESetCollection::at(), edm::EventBase::bunchCrossing(), bxBin_, bxBinEdges_, bxBinEdgesFine_, bxBinFine_, ecaldqm::MESet::fill(), BSTRecord::getBeamMode(), TCDSRecord::getBST(), edm::Event::getByToken(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), EcalTPGTowerStatus::getMap(), EcalTPGStripStatus::getMap(), edm::HandleBase::isValid(), lhcStatusInfoRecordToken_, ecaldqm::DQWorker::MEs_, muonRecoAnalyzer_cfi::pBin, realTps_, ecaldqm::MESet::reset(), StripStatus, towerReadouts_, TTStatus, and pfDeepBoostedJetPreprocessParams_cfi::upper_bound.

60  {
61  using namespace std;
62 
63  towerReadouts_.clear();
64 
65  if (ByLumiResetSwitch) {
66  MEs_.at("EtSummaryByLumi").reset(GetElectronicsMap());
67  MEs_.at("TTFlags4ByLumi").reset(GetElectronicsMap());
68  MEs_.at("LHCStatusByLumi").reset(GetElectronicsMap(), -1);
69  }
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(getEcalDQMSetupObjects(), double(tcdsData->getBST().getBeamMode()));
78  lhcStatusSet = true;
79  }
80  }
81 
82  realTps_ = nullptr;
83 
84  // HLTCaloBit_ = false;
85  // HLTMuonBit_ = false;
86 
87  std::vector<int>::iterator pBin(std::upper_bound(bxBinEdges_.begin(), bxBinEdges_.end(), _evt.bunchCrossing()));
88  bxBin_ = static_cast<int>(pBin - bxBinEdges_.begin()) - 0.5;
89  // fine binning for TP Occ vs BX plot as requested by DAQ in March 2021
90  std::vector<int>::iterator pBinFine(
91  std::upper_bound(bxBinEdgesFine_.begin(), bxBinEdgesFine_.end(), _evt.bunchCrossing()));
92  bxBinFine_ = static_cast<int>(pBinFine - bxBinEdgesFine_.begin()) - 0.5;
93 
94  const EcalTPGTowerStatusMap& towerMap = TTStatus->getMap();
95  const EcalTPGStripStatusMap& stripMap = StripStatus->getMap();
96 
97  MESet& meTTMaskMap(MEs_.at("TTMaskMap"));
98 
99  for (EcalTPGTowerStatusMap::const_iterator ttItr(towerMap.begin()); ttItr != towerMap.end(); ++ttItr) {
100  if ((*ttItr).second > 0) {
101  const EcalTrigTowerDetId ttid((*ttItr).first);
102  //if(ttid.subDet() == EcalBarrel)
103  meTTMaskMap.fill(getEcalDQMSetupObjects(), ttid, 1);
104  } //masked
105  } //loop on towers
106 
107  for (EcalTPGStripStatusMap::const_iterator stItr(stripMap.begin()); stItr != stripMap.end(); ++stItr) {
108  if ((*stItr).second > 0) {
109  const EcalElectronicsId stid((*stItr).first);
110  //if(stid.subdet() == EcalEndcap);
111  meTTMaskMap.fill(getEcalDQMSetupObjects(), stid, 1);
112  } //masked
113  } //loop on pseudo-strips
114 
115  // if(HLTCaloPath_.size() || HLTMuonPath_.size()){
116  // edm::TriggerResultsByName results(_evt.triggerResultsByName("HLT"));
117  // if(!results.isValid()) results = _evt.triggerResultsByName("RECO");
118  // if(results.isValid()){
119  // const vector<string>& pathNames(results.triggerNames());
120 
121  // size_t caloStar(HLTCaloPath_.find('*'));
122  // if(caloStar != string::npos){
123  // string caloSub(HLTCaloPath_.substr(0, caloStar));
124  // bool found(false);
125  // for(unsigned iP(0); iP < pathNames.size(); ++iP){
126  // if(pathNames[iP].substr(0, caloStar) == caloSub){
127  // HLTCaloPath_ = pathNames[iP];
128  // found = true;
129  // break;
130  // }
131  // }
132  // if(!found) HLTCaloPath_ = "";
133  // }
134 
135  // size_t muonStar(HLTMuonPath_.find('*'));
136  // if(muonStar != string::npos){
137  // string muonSub(HLTMuonPath_.substr(0, muonStar));
138  // bool found(false);
139  // for(unsigned iP(0); iP < pathNames.size(); ++iP){
140  // if(pathNames[iP].substr(0, muonStar) == muonSub){
141  // HLTMuonPath_ = pathNames[iP];
142  // found = true;
143  // break;
144  // }
145  // }
146  // if(!found) HLTMuonPath_ = "";
147  // }
148 
149  // if(HLTCaloPath_.size()){
150  // try{
151  // HLTCaloBit_ = results.accept(HLTCaloPath_);
152  // }
153  // catch(cms::Exception e){
154  // if(e.category() != "LogicError") throw e;
155  // HLTCaloPath_ = "";
156  // }
157  // }
158  // if(HLTMuonPath_.size()){
159  // try{
160  // HLTMuonBit_ = results.accept(HLTMuonPath_);
161  // }
162  // catch(cms::Exception e){
163  // if(e.category() != "LogicError") throw e;
164  // HLTMuonPath_ = "";
165  // }
166  // }
167  // }
168  // }
169  }
const EcalTPGTowerStatus * TTStatus
Definition: TrigPrimTask.h:63
std::map< uint32_t, uint16_t > EcalTPGTowerStatusMap
MESet & at(const std::string &key)
Definition: MESet.h:399
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
std::vector< int > bxBinEdgesFine_
Definition: TrigPrimTask.h:55
std::map< uint32_t, unsigned > towerReadouts_
Definition: TrigPrimTask.h:59
edm::EDGetTokenT< TCDSRecord > lhcStatusInfoRecordToken_
Definition: TrigPrimTask.h:67
const EcalTPGStripStatus * StripStatus
Definition: TrigPrimTask.h:64
const BSTRecord & getBST() const
Definition: TCDSRecord.h:100
uint16_t const getBeamMode() const
Definition: BSTRecord.h:70
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
EcalTrigPrimDigiCollection const * realTps_
Definition: TrigPrimTask.h:45
std::vector< int > bxBinEdges_
Definition: TrigPrimTask.h:54
MESetCollection MEs_
Definition: DQWorker.h:131
bool isValid() const
Definition: HandleBase.h:70
const std::map< uint32_t, uint16_t > & getMap() const
const std::map< uint32_t, uint16_t > & getMap() const
std::map< uint32_t, uint16_t > EcalTPGStripStatusMap
virtual void reset(EcalElectronicsMapping const *, double=0., double=0., double=0.)
Definition: MESet.cc:98

◆ beginRun()

void ecaldqm::TrigPrimTask::beginRun ( edm::Run const &  ,
edm::EventSetup const &  _es 
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 49 of file TrigPrimTask.cc.

References edm::EventSetup::getData(), StripStatus, StripStatusRcd_, TTStatus, and TTStatusRcd_.

49  {
50  // Read-in Status records:
51  // Status records stay constant over run so they are read-in only once here
52  // but filled by LS in runOnRealTPs() because MEs are not yet booked at beginRun()
53  TTStatus = &_es.getData(TTStatusRcd_);
54  StripStatus = &_es.getData(StripStatusRcd_);
55  }
const EcalTPGTowerStatus * TTStatus
Definition: TrigPrimTask.h:63
edm::ESGetToken< EcalTPGTowerStatus, EcalTPGTowerStatusRcd > TTStatusRcd_
Definition: TrigPrimTask.h:61
edm::ESGetToken< EcalTPGStripStatus, EcalTPGStripStatusRcd > StripStatusRcd_
Definition: TrigPrimTask.h:62
const EcalTPGStripStatus * StripStatus
Definition: TrigPrimTask.h:64

◆ runOnDigis()

template<typename DigiCollection >
void ecaldqm::TrigPrimTask::runOnDigis ( DigiCollection const &  _digis)

Definition at line 172 of file TrigPrimTask.cc.

References ecaldqm::DQWorker::GetTrigTowerMap(), DetId::rawId(), egamma::towerOf(), and towerReadouts_.

Referenced by analyze().

172  {
173  for (typename DigiCollection::const_iterator digiItr(_digis.begin()); digiItr != _digis.end(); ++digiItr) {
174  EcalTrigTowerDetId ttid(GetTrigTowerMap()->towerOf(digiItr->id()));
175  towerReadouts_[ttid.rawId()]++;
176  }
177  }
std::map< uint32_t, unsigned > towerReadouts_
Definition: TrigPrimTask.h:59
CaloTowerDetId towerOf(reco::CaloCluster const &cluster, CaloTowerConstituentsMap const &towerMap)
EcalTrigTowerConstituentsMap const * GetTrigTowerMap()
Definition: DQWorker.cc:155

◆ runOnEmulTPs()

void ecaldqm::TrigPrimTask::runOnEmulTPs ( EcalTrigPrimDigiCollection const &  _tps)

Definition at line 284 of file TrigPrimTask.cc.

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), EcalTrigTowerConstituentsMap::constituentsOf(), edm::SortedCollection< T, SORT >::end(), EgHLTOffHistBins_cfi::et, edm::SortedCollection< T, SORT >::find(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetTrigTowerMap(), heavyionUCCDQM_cfi::maxEt, ecaldqm::DQWorker::MEs_, realTps_, and towerReadouts_.

Referenced by analyze().

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

◆ runOnRealTPs()

void ecaldqm::TrigPrimTask::runOnRealTPs ( EcalTrigPrimDigiCollection const &  _tps)

Definition at line 185 of file TrigPrimTask.cc.

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), bxBin_, bxBinFine_, EcalTrigTowerConstituentsMap::constituentsOf(), EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), EgHLTOffHistBins_cfi::et, ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), EcalTPGTowerStatus::getMap(), EcalTPGStripStatus::getMap(), ecaldqm::DQWorker::GetTrigTowerMap(), ecaldqm::DQWorker::MEs_, realTps_, StripStatus, EcalTriggerElectronicsId::tccId(), towerReadouts_, EcalTriggerElectronicsId::ttId(), and TTStatus.

Referenced by analyze().

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

◆ setParams()

void ecaldqm::TrigPrimTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 28 of file TrigPrimTask.cc.

References l1extraParticles_cfi::_params, bxBinEdges_, bxBinEdgesFine_, ecaldqm::MESetCollection::erase(), HLT_2022v15_cff::InputTag, lhcStatusInfoCollectionTag_, ecaldqm::DQWorker::MEs_, runOnEmul_, and AlCaHLTBitMon_QueryRunRegistry::string.

28  {
29  runOnEmul_ = _params.getUntrackedParameter<bool>("runOnEmul");
30  if (!runOnEmul_) {
31  MEs_.erase(std::string("EtMaxEmul"));
32  MEs_.erase(std::string("EmulMaxIndex"));
33  MEs_.erase(std::string("MatchedIndex"));
34  MEs_.erase(std::string("EtEmulError"));
35  MEs_.erase(std::string("FGEmulError"));
36  MEs_.erase(std::string("RealvEmulEt"));
37  }
38  lhcStatusInfoCollectionTag_ = _params.getUntrackedParameter<edm::InputTag>(
39  "lhcStatusInfoCollectionTag", edm::InputTag("tcdsDigis", "tcdsRecord"));
40  bxBinEdges_ = _params.getUntrackedParameter<std::vector<int> >("bxBins");
41  bxBinEdgesFine_ = _params.getUntrackedParameter<std::vector<int> >("bxBinsFine");
42  }
std::vector< int > bxBinEdgesFine_
Definition: TrigPrimTask.h:55
std::vector< int > bxBinEdges_
Definition: TrigPrimTask.h:54
MESetCollection MEs_
Definition: DQWorker.h:131
void erase(const std::string &key)
Definition: MESet.h:390
edm::InputTag lhcStatusInfoCollectionTag_
Definition: TrigPrimTask.h:66

◆ setTokens()

void ecaldqm::TrigPrimTask::setTokens ( edm::ConsumesCollector _collector)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 179 of file TrigPrimTask.cc.

References edm::BeginRun, edm::ConsumesCollector::consumes(), edm::ConsumesCollector::esConsumes(), lhcStatusInfoCollectionTag_, lhcStatusInfoRecordToken_, StripStatusRcd_, and TTStatusRcd_.

179  {
183  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::ESGetToken< EcalTPGTowerStatus, EcalTPGTowerStatusRcd > TTStatusRcd_
Definition: TrigPrimTask.h:61
Class to contain information from TCDS FED.
Definition: TCDSRecord.h:19
edm::EDGetTokenT< TCDSRecord > lhcStatusInfoRecordToken_
Definition: TrigPrimTask.h:67
edm::ESGetToken< EcalTPGStripStatus, EcalTPGStripStatusRcd > StripStatusRcd_
Definition: TrigPrimTask.h:62
edm::InputTag lhcStatusInfoCollectionTag_
Definition: TrigPrimTask.h:66

Member Data Documentation

◆ bxBin_

double ecaldqm::TrigPrimTask::bxBin_
private

Definition at line 56 of file TrigPrimTask.h.

Referenced by beginEvent(), and runOnRealTPs().

◆ bxBinEdges_

std::vector<int> ecaldqm::TrigPrimTask::bxBinEdges_
private

Definition at line 54 of file TrigPrimTask.h.

Referenced by beginEvent(), and setParams().

◆ bxBinEdgesFine_

std::vector<int> ecaldqm::TrigPrimTask::bxBinEdgesFine_
private

Definition at line 55 of file TrigPrimTask.h.

Referenced by beginEvent(), and setParams().

◆ bxBinFine_

double ecaldqm::TrigPrimTask::bxBinFine_
private

Definition at line 57 of file TrigPrimTask.h.

Referenced by beginEvent(), and runOnRealTPs().

◆ lhcStatusInfoCollectionTag_

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

Definition at line 66 of file TrigPrimTask.h.

Referenced by setParams(), and setTokens().

◆ lhcStatusInfoRecordToken_

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

Definition at line 67 of file TrigPrimTask.h.

Referenced by beginEvent(), and setTokens().

◆ realTps_

EcalTrigPrimDigiCollection const* ecaldqm::TrigPrimTask::realTps_
private

Definition at line 45 of file TrigPrimTask.h.

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

◆ runOnEmul_

bool ecaldqm::TrigPrimTask::runOnEmul_
private

Definition at line 47 of file TrigPrimTask.h.

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

◆ StripStatus

const EcalTPGStripStatus* ecaldqm::TrigPrimTask::StripStatus
private

Definition at line 64 of file TrigPrimTask.h.

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

◆ StripStatusRcd_

edm::ESGetToken<EcalTPGStripStatus, EcalTPGStripStatusRcd> ecaldqm::TrigPrimTask::StripStatusRcd_
private

Definition at line 62 of file TrigPrimTask.h.

Referenced by beginRun(), and setTokens().

◆ towerReadouts_

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

Definition at line 59 of file TrigPrimTask.h.

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

◆ TTStatus

const EcalTPGTowerStatus* ecaldqm::TrigPrimTask::TTStatus
private

Definition at line 63 of file TrigPrimTask.h.

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

◆ TTStatusRcd_

edm::ESGetToken<EcalTPGTowerStatus, EcalTPGTowerStatusRcd> ecaldqm::TrigPrimTask::TTStatusRcd_
private

Definition at line 61 of file TrigPrimTask.h.

Referenced by beginRun(), and setTokens().