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 
28 #include "SiHitDigitizer.h"
36 
37 #include <iostream>
38 #include <fstream>
39 
40 class TrackerTopology;
41 
42 namespace edm {
43  class EventSetup;
44 }
45 
47 class StripDigiSimLink;
48 
49 namespace CLHEP {
50  class HepRandomEngine;
51 }
52 
54 public:
58  typedef std::map<int, float, std::less<int>> hit_map_type;
59  typedef float Amplitude;
60 
61  // Constructor
63 
64  // Destructor
66 
67  void initializeDetUnit(StripGeomDetUnit const* det, const edm::EventSetup& iSetup);
68 
69  void initializeEvent(const edm::EventSetup& iSetup);
70 
71  //run the algorithm to digitize a single det
72  void accumulateSimHits(const std::vector<PSimHit>::const_iterator inputBegin,
73  const std::vector<PSimHit>::const_iterator inputEnd,
74  size_t inputBeginGlobalIndex,
75  unsigned int tofBin,
76  const StripGeomDetUnit* stripdet,
77  const GlobalVector& bfield,
78  const TrackerTopology* tTopo,
79  CLHEP::HepRandomEngine*);
80 
81  void digitize(edm::DetSet<SiStripDigi>& outDigis,
82  edm::DetSet<SiStripRawDigi>& outRawDigis,
84  const StripGeomDetUnit* stripdet,
89  std::vector<std::pair<int, std::bitset<6>>>& theAffectedAPVvector,
90  CLHEP::HepRandomEngine*);
91 
92  void calculateInstlumiScale(PileupMixingContent* puInfo);
93 
94  // ParticleDataTable
96  theSiHitDigitizer->setParticleDataTable(pardt);
97  pdt = pardt;
98  }
99 
100 private:
102  const double theThreshold;
103  const double cmnRMStib;
104  const double cmnRMStob;
105  const double cmnRMStid;
106  const double cmnRMStec;
108  const bool
109  makeDigiSimLinks_; //< Whether or not to create the association to sim truth collection. Set in configuration.
110  const bool peakMode;
111  const bool noise;
112  const bool RealPedestals;
113  const bool SingleStripNoise;
114  const bool CommonModeNoise;
115  const bool BaselineShift;
117 
118  const int theFedAlgo;
119  const bool zeroSuppression;
120  const double theElectronPerADC;
121  const double theTOFCutForPeak;
123  const double tofCut;
124  const double cosmicShift;
125  const double inefficiency;
126  const double pedOffset;
127  const bool PreMixing_;
128 
131 
135 
136  const std::unique_ptr<SiHitDigitizer> theSiHitDigitizer;
137  const std::unique_ptr<SiPileUpSignals> theSiPileUpSignals;
138  const std::unique_ptr<const SiGaussianTailNoiseAdder> theSiNoiseAdder;
139  const std::unique_ptr<SiTrivialDigitalConverter> theSiDigitalConverter;
140  const std::unique_ptr<SiStripFedZeroSuppression> theSiZeroSuppress;
141 
142  // bad channels for each detector ID
143  std::map<unsigned int, std::vector<bool>> allBadChannels;
144  std::map<unsigned int, std::vector<bool>> allHIPChannels;
145  // first and last channel wit signal for each detector ID
146  std::map<unsigned int, size_t> firstChannelsWithSignal;
147  std::map<unsigned int, size_t> lastChannelsWithSignal;
148 
149  // ESHandles
151 
155  unsigned int trackID;
159  unsigned int tofBin; // Needed along with subDet to determine which PSimHit collection simHitGlobalIndex indexes
160  };
161 
162  typedef std::map<int, std::vector<AssociationInfo>> AssociationInfoForChannel;
163  typedef std::map<uint32_t, AssociationInfoForChannel> AssociationInfoForDetId;
165  AssociationInfoForDetId associationInfoForDetId_;
166 
168 
169  std::ifstream APVProbaFile;
170  std::map<int, float> mapOfAPVprobabilities;
171  std::map<int, std::bitset<6>> SiStripTrackerAffectedAPVMap;
173 };
174 
175 #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.