CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::OccupancyTask Class Reference

#include <OccupancyTask.h>

Inheritance diagram for ecaldqm::OccupancyTask:
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
 
bool filterRunType (short const *) override
 
 OccupancyTask ()
 
template<typename DigiCollection >
void runOnDigis (DigiCollection const &, Collections)
 
void runOnRawData (EcalRawDataCollection const &)
 
void runOnRecHits (EcalRecHitCollection const &, Collections)
 
void runOnTPDigis (EcalTrigPrimDigiCollection const &)
 
 ~OccupancyTask () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerTask
virtual void addDependencies (DependencySet &)
 
 DQWorkerTask ()
 
virtual void endEvent (edm::Event const &, edm::EventSetup 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 setTime (time_t _t)
 
virtual ~DQWorker () noexcept(false)
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

float recHitThreshold_
 
float tpThreshold_
 

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 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 11 of file OccupancyTask.h.

Constructor & Destructor Documentation

◆ OccupancyTask()

ecaldqm::OccupancyTask::OccupancyTask ( )

Definition at line 9 of file OccupancyTask.cc.

◆ ~OccupancyTask()

ecaldqm::OccupancyTask::~OccupancyTask ( )
inlineoverride

Definition at line 14 of file OccupancyTask.h.

14 {}

Member Function Documentation

◆ analyze()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 35 of file OccupancyTask.h.

35  {
36  switch (_collection) {
37  case kEcalRawData:
38  if (_p)
39  runOnRawData(*static_cast<EcalRawDataCollection const*>(_p));
40  return true;
41  case kEBDigi:
42  if (_p)
43  runOnDigis(*static_cast<EBDigiCollection const*>(_p), _collection);
44  return true;
45  break;
46  case kEEDigi:
47  if (_p)
48  runOnDigis(*static_cast<EEDigiCollection const*>(_p), _collection);
49  return true;
50  break;
51  case kTrigPrimDigi:
52  if (_p)
53  runOnTPDigis(*static_cast<EcalTrigPrimDigiCollection const*>(_p));
54  return true;
55  break;
56  case kEBRecHit:
57  case kEERecHit:
58  if (_p)
59  runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
60  return true;
61  break;
62  default:
63  break;
64  }
65 
66  return false;
67  }

References ecaldqm::kEBDigi, ecaldqm::kEBRecHit, ecaldqm::kEcalRawData, ecaldqm::kEEDigi, ecaldqm::kEERecHit, ecaldqm::kTrigPrimDigi, runOnDigis(), runOnRawData(), runOnRecHits(), and runOnTPDigis().

◆ beginEvent()

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 28 of file OccupancyTask.cc.

31  {
32  if (ByLumiResetSwitch) {
33  MEs_.at("DigiAllByLumi").reset(GetElectronicsMap());
34  MEs_.at("TPDigiThrAllByLumi").reset(GetElectronicsMap());
35  MEs_.at("RecHitThrAllByLumi").reset(GetElectronicsMap());
36  }
37  }

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

◆ filterRunType()

bool ecaldqm::OccupancyTask::filterRunType ( short const *  _runType)
overridevirtual

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 16 of file OccupancyTask.cc.

16  {
17  for (int iFED(0); iFED < 54; iFED++) {
18  if (_runType[iFED] == EcalDCCHeaderBlock::COSMIC || _runType[iFED] == EcalDCCHeaderBlock::MTCC ||
19  _runType[iFED] == EcalDCCHeaderBlock::COSMICS_GLOBAL ||
20  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_GLOBAL || _runType[iFED] == EcalDCCHeaderBlock::COSMICS_LOCAL ||
21  _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_LOCAL)
22  return true;
23  }
24 
25  return false;
26  }

References EcalDCCHeaderBlock::COSMIC, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, EcalDCCHeaderBlock::MTCC, EcalDCCHeaderBlock::PHYSICS_GLOBAL, and EcalDCCHeaderBlock::PHYSICS_LOCAL.

◆ runOnDigis()

template<typename DigiCollection >
void ecaldqm::OccupancyTask::runOnDigis ( DigiCollection const &  _digis,
Collections  _collection 
)

Definition at line 47 of file OccupancyTask.cc.

47  {
48  MESet& meDigi(MEs_.at("Digi"));
49  MESet& meDigiProjEta(MEs_.at("DigiProjEta"));
50  MESet& meDigiProjPhi(MEs_.at("DigiProjPhi"));
51  MESet& meDigiAll(MEs_.at("DigiAll"));
52  MESet& meDigiAllByLumi(MEs_.at("DigiAllByLumi"));
53  MESet& meDigiDCC(MEs_.at("DigiDCC"));
54  MESet& meDigi1D(MEs_.at("Digi1D"));
55  MESet& meTrendNDigi(MEs_.at("TrendNDigi"));
56 
57  std::for_each(_digis.begin(), _digis.end(), [&](typename DigiCollection::Digi const& digi) {
58  DetId id(digi.id());
59  meDigi.fill(getEcalDQMSetupObjects(), id);
60  meDigiProjEta.fill(getEcalDQMSetupObjects(), id);
61  meDigiProjPhi.fill(getEcalDQMSetupObjects(), id);
62  meDigiAll.fill(getEcalDQMSetupObjects(), id);
63  meDigiAllByLumi.fill(getEcalDQMSetupObjects(), id);
64  meDigiDCC.fill(getEcalDQMSetupObjects(), id);
65  });
66 
67  int iSubdet(_collection == kEBDigi ? EcalBarrel : EcalEndcap);
68  meDigi1D.fill(getEcalDQMSetupObjects(), iSubdet, double(_digis.size()));
69  meTrendNDigi.fill(getEcalDQMSetupObjects(), iSubdet, double(timestamp_.iLumi), double(_digis.size()));
70  }

References ecaldqm::MESetCollection::at(), TrendClient_cfi::Digi, EcalBarrel, EcalEndcap, ecaldqm::DQWorker::getEcalDQMSetupObjects(), triggerObjects_cff::id, ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::kEBDigi, ecaldqm::DQWorker::MEs_, and ecaldqm::DQWorker::timestamp_.

Referenced by analyze().

◆ runOnRawData()

void ecaldqm::OccupancyTask::runOnRawData ( EcalRawDataCollection const &  _dcchs)

Definition at line 39 of file OccupancyTask.cc.

39  {
40  MESet& meDCC(MEs_.at("DCC"));
41 
42  for (EcalRawDataCollection::const_iterator dcchItr(_dcchs.begin()); dcchItr != _dcchs.end(); ++dcchItr)
43  meDCC.fill(getEcalDQMSetupObjects(), dcchItr->id());
44  }

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), ecaldqm::MESet::fill(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), and ecaldqm::DQWorker::MEs_.

