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 
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;
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
Vector3DBase
Definition: Vector3DBase.h:8
SiStripDigitizerAlgorithm::firstChannelsWithSignal
std::map< unsigned int, size_t > firstChannelsWithSignal
Definition: SiStripDigitizerAlgorithm.h:157
SiStripDigitizerAlgorithm::APVSaturationProbScaling_
const double APVSaturationProbScaling_
Definition: SiStripDigitizerAlgorithm.h:117
SiStripDigitizerAlgorithm::NumberOfBxBetweenHIPandEvent
int NumberOfBxBetweenHIPandEvent
Definition: SiStripDigitizerAlgorithm.h:183
SiStripDigitizerAlgorithm::PreMixing_
const bool PreMixing_
Definition: SiStripDigitizerAlgorithm.h:138
StripGeomDetUnit.h
SiStripDigitizerAlgorithm::CommonModeNoise
const bool CommonModeNoise
Definition: SiStripDigitizerAlgorithm.h:124
SiStripDigitizerAlgorithm::makeDigiSimLinks_
const bool makeDigiSimLinks_
Definition: SiStripDigitizerAlgorithm.h:119
SiStripDigitizerAlgorithm::includeAPVSimulation_
bool includeAPVSimulation_
Definition: SiStripDigitizerAlgorithm.h:185
TrackerGeometry.h
SiStripDigitizerAlgorithm::noise
const bool noise
Definition: SiStripDigitizerAlgorithm.h:121
SiStripDigitizerAlgorithm::SingleStripNoise
const bool SingleStripNoise
Definition: SiStripDigitizerAlgorithm.h:123
SiStripDigitizerAlgorithm::AssociationInfoForDetId
std::map< uint32_t, AssociationInfoForChannel > AssociationInfoForDetId
Definition: SiStripDigitizerAlgorithm.h:174
SiStripGain.h
edm::DetSet< SiStripDigi >
SiStripDigitizerAlgorithm::particle
const ParticleData * particle
Definition: SiStripDigitizerAlgorithm.h:141
SiStripDigitizerAlgorithm::allHIPChannels
std::map< unsigned int, std::vector< bool > > allHIPChannels
Definition: SiStripDigitizerAlgorithm.h:155
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackerTopology
Definition: TrackerTopology.h:16
SiStripRawDigi.h
GeomDetType.h
SiStripDigitizerAlgorithm::BaselineShift
const bool BaselineShift
Definition: SiStripDigitizerAlgorithm.h:125
SiStripDigitizerAlgorithm::AssociationInfo::trackID
unsigned int trackID
Definition: SiStripDigitizerAlgorithm.h:166
SiStripDigitizerAlgorithm::apv_rate_
const double apv_rate_
Definition: SiStripDigitizerAlgorithm.h:187
SiStripDigitizerAlgorithm::digitize
void digitize(edm::DetSet< SiStripDigi > &outDigis, edm::DetSet< SiStripRawDigi > &outRawDigis, edm::DetSet< SiStripRawDigi > &outStripAmplitudes, edm::DetSet< SiStripRawDigi > &outStripAmplitudesPostAPV, edm::DetSet< SiStripRawDigi > &outStripAPVBaselines, edm::DetSet< StripDigiSimLink > &outLink, const StripGeomDetUnit *stripdet, edm::ESHandle< SiStripGain > &, edm::ESHandle< SiStripThreshold > &, edm::ESHandle< SiStripNoises > &, edm::ESHandle< SiStripPedestals > &, bool simulateAPVInThisEvent, edm::ESHandle< SiStripApvSimulationParameters > &, std::vector< std::pair< int, std::bitset< 6 >>> &theAffectedAPVvector, CLHEP::HepRandomEngine *, const TrackerTopology *tTopo)
Definition: SiStripDigitizerAlgorithm.cc:285
SiStripNoises.h
SiStripDigitizerAlgorithm::associationInfoForDetId_
AssociationInfoForDetId associationInfoForDetId_
Structure that holds the information on the SimTrack contributions. Only filled if makeDigiSimLinks_ ...
Definition: SiStripDigitizerAlgorithm.h:176
SiStripDigitizerAlgorithm::calculateInstlumiScale
void calculateInstlumiScale(PileupMixingContent *puInfo)
Definition: SiStripDigitizerAlgorithm.cc:249
StripTopology.h
SiStripBadStrip.h
SiStripDigitizerAlgorithm::theTOFCutForDeconvolution
const double theTOFCutForDeconvolution
Definition: SiStripDigitizerAlgorithm.h:133
SiStripDigitizerAlgorithm::theThreshold
const double theThreshold
Definition: SiStripDigitizerAlgorithm.h:112
SiStripDigitizerAlgorithm::initializeDetUnit
void initializeDetUnit(StripGeomDetUnit const *det, const edm::EventSetup &iSetup)
Definition: SiStripDigitizerAlgorithm.cc:109
ParticleData
HepPDT::ParticleData ParticleData
Definition: ParticleDataTable.h:9
SiStripDigitizerAlgorithm::cmnRMStib
const double cmnRMStib
Definition: SiStripDigitizerAlgorithm.h:113
SiStripDigitizerAlgorithm::apv_mVPerQ_
const double apv_mVPerQ_
Definition: SiStripDigitizerAlgorithm.h:188
EncodedEventId
Definition: EncodedEventId.h:11
edm::FileInPath
Definition: FileInPath.h:64
SiStripDigitizerAlgorithm::AssociationInfo::simHitGlobalIndex
size_t simHitGlobalIndex
The array index of the sim hit, but in the array for all crossings.
Definition: SiStripDigitizerAlgorithm.h:169
SiStripDigitizerAlgorithm::pdt
const ParticleDataTable * pdt
Definition: SiStripDigitizerAlgorithm.h:140
SiStripLorentzAngle
Definition: SiStripLorentzAngle.h:26
PSimHit.h
SiStripDigitizerAlgorithm::lastChannelsWithSignal
std::map< unsigned int, size_t > lastChannelsWithSignal
Definition: SiStripDigitizerAlgorithm.h:158
SiStripFedZeroSuppression.h
SiStripDigitizerAlgorithm::theFedAlgo
const int theFedAlgo
Definition: SiStripDigitizerAlgorithm.h:128
SiStripDigitizerAlgorithm::AssociationInfo
Definition: SiStripDigitizerAlgorithm.h:165
SiStripDigitizerAlgorithm::hit_map_type
std::map< int, float, std::less< int > > hit_map_type
Definition: SiStripDigitizerAlgorithm.h:62
SiStripDigitizerAlgorithm::DigitalRawVecType
SiDigitalConverter::DigitalRawVecType DigitalRawVecType
Definition: SiStripDigitizerAlgorithm.h:60
SiStripDigi.h
SiStripDigitizerAlgorithm::theElectronPerADC
const double theElectronPerADC
Definition: SiStripDigitizerAlgorithm.h:130
SiStripDigitizerAlgorithm::Amplitude
float Amplitude
Definition: SiStripDigitizerAlgorithm.h:63
SiStripDigitizerAlgorithm::cmnRMStid
const double cmnRMStid
Definition: SiStripDigitizerAlgorithm.h:115
edm::ESHandle< SiStripGain >
SiStripDigitizerAlgorithm::tofCut
const double tofCut
Definition: SiStripDigitizerAlgorithm.h:134
SiStripDigitizerAlgorithm::nTruePU_
unsigned int nTruePU_
Definition: SiStripDigitizerAlgorithm.h:190
SiPileUpSignals.h
SiStripDigitizerAlgorithm::~SiStripDigitizerAlgorithm
~SiStripDigitizerAlgorithm()
Definition: SiStripDigitizerAlgorithm.cc:107
SiHitDigitizer.h
SiStripThreshold.h
SiStripDigitizerAlgorithm::allBadChannels
std::map< unsigned int, std::vector< bool > > allBadChannels
Definition: SiStripDigitizerAlgorithm.h:154
CLHEP
Definition: CocoaGlobals.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripDigitizerAlgorithm::inefficiency
const double inefficiency
Definition: SiStripDigitizerAlgorithm.h:136
SiStripDigitizerAlgorithm::FirstLumiCalc_
bool FirstLumiCalc_
Definition: SiStripDigitizerAlgorithm.h:144
SiDigitalConverter::DigitalVecType
std::vector< SiStripDigi > DigitalVecType
Definition: SiDigitalConverter.h:14
SiStripDigitizerAlgorithm::theSiDigitalConverter
const std::unique_ptr< SiTrivialDigitalConverter > theSiDigitalConverter
Definition: SiStripDigitizerAlgorithm.h:150
SiStripDigitizerAlgorithm::AssociationInfoForChannel
std::map< int, std::vector< AssociationInfo > > AssociationInfoForChannel
Definition: SiStripDigitizerAlgorithm.h:173
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripDigitizerAlgorithm::pedOffset
const double pedOffset
Definition: SiStripDigitizerAlgorithm.h:137
ParticleDataTable.h
SiStripDigitizerAlgorithm::RealPedestals
const bool RealPedestals
Definition: SiStripDigitizerAlgorithm.h:122
SiStripDigitizerAlgorithm::theSiHitDigitizer
const std::unique_ptr< SiHitDigitizer > theSiHitDigitizer
Definition: SiStripDigitizerAlgorithm.h:147
SiStripDigitizerAlgorithm::apv_maxResponse_
const double apv_maxResponse_
Definition: SiStripDigitizerAlgorithm.h:186
SiStripDigitizerAlgorithm::theSiZeroSuppress
const std::unique_ptr< SiStripFedZeroSuppression > theSiZeroSuppress
Definition: SiStripDigitizerAlgorithm.h:151
PileupMixingContent
Definition: PileupMixingContent.h:24
SiStripDigitizerAlgorithm::SiStripDigitizerAlgorithm
SiStripDigitizerAlgorithm(const edm::ParameterSet &conf)
Definition: SiStripDigitizerAlgorithm.cc:38
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
SiStripDigitizerAlgorithm::setParticleDataTable
void setParticleDataTable(const ParticleDataTable *pardt)
Definition: SiStripDigitizerAlgorithm.h:105
edm::EventSetup
Definition: EventSetup.h:57
SiStripDigitizerAlgorithm::accumulateSimHits
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 *)
Definition: SiStripDigitizerAlgorithm.cc:158
SiStripDigitizerAlgorithm::zeroSuppression
const bool zeroSuppression
Definition: SiStripDigitizerAlgorithm.h:129
SiStripDigitizerAlgorithm::AssociationInfo::contributionToADC
float contributionToADC
Definition: SiStripDigitizerAlgorithm.h:168
SiPileUpSignals::SignalMapType
std::map< int, Amplitude > SignalMapType
Definition: SiPileUpSignals.h:20
SiStripDigitizerAlgorithm::DigitalVecType
SiDigitalConverter::DigitalVecType DigitalVecType
Definition: SiStripDigitizerAlgorithm.h:59
SiStripDigitizerAlgorithm::APVSaturationFromHIP
const bool APVSaturationFromHIP
Definition: SiStripDigitizerAlgorithm.h:126
SiStripDigitizerAlgorithm::theSiPileUpSignals
const std::unique_ptr< SiPileUpSignals > theSiPileUpSignals
Definition: SiStripDigitizerAlgorithm.h:148
GeomDet.h
SiStripDigitizerAlgorithm::cmnRMStob
const double cmnRMStob
Definition: SiStripDigitizerAlgorithm.h:114
DetId.h
SiStripDigitizerAlgorithm::mapOfAPVprobabilities
std::map< int, float > mapOfAPVprobabilities
Definition: SiStripDigitizerAlgorithm.h:181
SiStripDigitizerAlgorithm::APVSaturationProb_
double APVSaturationProb_
Definition: SiStripDigitizerAlgorithm.h:143
SiStripDigitizerAlgorithm::cmnRMStec
const double cmnRMStec
Definition: SiStripDigitizerAlgorithm.h:116
SiStripDigitizerAlgorithm::theSiNoiseAdder
const std::unique_ptr< const SiGaussianTailNoiseAdder > theSiNoiseAdder
Definition: SiStripDigitizerAlgorithm.h:149
SiStripPedestals.h
SiStripApvSimulationParameters.h
SiStripDigitizerAlgorithm::lorentzAngleHandle
edm::ESHandle< SiStripLorentzAngle > lorentzAngleHandle
Definition: SiStripDigitizerAlgorithm.h:161
SiStripDigitizerAlgorithm::lorentzAngleName
const std::string lorentzAngleName
Definition: SiStripDigitizerAlgorithm.h:111
SiStripDigitizerAlgorithm::FirstDigitize_
bool FirstDigitize_
Definition: SiStripDigitizerAlgorithm.h:145
SiStripDigitizerAlgorithm::AssociationInfo::tofBin
unsigned int tofBin
Definition: SiStripDigitizerAlgorithm.h:170
PileupMixingContent.h
SiStripDigitizerAlgorithm::AssociationInfo::eventID
EncodedEventId eventID
Definition: SiStripDigitizerAlgorithm.h:167
DetSet.h
SiStripDigitizerAlgorithm::theTOFCutForPeak
const double theTOFCutForPeak
Definition: SiStripDigitizerAlgorithm.h:132
EventSetup
ParameterSet.h
SiStripDigitizerAlgorithm::apv_fCPerElectron_
const double apv_fCPerElectron_
Definition: SiStripDigitizerAlgorithm.h:189
SiGaussianTailNoiseAdder.h
SiTrivialDigitalConverter.h
SiStripDigitizerAlgorithm::peakMode
const bool peakMode
Definition: SiStripDigitizerAlgorithm.h:120
ParticleDataTable
HepPDT::ParticleDataTable ParticleDataTable
Definition: ParticleDataTable.h:8
SiStripDigitizerAlgorithm
Definition: SiStripDigitizerAlgorithm.h:57
SiStripDigitizerAlgorithm::APVProbabilityFile
edm::FileInPath APVProbabilityFile
Definition: SiStripDigitizerAlgorithm.h:178
SiStripDigitizerAlgorithm::initializeEvent
void initializeEvent(const edm::EventSetup &iSetup)
Definition: SiStripDigitizerAlgorithm.cc:136
SiDigitalConverter::DigitalRawVecType
std::vector< SiStripRawDigi > DigitalRawVecType
Definition: SiDigitalConverter.h:15
SiStripDigitizerAlgorithm::SiStripTrackerAffectedAPVMap
std::map< int, std::bitset< 6 > > SiStripTrackerAffectedAPVMap
Definition: SiStripDigitizerAlgorithm.h:182
SiStripDigitizerAlgorithm::cosmicShift
const double cosmicShift
Definition: SiStripDigitizerAlgorithm.h:135
SiStripDigitizerAlgorithm::SignalMapType
SiPileUpSignals::SignalMapType SignalMapType
Definition: SiStripDigitizerAlgorithm.h:61
SiStripDigitizerAlgorithm::APVProbaFile
std::ifstream APVProbaFile
Definition: SiStripDigitizerAlgorithm.h:180
StripGeomDetUnit
Definition: StripGeomDetUnit.h:15