CMS 3D CMS Logo

EcalTimeDigiProducer.cc
Go to the documentation of this file.
13 
14 //#define EDM_ML_DEBUG
15 
17  edm::ProducesCollector producesCollector,
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 }
40 
42 
45  // checkCalibrations( event, eventSetup );
46  // here the methods to clean the maps
48  if (m_componentWaveform) {
51  }
52 }
53 
54 void EcalTimeDigiProducer::accumulateCaloHits(HitsHandle const &ebHandle, int bunchCrossing) {
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 }
61 
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 }
75 
78  edm::StreamID const &) {
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 }
90 
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 }
113 
117  updateGeometry();
118  }
119 }
120 
123 }
void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
Log< level::Info, true > LogVerbatim
ComponentShapeCollection * m_ComponentShapes
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override
void run(EcalTimeDigiCollection &output)
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > m_geometryToken
T const * product() const
Definition: Handle.h:70
EcalTimeDigiProducer(const edm::ParameterSet &params, edm::ProducesCollector, edm::ConsumesCollector &)
void setGeometry(const CaloSubdetectorGeometry *geometry)
edm::ESWatcher< CaloGeometryRecord > m_geometryWatcher
void setTimeLayerId(const int &layerId)
const edm::EDGetTokenT< std::vector< PCaloHit > > m_hitsProducerTokenEB
const edm::InputTag m_hitsProducerTagEB
void setEventSetup(const edm::EventSetup &evtSetup)
void accumulate(edm::Event const &e, edm::EventSetup const &c) override
Log< level::Info, false > LogInfo
void setEventSetup(const edm::EventSetup &eventSetup)
EcalTimeMapDigitizer * m_BarrelDigitizer
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
bool isValid() const
Definition: HandleBase.h:70
void add(const std::vector< PCaloHit > &hits, int bunchCrossing)
HLT enums.
const CaloGeometry * m_Geometry
void accumulateCaloHits(HitsHandle const &ebHandle, int bunchCrossing)
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
def move(src, dest)
Definition: eostools.py:511
void checkGeometry(const edm::EventSetup &eventSetup)
Definition: event.py:1
const std::string m_EBdigiCollection