Referenced by analyze().

◆ runOnRecHits()

void ecaldqm::OccupancyTask::runOnRecHits ( EcalRecHitCollection const &  _hits,
Collections  _collection 
)

Definition at line 108 of file OccupancyTask.cc.

108  {
109  MESet& meRecHitAll(MEs_.at("RecHitAll"));
110  MESet& meRecHitProjEta(MEs_.at("RecHitProjEta"));
111  MESet& meRecHitProjPhi(MEs_.at("RecHitProjPhi"));
112  MESet& meRecHitThrAll(MEs_.at("RecHitThrAll"));
113  MESet& meRecHitThrAllByLumi(MEs_.at("RecHitThrAllByLumi"));
114  MESet& meRecHitThrmvp(MEs_.at("RecHitThrmvp"));
115  MESet& meRecHitThrpm(MEs_.at("RecHitThrpm"));
116  MESet& meRecHitThrProjEta(MEs_.at("RecHitThrProjEta"));
117  MESet& meRecHitThrProjPhi(MEs_.at("RecHitThrProjPhi"));
118  MESet& meRecHitThr1D(MEs_.at("RecHitThr1D"));
119  MESet& meTrendNRecHitThr(MEs_.at("TrendNRecHitThr"));
120 
121  uint32_t mask(~(0x1 << EcalRecHit::kGood));
122  double nFiltered(0.);
123 
124  float nRHThrp(0), nRHThrm(0);
125  int iSubdet(_collection == kEBRecHit ? EcalBarrel : EcalEndcap);
126  std::for_each(_hits.begin(), _hits.end(), [&](EcalRecHitCollection::value_type const& hit) {
127  DetId id(hit.id());
128 
129  meRecHitAll.fill(getEcalDQMSetupObjects(), id);
130  meRecHitProjEta.fill(getEcalDQMSetupObjects(), id);
131  meRecHitProjPhi.fill(getEcalDQMSetupObjects(), id);
132 
133  if (!hit.checkFlagMask(mask) && hit.energy() > recHitThreshold_) {
134  meRecHitThrProjEta.fill(getEcalDQMSetupObjects(), id);
135  meRecHitThrProjPhi.fill(getEcalDQMSetupObjects(), id);
136  meRecHitThrAll.fill(getEcalDQMSetupObjects(), id);
137  meRecHitThrAllByLumi.fill(getEcalDQMSetupObjects(), id);
138  nFiltered += 1.;
139  bool isPlusFar(iSubdet == EcalBarrel ? (EBDetId(id).iphi() > 100 && EBDetId(id).iphi() < 280) : zside(id) > 0);
140  if (isPlusFar)
141  nRHThrp++;
142  else
143  nRHThrm++;
144  }
145  });
146 
147  meRecHitThr1D.fill(getEcalDQMSetupObjects(), iSubdet, nFiltered);
148  meTrendNRecHitThr.fill(getEcalDQMSetupObjects(), iSubdet, double(timestamp_.iLumi), nFiltered);
149  meRecHitThrmvp.fill(getEcalDQMSetupObjects(), iSubdet, nRHThrp, nRHThrm);
150  meRecHitThrpm.fill(getEcalDQMSetupObjects(), iSubdet, nRHThrp - nRHThrm);
151  }

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), triggerObjects_cff::id, hit::id, ecaldqm::DQWorker::Timestamp::iLumi, LEDCalibrationChannels::iphi, ecaldqm::kEBRecHit, EcalRecHit::kGood, ecaldqm::DQWorker::MEs_, recHitThreshold_, ecaldqm::DQWorker::timestamp_, testProducerWithPsetDescEmpty_cfi::x1, and ecaldqm::zside().

