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

Private Attributes

EcalTimeMapDigitizerm_BarrelDigitizer
 
const std::string m_EBdigiCollection
 
const CaloGeometrym_Geometry
 
const edm::InputTag m_hitsProducerTagEB
 
const edm::EDGetTokenT< std::vector< PCaloHit > > m_hitsProducerTokenEB
 
int m_timeLayerEB
 

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 18 of file EcalTimeDigiProducer.cc.

22  m_EBdigiCollection(params.getParameter<std::string>("EBtimeDigiCollection")),
23  m_hitsProducerTagEB(params.getParameter<edm::InputTag>("hitsProducerEB")),
24  m_hitsProducerTokenEB(sumes.consumes<std::vector<PCaloHit>>(m_hitsProducerTagEB)),
25  m_timeLayerEB(params.getParameter<int>("timeLayerBarrel")),
26  m_Geometry(nullptr) {
28 
30 
31 #ifdef ecal_time_debug
32  std::cout << "[EcalTimeDigiProducer]::Create EB " << m_EBdigiCollection << " "
33  << " collection and digitizer" << std::endl;
34 #endif
35 
37 }

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

◆ ~EcalTimeDigiProducer()

EcalTimeDigiProducer::~EcalTimeDigiProducer ( )
override

Definition at line 39 of file EcalTimeDigiProducer.cc.

39 {}

Member Function Documentation

◆ accumulate() [1/2]

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

Implements DigiAccumulatorMixMod.

Definition at line 56 of file EcalTimeDigiProducer.cc.

56  {
57  // Step A: Get Inputs
59  e.getByToken(m_hitsProducerTokenEB, ebHandle);
60 
61 #ifdef ecal_time_debug
62  std::cout << "[EcalTimeDigiProducer]::Accumulate Hits HS event" << std::endl;
63 #endif
64 
65  accumulateCaloHits(ebHandle, 0);
66 }

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

◆ accumulate() [2/2]

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

Implements DigiAccumulatorMixMod.

Definition at line 68 of file EcalTimeDigiProducer.cc.

70  {
72  e.getByLabel(m_hitsProducerTagEB, ebHandle);
73 
74 #ifdef ecal_time_debug
75  std::cout << "[EcalTimeDigiProducer]::Accumulate Hits for BC " << e.bunchCrossing() << std::endl;
76 #endif
77  accumulateCaloHits(ebHandle, e.bunchCrossing());
78 }

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

◆ accumulateCaloHits()

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

Definition at line 48 of file EcalTimeDigiProducer.cc.

48  {
49  // accumulate the simHits and do the averages in a given layer per bunch
50  // crossing
51  if (ebHandle.isValid()) {
52  m_BarrelDigitizer->add(*ebHandle.product(), bunchCrossing);
53  }
54 }

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

Referenced by accumulate().

◆ checkGeometry()

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

Definition at line 103 of file EcalTimeDigiProducer.cc.

103  {
104  // TODO find a way to avoid doing this every event
105  edm::ESHandle<CaloGeometry> hGeometry;
106  eventSetup.get<CaloGeometryRecord>().get(hGeometry);
107 
108  const CaloGeometry *pGeometry = &*hGeometry;
109 
110  if (pGeometry != m_Geometry) {
111  m_Geometry = pGeometry;
112  updateGeometry();
113  }
114 }

References edm::EventSetup::get(), 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 80 of file EcalTimeDigiProducer.cc.

80  {
81  std::unique_ptr<EcalTimeDigiCollection> barrelResult = std::make_unique<EcalTimeDigiCollection>();
82 
83 #ifdef ecal_time_debug
84  std::cout << "[EcalTimeDigiProducer]::finalizeEvent" << std::endl;
85 #endif
86 
87  // here basically just put everything in the final collections
88  m_BarrelDigitizer->run(*barrelResult);
89 
90 #ifdef ecal_time_debug
91  std::cout << "[EcalTimeDigiProducer]::EB Digi size " << barrelResult->size() << std::endl;
92 #endif
93 
94  edm::LogInfo("TimeDigiInfo") << "EB time Digis: " << barrelResult->size();
95 
96 #ifdef ecal_time_debug
97  std::cout << "[EcalTimeDigiProducer]::putting EcalTimeDigiCollection into the event " << std::endl;
98 #endif
99 
100  event.put(std::move(barrelResult), m_EBdigiCollection);
101 }

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

◆ initializeEvent()

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

Implements DigiAccumulatorMixMod.

Definition at line 41 of file EcalTimeDigiProducer.cc.

41  {
42  checkGeometry(eventSetup);
43  // checkCalibrations( event, eventSetup );
44  // here the methods to clean the maps
46 }

References checkGeometry(), EcalTimeMapDigitizer::initializeMap(), and m_BarrelDigitizer.

◆ 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_Geometry

const CaloGeometry* EcalTimeDigiProducer::m_Geometry
private

Definition at line 55 of file EcalTimeDigiProducer.h.

Referenced by checkGeometry(), and updateGeometry().

◆ m_hitsProducerTagEB

const edm::InputTag EcalTimeDigiProducer::m_hitsProducerTagEB
private

Definition at line 50 of file EcalTimeDigiProducer.h.

Referenced by accumulate().

◆ m_hitsProducerTokenEB

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

Definition at line 51 of file EcalTimeDigiProducer.h.

Referenced by accumulate().

◆ m_timeLayerEB

int EcalTimeDigiProducer::m_timeLayerEB
private

Definition at line 54 of file EcalTimeDigiProducer.h.

Referenced by EcalTimeDigiProducer().

EcalTimeMapDigitizer
Definition: EcalTimeMapDigitizer.h:19
EcalTimeDigiProducer::m_Geometry
const CaloGeometry * m_Geometry
Definition: EcalTimeDigiProducer.h:55
EcalTimeMapDigitizer::run
void run(EcalTimeDigiCollection &output)
Definition: EcalTimeMapDigitizer.cc:168
EcalTimeDigiProducer::updateGeometry
void updateGeometry()
Definition: EcalTimeDigiProducer.cc:116
EcalTimeDigiProducer::m_timeLayerEB
int m_timeLayerEB
Definition: EcalTimeDigiProducer.h:54
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
gather_cfg.cout
cout
Definition: gather_cfg.py:144
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
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
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:50
edm::Handle
Definition: AssociativeIterator.h:50
EcalBarrel
Definition: EcalSubdetector.h:10
CaloGeometry
Definition: CaloGeometry.h:21
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
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:55
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:51
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ProducesCollector::produces
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
Definition: ProducesCollector.h:52
DetId::Ecal
Definition: DetId.h:27
get
#define get
EcalTimeDigiProducer::m_BarrelDigitizer
EcalTimeMapDigitizer * m_BarrelDigitizer
Definition: EcalTimeDigiProducer.h:57
eostools.move
def move(src, dest)
Definition: eostools.py:511
EcalTimeDigiProducer::accumulateCaloHits
void accumulateCaloHits(HitsHandle const &ebHandle, int bunchCrossing)
Definition: EcalTimeDigiProducer.cc:48
EcalTimeDigiProducer::checkGeometry
void checkGeometry(const edm::EventSetup &eventSetup)
Definition: EcalTimeDigiProducer.cc:103
EcalTimeDigiProducer::m_EBdigiCollection
const std::string m_EBdigiCollection
Definition: EcalTimeDigiProducer.h:49
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37