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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) 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 ()
 
- 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 filterTrigger (edm::TriggerResultsByName const &)
 
void recoverStats ()
 
virtual void setTokens (edm::ConsumesCollector &)
 
void softReset ()
 
 ~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)
 

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 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::DQWorkerTask
std::set< std::string > resettable_
 
- 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 12 of file OccupancyTask.h.

Constructor & Destructor Documentation

ecaldqm::OccupancyTask::OccupancyTask ( )

Definition at line 10 of file OccupancyTask.cc.

10  :
11  DQWorkerTask(),
12  recHitThreshold_(0.),
13  tpThreshold_(0.)
14  {
15  }
ecaldqm::OccupancyTask::~OccupancyTask ( )
inline

Member Function Documentation

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

Reimplemented from ecaldqm::DQWorkerTask.

Definition at line 35 of file OccupancyTask.h.

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

Referenced by ~OccupancyTask().

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

Reimplemented from ecaldqm::DQWorker.

Definition at line 40 of file OccupancyTask.cc.

References ecaldqm::DQWorker::MEs_.

Referenced by ~OccupancyTask().

41  {
42  // Reset by LS plots at beginning of every LS
43  MEs_.at("DigiAllByLumi").reset();
44  MEs_.at("TPDigiThrAllByLumi").reset();
45  MEs_.at("RecHitThrAllByLumi").reset();
46  }
MESetCollection MEs_
Definition: DQWorker.h:75
bool ecaldqm::OccupancyTask::filterRunType ( short const *  _runType)
overridevirtual
template<typename DigiCollection >
void ecaldqm::OccupancyTask::runOnDigis ( DigiCollection const &  _digis,
Collections  _collection 
)

Definition at line 59 of file OccupancyTask.cc.

References EcalBarrel, EcalEndcap, triggerObjects_cff::id, ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::kEBDigi, ecaldqm::DQWorker::MEs_, and ecaldqm::DQWorker::timestamp_.

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

60  {
61  MESet& meDigi(MEs_.at("Digi"));
62  MESet& meDigiProjEta(MEs_.at("DigiProjEta"));
63  MESet& meDigiProjPhi(MEs_.at("DigiProjPhi"));
64  MESet& meDigiAll(MEs_.at("DigiAll"));
65  MESet& meDigiAllByLumi(MEs_.at("DigiAllByLumi"));
66  MESet& meDigiDCC(MEs_.at("DigiDCC"));
67  MESet& meDigi1D(MEs_.at("Digi1D"));
68  MESet& meTrendNDigi(MEs_.at("TrendNDigi"));
69 
70  std::for_each(_digis.begin(), _digis.end(), [&](typename DigiCollection::Digi const& digi){
71  DetId id(digi.id());
72  meDigi.fill(id);
73  meDigiProjEta.fill(id);
74  meDigiProjPhi.fill(id);
75  meDigiAll.fill(id);
76  meDigiAllByLumi.fill(id);
77  meDigiDCC.fill(id);
78  });
79 
80  int iSubdet(_collection == kEBDigi ? EcalBarrel : EcalEndcap);
81  meDigi1D.fill(iSubdet, double(_digis.size()));
82  meTrendNDigi.fill(iSubdet, double(timestamp_.iLumi), double(_digis.size()));
83  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
std::tuple< unsigned int, int, int, DigiType, int, int, int, float > Digi
Definition: GenericDigi.h:30
Definition: DetId.h:18
Timestamp timestamp_
Definition: DQWorker.h:78
MESetCollection MEs_
Definition: DQWorker.h:75
void ecaldqm::OccupancyTask::runOnRawData ( EcalRawDataCollection const &  _dcchs)

Definition at line 49 of file OccupancyTask.cc.

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

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

50  {
51  MESet& meDCC(MEs_.at("DCC"));
52 
53  for(EcalRawDataCollection::const_iterator dcchItr(_dcchs.begin()); dcchItr != _dcchs.end(); ++dcchItr)
54  meDCC.fill(dcchItr->id());
55  }
std::vector< EcalDCCHeaderBlock >::const_iterator const_iterator
MESetCollection MEs_
Definition: DQWorker.h:75
void ecaldqm::OccupancyTask::runOnRecHits ( EcalRecHitCollection const &  _hits,
Collections  _collection 
)

Definition at line 122 of file OccupancyTask.cc.

References edm::SortedCollection< T, SORT >::begin(), DEFINE_ECALDQM_WORKER, EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), triggerObjects_cff::id, hit::id, ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::kEBRecHit, EcalRecHit::kGood, RecoTauDiscriminantConfiguration::mask, ecaldqm::DQWorker::MEs_, recHitThreshold_, ecaldqm::DQWorker::timestamp_, globals_cff::x1, and ecaldqm::zside().

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