Referenced by analyze().

◆ runOnTPDigis()

void ecaldqm::OccupancyTask::runOnTPDigis ( EcalTrigPrimDigiCollection const &  _digis)

Definition at line 72 of file OccupancyTask.cc.

72  {
73  // MESet& meTPDigiAll(MEs_.at("TPDigiAll"));
74  // MESet& meTPDigiProjEta(MEs_.at("TPDigiProjEta"));
75  // MESet& meTPDigiProjPhi(MEs_.at("TPDigiProjPhi"));
76  MESet& meTPDigiRCT(MEs_.at("TPDigiRCT"));
77  MESet& meTPDigiThrAll(MEs_.at("TPDigiThrAll"));
78  MESet& meTPDigiThrAllByLumi(MEs_.at("TPDigiThrAllByLumi"));
79  MESet& meTPDigiThrProjEta(MEs_.at("TPDigiThrProjEta"));
80  MESet& meTPDigiThrProjPhi(MEs_.at("TPDigiThrProjPhi"));
81  MESet& meTrendNTPDigi(MEs_.at("TrendNTPDigi"));
82 
83  double nFilteredEB(0.);
84  double nFilteredEE(0.);
85 
86  std::for_each(_digis.begin(), _digis.end(), [&](EcalTrigPrimDigiCollection::value_type const& digi) {
87  EcalTrigTowerDetId const& id(digi.id());
88  // meTPDigiProjEta.fill(id);
89  // meTPDigiProjPhi.fill(id);
90  // meTPDigiAll.fill(id);
91  if (digi.compressedEt() > tpThreshold_) {
92  meTPDigiThrProjEta.fill(getEcalDQMSetupObjects(), id);
93  meTPDigiThrProjPhi.fill(getEcalDQMSetupObjects(), id);
94  meTPDigiThrAll.fill(getEcalDQMSetupObjects(), id);
95  meTPDigiThrAllByLumi.fill(getEcalDQMSetupObjects(), id);
96  meTPDigiRCT.fill(getEcalDQMSetupObjects(), id);
97  if (id.subDet() == EcalBarrel)
98  nFilteredEB += 1.;
99  else
100  nFilteredEE += 1.;
101  }
102  });
103 
104  meTrendNTPDigi.fill(getEcalDQMSetupObjects(), EcalBarrel, double(timestamp_.iLumi), nFilteredEB);
105  meTrendNTPDigi.fill(getEcalDQMSetupObjects(), EcalEndcap, double(timestamp_.iLumi), nFilteredEE);
106  }

References ecaldqm::MESetCollection::at(), edm::SortedCollection< T, SORT >::begin(), EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), ecaldqm::DQWorker::getEcalDQMSetupObjects(), triggerObjects_cff::id, ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::DQWorker::MEs_, ecaldqm::DQWorker::timestamp_, and tpThreshold_.

Referenced by analyze().

◆ setParams()

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 11 of file OccupancyTask.cc.

