CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions
ecaldqm::IntegrityTask Class Reference

#include <IntegrityTask.h>

Inheritance diagram for ecaldqm::IntegrityTask:
ecaldqm::DQWorkerTask ecaldqm::DQWorker

Public Member Functions

bool analyze (void const *, Collections) override
 
void beginEvent (edm::Event const &, edm::EventSetup const &, bool const &, bool &) override
 
 IntegrityTask ()
 
template<typename IDCollection >
void runOnDetIdCollection (IDCollection const &_ids, Collections _collection)
 
template<class C >
void runOnDetIdCollection (C const &, Collections)
 
void runOnElectronicsIdCollection (EcalElectronicsIdCollection const &, Collections)
 
 ~IntegrityTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
virtual void addDependencies (DependencySet &)
 
 DQWorkerTask ()
 
virtual void endEvent (edm::Event const &, edm::EventSetup const &)
 
virtual bool filterRunType (short const *)
 
virtual bool filterTrigger (edm::TriggerResultsByName const &)
 
virtual void setTokens (edm::ConsumesCollector &)
 
 ~DQWorkerTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run 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)
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DQWorkerTask
typedef EcalDCCHeaderBlock::EcalDCCEventSettings EventSettings
 
- 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 setParams (edm::ParameterSet 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 13 of file IntegrityTask.h.

Constructor & Destructor Documentation

◆ IntegrityTask()

ecaldqm::IntegrityTask::IntegrityTask ( )

Definition at line 7 of file IntegrityTask.cc.

◆ ~IntegrityTask()

ecaldqm::IntegrityTask::~IntegrityTask ( )
inlineoverride

Definition at line 16 of file IntegrityTask.h.

16 {}

Member Function Documentation

◆ analyze()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 27 of file IntegrityTask.h.

References ecaldqm::kBlockSizeErrors, ecaldqm::kEBChIdErrors, ecaldqm::kEBGainErrors, ecaldqm::kEBGainSwitchErrors, ecaldqm::kEEChIdErrors, ecaldqm::kEEGainErrors, ecaldqm::kEEGainSwitchErrors, ecaldqm::kTowerIdErrors, runOnDetIdCollection(), and runOnElectronicsIdCollection().

27  {
28  switch (_collection) {
29  case kEBGainErrors:
30  case kEBChIdErrors:
32  if (_p)
33  runOnDetIdCollection(*static_cast<EBDetIdCollection const*>(_p), _collection);
34  return true;
35  case kEEGainErrors:
36  case kEEChIdErrors:
38  if (_p)
39  runOnDetIdCollection(*static_cast<EEDetIdCollection const*>(_p), _collection);
40  return true;
41  break;
42  case kTowerIdErrors:
43  case kBlockSizeErrors:
44  if (_p)
45  runOnElectronicsIdCollection(*static_cast<EcalElectronicsIdCollection const*>(_p), _collection);
46  return true;
47  break;
48  default:
49  break;
50  }
51 
52  return false;
53  }
void runOnDetIdCollection(C const &, Collections)
void runOnElectronicsIdCollection(EcalElectronicsIdCollection const &, Collections)

◆ beginEvent()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 9 of file IntegrityTask.cc.

References ecaldqm::MESetCollection::at(), ecaldqm::DQWorker::GetElectronicsMap(), ecaldqm::DQWorker::MEs_, and ecaldqm::MESet::reset().

12  {
13  if (ByLumiResetSwitch) {
14  MEs_.at("MapByLumi").reset(GetElectronicsMap());
15  MEs_.at("ByLumi").reset(GetElectronicsMap());
16  MEs_.at("TTIDByLumi").reset(GetElectronicsMap());
17  }
18  }
MESet & at(const std::string &key)
Definition: MESet.h:399
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
MESetCollection MEs_
Definition: DQWorker.h:131
virtual void reset(EcalElectronicsMapping const *, double=0., double=0., double=0.)
Definition: MESet.cc:98

◆ runOnDetIdCollection() [1/2]

template<typename IDCollection >
void ecaldqm::IntegrityTask::runOnDetIdCollection ( IDCollection const &  _ids,
Collections  _collection 
)

Definition at line 21 of file IntegrityTask.cc.

References ecaldqm::MESetCollection::at(), ecaldqm::dccId(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), l1ctLayer2EG_cff::id, ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::kEBChIdErrors, ecaldqm::kEBGainErrors, ecaldqm::kEBGainSwitchErrors, ecaldqm::kEEChIdErrors, ecaldqm::kEEGainErrors, ecaldqm::kEEGainSwitchErrors, ecaldqm::DQWorker::MEs_, and ecaldqm::DQWorker::timestamp_.

21  {
22  // Collection is empty if there are no errors
23  if (_ids.empty())
24  return;
25 
26  MESet* set(nullptr);
27  switch (_collection) {
28  case kEBGainErrors:
29  case kEEGainErrors:
30  set = &MEs_.at("Gain");
31  break;
32  case kEBChIdErrors:
33  case kEEChIdErrors:
34  set = &MEs_.at("ChId");
35  break;
38  set = &MEs_.at("GainSwitch");
39  break;
40  default:
41  return;
42  }
43 
44  MESet& meMapByLumi(MEs_.at("MapByLumi"));
45  MESet& meByLumi(MEs_.at("ByLumi"));
46  MESet& meTotal(MEs_.at("Total"));
47  MESet& meTrendNErrors(MEs_.at("TrendNErrors"));
48 
49  std::for_each(_ids.begin(), _ids.end(), [&](typename IDCollection::value_type const& id) {
50  set->fill(getEcalDQMSetupObjects(), id);
51  int dccid(dccId(id, GetElectronicsMap()));
52  meByLumi.fill(getEcalDQMSetupObjects(), dccid);
53  meTotal.fill(getEcalDQMSetupObjects(), dccid);
54  // Fill Integrity Errors Map with channel errors for this lumi
55  meMapByLumi.fill(getEcalDQMSetupObjects(), id);
56 
57  meTrendNErrors.fill(getEcalDQMSetupObjects(), double(timestamp_.iLumi), 1.);
58  });
59  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:48
MESet & at(const std::string &key)
Definition: MESet.h:399
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
Timestamp timestamp_
Definition: DQWorker.h:134
MESetCollection MEs_
Definition: DQWorker.h:131

◆ runOnDetIdCollection() [2/2]

template<class C >
void ecaldqm::IntegrityTask::runOnDetIdCollection ( C const &  ,
Collections   
)

Referenced by analyze().

◆ runOnElectronicsIdCollection()

void ecaldqm::IntegrityTask::runOnElectronicsIdCollection ( EcalElectronicsIdCollection const &  _ids,
Collections  _collection 
)

Definition at line 61 of file IntegrityTask.cc.

References ecaldqm::MESetCollection::at(), edm::EDCollection< T >::begin(), ecaldqm::dccId(), edm::EDCollection< T >::empty(), edm::EDCollection< T >::end(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), l1ctLayer2EG_cff::id, ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::kBlockSizeErrors, ecaldqm::kEEpLow, ecaldqm::kTowerIdErrors, ecaldqm::DQWorker::MEs_, ecaldqm::nCrystals(), ecaldqm::DQWorker::timestamp_, and ecaldqm::towerId().

Referenced by analyze().

61  {
62  // Collection is empty if there are no errors
63  if (_ids.empty())
64  return;
65 
66  MESet* set(nullptr);
67  switch (_collection) {
68  case kTowerIdErrors:
69  set = &MEs_.at("TowerId");
70  break;
71  case kBlockSizeErrors:
72  set = &MEs_.at("BlockSize");
73  break;
74  default:
75  return;
76  }
77 
78  MESet& meMapByLumi(MEs_.at("MapByLumi"));
79  MESet& meByLumi(MEs_.at("ByLumi"));
80  MESet& meTotal(MEs_.at("Total"));
81  MESet& meTrendNErrors(MEs_.at("TrendNErrors"));
82  MESet& meTTIDTotal(MEs_.at("TTIDTotal"));
83  MESet& meTTIDByLumi(MEs_.at("TTIDByLumi"));
84 
85  std::for_each(_ids.begin(), _ids.end(), [&](EcalElectronicsIdCollection::value_type const& id) {
86  set->fill(getEcalDQMSetupObjects(), id);
87  int dccid(id.dccId());
88  double nCrystals(0.);
89  std::vector<DetId> chIds(GetElectronicsMap()->dccTowerConstituents(dccid, id.towerId()));
90  if (dccid <= kEEmHigh + 1 || dccid >= kEEpLow + 1)
91  nCrystals = chIds.size();
92  else
93  nCrystals = 25.;
94  meByLumi.fill(getEcalDQMSetupObjects(), dccid, nCrystals);
95  meTotal.fill(getEcalDQMSetupObjects(), dccid, nCrystals);
96 
97  if (_collection == kTowerIdErrors) {
98  meTTIDByLumi.fill(getEcalDQMSetupObjects(), dccid, nCrystals);
99  meTTIDTotal.fill(getEcalDQMSetupObjects(), dccid, nCrystals);
100  }
101  // Fill Integrity Errors Map with tower errors for this lumi
102  // Since binned by crystal for compatibility with channel errors,
103  // fill with constituent channels of tower
104  for (std::vector<DetId>::iterator chItr(chIds.begin()); chItr != chIds.end(); ++chItr)
105  meMapByLumi.fill(getEcalDQMSetupObjects(), *chItr);
106 
107  meTrendNErrors.fill(getEcalDQMSetupObjects(), double(timestamp_.iLumi), nCrystals);
108  });
109  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:48
MESet & at(const std::string &key)
Definition: MESet.h:399
unsigned nCrystals(unsigned)
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
EcalElectronicsMapping const * GetElectronicsMap()
Definition: DQWorker.cc:150
EcalDQMSetupObjects const getEcalDQMSetupObjects()
Definition: DQWorker.cc:170
Timestamp timestamp_
Definition: DQWorker.h:134
MESetCollection MEs_
Definition: DQWorker.h:131