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 ()
 
 DigiAccumulatorMixMod (DigiAccumulatorMixMod const &)=delete
 
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)
 
DigiAccumulatorMixMod const & operator= (DigiAccumulatorMixMod const &)=delete
 
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, int bunchCrossing)
 
void checkGeometry (const edm::EventSetup &eventSetup)
 
void updateGeometry ()
 

Private Attributes

EcalTimeMapDigitizerm_BarrelDigitizer
 
ComponentShapeCollectionm_ComponentShapes = nullptr
 
const bool m_componentWaveform
 
const std::string m_EBdigiCollection
 
const CaloGeometrym_Geometry
 
const edm::ESGetToken< CaloGeometry, CaloGeometryRecordm_geometryToken
 
edm::ESWatcher< CaloGeometryRecordm_geometryWatcher
 
const edm::InputTag m_hitsProducerTagEB
 
const edm::EDGetTokenT< std::vector< PCaloHit > > m_hitsProducerTokenEB
 
int m_timeLayerEB
 

Detailed Description

Definition at line 32 of file EcalTimeDigiProducer.h.

Member Typedef Documentation

◆ HitsHandle

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

Definition at line 43 of file EcalTimeDigiProducer.h.

Constructor & Destructor Documentation

◆ EcalTimeDigiProducer()

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

Definition at line 16 of file EcalTimeDigiProducer.cc.

References EcalBarrel, m_BarrelDigitizer, m_ComponentShapes, m_componentWaveform, m_EBdigiCollection, m_timeLayerEB, edm::ProducesCollector::produces(), and EcalTimeMapDigitizer::setTimeLayerId().