11  {
12  recHitThreshold_ = _params.getUntrackedParameter<double>("recHitThreshold");
13  tpThreshold_ = _params.getUntrackedParameter<double>("tpThreshold");
14  }

References l1extraParticles_cfi::_params, recHitThreshold_, and tpThreshold_.

Member Data Documentation

◆ recHitThreshold_

float ecaldqm::OccupancyTask::recHitThreshold_
private

Definition at line 31 of file OccupancyTask.h.

Referenced by runOnRecHits(), and setParams().

◆ tpThreshold_

float ecaldqm::OccupancyTask::tpThreshold_
private

Definition at line 32 of file OccupancyTask.h.

Referenced by runOnTPDigis(), and setParams().

EcalDCCHeaderBlock::COSMICS_LOCAL
Definition: EcalDCCHeaderBlock.h:49
EcalRecHit
Definition: EcalRecHit.h:15
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
EBDetId
Definition: EBDetId.h:17
ecaldqm::kEEDigi
Definition: Collections.h:26
l1extraParticles_cfi._params
_params
Definition: l1extraParticles_cfi.py:29
TrendClient_cfi.Digi
Digi
Definition: TrendClient_cfi.py:7
EcalTrigTowerDetId
Definition: EcalTrigTowerDetId.h:14
ecaldqm::kEcalRawData
Definition: Collections.h:10
ecaldqm::DQWorker::GetElectronicsMap
const EcalElectronicsMapping * GetElectronicsMap()
Definition: DQWorker.cc:104
EcalBarrel
Definition: EcalSubdetector.h:10
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
DetId
Definition: DetId.h:17
EcalDCCHeaderBlock::PHYSICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:37
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
ecaldqm::MESet::reset
virtual void reset(EcalElectronicsMapping const *, double=0., double=0., double=0.)
Definition: MESet.cc:98
ecaldqm::OccupancyTask::runOnDigis
void runOnDigis(DigiCollection const &, Collections)
Definition: OccupancyTask.cc:47
ecaldqm::DQWorkerTask::DQWorkerTask
DQWorkerTask()
Definition: DQWorkerTask.cc:8
ecaldqm::kEBRecHit
Definition: Collections.h:36
EcalRecHit::kGood
Definition: EcalRecHit.h:21
ecaldqm::OccupancyTask::recHitThreshold_
float recHitThreshold_
Definition: OccupancyTask.h:31
ecaldqm::DQWorker::MEs_
MESetCollection MEs_
Definition: DQWorker.h:104
EcalEndcap
Definition: EcalSubdetector.h:10
ecaldqm::OccupancyTask::tpThreshold_
float tpThreshold_
Definition: OccupancyTask.h:32
ecaldqm::OccupancyTask::runOnRawData
void runOnRawData(EcalRawDataCollection const &)
Definition: OccupancyTask.cc:39
EcalDCCHeaderBlock::PHYSICS_LOCAL
Definition: EcalDCCHeaderBlock.h:48
ecaldqm::MESetCollection::at
MESet & at(const std::string &key)
Definition: MESet.h:399
ecaldqm::kTrigPrimDigi
Definition: Collections.h:28
ecaldqm::OccupancyTask::runOnTPDigis
void runOnTPDigis(EcalTrigPrimDigiCollection const &)
Definition: OccupancyTask.cc:72
ecaldqm::DQWorker::Timestamp::iLumi
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:40
ecaldqm::kEERecHit
Definition: Collections.h:37
ecaldqm::DQWorker::getEcalDQMSetupObjects
const EcalDQMSetupObjects getEcalDQMSetupObjects()
Definition: DQWorker.cc:128
EcalDCCHeaderBlock::COSMICS_GLOBAL
Definition: EcalDCCHeaderBlock.h:38
ecaldqm::kEBDigi
Definition: Collections.h:25
edm::SortedCollection::value_type
T value_type
Definition: SortedCollection.h:77
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
EcalDCCHeaderBlock::MTCC
Definition: EcalDCCHeaderBlock.h:25
ecaldqm::DQWorker::timestamp_
Timestamp timestamp_
Definition: DQWorker.h:107
EcalDCCHeaderBlock::COSMIC
Definition: EcalDCCHeaderBlock.h:22
ecaldqm::OccupancyTask::runOnRecHits
void runOnRecHits(EcalRecHitCollection const &, Collections)
Definition: OccupancyTask.cc:108
hit
Definition: SiStripHitEffFromCalibTree.cc:88