CMS 3D CMS Logo

SiStripDigitizer.h
Go to the documentation of this file.
1 #ifndef SiStripDigitizer_h
2 #define SiStripDigitizer_h
3 
4 #include <map>
5 #include <memory>
6 #include <string>
7 #include <vector>
8 #include <bitset>
24 
25 class TrackerTopology;
26 
27 namespace CLHEP {
28  class HepRandomEngine;
29 }
30 
31 namespace edm {
32  class ConsumesCollector;
33  class Event;
34  class EventSetup;
35  class ParameterSet;
36  template <typename T>
37  class Handle;
38  class StreamID;
39 } // namespace edm
40 
41 class MagneticField;
43 class PSimHit;
45 class StripGeomDetUnit;
46 class TrackerGeometry;
47 class SiStripBadStrip;
48 
58 public:
60 
61  ~SiStripDigitizer() override;
62 
63  void initializeEvent(edm::Event const& e, edm::EventSetup const& c) override;
64  void accumulate(edm::Event const& e, edm::EventSetup const& c) override;
65  void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c, edm::StreamID const&) override;
66  void finalizeEvent(edm::Event& e, edm::EventSetup const& c) override;
67 
68  void StorePileupInformation(std::vector<int>& numInteractionList,
69  std::vector<int>& bunchCrossingList,
70  std::vector<float>& TrueInteractionList,
71  std::vector<edm::EventID>& eventInfoList,
72  int bunchSpacing) override {
73  PileupInfo_ = std::make_unique<PileupMixingContent>(
74  numInteractionList, bunchCrossingList, TrueInteractionList, eventInfoList, bunchSpacing);
75  }
76 
77  PileupMixingContent* getEventPileupInfo() override { return PileupInfo_.get(); }
78 
79 private:
80  void accumulateStripHits(edm::Handle<std::vector<PSimHit>>,
81  const TrackerTopology* tTopo,
82  size_t globalSimHitIndex,
83  const unsigned int tofBin);
84 
85  typedef std::vector<std::string> vstring;
86  typedef std::map<unsigned int, std::vector<std::pair<const PSimHit*, int>>, std::less<unsigned int>> simhit_map;
87  typedef simhit_map::iterator simhit_map_iterator;
88 
95  const bool useConfFromDB;
96  const bool zeroSuppression;
97  const bool makeDigiSimLinks_;
99  const double fracOfEventsToSimAPV_;
110 
111  unsigned long long ddCacheID_ = 0;
112  unsigned long long deadChannelCacheID_ = 0;
113 
115 
123  std::map<std::string, size_t> crossingSimHitIndexOffset_;
124 
125  std::unique_ptr<SiStripDigitizerAlgorithm> theDigiAlgo;
126  std::map<uint32_t, std::vector<int>> theDetIdList;
127  const TrackerGeometry* pDD = nullptr;
128  const MagneticField* pSetup = nullptr;
129  std::map<unsigned int, StripGeomDetUnit const*> detectorUnits;
130  CLHEP::HepRandomEngine* randomEngine_ = nullptr;
131  std::vector<std::pair<int, std::bitset<6>>> theAffectedAPVvector;
132 
133  std::unique_ptr<PileupMixingContent> PileupInfo_;
134 };
135 
136 #endif
void StorePileupInformation(std::vector< int > &numInteractionList, std::vector< int > &bunchCrossingList, std::vector< float > &TrueInteractionList, std::vector< edm::EventID > &eventInfoList, int bunchSpacing) override
const vstring trackerContainers
unsigned long long deadChannelCacheID_
Whether or not to create the association to sim truth collection. Set in configuration.
const std::string ZSDigi
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const bool zeroSuppression
void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
const std::string hitsProducer
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override
void accumulate(edm::Event const &e, edm::EventSetup const &c) override
std::map< unsigned int, StripGeomDetUnit const * > detectorUnits
const MagneticField * pSetup
const bool useConfFromDB
std::map< uint32_t, std::vector< int > > theDetIdList
std::map< unsigned int, std::vector< std::pair< const PSimHit *, int > >, std::less< unsigned int > > simhit_map
const edm::ESGetToken< SiStripBadStrip, SiStripBadChannelRcd > deadChannelToken_
edm::ESGetToken< SiStripApvSimulationParameters, SiStripApvSimulationParametersRcd > apvSimulationParametersToken_
CLHEP::HepRandomEngine * randomEngine_
const bool includeAPVSimulation_
simhit_map::iterator simhit_map_iterator
Accumulator to perform digitisation on the strip tracker sim hits.
const TrackerGeometry * pDD
void accumulateStripHits(edm::Handle< std::vector< PSimHit >>, const TrackerTopology *tTopo, size_t globalSimHitIndex, const unsigned int tofBin)
const edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd > pedestalToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
~SiStripDigitizer() override
std::unique_ptr< SiStripDigitizerAlgorithm > theDigiAlgo
const std::string VRDigi
const std::string PRDigi
std::vector< std::pair< int, std::bitset< 6 > > > theAffectedAPVvector
unsigned long long ddCacheID_
std::vector< std::string > vstring
HLT enums.
const edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noiseToken_
const double fracOfEventsToSimAPV_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > pSetupToken_
std::map< std::string, size_t > crossingSimHitIndexOffset_
Offset to add to the index of each sim hit to account for which crossing it&#39;s in. ...
const edm::ESGetToken< SiStripThreshold, SiStripThresholdRcd > thresholdToken_
const bool makeDigiSimLinks_
SiStripDigitizer(const edm::ParameterSet &conf, edm::ProducesCollector, edm::ConsumesCollector &iC)
const edm::ESGetToken< SiStripGain, SiStripGainSimRcd > gainToken_
PileupMixingContent * getEventPileupInfo() override
std::unique_ptr< PileupMixingContent > PileupInfo_
const std::string SCDigi