CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
const std::string m_EBdigiCollection
 
const CaloGeometrym_Geometry
 
const edm::ESGetToken
< CaloGeometry,
CaloGeometryRecord
m_geometryToken
 
edm::ESWatcher
< CaloGeometryRecord
m_geometryWatcher
 
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

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

Definition at line 42 of file EcalTimeDigiProducer.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file EcalTimeDigiProducer.cc.

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

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) {
27 
29 
30 #ifdef ecal_time_debug
31  std::cout << "[EcalTimeDigiProducer]::Create EB " << m_EBdigiCollection << " "
32  << " collection and digitizer" << std::endl;
33 #endif
34 
35  m_BarrelDigitizer->setTimeLayerId(m_timeLayerEB);
36 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > m_geometryToken
const edm::EDGetTokenT< std::vector< PCaloHit > > m_hitsProducerTokenEB
const edm::InputTag m_hitsProducerTagEB
EcalTimeMapDigitizer * m_BarrelDigitizer
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const CaloGeometry * m_Geometry
tuple cout
Definition: gather_cfg.py:144
const std::string m_EBdigiCollection
EcalTimeDigiProducer::~EcalTimeDigiProducer ( )
override

Definition at line 38 of file EcalTimeDigiProducer.cc.

38 {}

Member Function Documentation

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

Implements DigiAccumulatorMixMod.

Definition at line 55 of file EcalTimeDigiProducer.cc.

References accumulateCaloHits(), gather_cfg::cout, edm::Event::getByToken(), and m_hitsProducerTokenEB.

55  {
56  // Step A: Get Inputs
58  e.getByToken(m_hitsProducerTokenEB, ebHandle);
59 
60 #ifdef ecal_time_debug
61  std::cout << "[EcalTimeDigiProducer]::Accumulate Hits HS event" << std::endl;
62 #endif
63 
64  accumulateCaloHits(ebHandle, 0);
65 }
const edm::EDGetTokenT< std::vector< PCaloHit > > m_hitsProducerTokenEB
tuple cout
Definition: gather_cfg.py:144
void accumulateCaloHits(HitsHandle const &ebHandle, int bunchCrossing)
void EcalTimeDigiProducer::accumulate ( PileUpEventPrincipal const &  e,
edm::EventSetup const &  c,
edm::StreamID const &   
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 67 of file EcalTimeDigiProducer.cc.

References accumulateCaloHits(), PileUpEventPrincipal::bunchCrossing(), gather_cfg::cout, PileUpEventPrincipal::getByLabel(), and m_hitsProducerTagEB.

69  {
71  e.getByLabel(m_hitsProducerTagEB, ebHandle);
72 
73 #ifdef ecal_time_debug
74  std::cout << "[EcalTimeDigiProducer]::Accumulate Hits for BC " << e.bunchCrossing() << std::endl;
75 #endif
76  accumulateCaloHits(ebHandle, e.bunchCrossing());
77 }
const edm::InputTag m_hitsProducerTagEB
tuple cout
Definition: gather_cfg.py:144
void accumulateCaloHits(HitsHandle const &ebHandle, int bunchCrossing)
void EcalTimeDigiProducer::accumulateCaloHits ( HitsHandle const &  ebHandle,
int  bunchCrossing 
)
private

Definition at line 47 of file EcalTimeDigiProducer.cc.

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

Referenced by accumulate().

47  {
48  // accumulate the simHits and do the averages in a given layer per bunch
49  // crossing
50  if (ebHandle.isValid()) {
51  m_BarrelDigitizer->add(*ebHandle.product(), bunchCrossing);
52  }
53 }
EcalTimeMapDigitizer * m_BarrelDigitizer
void add(const std::vector< PCaloHit > &hits, int bunchCrossing)
void EcalTimeDigiProducer::checkGeometry ( const edm::EventSetup eventSetup)
private

Definition at line 102 of file EcalTimeDigiProducer.cc.

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

Referenced by initializeEvent().

102  {
103  if (m_geometryWatcher.check(eventSetup)) {
104  m_Geometry = &eventSetup.getData(m_geometryToken);
105  updateGeometry();
106  }
107 }
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > m_geometryToken
edm::ESWatcher< CaloGeometryRecord > m_geometryWatcher
bool getData(T &iHolder) const
Definition: EventSetup.h:128
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
const CaloGeometry * m_Geometry
void EcalTimeDigiProducer::finalizeEvent ( edm::Event e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 79 of file EcalTimeDigiProducer.cc.

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

79  {
80  std::unique_ptr<EcalTimeDigiCollection> barrelResult = std::make_unique<EcalTimeDigiCollection>();
81 
82 #ifdef ecal_time_debug
83  std::cout << "[EcalTimeDigiProducer]::finalizeEvent" << std::endl;
84 #endif
85 
86  // here basically just put everything in the final collections
87  m_BarrelDigitizer->run(*barrelResult);
88 
89 #ifdef ecal_time_debug
90  std::cout << "[EcalTimeDigiProducer]::EB Digi size " << barrelResult->size() << std::endl;
91 #endif
92 
93  edm::LogInfo("TimeDigiInfo") << "EB time Digis: " << barrelResult->size();
94 
95 #ifdef ecal_time_debug
96  std::cout << "[EcalTimeDigiProducer]::putting EcalTimeDigiCollection into the event " << std::endl;
97 #endif
98 
99  event.put(std::move(barrelResult), m_EBdigiCollection);
100 }
void run(EcalTimeDigiCollection &output)
def move
Definition: eostools.py:511
Log< level::Info, false > LogInfo
EcalTimeMapDigitizer * m_BarrelDigitizer
tuple cout
Definition: gather_cfg.py:144
const std::string m_EBdigiCollection
void EcalTimeDigiProducer::initializeEvent ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overridevirtual

Implements DigiAccumulatorMixMod.

Definition at line 40 of file EcalTimeDigiProducer.cc.

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

40  {
41  checkGeometry(eventSetup);
42  // checkCalibrations( event, eventSetup );
43  // here the methods to clean the maps
45 }
EcalTimeMapDigitizer * m_BarrelDigitizer
void checkGeometry(const edm::EventSetup &eventSetup)
void EcalTimeDigiProducer::updateGeometry ( )
private

Definition at line 109 of file EcalTimeDigiProducer.cc.

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

Referenced by checkGeometry().

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

Member Data Documentation

EcalTimeMapDigitizer* EcalTimeDigiProducer::m_BarrelDigitizer
private
const std::string EcalTimeDigiProducer::m_EBdigiCollection
private

Definition at line 49 of file EcalTimeDigiProducer.h.

Referenced by EcalTimeDigiProducer(), and finalizeEvent().

const CaloGeometry* EcalTimeDigiProducer::m_Geometry
private

Definition at line 57 of file EcalTimeDigiProducer.h.

Referenced by checkGeometry(), and updateGeometry().

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

Definition at line 52 of file EcalTimeDigiProducer.h.

Referenced by checkGeometry().

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

Definition at line 53 of file EcalTimeDigiProducer.h.

Referenced by checkGeometry().

const edm::InputTag EcalTimeDigiProducer::m_hitsProducerTagEB
private

Definition at line 50 of file EcalTimeDigiProducer.h.

Referenced by accumulate().

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

Definition at line 51 of file EcalTimeDigiProducer.h.

Referenced by accumulate().

int EcalTimeDigiProducer::m_timeLayerEB
private

Definition at line 56 of file EcalTimeDigiProducer.h.

Referenced by EcalTimeDigiProducer().