File indexing completed on 2023-10-25 10:05:02
0001 #ifndef SiPixelDigitizer_h
0002 #define SiPixelDigitizer_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include <map>
0017 #include <memory>
0018 #include <string>
0019 #include <vector>
0020
0021 #include "DataFormats/Common/interface/Handle.h"
0022 #include "DataFormats/Provenance/interface/EventID.h"
0023 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0024 #include "FWCore/Framework/interface/ProducesCollector.h"
0025 #include "FWCore/Framework/interface/FrameworkfwdMostUsed.h"
0026 #include "FWCore/Utilities/interface/ESGetToken.h"
0027 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0028 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0029 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0030 #include "SimGeneral/MixingModule/interface/DigiAccumulatorMixMod.h"
0031
0032 class MagneticField;
0033 class PileUpEventPrincipal;
0034 class PixelGeomDetUnit;
0035 class PSimHit;
0036 class SiPixelDigitizerAlgorithm;
0037 class TrackerGeometry;
0038
0039 namespace CLHEP {
0040 class HepRandomEngine;
0041 }
0042
0043 namespace cms {
0044 class SiPixelDigitizer : public DigiAccumulatorMixMod {
0045 public:
0046 explicit SiPixelDigitizer(const edm::ParameterSet& conf, edm::ProducesCollector, edm::ConsumesCollector& iC);
0047
0048 ~SiPixelDigitizer() override;
0049
0050 void initializeEvent(edm::Event const& e, edm::EventSetup const& c) override;
0051 void accumulate(edm::Event const& e, edm::EventSetup const& c) override;
0052 void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c, edm::StreamID const&) override;
0053 void finalizeEvent(edm::Event& e, edm::EventSetup const& c) override;
0054
0055 virtual void beginJob() {}
0056
0057 void StorePileupInformation(std::vector<int>& numInteractionList,
0058 std::vector<int>& bunchCrossingList,
0059 std::vector<float>& TrueInteractionList,
0060 std::vector<edm::EventID>& eventInfoList,
0061 int bunchSpacing) override {
0062 PileupInfo_ = std::make_unique<PileupMixingContent>(
0063 numInteractionList, bunchCrossingList, TrueInteractionList, eventInfoList, bunchSpacing);
0064 }
0065
0066 PileupMixingContent* getEventPileupInfo() override { return PileupInfo_.get(); }
0067
0068 private:
0069 void accumulatePixelHits(edm::Handle<std::vector<PSimHit> >,
0070 size_t globalSimHitIndex,
0071 const unsigned int tofBin,
0072 edm::EventSetup const& c);
0073
0074 bool firstInitializeEvent_;
0075 bool firstFinalizeEvent_;
0076 bool applyLateReweighting_;
0077 const bool store_SimHitEntryExitPoints_;
0078 bool makeDigiSimLinks_;
0079 std::unique_ptr<SiPixelDigitizerAlgorithm> _pixeldigialgo;
0080
0081
0082
0083
0084
0085
0086
0087
0088 std::map<std::string, size_t> crossingSimHitIndexOffset_;
0089
0090 typedef std::vector<std::string> vstring;
0091 const std::string hitsProducer;
0092 const vstring trackerContainers;
0093 const TrackerGeometry* pDD = nullptr;
0094 const MagneticField* pSetup = nullptr;
0095 std::map<unsigned int, PixelGeomDetUnit const*> detectorUnits;
0096 CLHEP::HepRandomEngine* randomEngine_ = nullptr;
0097
0098 std::unique_ptr<PileupMixingContent> PileupInfo_;
0099
0100 const bool pilotBlades;
0101 const int NumberOfEndcapDisks;
0102
0103 const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
0104 const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> pDDToken_;
0105 const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> pSetupToken_;
0106
0107
0108 };
0109 }
0110
0111 #endif