CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ESOccupancyTask Class Reference

#include <ESOccupancyTask.h>

Inheritance diagram for ESOccupancyTask:
DQMOneEDAnalyzer<> edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ESOccupancyTask (const edm::ParameterSet &ps)
 
 ~ESOccupancyTask () override
 
- Public Member Functions inherited from DQMOneEDAnalyzer<>
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

int eCount_
 
MonitorElementhE1E2_ [2]
 
MonitorElementhEnDensity_ [2][2]
 
MonitorElementhEng_ [2][2]
 
MonitorElementhEvEng_ [2][2]
 
MonitorElementhGoodRecNHit_ [2][2]
 
MonitorElementhRecNHit_ [2][2]
 
MonitorElementhRecOCC_ [2][2]
 
MonitorElementhSelEnDensity_ [2][2]
 
MonitorElementhSelEng_ [2][2]
 
MonitorElementhSelOCC_ [2][2]
 
std::string prefixME_
 
edm::EDGetTokenT< ESRecHitCollectionrechittoken_
 
int runNum_
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer<>
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from DQMOneEDAnalyzer<>
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
- Protected Attributes inherited from DQMOneEDAnalyzer<>
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 10 of file ESOccupancyTask.h.

Constructor & Destructor Documentation

◆ ESOccupancyTask()

ESOccupancyTask::ESOccupancyTask ( const edm::ParameterSet ps)

Definition at line 24 of file ESOccupancyTask.cc.

24  {
25  rechittoken_ = consumes<ESRecHitCollection>(ps.getParameter<InputTag>("RecHitLabel"));
26  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "EcalPreshower");
27 
28  eCount_ = 0;
29 
30  //Histogram init
31  for (int i = 0; i < 2; ++i)
32  for (int j = 0; j < 2; ++j) {
33  hRecOCC_[i][j] = nullptr;
34  hRecNHit_[i][j] = nullptr;
35  hEng_[i][j] = nullptr;
36  hEvEng_[i][j] = nullptr;
37  hEnDensity_[i][i] = nullptr;
38  hGoodRecNHit_[i][j] = nullptr;
39 
40  hSelEng_[i][j] = nullptr;
41  hSelOCC_[i][j] = nullptr;
42  hSelEnDensity_[i][j] = nullptr;
43  }
44 
45  for (int i = 0; i < 2; ++i)
46  hE1E2_[i] = nullptr;
47 }

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), mps_fire::i, and dqmiolumiharvest::j.

◆ ~ESOccupancyTask()

ESOccupancyTask::~ESOccupancyTask ( )
inlineoverride

Definition at line 13 of file ESOccupancyTask.h.

13 {}

Member Function Documentation

◆ analyze()