20  m_EBdigiCollection(params.getParameter<std::string>("EBtimeDigiCollection")),
21  m_hitsProducerTagEB(params.getParameter<edm::InputTag>("hitsProducerEB")),
22  m_hitsProducerTokenEB(sumes.consumes<std::vector<PCaloHit>>(m_hitsProducerTagEB)),
23  m_geometryToken(sumes.esConsumes()),
24  m_timeLayerEB(params.getParameter<int>("timeLayerBarrel")),
25  m_Geometry(nullptr),
26  m_componentWaveform(params.getParameter<bool>("componentWaveform")) {
28 
32 
33 #ifdef EDM_ML_DEBUG
34  edm::LogVerbatim("TimeDigiInfo") << "[EcalTimeDigiProducer]::Create EB " << m_EBdigiCollection
35  << " collection and digitizer";
36 #endif
37 
39 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Log< level::Info, true > LogVerbatim
ComponentShapeCollection * m_ComponentShapes
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > m_geometryToken
void setTimeLayerId(const int &layerId)
const edm::EDGetTokenT< std::vector< PCaloHit > > m_hitsProducerTokenEB
const edm::InputTag m_hitsProducerTagEB
EcalTimeMapDigitizer * m_BarrelDigitizer
const CaloGeometry * m_Geometry
const std::string m_EBdigiCollection

◆ ~EcalTimeDigiProducer()

EcalTimeDigiProducer::~EcalTimeDigiProducer ( )
override

Definition at line 41 of file EcalTimeDigiProducer.cc.

41 {}

Member Function Documentation

◆ accumulate() [1/2]

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

Implements DigiAccumulatorMixMod.

Definition at line 62 of file EcalTimeDigiProducer.cc.

References accumulateCaloHits(), MillePedeFileConverter_cfg::e, options_cfi::eventSetup, m_BarrelDigitizer, m_componentWaveform, m_hitsProducerTokenEB, and EcalTimeMapDigitizer::setEventSetup().

62  {
63  // Step A: Get Inputs
64  const edm::Handle<std::vector<PCaloHit>> &ebHandle = e.getHandle(m_hitsProducerTokenEB);
65 
66 #ifdef EDM_ML_DEBUG
67  edm::LogVerbatim("TimeDigiInfo") << "[EcalTimeDigiProducer]::Accumulate Hits HS event";
68 #endif
69 
70  if (m_componentWaveform) {
72  }
73  accumulateCaloHits(ebHandle, 0);
74 }
Log< level::Info, true > LogVerbatim
const edm::EDGetTokenT< std::vector< PCaloHit > > m_hitsProducerTokenEB
void setEventSetup(const edm::EventSetup &eventSetup)
EcalTimeMapDigitizer * m_BarrelDigitizer
void accumulateCaloHits(HitsHandle const &ebHandle, int bunchCrossing)

◆ accumulate() [2/2]

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

Implements DigiAccumulatorMixMod.

Definition at line 76 of file EcalTimeDigiProducer.cc.

References accumulateCaloHits(), MillePedeFileConverter_cfg::e, options_cfi::eventSetup, m_BarrelDigitizer, m_componentWaveform, m_hitsProducerTagEB, and EcalTimeMapDigitizer::setEventSetup().

78  {
80  e.getByLabel(m_hitsProducerTagEB, ebHandle);
81 
82 #ifdef EDM_ML_DEBUG
83  edm::LogVerbatim("TimeDigiInfo") << "[EcalTimeDigiProducer]::Accumulate Hits for BC " << e.bunchCrossing();
84 #endif
85  if (m_componentWaveform) {
87  }
88  accumulateCaloHits(ebHandle, e.bunchCrossing());
89 }
Log< level::Info, true > LogVerbatim
const edm::InputTag m_hitsProducerTagEB
void setEventSetup(const edm::EventSetup &eventSetup)
EcalTimeMapDigitizer * m_BarrelDigitizer
void accumulateCaloHits(HitsHandle const &ebHandle, int bunchCrossing)

◆ accumulateCaloHits()

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

Definition at line 54 of file EcalTimeDigiProducer.cc.

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

Referenced by accumulate().

54  {
55  // accumulate the simHits and do the averages in a given layer per bunch
56  // crossing
57  if (ebHandle.isValid()) {
58  m_BarrelDigitizer->add(*ebHandle.product(), bunchCrossing);
59  }
60 }
EcalTimeMapDigitizer * m_BarrelDigitizer
void add(const std::vector< PCaloHit > &hits, int bunchCrossing)

◆ checkGeometry()

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

Definition at line 114 of file EcalTimeDigiProducer.cc.

References edm::ESWatcher< T >::check(), options_cfi::eventSetup, m_Geometry, m_geometryToken, m_geometryWatcher, and updateGeometry().

Referenced by initializeEvent().

114  {
117  updateGeometry();
118  }
119 }
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > m_geometryToken
edm::ESWatcher< CaloGeometryRecord > m_geometryWatcher
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
const CaloGeometry * m_Geometry

◆ finalizeEvent()

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

Implements DigiAccumulatorMixMod.

Definition at line 91 of file EcalTimeDigiProducer.cc.

References m_BarrelDigitizer, m_EBdigiCollection, eostools::move(), and EcalTimeMapDigitizer::run().

91  {
92  std::unique_ptr<EcalTimeDigiCollection> barrelResult = std::make_unique<EcalTimeDigiCollection>();
93 
94 #ifdef EDM_ML_DEBUG
95  edm::LogVerbatim("TimeDigiInfo") << "[EcalTimeDigiProducer]::finalizeEvent";
96 #endif
97 
98  // here basically just put everything in the final collections
99  m_BarrelDigitizer->run(*barrelResult);
100 
101 #ifdef EDM_ML_DEBUG
102  edm::LogVerbatim("TimeDigiInfo") << "[EcalTimeDigiProducer]::EB Digi size " << barrelResult->size();
103 #endif
104 
105  edm::LogInfo("TimeDigiInfo") << "EB time Digis: " << barrelResult->size();
106 
107 #ifdef EDM_ML_DEBUG
108  edm::LogVerbatim("TimeDigiInfo") << "[EcalTimeDigiProducer]::putting EcalTimeDigiCollection into the event ";
109 #endif
110 
111  event.put(std::move(barrelResult), m_EBdigiCollection);
112 }
Log< level::Info, true > LogVerbatim
void run(EcalTimeDigiCollection &output)
Log< level::Info, false > LogInfo
EcalTimeMapDigitizer * m_BarrelDigitizer
def move(src, dest)
Definition: eostools.py:511
const std::string m_EBdigiCollection

