CMS 3D CMS Logo

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<class C >
void runOnDetIdCollection (C const &, Collections)
 
template<typename IDCollection >
void runOnDetIdCollection (IDCollection const &_ids, Collections _collection)
 
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 &)
 
 DQWorker ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
const EcalDQMSetupObjects getEcalDQMSetupObjects ()
 
const EcalElectronicsMappingGetElectronicsMap ()
 
const CaloGeometryGetGeometry ()
 
const std::string & getName () const
 
const CaloTopologyGetTopology ()
 
const EcalTrigTowerConstituentsMapGetTrigTowerMap ()
 
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.

7 : DQWorkerTask() {}

◆ ~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.

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  }

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

◆ 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.

12  {
13  if (ByLumiResetSwitch) {
14  MEs_.at("MapByLumi").reset(GetElectronicsMap());
15  MEs_.at("ByLumi").reset(GetElectronicsMap());
16  }
17  }

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

◆ runOnDetIdCollection() [1/2]

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

Referenced by analyze().

◆ runOnDetIdCollection() [2/2]

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

Definition at line 20 of file IntegrityTask.cc.

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

References ecaldqm::MESetCollection::at(), ecaldqm::dccId(), ecaldqm::MESet::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), triggerObjects_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_.

◆ runOnElectronicsIdCollection()

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

Definition at line 60 of file IntegrityTask.cc.

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

References ecaldqm::MESetCollection::at(), edm::EDCollection< T >::begin(), ecaldqm::dccId(), edm::EDCollection< T >::empty(), edm::EDCollection< T >::end(), ecaldqm::MESet::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), ecaldqm::DQWorker::GetElectronicsMap(), triggerObjects_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().

edm::EDCollection::value_type
T value_type
Definition: EDCollection.h:18
ecaldqm::kEEGainSwitchErrors
Definition: Collections.h:16
ecaldqm::kEBGainErrors
Definition: Collections.h:11
ecaldqm::kEBChIdErrors
Definition: Collections.h:13
ecaldqm::DQWorker::GetElectronicsMap
const EcalElectronicsMapping * GetElectronicsMap()
Definition: DQWorker.cc:118
ecaldqm::kEEGainErrors
Definition: Collections.h:12
ecaldqm::towerId
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
Definition: EcalDQMCommonUtils.cc:77
ecaldqm::kTowerIdErrors
Definition: Collections.h:17
ecaldqm::MESet::reset
virtual void reset(EcalElectronicsMapping const *, double=0., double=0., double=0.)
Definition: MESet.cc:98
ecaldqm::DQWorkerTask::DQWorkerTask
DQWorkerTask()
Definition: DQWorkerTask.cc:8
ecaldqm::kEEChIdErrors
Definition: Collections.h:14
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:125
ecaldqm::nCrystals
unsigned nCrystals(unsigned)
Definition: EcalDQMCommonUtils.cc:334
ecaldqm::MESetCollection::at
MESet & at(const std::string &key)
Definition: MESet.h:399
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
ecaldqm::dccId
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
Definition: EcalDQMCommonUtils.cc:16
ecaldqm::DQWorker::Timestamp::iLumi
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:48
ecaldqm::DQWorker::getEcalDQMSetupObjects
const EcalDQMSetupObjects getEcalDQMSetupObjects()
Definition: DQWorker.cc:142
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
ecaldqm::IntegrityTask::runOnDetIdCollection
void runOnDetIdCollection(C const &, Collections)
ecaldqm::kEEpLow
Definition: EcalDQMCommonUtils.h:82
ecaldqm::DQWorker::timestamp_
Timestamp timestamp_
Definition: DQWorker.h:128
ecaldqm::IntegrityTask::runOnElectronicsIdCollection
void runOnElectronicsIdCollection(EcalElectronicsIdCollection const &, Collections)
Definition: IntegrityTask.cc:60
ecaldqm::kBlockSizeErrors
Definition: Collections.h:18
ecaldqm::kEBGainSwitchErrors
Definition: Collections.h:15