CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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(
82  edm::DetSet<SiStripDigi>& outDigis,
83  edm::DetSet<SiStripRawDigi>& outRawDigis,
85  const StripGeomDetUnit* stripdet,
90  std::vector<std::pair<int,std::bitset<6>>> & theAffectedAPVvector,
91  CLHEP::HepRandomEngine*);
92 
94 
95  // ParticleDataTable
97  theSiHitDigitizer->setParticleDataTable(pardt);
98  pdt= pardt;
99  }
100 
101  private:
103  const double theThreshold;
104  const double cmnRMStib;
105  const double cmnRMStob;
106  const double cmnRMStid;
107  const double cmnRMStec;
109  const bool 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  {
156  unsigned int trackID;
160  unsigned int tofBin; // Needed along with subDet to determine which PSimHit collection simHitGlobalIndex indexes
161  };
162 
163  typedef std::map<int, std::vector<AssociationInfo> > AssociationInfoForChannel;
164  typedef std::map<uint32_t, AssociationInfoForChannel> AssociationInfoForDetId;
167 
169 
170  std::ifstream APVProbaFile;
171  std::map < int , float> mapOfAPVprobabilities;
172  std::map < int , std::bitset<6> > SiStripTrackerAffectedAPVMap;
174 };
175 
176 #endif
std::map< int, float > mapOfAPVprobabilities
const std::unique_ptr< SiPileUpSignals > theSiPileUpSignals
std::vector< SiStripDigi > DigitalVecType
void digitize(edm::DetSet< SiStripDigi > &outDigis, edm::DetSet< SiStripRawDigi > &outRawDigis, edm::DetSet< StripDigiSimLink > &outLink, const StripGeomDetUnit *stripdet, edm::ESHandle< SiStripGain > &, edm::ESHandle< SiStripThreshold > &, edm::ESHandle< SiStripNoises > &, edm::ESHandle< SiStripPedestals > &, std::vector< std::pair< int, std::bitset< 6 >>> &theAffectedAPVvector, CLHEP::HepRandomEngine *)
edm::ESHandle< SiStripLorentzAngle > lorentzAngleHandle
std::map< unsigned int, std::vector< bool > > allHIPChannels
HepPDT::ParticleDataTable ParticleDataTable
AssociationInfoForDetId associationInfoForDetId_
Structure that holds the information on the SimTrack contributions. Only filled if makeDigiSimLinks_ ...
std::map< int, std::bitset< 6 > > SiStripTrackerAffectedAPVMap
SiDigitalConverter::DigitalRawVecType DigitalRawVecType
SiDigitalConverter::DigitalVecType DigitalVecType
void initializeEvent(const edm::EventSetup &iSetup)
void initializeDetUnit(StripGeomDetUnit const *det, const edm::EventSetup &iSetup)
std::map< int, float, std::less< int > > hit_map_type
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
const std::unique_ptr< SiTrivialDigitalConverter > theSiDigitalConverter
SiPileUpSignals::SignalMapType SignalMapType
const std::unique_ptr< SiStripFedZeroSuppression > theSiZeroSuppress
std::vector< SiStripRawDigi > DigitalRawVecType
void calculateInstlumiScale(PileupMixingContent *puInfo)
std::map< unsigned int, std::vector< bool > > allBadChannels
HepPDT::ParticleData ParticleData
void setParticleDataTable(const ParticleDataTable *pardt)
std::map< int, std::vector< AssociationInfo > > AssociationInfoForChannel
SiStripDigitizerAlgorithm(const edm::ParameterSet &conf)
std::map< unsigned int, size_t > lastChannelsWithSignal
void accumulateSimHits(const std::vector< PSimHit >::const_iterator inputBegin, const std::vector< PSimHit >::const_iterator inputEnd, size_t inputBeginGlobalIndex, unsigned int tofBin, const StripGeomDetUnit *stripdet, const GlobalVector &bfield, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
std::map< uint32_t, AssociationInfoForChannel > AssociationInfoForDetId
const ParticleDataTable * pdt
size_t simHitGlobalIndex
The array index of the sim hit, but in the array for all crossings.