File indexing completed on 2024-04-06 12:29:27
0001 #ifndef SimCalorimetry_EcalSimProducers_EcalTimeDigiProducer_h
0002 #define SimCalorimetry_EcalSimProducers_EcalTimeDigiProducer_h
0003
0004 #include "DataFormats/Math/interface/Error.h"
0005
0006 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
0007 #include "FWCore/Framework/interface/ConsumesCollector.h"
0008 #include "FWCore/Framework/interface/ESWatcher.h"
0009 #include "FWCore/Framework/interface/FrameworkfwdMostUsed.h"
0010 #include "FWCore/Framework/interface/ProducesCollector.h"
0011 #include "FWCore/Utilities/interface/EDGetToken.h"
0012 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0013 #include "SimCalorimetry/EcalSimAlgos/interface/EcalDigitizerTraits.h"
0014 #include "SimCalorimetry/EcalSimAlgos/interface/ComponentShapeCollection.h"
0015 #include "SimDataFormats/CaloHit/interface/PCaloHit.h"
0016 #include "SimGeneral/MixingModule/interface/DigiAccumulatorMixMod.h"
0017
0018 #include <vector>
0019
0020 class ESDigitizer;
0021
0022 class CaloGeometry;
0023 class EcalSimParameterMap;
0024 class PileUpEventPrincipal;
0025 class EcalTimeMapDigitizer;
0026
0027 namespace edm {
0028 template <typename T>
0029 class Handle;
0030 }
0031
0032 class EcalTimeDigiProducer : public DigiAccumulatorMixMod {
0033 public:
0034 EcalTimeDigiProducer(const edm::ParameterSet ¶ms, edm::ProducesCollector, edm::ConsumesCollector &);
0035 ~EcalTimeDigiProducer() override;
0036
0037 void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override;
0038 void accumulate(edm::Event const &e, edm::EventSetup const &c) override;
0039 void accumulate(PileUpEventPrincipal const &e, edm::EventSetup const &c, edm::StreamID const &) override;
0040 void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override;
0041
0042 private:
0043 typedef edm::Handle<std::vector<PCaloHit>> HitsHandle;
0044 void accumulateCaloHits(HitsHandle const &ebHandle, int bunchCrossing);
0045
0046 void checkGeometry(const edm::EventSetup &eventSetup);
0047
0048 void updateGeometry();
0049
0050 const std::string m_EBdigiCollection;
0051 const edm::InputTag m_hitsProducerTagEB;
0052 const edm::EDGetTokenT<std::vector<PCaloHit>> m_hitsProducerTokenEB;
0053 const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> m_geometryToken;
0054 edm::ESWatcher<CaloGeometryRecord> m_geometryWatcher;
0055
0056 private:
0057 int m_timeLayerEB;
0058 const CaloGeometry *m_Geometry;
0059 const bool m_componentWaveform;
0060 ComponentShapeCollection *m_ComponentShapes = nullptr;
0061 EcalTimeMapDigitizer *m_BarrelDigitizer;
0062 };
0063
0064 #endif