void ESOccupancyTask::analyze ( const edm::Event e,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMOneEDAnalyzer<>.

Definition at line 110 of file ESOccupancyTask.cc.

110  {
111  runNum_ = e.id().run();
112  eCount_++;
113 
114  // RecHits
115  int zside, plane, ix, iy;
116  int sum_RecHits[2][2], sum_GoodRecHits[2][2];
117  float sum_Energy[2][2];
118 
119  for (int i = 0; i < 2; ++i)
120  for (int j = 0; j < 2; ++j) {
121  sum_RecHits[i][j] = 0;
122  sum_GoodRecHits[i][j] = 0;
123  sum_Energy[i][j] = 0;
124  }
125 
127  if (e.getByToken(rechittoken_, ESRecHit)) {
128  for (ESRecHitCollection::const_iterator hitItr = ESRecHit->begin(); hitItr != ESRecHit->end(); ++hitItr) {
129  ESDetId id = ESDetId(hitItr->id());
130 
131  zside = id.zside();
132  plane = id.plane();
133  ix = id.six();
134  iy = id.siy();
135 
136  int i = (zside == 1) ? 0 : 1;
137  int j = plane - 1;
138 
139  sum_RecHits[i][j]++;
140  sum_Energy[i][j] += hitItr->energy();
141  hRecOCC_[i][j]->Fill(ix, iy);
142  if (hitItr->energy() != 0) {
143  hEng_[i][j]->Fill(hitItr->energy());
144  hEnDensity_[i][j]->Fill(ix, iy, hitItr->energy());
145 
146  if (hitItr->recoFlag() == 14 || hitItr->recoFlag() == 1 ||
147  (hitItr->recoFlag() <= 10 && hitItr->recoFlag() >= 5))
148  continue;
149  sum_GoodRecHits[i][j]++;
150  hSelEng_[i][j]->Fill(hitItr->energy());
151  hSelEnDensity_[i][j]->Fill(ix, iy, hitItr->energy());
152  hSelOCC_[i][j]->Fill(ix, iy);
153  }
154  }
155  } else {
156  LogWarning("ESOccupancyTask") << "RecHitCollection not available";
157  }
158 
159  //Fill histograms after a event
160  for (int i = 0; i < 2; ++i)
161  for (int j = 0; j < 2; ++j) {
162  hRecNHit_[i][j]->Fill(sum_RecHits[i][j]);
163  hGoodRecNHit_[i][j]->Fill(sum_GoodRecHits[i][j]);
164  hEvEng_[i][j]->Fill(sum_Energy[i][j]);
165 
166  //Save eCount_ for Scaling
167  hRecOCC_[i][j]->setBinContent(40, 40, eCount_);
168  hEnDensity_[i][j]->setBinContent(40, 40, eCount_);
169 
170  hSelOCC_[i][j]->setBinContent(40, 40, eCount_);
171  hSelEnDensity_[i][j]->setBinContent(40, 40, eCount_);
172  }
173 
174  hE1E2_[0]->Fill(sum_Energy[0][0], sum_Energy[0][1]);
175  hE1E2_[1]->Fill(sum_Energy[1][0], sum_Energy[1][1]);
176 }

References edm::SortedCollection< T, SORT >::begin(), MillePedeFileConverter_cfg::e, edm::SortedCollection< T, SORT >::end(), mps_fire::i, dqmiolumiharvest::j, and ecaldqm::zside().

◆ bookHistograms()

void ESOccupancyTask::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivate

Definition at line 49 of file ESOccupancyTask.cc.

49  {
50  iBooker.setCurrentFolder(prefixME_ + "/ESOccupancyTask");
51 
52  //Booking Histograms
53  //Notice: Change ESRenderPlugin under DQM/RenderPlugins/src if you change this histogram name.
54  char histo[200];
55  for (int i = 0; i < 2; ++i)
56  for (int j = 0; j < 2; ++j) {
57  int iz = (i == 0) ? 1 : -1;
58  sprintf(histo, "ES RecHit 2D Occupancy Z %d P %d", iz, j + 1);
59  hRecOCC_[i][j] = iBooker.book2D(histo, histo, 40, 0.5, 40.5, 40, 0.5, 40.5);
60  hRecOCC_[i][j]->setAxisTitle("Si X", 1);
61  hRecOCC_[i][j]->setAxisTitle("Si Y", 2);
62 
63  //Bin 40,40 is used to save eumber of event for scaling.
64  sprintf(histo, "ES Energy Density Z %d P %d", iz, j + 1);
65  hEnDensity_[i][j] = iBooker.book2D(histo, histo, 40, 0.5, 40.5, 40, 0.5, 40.5);
66  hEnDensity_[i][j]->setAxisTitle("Si X", 1);
67  hEnDensity_[i][j]->setAxisTitle("Si Y", 2);
68 
69  sprintf(histo, "ES Num of RecHits Z %d P %d", iz, j + 1);
70  hRecNHit_[i][j] = iBooker.book1DD(histo, histo, 60, 0, 1920);
71  hRecNHit_[i][j]->setAxisTitle("# of RecHits", 1);
72  hRecNHit_[i][j]->setAxisTitle("Num of Events", 2);
73 
74  sprintf(histo, "ES Num of Good RecHits Z %d P %d", iz, j + 1);
75  hGoodRecNHit_[i][j] = iBooker.book1DD(histo, histo, 60, 0, 1920);
76  hGoodRecNHit_[i][j]->setAxisTitle("# of good RecHits", 1);
77  hGoodRecNHit_[i][j]->setAxisTitle("Num of Events", 2);
78 
79  sprintf(histo, "ES RecHit Energy Z %d P %d", iz, j + 1);
80  hEng_[i][j] = iBooker.book1DD(histo, histo, 50, 0, 0.001);
81  hEng_[i][j]->setAxisTitle("RecHit Energy", 1);
82  hEng_[i][j]->setAxisTitle("Num of ReHits", 2);
83 
84  sprintf(histo, "ES Event Energy Z %d P %d", iz, j + 1);
85  hEvEng_[i][j] = iBooker.book1DD(histo, histo, 50, 0, 0.1);
86  hEvEng_[i][j]->setAxisTitle("Event Energy", 1);
87  hEvEng_[i][j]->setAxisTitle("Num of Events", 2);
88 
89  // histograms with selected hits
90  sprintf(histo, "ES RecHit Energy with selected hits Z %d P %d", iz, j + 1);
91  hSelEng_[i][j] = iBooker.book1DD(histo, histo, 50, 0, 0.001);
92  hSelEng_[i][j]->setAxisTitle("RecHit Energy", 1);
93  hSelEng_[i][j]->setAxisTitle("Num of ReHits", 2);
94 
95  sprintf(histo, "ES Occupancy with selected hits Z %d P %d", iz, j + 1);
96  hSelOCC_[i][j] = iBooker.book2D(histo, histo, 40, 0.5, 40.5, 40, 0.5, 40.5);
97  hSelOCC_[i][j]->setAxisTitle("Si X", 1);
98  hSelOCC_[i][j]->setAxisTitle("Si Y", 2);
99 
100  sprintf(histo, "ES Energy Density with selected hits Z %d P %d", iz, j + 1);
101  hSelEnDensity_[i][j] = iBooker.book2D(histo, histo, 40, 0.5, 40.5, 40, 0.5, 40.5);
102  hSelEnDensity_[i][j]->setAxisTitle("Si X", 1);
103  hSelEnDensity_[i][j]->setAxisTitle("Si Y", 2);
104  }
105 
106  hE1E2_[0] = iBooker.book2D("ES+ EP1 vs EP2", "ES+ EP1 vs EP2", 50, 0, 0.1, 50, 0, 0.1);
107  hE1E2_[1] = iBooker.book2D("ES- EP1 vs EP2", "ES- EP1 vs EP2", 50, 0, 0.1, 50, 0, 0.1);
108 }

References timingPdfMaker::histo, mps_fire::i, and dqmiolumiharvest::j.

Member Data Documentation

◆ eCount_

int ESOccupancyTask::eCount_
private

Definition at line 34 of file ESOccupancyTask.h.

◆ hE1E2_

MonitorElement* ESOccupancyTask::hE1E2_[2]
private

Definition at line 32 of file ESOccupancyTask.h.

◆ hEnDensity_

MonitorElement* ESOccupancyTask::hEnDensity_[2][2]
private

Definition at line 26 of file ESOccupancyTask.h.

◆ hEng_

MonitorElement* ESOccupancyTask::hEng_[2][2]
private

Definition at line 30 of file ESOccupancyTask.h.

◆ hEvEng_

MonitorElement* ESOccupancyTask::hEvEng_[2][2]
private

Definition at line 31 of file ESOccupancyTask.h.

◆ hGoodRecNHit_

MonitorElement* ESOccupancyTask::hGoodRecNHit_[2][2]
private

Definition at line 28 of file ESOccupancyTask.h.

◆ hRecNHit_

MonitorElement* ESOccupancyTask::hRecNHit_[2][2]
private

Definition at line 25 of file ESOccupancyTask.h.

◆ hRecOCC_

MonitorElement* ESOccupancyTask::hRecOCC_[2][2]
private

Definition at line 23 of file ESOccupancyTask.h.

◆ hSelEnDensity_

MonitorElement* ESOccupancyTask::hSelEnDensity_[2][2]
private

Definition at line 27 of file ESOccupancyTask.h.

◆ hSelEng_

MonitorElement* ESOccupancyTask::hSelEng_[2][2]
private

Definition at line 29 of file ESOccupancyTask.h.

◆ hSelOCC_

MonitorElement* ESOccupancyTask::hSelOCC_[2][2]
private

Definition at line 24 of file ESOccupancyTask.h.

◆ prefixME_

std::string ESOccupancyTask::prefixME_
private

Definition at line 21 of file ESOccupancyTask.h.

◆ rechittoken_

edm::EDGetTokenT<ESRecHitCollection> ESOccupancyTask::rechittoken_
private

Definition at line 20 of file ESOccupancyTask.h.

◆ runNum_

int ESOccupancyTask::runNum_
private

Definition at line 34 of file ESOccupancyTask.h.

mps_fire.i
i
Definition: mps_fire.py:355
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
ESOccupancyTask::hGoodRecNHit_
MonitorElement * hGoodRecNHit_[2][2]
Definition: ESOccupancyTask.h:28
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
ESOccupancyTask::hSelOCC_
MonitorElement * hSelOCC_[2][2]
Definition: ESOccupancyTask.h:24
ESOccupancyTask::runNum_
int runNum_
Definition: ESOccupancyTask.h:34
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
ESDetId
Definition: ESDetId.h:15
edm::Handle
Definition: AssociativeIterator.h:50
ESOccupancyTask::eCount_
int eCount_
Definition: ESOccupancyTask.h:34
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
ESOccupancyTask::hRecNHit_
MonitorElement * hRecNHit_[2][2]
Definition: ESOccupancyTask.h:25
edm::LogWarning
Definition: MessageLogger.h:141
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
ESOccupancyTask::hEnDensity_
MonitorElement * hEnDensity_[2][2]
Definition: ESOccupancyTask.h:26
ESOccupancyTask::prefixME_
std::string prefixME_
Definition: ESOccupancyTask.h:21
ESOccupancyTask::hRecOCC_
MonitorElement * hRecOCC_[2][2]
Definition: ESOccupancyTask.h:23
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ESOccupancyTask::hSelEnDensity_
MonitorElement * hSelEnDensity_[2][2]
Definition: ESOccupancyTask.h:27
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
ESOccupancyTask::hEng_
MonitorElement * hEng_[2][2]
Definition: ESOccupancyTask.h:30
ESOccupancyTask::rechittoken_
edm::EDGetTokenT< ESRecHitCollection > rechittoken_
Definition: ESOccupancyTask.h:20
ESOccupancyTask::hSelEng_
MonitorElement * hSelEng_[2][2]
Definition: ESOccupancyTask.h:29
ESOccupancyTask::hE1E2_
MonitorElement * hE1E2_[2]
Definition: ESOccupancyTask.h:32
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
ESOccupancyTask::hEvEng_
MonitorElement * hEvEng_[2][2]
Definition: ESOccupancyTask.h:31
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37