CMS 3D CMS Logo

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

#include <EcalTimeDigiProducer.h>

Inheritance diagram for EcalTimeDigiProducer:
DigiAccumulatorMixMod

Public Member Functions

void accumulate (edm::Event const &e, edm::EventSetup const &c) override
 
void accumulate (PileUpEventPrincipal const &e, edm::EventSetup const &c, edm::StreamID const &) override
 
 EcalTimeDigiProducer (const edm::ParameterSet &params, edm::ProducesCollector, edm::ConsumesCollector &)
 
void finalizeEvent (edm::Event &e, edm::EventSetup const &c) override
 
void initializeEvent (edm::Event const &e, edm::EventSetup const &c) override
 
 ~EcalTimeDigiProducer () override
 
- Public Member Functions inherited from DigiAccumulatorMixMod
virtual void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
virtual void beginRun (edm::Run const &run, edm::EventSetup const &setup)
 
 DigiAccumulatorMixMod ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
virtual void endRun (edm::Run const &run, edm::EventSetup const &setup)
 
virtual void finalizeBunchCrossing (edm::Event &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual PileupMixingContentgetEventPileupInfo ()
 
virtual void initializeBunchCrossing (edm::Event const &event, edm::EventSetup const &setup, int bunchCrossing)
 
virtual void StorePileupInformation (std::vector< int > &numInteractionList, std::vector< int > &bunchCrossingList, std::vector< float > &TrueInteractionList, std::vector< edm::EventID > &eventList, int bunchSpace)
 
virtual ~DigiAccumulatorMixMod ()
 

Private Types

typedef edm::Handle< std::vector< PCaloHit > > HitsHandle
 

Private Member Functions

void accumulateCaloHits (HitsHandle const &ebHandle, HitsHandle const &eeHandle, int bunchCrossing)
 
void checkGeometry (const edm::EventSetup &eventSetup)
 
void updateGeometry ()
 

Private Attributes

EcalTimeMapDigitizerm_BarrelDigitizer
 
const std::string m_EBdigiCollection
 
const std::string m_EEdigiCollection
 
EcalTimeMapDigitizerm_EndcapDigitizer
 
const CaloGeometrym_Geometry
 
const edm::InputTag m_hitsProducerTagEB
 
const edm::InputTag m_hitsProducerTagEE
 
const edm::EDGetTokenT< std::vector< PCaloHit > > m_hitsProducerTokenEB
 
const edm::EDGetTokenT< std::vector< PCaloHit > > m_hitsProducerTokenEE
 
int m_timeLayerEB
 
int m_timeLayerEE
 

Detailed Description

Definition at line 31 of file EcalTimeDigiProducer.h.

Member Typedef Documentation

◆ HitsHandle

typedef edm::Handle<std::vector<PCaloHit> > EcalTimeDigiProducer::HitsHandle
private

Definition at line 42 of file EcalTimeDigiProducer.h.

Constructor & Destructor Documentation

◆ EcalTimeDigiProducer()

EcalTimeDigiProducer::EcalTimeDigiProducer ( const edm::ParameterSet params,
edm::ProducesCollector  producesCollector,
edm::ConsumesCollector sumes 
)

Definition at line 23 of file EcalTimeDigiProducer.cc.

27  m_EBdigiCollection(params.getParameter<std::string>("EBtimeDigiCollection")),
28  m_EEdigiCollection(params.getParameter<std::string>("EEtimeDigiCollection")),
29  m_hitsProducerTagEB(params.getParameter<edm::InputTag>("hitsProducerEB")),
30  m_hitsProducerTagEE(params.getParameter<edm::InputTag>("hitsProducerEE")),
31  m_hitsProducerTokenEB(sumes.consumes<std::vector<PCaloHit>>(m_hitsProducerTagEB)),
32  m_hitsProducerTokenEE(sumes.consumes<std::vector<PCaloHit>>(m_hitsProducerTagEE)),
33  m_timeLayerEB(params.getParameter<int>("timeLayerBarrel")),
34  m_timeLayerEE(params.getParameter<int>("timeLayerEndcap")),
35  m_Geometry(nullptr) {
38 
41 
42 #ifdef ecal_time_debug
43  std::cout << "[EcalTimeDigiProducer]::Create EB " << m_EBdigiCollection << " and EE " << m_EEdigiCollection
44  << " collections and digitizers" << std::endl;
45 #endif
46 
49 }

References gather_cfg::cout, EcalBarrel, EcalEndcap, m_BarrelDigitizer, m_EBdigiCollection, m_EEdigiCollection, m_EndcapDigitizer, m_timeLayerEB, m_timeLayerEE, edm::ProducesCollector::produces(), and EcalTimeMapDigitizer::setTimeLayerId().

◆ ~EcalTimeDigiProducer()

EcalTimeDigiProducer::~EcalTimeDigiProducer ( )
override

Definition at line 51 of file EcalTimeDigiProducer.cc.

51 {}

Member Function Documentation

◆ accumulate() [1/2]

void EcalTimeDigiProducer::accumulate ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 75 of file EcalTimeDigiProducer.cc.

75  {
76  // Step A: Get Inputs
78  e.getByToken(m_hitsProducerTokenEB, ebHandle);
79 
81  e.getByToken(m_hitsProducerTokenEE, eeHandle);
82 
83 #ifdef ecal_time_debug
84  std::cout << "[EcalTimeDigiProducer]::Accumulate Hits HS event" << std::endl;
85 #endif
86 
87  accumulateCaloHits(ebHandle, eeHandle, 0);
88 }

References accumulateCaloHits(), gather_cfg::cout, MillePedeFileConverter_cfg::e, m_hitsProducerTokenEB, and m_hitsProducerTokenEE.

◆ accumulate() [2/2]

void EcalTimeDigiProducer::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
edm::StreamID const &   
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 90 of file EcalTimeDigiProducer.cc.

92  {
94  e.getByLabel(m_hitsProducerTagEB, ebHandle);
95 
97  e.getByLabel(m_hitsProducerTagEE, eeHandle);
98 
99 #ifdef ecal_time_debug
100  std::cout << "[EcalTimeDigiProducer]::Accumulate Hits for BC " << e.bunchCrossing() << std::endl;
101 #endif
102  accumulateCaloHits(ebHandle, eeHandle, e.bunchCrossing());
103 }

References accumulateCaloHits(), gather_cfg::cout, MillePedeFileConverter_cfg::e, m_hitsProducerTagEB, and m_hitsProducerTagEE.

◆ accumulateCaloHits()

void EcalTimeDigiProducer::accumulateCaloHits ( HitsHandle const &  ebHandle,
HitsHandle const &  eeHandle,
int  bunchCrossing 
)
private

Definition at line 61 of file EcalTimeDigiProducer.cc.

63  {
64  // accumulate the simHits and do the averages in a given layer per bunch
65  // crossing
66  if (ebHandle.isValid()) {
67  m_BarrelDigitizer->add(*ebHandle.product(), bunchCrossing);
68  }
69 
70  if (eeHandle.isValid()) {
71  m_EndcapDigitizer->add(*eeHandle.product(), bunchCrossing);
72  }
73 }

References EcalTimeMapDigitizer::add(), edm::HandleBase::isValid(), m_BarrelDigitizer, m_EndcapDigitizer, and edm::Handle< T >::product().

Referenced by accumulate().

◆ checkGeometry()

void EcalTimeDigiProducer::checkGeometry ( const edm::EventSetup eventSetup)
private

Definition at line 138 of file EcalTimeDigiProducer.cc.

138  {
139  // TODO find a way to avoid doing this every event
140  edm::ESHandle<CaloGeometry> hGeometry;
141  eventSetup.get<CaloGeometryRecord>().get(hGeometry);
142 
143  const CaloGeometry *pGeometry = &*hGeometry;
144 
145  if (pGeometry != m_Geometry) {
146  m_Geometry = pGeometry;
147  updateGeometry();
148  }
149 }

References options_cfi::eventSetup, get, m_Geometry, and updateGeometry().

Referenced by initializeEvent().

◆ finalizeEvent()

void EcalTimeDigiProducer::finalizeEvent ( edm::Event e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 105 of file EcalTimeDigiProducer.cc.

105  {
106  std::unique_ptr<EcalTimeDigiCollection> barrelResult(new EcalTimeDigiCollection());
107  std::unique_ptr<EcalTimeDigiCollection> endcapResult(new EcalTimeDigiCollection());
108 
109 #ifdef ecal_time_debug
110  std::cout << "[EcalTimeDigiProducer]::finalizeEvent" << std::endl;
111 #endif
112 
113  // here basically just put everything in the final collections
114  m_BarrelDigitizer->run(*barrelResult);
115 
116 #ifdef ecal_time_debug
117  std::cout << "[EcalTimeDigiProducer]::EB Digi size " << barrelResult->size() << std::endl;
118 #endif
119 
120  edm::LogInfo("TimeDigiInfo") << "EB time Digis: " << barrelResult->size();
121 
122  m_EndcapDigitizer->run(*endcapResult);
123 
124 #ifdef ecal_time_debug
125  std::cout << "[EcalTimeDigiProducer]::EE Digi size " << endcapResult->size() << std::endl;
126 #endif
127 
128  edm::LogInfo("TimeDigiInfo") << "EE Digis: " << endcapResult->size();
129 
130 #ifdef ecal_time_debug
131  std::cout << "[EcalTimeDigiProducer]::putting collections into the event " << std::endl;
132 #endif
133 
134  event.put(std::move(barrelResult), m_EBdigiCollection);
135  event.put(std::move(endcapResult), m_EEdigiCollection);
136 }

References gather_cfg::cout, m_BarrelDigitizer, m_EBdigiCollection, m_EEdigiCollection, m_EndcapDigitizer, eostools::move(), and EcalTimeMapDigitizer::run().

◆ initializeEvent()

void EcalTimeDigiProducer::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 53 of file EcalTimeDigiProducer.cc.

53  {
55  // checkCalibrations( event, eventSetup );
56  // here the methods to clean the maps
59 }

References checkGeometry(), options_cfi::eventSetup, EcalTimeMapDigitizer::initializeMap(), m_BarrelDigitizer, and m_EndcapDigitizer.

◆ updateGeometry()

void EcalTimeDigiProducer::updateGeometry ( )
private

Member Data Documentation

◆ m_BarrelDigitizer

EcalTimeMapDigitizer* EcalTimeDigiProducer::m_BarrelDigitizer
private

◆ m_EBdigiCollection

const std::string EcalTimeDigiProducer::m_EBdigiCollection
private

Definition at line 49 of file EcalTimeDigiProducer.h.

Referenced by EcalTimeDigiProducer(), and finalizeEvent().

◆ m_EEdigiCollection

const std::string EcalTimeDigiProducer::m_EEdigiCollection
private

Definition at line 50 of file EcalTimeDigiProducer.h.

Referenced by EcalTimeDigiProducer(), and finalizeEvent().

◆ m_EndcapDigitizer

EcalTimeMapDigitizer* EcalTimeDigiProducer::m_EndcapDigitizer
private

◆ m_Geometry

const CaloGeometry* EcalTimeDigiProducer::m_Geometry
private

Definition at line 59 of file EcalTimeDigiProducer.h.

Referenced by checkGeometry(), and updateGeometry().

◆ m_hitsProducerTagEB

const edm::InputTag EcalTimeDigiProducer::m_hitsProducerTagEB
private

Definition at line 51 of file EcalTimeDigiProducer.h.

Referenced by accumulate().

◆ m_hitsProducerTagEE

const edm::InputTag EcalTimeDigiProducer::m_hitsProducerTagEE
private

Definition at line 52 of file EcalTimeDigiProducer.h.

Referenced by accumulate().

◆ m_hitsProducerTokenEB

const edm::EDGetTokenT<std::vector<PCaloHit> > EcalTimeDigiProducer::m_hitsProducerTokenEB
private

Definition at line 53 of file EcalTimeDigiProducer.h.

Referenced by accumulate().

◆ m_hitsProducerTokenEE

const edm::EDGetTokenT<std::vector<PCaloHit> > EcalTimeDigiProducer::m_hitsProducerTokenEE
private

Definition at line 54 of file EcalTimeDigiProducer.h.

Referenced by accumulate().

◆ m_timeLayerEB

int EcalTimeDigiProducer::m_timeLayerEB
private

Definition at line 57 of file EcalTimeDigiProducer.h.

Referenced by EcalTimeDigiProducer().

◆ m_timeLayerEE

int EcalTimeDigiProducer::m_timeLayerEE
private

Definition at line 58 of file EcalTimeDigiProducer.h.

Referenced by EcalTimeDigiProducer().

EcalTimeMapDigitizer
Definition: EcalTimeMapDigitizer.h:19
EcalTimeDigiProducer::m_Geometry
const CaloGeometry * m_Geometry
Definition: EcalTimeDigiProducer.h:59
EcalTimeMapDigitizer::run
void run(EcalTimeDigiCollection &output)
Definition: EcalTimeMapDigitizer.cc:168
EcalTimeDigiProducer::m_hitsProducerTokenEE
const edm::EDGetTokenT< std::vector< PCaloHit > > m_hitsProducerTokenEE
Definition: EcalTimeDigiProducer.h:54
EcalTimeDigiProducer::updateGeometry
void updateGeometry()
Definition: EcalTimeDigiProducer.cc:151
EcalTimeDigiProducer::m_timeLayerEB
int m_timeLayerEB
Definition: EcalTimeDigiProducer.h:57
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EcalTimeDigiProducer::accumulateCaloHits
void accumulateCaloHits(HitsHandle const &ebHandle, HitsHandle const &eeHandle, int bunchCrossing)
Definition: EcalTimeDigiProducer.cc:61
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
EcalTimeDigiProducer::m_EEdigiCollection
const std::string m_EEdigiCollection
Definition: EcalTimeDigiProducer.h:50
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
edm::SortedCollection
Definition: SortedCollection.h:49
EcalTimeMapDigitizer::setGeometry
void setGeometry(const CaloSubdetectorGeometry *geometry)
Definition: EcalTimeMapDigitizer.cc:124
EcalTimeMapDigitizer::setTimeLayerId
void setTimeLayerId(const int &layerId)
Definition: EcalTimeMapDigitizer.h:83
EcalTimeDigiProducer::m_hitsProducerTagEB
const edm::InputTag m_hitsProducerTagEB
Definition: EcalTimeDigiProducer.h:51
edm::Handle
Definition: AssociativeIterator.h:50
EcalBarrel
Definition: EcalSubdetector.h:10
CaloGeometry
Definition: CaloGeometry.h:21
EcalTimeMapDigitizer::add
void add(const std::vector< PCaloHit > &hits, int bunchCrossing)
Definition: EcalTimeMapDigitizer.cc:76
edm::ESHandle< CaloGeometry >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
DigiAccumulatorMixMod::DigiAccumulatorMixMod
DigiAccumulatorMixMod()
Definition: DigiAccumulatorMixMod.cc:3
EcalTimeMapDigitizer::initializeMap
void initializeMap()
Definition: EcalTimeMapDigitizer.cc:161
EcalTimeDigiProducer::m_hitsProducerTokenEB
const edm::EDGetTokenT< std::vector< PCaloHit > > m_hitsProducerTokenEB
Definition: EcalTimeDigiProducer.h:53
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalEndcap
Definition: EcalSubdetector.h:10
edm::ProducesCollector::produces
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
Definition: ProducesCollector.h:52
EcalTimeDigiCollection
edm::SortedCollection< EcalTimeDigi > EcalTimeDigiCollection
Definition: EcalDigiCollections.h:92
DetId::Ecal
Definition: DetId.h:27
get
#define get
EcalTimeDigiProducer::m_BarrelDigitizer
EcalTimeMapDigitizer * m_BarrelDigitizer
Definition: EcalTimeDigiProducer.h:61
eostools.move
def move(src, dest)
Definition: eostools.py:511
options_cfi.eventSetup
eventSetup
Definition: options_cfi.py:12
EcalTimeDigiProducer::checkGeometry
void checkGeometry(const edm::EventSetup &eventSetup)
Definition: EcalTimeDigiProducer.cc:138
EcalTimeDigiProducer::m_EndcapDigitizer
EcalTimeMapDigitizer * m_EndcapDigitizer
Definition: EcalTimeDigiProducer.h:62
EcalTimeDigiProducer::m_EBdigiCollection
const std::string m_EBdigiCollection
Definition: EcalTimeDigiProducer.h:49
EcalTimeDigiProducer::m_hitsProducerTagEE
const edm::InputTag m_hitsProducerTagEE
Definition: EcalTimeDigiProducer.h:52
edm::InputTag
Definition: InputTag.h:15
EcalTimeDigiProducer::m_timeLayerEE
int m_timeLayerEE
Definition: EcalTimeDigiProducer.h:58
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37