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 
30 #include "SiHitDigitizer.h"
41 
42 #include "TH1F.h"
43 
44 #include <iostream>
45 #include <fstream>
46 
47 class TrackerTopology;
48 
50 class StripDigiSimLink;
51 
52 namespace CLHEP {
53  class HepRandomEngine;
54 }
55 
57 public:
61  typedef std::map<int, float, std::less<int>> hit_map_type;
62  typedef float Amplitude;
63 
64  // Constructor
66 
67  // Destructor
69 
70  void initializeDetUnit(StripGeomDetUnit const* det, const edm::EventSetup& iSetup);
71 
72  void initializeEvent(const edm::EventSetup& iSetup);
73 
74  //run the algorithm to digitize a single det
75  void accumulateSimHits(const std::vector<PSimHit>::const_iterator inputBegin,
76  const std::vector<PSimHit>::const_iterator inputEnd,
77  size_t inputBeginGlobalIndex,
78  unsigned int tofBin,
79  const StripGeomDetUnit* stripdet,
80  const GlobalVector& bfield,
81  const TrackerTopology* tTopo,
82  CLHEP::HepRandomEngine*);
83 
84  void digitize(edm::DetSet<SiStripDigi>& outDigis,
85  edm::DetSet<SiStripRawDigi>& outRawDigis,
86  edm::DetSet<SiStripRawDigi>& outStripAmplitudes,
87  edm::DetSet<SiStripRawDigi>& outStripAmplitudesPostAPV,
88  edm::DetSet<SiStripRawDigi>& outStripAPVBaselines,
90  const StripGeomDetUnit* stripdet,
91  const SiStripGain&,
92  const SiStripThreshold&,
93  const SiStripNoises&,
94  const SiStripPedestals&,
95  bool simulateAPVInThisEvent,
97  std::vector<std::pair<int, std::bitset<6>>>& theAffectedAPVvector,
98  CLHEP::HepRandomEngine*,
99  const TrackerTopology* tTopo);
100 
102 
103  // ParticleDataTable
105  theSiHitDigitizer->setParticleDataTable(pardt);
106  pdt = pardt;
107  }
108 
109 private:
110  const double theThreshold;
111  const double cmnRMStib;
112  const double cmnRMStob;
113  const double cmnRMStid;
114  const double cmnRMStec;
116  const bool
117  makeDigiSimLinks_; //< Whether or not to create the association to sim truth collection. Set in configuration.
118  const bool peakMode;
119  const bool noise;
120  const bool RealPedestals;
121  const bool SingleStripNoise;
122  const bool CommonModeNoise;
123  const bool BaselineShift;
125 
126  const int theFedAlgo;
127  const bool zeroSuppression;
128  const double theElectronPerADC;
129 
130  const double theTOFCutForPeak;
132  const double tofCut;
133  const double cosmicShift;
134  const double inefficiency;
135  const double pedOffset;
136  const bool PreMixing_;
140 
143 
147 
148  const std::unique_ptr<SiHitDigitizer> theSiHitDigitizer;
149  const std::unique_ptr<SiPileUpSignals> theSiPileUpSignals;
150  const std::unique_ptr<const SiGaussianTailNoiseAdder> theSiNoiseAdder;
151  const std::unique_ptr<SiTrivialDigitalConverter> theSiDigitalConverter;
152  const std::unique_ptr<SiStripFedZeroSuppression> theSiZeroSuppress;
153 
154  // bad channels for each detector ID
155  std::map<unsigned int, std::vector<bool>> allBadChannels;
156  std::map<unsigned int, std::vector<bool>> allHIPChannels;
157  // first and last channel wit signal for each detector ID
158  std::map<unsigned int, size_t> firstChannelsWithSignal;
159  std::map<unsigned int, size_t> lastChannelsWithSignal;
160 
161  // ESHandles
163 
167  unsigned int trackID;
171  unsigned int tofBin; // Needed along with subDet to determine which PSimHit collection simHitGlobalIndex indexes
172  };
173 
174  typedef std::map<int, std::vector<AssociationInfo>> AssociationInfoForChannel;
175  typedef std::map<uint32_t, AssociationInfoForChannel> AssociationInfoForDetId;
178 
180 
181  std::ifstream APVProbaFile;
182  std::map<int, float> mapOfAPVprobabilities;
183  std::map<int, std::bitset<6>> SiStripTrackerAffectedAPVMap;
185 
187  const double apv_maxResponse_;
188  const double apv_rate_;
189  const double apv_mVPerQ_;
190  const double apv_fCPerElectron_;
191  unsigned int nTruePU_;
192 };
193 
194 #endif
Vector3DBase
Definition: Vector3DBase.h:8
SiStripDigitizerAlgorithm::firstChannelsWithSignal
std::map< unsigned int, size_t > firstChannelsWithSignal
Definition: SiStripDigitizerAlgorithm.h:158
SiStripDigitizerAlgorithm::APVSaturationProbScaling_
const double APVSaturationProbScaling_
Definition: SiStripDigitizerAlgorithm.h:115
SiStripDigitizerAlgorithm::NumberOfBxBetweenHIPandEvent
int NumberOfBxBetweenHIPandEvent
Definition: SiStripDigitizerAlgorithm.h:184
SiStripDigitizerAlgorithm::PreMixing_
const bool PreMixing_
Definition: SiStripDigitizerAlgorithm.h:136
StripGeomDetUnit.h
SiStripDigitizerAlgorithm::CommonModeNoise
const bool CommonModeNoise
Definition: SiStripDigitizerAlgorithm.h:122
SiStripDigitizerAlgorithm::makeDigiSimLinks_
const bool makeDigiSimLinks_
Definition: SiStripDigitizerAlgorithm.h:117
SiStripDigitizerAlgorithm::includeAPVSimulation_
bool includeAPVSimulation_
Definition: SiStripDigitizerAlgorithm.h:186
TrackerGeometry.h
SiStripDigitizerAlgorithm::noise
const bool noise
Definition: SiStripDigitizerAlgorithm.h:119
SiStripDigitizerAlgorithm::SingleStripNoise
const bool SingleStripNoise
Definition: SiStripDigitizerAlgorithm.h:121
SiStripDigitizerAlgorithm::AssociationInfoForDetId
std::map< uint32_t, AssociationInfoForChannel > AssociationInfoForDetId
Definition: SiStripDigitizerAlgorithm.h:175
SiStripNoises
Definition: SiStripNoises.h:25
SiStripGain.h
edm::DetSet< SiStripDigi >
SiStripGain
Definition: SiStripGain.h:45
SiStripDigitizerAlgorithm::particle
const ParticleData * particle
Definition: SiStripDigitizerAlgorithm.h:142
SiStripDigitizerAlgorithm::allHIPChannels
std::map< unsigned int, std::vector< bool > > allHIPChannels
Definition: SiStripDigitizerAlgorithm.h:156
TrackerTopology
Definition: TrackerTopology.h:16
SiStripRawDigi.h
GeomDetType.h
SiStripDigitizerAlgorithm::BaselineShift
const bool BaselineShift
Definition: SiStripDigitizerAlgorithm.h:123
SiStripDigitizerAlgorithm::AssociationInfo::trackID
unsigned int trackID
Definition: SiStripDigitizerAlgorithm.h:167
SiStripDigitizerAlgorithm::apv_rate_
const double apv_rate_
Definition: SiStripDigitizerAlgorithm.h:188
SiStripNoises.h
SiStripDigitizerAlgorithm::associationInfoForDetId_
AssociationInfoForDetId associationInfoForDetId_
Structure that holds the information on the SimTrack contributions. Only filled if makeDigiSimLinks_ ...
Definition: SiStripDigitizerAlgorithm.h:177
SiStripDigitizerAlgorithm::calculateInstlumiScale
void calculateInstlumiScale(PileupMixingContent *puInfo)
Definition: SiStripDigitizerAlgorithm.cc:248
StripTopology.h
SiStripBadStrip.h
SiStripDigitizerAlgorithm::theTOFCutForDeconvolution
const double theTOFCutForDeconvolution
Definition: SiStripDigitizerAlgorithm.h:131
ESGetToken.h
SiStripDigitizerAlgorithm::theThreshold
const double theThreshold
Definition: SiStripDigitizerAlgorithm.h:110
SiStripDigitizerAlgorithm::initializeDetUnit
void initializeDetUnit(StripGeomDetUnit const *det, const edm::EventSetup &iSetup)
Definition: SiStripDigitizerAlgorithm.cc:111
ParticleData
HepPDT::ParticleData ParticleData
Definition: ParticleDataTable.h:9
SiStripDigitizerAlgorithm::cmnRMStib
const double cmnRMStib
Definition: SiStripDigitizerAlgorithm.h:111
SiStripDigitizerAlgorithm::apv_mVPerQ_
const double apv_mVPerQ_
Definition: SiStripDigitizerAlgorithm.h:189
EncodedEventId
Definition: EncodedEventId.h:11
edm::FileInPath
Definition: FileInPath.h:61
SiStripDigitizerAlgorithm::AssociationInfo::simHitGlobalIndex
size_t simHitGlobalIndex
The array index of the sim hit, but in the array for all crossings.
Definition: SiStripDigitizerAlgorithm.h:170
SiStripDigitizerAlgorithm::pdt
const ParticleDataTable * pdt
Definition: SiStripDigitizerAlgorithm.h:141
SiStripLorentzAngle
Definition: SiStripLorentzAngle.h:26
PSimHit.h
SiStripDigitizerAlgorithm::lastChannelsWithSignal
std::map< unsigned int, size_t > lastChannelsWithSignal
Definition: SiStripDigitizerAlgorithm.h:159
SiStripDigitizerAlgorithm::deadChannelToken_
const edm::ESGetToken< SiStripBadStrip, SiStripBadChannelRcd > deadChannelToken_
Definition: SiStripDigitizerAlgorithm.h:137
SiStripFedZeroSuppression.h
SiStripDigitizerAlgorithm::pdtToken_
const edm::ESGetToken< HepPDT::ParticleDataTable, PDTRecord > pdtToken_
Definition: SiStripDigitizerAlgorithm.h:138
SiStripDigitizerAlgorithm::theFedAlgo
const int theFedAlgo
Definition: SiStripDigitizerAlgorithm.h:126
SiStripDigitizerAlgorithm::AssociationInfo
Definition: SiStripDigitizerAlgorithm.h:166
SiStripDigitizerAlgorithm::hit_map_type
std::map< int, float, std::less< int > > hit_map_type
Definition: SiStripDigitizerAlgorithm.h:61
SiStripDigitizerAlgorithm::DigitalRawVecType
SiDigitalConverter::DigitalRawVecType DigitalRawVecType
Definition: SiStripDigitizerAlgorithm.h:59
SiStripDigi.h
SiStripDigitizerAlgorithm::theElectronPerADC
const double theElectronPerADC
Definition: SiStripDigitizerAlgorithm.h:128
SiStripDigitizerAlgorithm::Amplitude
float Amplitude
Definition: SiStripDigitizerAlgorithm.h:62
SiStripDigitizerAlgorithm::cmnRMStid
const double cmnRMStid
Definition: SiStripDigitizerAlgorithm.h:113
edm::ESHandle< SiStripLorentzAngle >
SiStripDigitizerAlgorithm::tofCut
const double tofCut
Definition: SiStripDigitizerAlgorithm.h:132
SiStripDigitizerAlgorithm::nTruePU_
unsigned int nTruePU_
Definition: SiStripDigitizerAlgorithm.h:191
SiPileUpSignals.h
SiStripDigitizerAlgorithm::~SiStripDigitizerAlgorithm
~SiStripDigitizerAlgorithm()
Definition: SiStripDigitizerAlgorithm.cc:109
SiHitDigitizer.h
SiStripThreshold.h
SiStripDigitizerAlgorithm::allBadChannels
std::map< unsigned int, std::vector< bool > > allBadChannels
Definition: SiStripDigitizerAlgorithm.h:155
CLHEP
Definition: CocoaGlobals.h:27
SiStripDigitizerAlgorithm::inefficiency
const double inefficiency
Definition: SiStripDigitizerAlgorithm.h:134
SiStripDigitizerAlgorithm::FirstLumiCalc_
bool FirstLumiCalc_
Definition: SiStripDigitizerAlgorithm.h:145
SiDigitalConverter::DigitalVecType
std::vector< SiStripDigi > DigitalVecType
Definition: SiDigitalConverter.h:13
SiStripDigitizerAlgorithm::theSiDigitalConverter
const std::unique_ptr< SiTrivialDigitalConverter > theSiDigitalConverter
Definition: SiStripDigitizerAlgorithm.h:151
SiStripDigitizerAlgorithm::AssociationInfoForChannel
std::map< int, std::vector< AssociationInfo > > AssociationInfoForChannel
Definition: SiStripDigitizerAlgorithm.h:174
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripCondDataRecords.h
SiStripDigitizerAlgorithm::pedOffset
const double pedOffset
Definition: SiStripDigitizerAlgorithm.h:135
ParticleDataTable.h
SiStripDigitizerAlgorithm::RealPedestals
const bool RealPedestals
Definition: SiStripDigitizerAlgorithm.h:120
SiStripDigitizerAlgorithm::theSiHitDigitizer
const std::unique_ptr< SiHitDigitizer > theSiHitDigitizer
Definition: SiStripDigitizerAlgorithm.h:148
FrameworkfwdMostUsed.h
SiStripDigitizerAlgorithm::apv_maxResponse_
const double apv_maxResponse_
Definition: SiStripDigitizerAlgorithm.h:187
SiStripDigitizerAlgorithm::theSiZeroSuppress
const std::unique_ptr< SiStripFedZeroSuppression > theSiZeroSuppress
Definition: SiStripDigitizerAlgorithm.h:152
PileupMixingContent
Definition: PileupMixingContent.h:24
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
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, const SiStripGain &, const SiStripThreshold &, const SiStripNoises &, const SiStripPedestals &, bool simulateAPVInThisEvent, const SiStripApvSimulationParameters *, std::vector< std::pair< int, std::bitset< 6 >>> &theAffectedAPVvector, CLHEP::HepRandomEngine *, const TrackerTopology *tTopo)
Definition: SiStripDigitizerAlgorithm.cc:284
SiStripDigitizerAlgorithm::setParticleDataTable
void setParticleDataTable(const ParticleDataTable *pardt)
Definition: SiStripDigitizerAlgorithm.h:104
edm::EventSetup
Definition: EventSetup.h:58
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:157
SiStripDigitizerAlgorithm::zeroSuppression
const bool zeroSuppression
Definition: SiStripDigitizerAlgorithm.h:127
SiStripDigitizerAlgorithm::AssociationInfo::contributionToADC
float contributionToADC
Definition: SiStripDigitizerAlgorithm.h:169
SiPileUpSignals::SignalMapType
std::map< int, Amplitude > SignalMapType
Definition: SiPileUpSignals.h:20
SiStripDigitizerAlgorithm::DigitalVecType
SiDigitalConverter::DigitalVecType DigitalVecType
Definition: SiStripDigitizerAlgorithm.h:58
edm::ESGetToken< SiStripBadStrip, SiStripBadChannelRcd >
SiStripDigitizerAlgorithm::APVSaturationFromHIP
const bool APVSaturationFromHIP
Definition: SiStripDigitizerAlgorithm.h:124
SiStripDigitizerAlgorithm::SiStripDigitizerAlgorithm
SiStripDigitizerAlgorithm(const edm::ParameterSet &conf, edm::ConsumesCollector iC)
Definition: SiStripDigitizerAlgorithm.cc:38
SiStripDigitizerAlgorithm::theSiPileUpSignals
const std::unique_ptr< SiPileUpSignals > theSiPileUpSignals
Definition: SiStripDigitizerAlgorithm.h:149
GeomDet.h
SiStripThreshold
Definition: __init__.py:1
SiStripDigitizerAlgorithm::cmnRMStob
const double cmnRMStob
Definition: SiStripDigitizerAlgorithm.h:112
DetId.h
SiStripDigitizerAlgorithm::mapOfAPVprobabilities
std::map< int, float > mapOfAPVprobabilities
Definition: SiStripDigitizerAlgorithm.h:182
SiStripDigitizerAlgorithm::APVSaturationProb_
double APVSaturationProb_
Definition: SiStripDigitizerAlgorithm.h:144
SiStripDigitizerAlgorithm::cmnRMStec
const double cmnRMStec
Definition: SiStripDigitizerAlgorithm.h:114
SiStripDigitizerAlgorithm::theSiNoiseAdder
const std::unique_ptr< const SiGaussianTailNoiseAdder > theSiNoiseAdder
Definition: SiStripDigitizerAlgorithm.h:150
SiStripPedestals.h
SiStripApvSimulationParameters.h
SiStripDigitizerAlgorithm::lorentzAngleHandle
edm::ESHandle< SiStripLorentzAngle > lorentzAngleHandle
Definition: SiStripDigitizerAlgorithm.h:162
SiStripDigitizerAlgorithm::FirstDigitize_
bool FirstDigitize_
Definition: SiStripDigitizerAlgorithm.h:146
SiStripDigitizerAlgorithm::AssociationInfo::tofBin
unsigned int tofBin
Definition: SiStripDigitizerAlgorithm.h:171
PileupMixingContent.h
SiStripDigitizerAlgorithm::AssociationInfo::eventID
EncodedEventId eventID
Definition: SiStripDigitizerAlgorithm.h:168
DetSet.h
SiStripPedestals
Definition: SiStripPedestals.h:27
SiStripDigitizerAlgorithm::theTOFCutForPeak
const double theTOFCutForPeak
Definition: SiStripDigitizerAlgorithm.h:130
ParameterSet.h
SiStripDigitizerAlgorithm::apv_fCPerElectron_
const double apv_fCPerElectron_
Definition: SiStripDigitizerAlgorithm.h:190
SiGaussianTailNoiseAdder.h
SiTrivialDigitalConverter.h
SiStripDigitizerAlgorithm::peakMode
const bool peakMode
Definition: SiStripDigitizerAlgorithm.h:118
ParticleDataTable
HepPDT::ParticleDataTable ParticleDataTable
Definition: ParticleDataTable.h:8
SiStripDigitizerAlgorithm
Definition: SiStripDigitizerAlgorithm.h:56
SiStripDigitizerAlgorithm::APVProbabilityFile
edm::FileInPath APVProbabilityFile
Definition: SiStripDigitizerAlgorithm.h:179
SiStripDigitizerAlgorithm::initializeEvent
void initializeEvent(const edm::EventSetup &iSetup)
Definition: SiStripDigitizerAlgorithm.cc:137
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
SiDigitalConverter::DigitalRawVecType
std::vector< SiStripRawDigi > DigitalRawVecType
Definition: SiDigitalConverter.h:14
SiStripDigitizerAlgorithm::SiStripTrackerAffectedAPVMap
std::map< int, std::bitset< 6 > > SiStripTrackerAffectedAPVMap
Definition: SiStripDigitizerAlgorithm.h:183
SiStripDigitizerAlgorithm::cosmicShift
const double cosmicShift
Definition: SiStripDigitizerAlgorithm.h:133
SiStripDigitizerAlgorithm::SignalMapType
SiPileUpSignals::SignalMapType SignalMapType
Definition: SiStripDigitizerAlgorithm.h:60
SiStripDigitizerAlgorithm::APVProbaFile
std::ifstream APVProbaFile
Definition: SiStripDigitizerAlgorithm.h:181
SiStripApvSimulationParameters
Definition: SiStripApvSimulationParameters.h:17
StripGeomDetUnit
Definition: StripGeomDetUnit.h:15
SiStripDigitizerAlgorithm::lorentzAngleToken_
const edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleSimRcd > lorentzAngleToken_
Definition: SiStripDigitizerAlgorithm.h:139