◆ initializeEvent()

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

Implements DigiAccumulatorMixMod.

Definition at line 43 of file EcalTimeDigiProducer.cc.

References checkGeometry(), options_cfi::eventSetup, EcalTimeMapDigitizer::initializeMap(), m_BarrelDigitizer, m_ComponentShapes, m_componentWaveform, ComponentShapeCollection::setEventSetup(), and EcalTimeMapDigitizer::setEventSetup().

43  {
45  // checkCalibrations( event, eventSetup );
46  // here the methods to clean the maps
48  if (m_componentWaveform) {
51  }
52 }
ComponentShapeCollection * m_ComponentShapes
void setEventSetup(const edm::EventSetup &evtSetup)
void setEventSetup(const edm::EventSetup &eventSetup)
EcalTimeMapDigitizer * m_BarrelDigitizer
void checkGeometry(const edm::EventSetup &eventSetup)

◆ updateGeometry()

void EcalTimeDigiProducer::updateGeometry ( )
private

Definition at line 121 of file EcalTimeDigiProducer.cc.

References DetId::Ecal, EcalBarrel, CaloGeometry::getSubdetectorGeometry(), m_BarrelDigitizer, m_Geometry, and EcalTimeMapDigitizer::setGeometry().

Referenced by checkGeometry().

121  {
123 }
void setGeometry(const CaloSubdetectorGeometry *geometry)
EcalTimeMapDigitizer * m_BarrelDigitizer
const CaloGeometry * m_Geometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

Member Data Documentation

◆ m_BarrelDigitizer

EcalTimeMapDigitizer* EcalTimeDigiProducer::m_BarrelDigitizer
private

◆ m_ComponentShapes

ComponentShapeCollection* EcalTimeDigiProducer::m_ComponentShapes = nullptr
private

Definition at line 60 of file EcalTimeDigiProducer.h.

Referenced by EcalTimeDigiProducer(), and initializeEvent().

◆ m_componentWaveform

const bool EcalTimeDigiProducer::m_componentWaveform
private

Definition at line 59 of file EcalTimeDigiProducer.h.

Referenced by accumulate(), EcalTimeDigiProducer(), and initializeEvent().

◆ m_EBdigiCollection

const std::string EcalTimeDigiProducer::m_EBdigiCollection
private

Definition at line 50 of file EcalTimeDigiProducer.h.

Referenced by EcalTimeDigiProducer(), and finalizeEvent().

◆ m_Geometry

const CaloGeometry* EcalTimeDigiProducer::m_Geometry
private

Definition at line 58 of file EcalTimeDigiProducer.h.

Referenced by checkGeometry(), and updateGeometry().

◆ m_geometryToken

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> EcalTimeDigiProducer::m_geometryToken
private

Definition at line 53 of file EcalTimeDigiProducer.h.

Referenced by checkGeometry().

◆ m_geometryWatcher

edm::ESWatcher<CaloGeometryRecord> EcalTimeDigiProducer::m_geometryWatcher
private

Definition at line 54 of file EcalTimeDigiProducer.h.

Referenced by checkGeometry().

◆ m_hitsProducerTagEB

const edm::InputTag EcalTimeDigiProducer::m_hitsProducerTagEB
private

Definition at line 51 of file EcalTimeDigiProducer.h.

Referenced by accumulate().

◆ m_hitsProducerTokenEB

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

Definition at line 52 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().