CMS 3D CMS Logo

SiStripDigitizerAlgorithm.h
Go to the documentation of this file.
1 #ifndef SiStripDigitizerAlgorithm_h
2 #define SiStripDigitizerAlgorithm_h
3 
10 #include <memory>
11 #include <string>
12 
14 
29 #include "SiHitDigitizer.h"
38 
39 #include "TH1F.h"
40 
41 #include <iostream>
42 #include <fstream>
43 
44 class TrackerTopology;
45 
46 namespace edm {
47  class EventSetup;
48 }
49 
51 class StripDigiSimLink;
52 
53 namespace CLHEP {
54  class HepRandomEngine;
55 }
56 
58 public:
62  typedef std::map<int, float, std::less<int>> hit_map_type;
63  typedef float Amplitude;
64 
65  // Constructor
67 
68  // Destructor
70 
71  void initializeDetUnit(StripGeomDetUnit const* det, const edm::EventSetup& iSetup);
72 
73  void initializeEvent(const edm::EventSetup& iSetup);
74 
75  //run the algorithm to digitize a single det
76  void accumulateSimHits(const std::vector<PSimHit>::const_iterator inputBegin,
77  const std::vector<PSimHit>::const_iterator inputEnd,
78  size_t inputBeginGlobalIndex,
79  unsigned int tofBin,
80  const StripGeomDetUnit* stripdet,
81  const GlobalVector& bfield,
82  const TrackerTopology* tTopo,
83  CLHEP::HepRandomEngine*);
84 
85  void digitize(edm::DetSet<SiStripDigi>& outDigis,
86  edm::DetSet<SiStripRawDigi>& outRawDigis,
87  edm::DetSet<SiStripRawDigi>& outStripAmplitudes,
88  edm::DetSet<SiStripRawDigi>& outStripAmplitudesPostAPV,
89  edm::DetSet<SiStripRawDigi>& outStripAPVBaselines,
91  const StripGeomDetUnit* stripdet,
96  bool simulateAPVInThisEvent,
98  std::vector<std::pair<int, std::bitset<6>>>& theAffectedAPVvector,
99  CLHEP::HepRandomEngine*,
100  const TrackerTopology* tTopo);
101 
102  void calculateInstlumiScale(PileupMixingContent* puInfo);
103 
104  // ParticleDataTable
106  theSiHitDigitizer->setParticleDataTable(pardt);
107  pdt = pardt;
108  }
109 
110 private:
112  const double theThreshold;
113  const double cmnRMStib;
114  const double cmnRMStob;
115  const double cmnRMStid;
116  const double cmnRMStec;
118  const bool
119  makeDigiSimLinks_; //< Whether or not to create the association to sim truth collection. Set in configuration.
120  const bool peakMode;
121  const bool noise;
122  const bool RealPedestals;
123  const bool SingleStripNoise;
124  const bool CommonModeNoise;
125  const bool BaselineShift;
127 
128  const int theFedAlgo;
129  const bool zeroSuppression;
130  const double theElectronPerADC;
131 
132  const double theTOFCutForPeak;
134  const double tofCut;
135  const double cosmicShift;
136  const double inefficiency;
137  const double pedOffset;
138  const bool PreMixing_;
139 
142 
146 
147  const std::unique_ptr<SiHitDigitizer> theSiHitDigitizer;
148  const std::unique_ptr<SiPileUpSignals> theSiPileUpSignals;
149  const std::unique_ptr<const SiGaussianTailNoiseAdder> theSiNoiseAdder;
150  const std::unique_ptr<SiTrivialDigitalConverter> theSiDigitalConverter;
151  const std::unique_ptr<SiStripFedZeroSuppression> theSiZeroSuppress;
152 
153  // bad channels for each detector ID
154  std::map<unsigned int, std::vector<bool>> allBadChannels;
155  std::map<unsigned int, std::vector<bool>> allHIPChannels;
156  // first and last channel wit signal for each detector ID
157  std::map<unsigned int, size_t> firstChannelsWithSignal;
158  std::map<unsigned int, size_t> lastChannelsWithSignal;
159 
160  // ESHandles
162 
166  unsigned int trackID;
170  unsigned int tofBin; // Needed along with subDet to determine which PSimHit collection simHitGlobalIndex indexes
171  };
172 
173  typedef std::map<int, std::vector<AssociationInfo>> AssociationInfoForChannel;
174  typedef std::map<uint32_t, AssociationInfoForChannel> AssociationInfoForDetId;
176  AssociationInfoForDetId associationInfoForDetId_;
177 
179 
180  std::ifstream APVProbaFile;
181  std::map<int, float> mapOfAPVprobabilities;
182  std::map<int, std::bitset<6>> SiStripTrackerAffectedAPVMap;
184 
186  const double apv_maxResponse_;
187  const double apv_rate_;
188  const double apv_mVPerQ_;
189  const double apv_fCPerElectron_;
190  unsigned int nTruePU_;
191 };
192 
193 #endif
const std::unique_ptr< SiPileUpSignals > theSiPileUpSignals
std::vector< SiStripDigi > DigitalVecType
edm::ESHandle< SiStripLorentzAngle > lorentzAngleHandle
std::map< unsigned int, std::vector< bool > > allHIPChannels
std::map< int, float > mapOfAPVprobabilities
HepPDT::ParticleDataTable ParticleDataTable
AssociationInfoForDetId associationInfoForDetId_
Structure that holds the information on the SimTrack contributions. Only filled if makeDigiSimLinks_ ...
SiDigitalConverter::DigitalRawVecType DigitalRawVecType
SiDigitalConverter::DigitalVecType DigitalVecType
const std::unique_ptr< const SiGaussianTailNoiseAdder > theSiNoiseAdder
const std::unique_ptr< SiHitDigitizer > theSiHitDigitizer
std::map< unsigned int, size_t > firstChannelsWithSignal
std::map< int, Amplitude > SignalMapType
std::map< int, float, std::less< int > > hit_map_type
const std::unique_ptr< SiTrivialDigitalConverter > theSiDigitalConverter
SiPileUpSignals::SignalMapType SignalMapType
const std::unique_ptr< SiStripFedZeroSuppression > theSiZeroSuppress
std::vector< SiStripRawDigi > DigitalRawVecType
std::map< unsigned int, std::vector< bool > > allBadChannels
HepPDT::ParticleData ParticleData
void setParticleDataTable(const ParticleDataTable *pardt)
std::map< int, std::vector< AssociationInfo > > AssociationInfoForChannel
HLT enums.
std::map< unsigned int, size_t > lastChannelsWithSignal
std::map< uint32_t, AssociationInfoForChannel > AssociationInfoForDetId
std::map< int, std::bitset< 6 > > SiStripTrackerAffectedAPVMap
const ParticleDataTable * pdt
size_t simHitGlobalIndex
The array index of the sim hit, but in the array for all crossings.