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<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 &)
 
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 &)
 
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)
 

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

ecaldqm::IntegrityTask::IntegrityTask ( )

Definition at line 7 of file IntegrityTask.cc.

ecaldqm::IntegrityTask::~IntegrityTask ( )
inlineoverride

Member Function Documentation

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().

Referenced by ~IntegrityTask().

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)
void ecaldqm::IntegrityTask::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 9 of file IntegrityTask.cc.

References ecaldqm::DQWorker::MEs_.

Referenced by ~IntegrityTask().

9  {
10  // Reset by LS plots at beginning of every LS
11  MEs_.at("MapByLumi").reset();
12  MEs_.at("ByLumi").reset();
13  }
MESetCollection MEs_
Definition: DQWorker.h:78
template<typename IDCollection >
void ecaldqm::IntegrityTask::runOnDetIdCollection ( IDCollection const &  _ids,
Collections  _collection 
)

Definition at line 16 of file IntegrityTask.cc.

References ecaldqm::dccId(), 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_.

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  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
Timestamp timestamp_
Definition: DQWorker.h:81
MESetCollection MEs_
Definition: DQWorker.h:78
unsigned dccId(DetId const &)
template<class C >
void ecaldqm::IntegrityTask::runOnDetIdCollection ( C const &  ,
Collections   
)

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

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

Definition at line 56 of file IntegrityTask.cc.

References edm::EDCollection< T >::begin(), ecaldqm::dccId(), DEFINE_ECALDQM_WORKER, edm::EDCollection< T >::empty(), edm::EDCollection< T >::end(), 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(), and ~IntegrityTask().

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  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
EcalElectronicsMapping const * getElectronicsMap()
unsigned nCrystals(unsigned)
unsigned towerId(DetId const &)
Timestamp timestamp_
Definition: DQWorker.h:81
MESetCollection MEs_
Definition: DQWorker.h:78
unsigned dccId(DetId const &)