123  {
124  MESet& meRecHitAll(MEs_.at("RecHitAll"));
125  MESet& meRecHitProjEta(MEs_.at("RecHitProjEta"));
126  MESet& meRecHitProjPhi(MEs_.at("RecHitProjPhi"));
127  MESet& meRecHitThrAll(MEs_.at("RecHitThrAll"));
128  MESet& meRecHitThrAllByLumi(MEs_.at("RecHitThrAllByLumi"));
129  MESet& meRecHitThrmvp(MEs_.at("RecHitThrmvp"));
130  MESet& meRecHitThrpm(MEs_.at("RecHitThrpm"));
131  MESet& meRecHitThrProjEta(MEs_.at("RecHitThrProjEta"));
132  MESet& meRecHitThrProjPhi(MEs_.at("RecHitThrProjPhi"));
133  MESet& meRecHitThr1D(MEs_.at("RecHitThr1D"));
134  MESet& meTrendNRecHitThr(MEs_.at("TrendNRecHitThr"));
135 
136  uint32_t mask(~(0x1 << EcalRecHit::kGood));
137  double nFiltered(0.);
138 
139  float nRHThrp(0), nRHThrm(0);
140  int iSubdet(_collection == kEBRecHit ? EcalBarrel : EcalEndcap);
141  std::for_each(_hits.begin(), _hits.end(), [&](EcalRecHitCollection::value_type const& hit){
142  DetId id(hit.id());
143 
144  meRecHitAll.fill(id);
145  meRecHitProjEta.fill(id);
146  meRecHitProjPhi.fill(id);
147 
148  if(!hit.checkFlagMask(mask) && hit.energy() > recHitThreshold_){
149  meRecHitThrProjEta.fill(id);
150  meRecHitThrProjPhi.fill(id);
151  meRecHitThrAll.fill(id);
152  meRecHitThrAllByLumi.fill(id);
153  nFiltered += 1.;
154  bool isPlusFar ( iSubdet == EcalBarrel ? (EBDetId(id).iphi() > 100 && EBDetId(id).iphi() < 280) : zside(id) > 0 );
155  if ( isPlusFar )
156  nRHThrp++;
157  else
158  nRHThrm++;
159  }
160  });
161 
162  meRecHitThr1D.fill(iSubdet, nFiltered);
163  meTrendNRecHitThr.fill(iSubdet, double(timestamp_.iLumi), nFiltered);
164  meRecHitThrmvp.fill(iSubdet,nRHThrp,nRHThrm);
165  meRecHitThrpm.fill(iSubdet,nRHThrp-nRHThrm);
166  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
int zside(DetId const &)
unsigned int id
Definition: DetId.h:18
Timestamp timestamp_
Definition: DQWorker.h:78
MESetCollection MEs_
Definition: DQWorker.h:75
void ecaldqm::OccupancyTask::runOnTPDigis ( EcalTrigPrimDigiCollection const &  _digis)

Definition at line 86 of file OccupancyTask.cc.

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

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

87  {
88  // MESet& meTPDigiAll(MEs_.at("TPDigiAll"));
89  // MESet& meTPDigiProjEta(MEs_.at("TPDigiProjEta"));
90  // MESet& meTPDigiProjPhi(MEs_.at("TPDigiProjPhi"));
91  MESet& meTPDigiRCT(MEs_.at("TPDigiRCT"));
92  MESet& meTPDigiThrAll(MEs_.at("TPDigiThrAll"));
93  MESet& meTPDigiThrAllByLumi(MEs_.at("TPDigiThrAllByLumi"));
94  MESet& meTPDigiThrProjEta(MEs_.at("TPDigiThrProjEta"));
95  MESet& meTPDigiThrProjPhi(MEs_.at("TPDigiThrProjPhi"));
96  MESet& meTrendNTPDigi(MEs_.at("TrendNTPDigi"));
97 
98  double nFilteredEB(0.);
99  double nFilteredEE(0.);
100 
101  std::for_each(_digis.begin(), _digis.end(), [&](EcalTrigPrimDigiCollection::value_type const& digi){
102  EcalTrigTowerDetId const& id(digi.id());
103  // meTPDigiProjEta.fill(id);
104  // meTPDigiProjPhi.fill(id);
105  // meTPDigiAll.fill(id);
106  if(digi.compressedEt() > tpThreshold_){
107  meTPDigiThrProjEta.fill(id);
108  meTPDigiThrProjPhi.fill(id);
109  meTPDigiThrAll.fill(id);
110  meTPDigiThrAllByLumi.fill(id);
111  meTPDigiRCT.fill(id);
112  if(id.subDet() == EcalBarrel) nFilteredEB += 1.;
113  else nFilteredEE += 1.;
114  }
115  });
116 
117  meTrendNTPDigi.fill(EcalBarrel, double(timestamp_.iLumi), nFilteredEB);
118  meTrendNTPDigi.fill(EcalEndcap, double(timestamp_.iLumi), nFilteredEE);
119  }
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
Timestamp timestamp_
Definition: DQWorker.h:78
MESetCollection MEs_
Definition: DQWorker.h:75
void ecaldqm::OccupancyTask::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 18 of file OccupancyTask.cc.

References edm::ParameterSet::getUntrackedParameter(), recHitThreshold_, and tpThreshold_.

Referenced by ~OccupancyTask().

19  {
20  recHitThreshold_ = _params.getUntrackedParameter<double>("recHitThreshold");
21  tpThreshold_ = _params.getUntrackedParameter<double>("tpThreshold");
22  }

Member Data Documentation

float ecaldqm::OccupancyTask::recHitThreshold_
private

Definition at line 31 of file OccupancyTask.h.

Referenced by runOnRecHits(), and setParams().

float ecaldqm::OccupancyTask::tpThreshold_
private

Definition at line 32 of file OccupancyTask.h.

Referenced by runOnTPDigis(), and setParams().