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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) 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 &)
 
virtual void beginEvent (edm::Event const &, edm::EventSetup const &)
 
 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 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 std::string & 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 () 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)
 
- 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().

◆ beginLuminosityBlock()

void ecaldqm::IntegrityTask::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 9 of file IntegrityTask.cc.

9  {
10  // Reset by LS plots at beginning of every LS
11  MEs_.at("MapByLumi").reset();
12  MEs_.at("ByLumi").reset();
13  }

References ecaldqm::DQWorker::MEs_.

◆ 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 16 of file IntegrityTask.cc.

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

References ecaldqm::dccId(), ecaldqm::MESet::fill(), 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 56 of file IntegrityTask.cc.

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

References edm::EDCollection< T >::begin(), ecaldqm::dccId(), edm::EDCollection< T >::empty(), edm::EDCollection< T >::end(), ecaldqm::MESet::fill(), ecaldqm::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::kEEGainErrors
Definition: Collections.h:12
ecaldqm::kTowerIdErrors
Definition: Collections.h:17
ecaldqm::DQWorkerTask::DQWorkerTask
DQWorkerTask()
Definition: DQWorkerTask.cc:8
ecaldqm::kEEChIdErrors
Definition: Collections.h:14
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:78
ecaldqm::nCrystals
unsigned nCrystals(unsigned)
Definition: EcalDQMCommonUtils.cc:334
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
ecaldqm::DQWorker::Timestamp::iLumi
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
ecaldqm::towerId
unsigned towerId(DetId const &)
Definition: EcalDQMCommonUtils.cc:79
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
ecaldqm::IntegrityTask::runOnDetIdCollection
void runOnDetIdCollection(C const &, Collections)
ecaldqm::kEEpLow
Definition: EcalDQMCommonUtils.h:83
ecaldqm::DQWorker::timestamp_
Timestamp timestamp_
Definition: DQWorker.h:81
ecaldqm::IntegrityTask::runOnElectronicsIdCollection
void runOnElectronicsIdCollection(EcalElectronicsIdCollection const &, Collections)
Definition: IntegrityTask.cc:56
ecaldqm::getElectronicsMap
const EcalElectronicsMapping * getElectronicsMap()
Definition: EcalDQMCommonUtils.cc:438
ecaldqm::kBlockSizeErrors
Definition: Collections.h:18
ecaldqm::kEBGainSwitchErrors
Definition: Collections.h:15
ecaldqm::dccId
unsigned dccId(DetId const &)
Definition: EcalDQMCommonUtils.cc:16