CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
57 public:
59 
60  ~SiStripDigitizer() override;
61 
62  void initializeEvent(edm::Event const& e, edm::EventSetup const& c) override;
63  void accumulate(edm::Event const& e, edm::EventSetup const& c) override;
64  void accumulate(PileUpEventPrincipal const& e, edm::EventSetup const& c, edm::StreamID const&) override;
65  void finalizeEvent(edm::Event& e, edm::EventSetup const& c) override;
66 
67  void StorePileupInformation(std::vector<int>& numInteractionList,
68  std::vector<int>& bunchCrossingList,
69  std::vector<float>& TrueInteractionList,
70  std::vector<edm::EventID>& eventInfoList,
71  int bunchSpacing) override {
72  PileupInfo_ = std::make_unique<PileupMixingContent>(
73  numInteractionList, bunchCrossingList, TrueInteractionList, eventInfoList, bunchSpacing);
74  }
75 
76  PileupMixingContent* getEventPileupInfo() override { return PileupInfo_.get(); }
77 
78 private:
79  void accumulateStripHits(edm::Handle<std::vector<PSimHit>>,
80  const TrackerTopology* tTopo,
81  size_t globalSimHitIndex,
82  const unsigned int tofBin);
83 
84  typedef std::vector<std::string> vstring;
85  typedef std::map<unsigned int, std::vector<std::pair<const PSimHit*, int>>, std::less<unsigned int>> simhit_map;
86  typedef simhit_map::iterator simhit_map_iterator;
87 
94  const bool useConfFromDB;
95  const bool zeroSuppression;
96  const bool makeDigiSimLinks_;
98  const double fracOfEventsToSimAPV_;
108 
110 
118  std::map<std::string, size_t> crossingSimHitIndexOffset_;
119 
120  std::unique_ptr<SiStripDigitizerAlgorithm> theDigiAlgo;
121  std::map<uint32_t, std::vector<int>> theDetIdList;
122  const TrackerGeometry* pDD = nullptr;
123  const MagneticField* pSetup = nullptr;
124  std::map<unsigned int, StripGeomDetUnit const*> detectorUnits;
125  CLHEP::HepRandomEngine* randomEngine_ = nullptr;
126  std::vector<std::pair<int, std::bitset<6>>> theAffectedAPVvector;
127 
128  std::unique_ptr<PileupMixingContent> PileupInfo_;
129 };
130 
131 #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
const std::string ZSDigi
const edm::EventSetup & c
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
edm::ESGetToken< SiStripApvSimulationParameters, SiStripApvSimulationParametersRcd > apvSimulationParametersToken_
Whether or not to create the association to sim truth collection. Set in configuration.
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
std::vector< std::string > vstring
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