1 #ifndef SiPixelDigitizerAlgorithm_h 2 #define SiPixelDigitizerAlgorithm_h 22 #include "boost/multi_array.hpp" 31 class HepRandomEngine;
68 void accumulateSimHits(
const std::vector<PSimHit>::const_iterator inputBegin,
69 const std::vector<PSimHit>::const_iterator inputEnd,
70 const size_t inputBeginGlobalIndex,
71 const unsigned int tofBin,
75 CLHEP::HepRandomEngine*);
77 std::vector<PixelDigi>& digis,
78 std::vector<PixelDigiSimLink>& simlinks,
80 CLHEP::HepRandomEngine*);
83 std::unique_ptr<PixelFEDChannelCollection> chooseScenario(
PileupMixingContent* puInfo, CLHEP::HepRandomEngine*);
86 void calculateInstlumiFactor(
const std::vector<PileupSummaryInfo> &ps,
int bunchSpacing);
87 void setSimAccumulator(
const std::map<uint32_t, std::map<int, int> >& signalMap);
89 std::unique_ptr<PixelFEDChannelCollection> chooseScenario(
const std::vector<PileupSummaryInfo>& ps,
90 CLHEP::HepRandomEngine* engine);
92 bool killBadFEDChannels()
const;
123 _amp(amp), _frac(1, frac) {
132 _amp(amp), _frac(1, frac) {
140 _hitInfos.emplace_back(hitp, hitIndex, tofBin);
145 operator float()
const {
return _amp;}
146 float ampl()
const {
return _amp;}
148 const std::vector<SimHitInfoForLinks>&
hitInfos()
const {
return _hitInfos; }
154 if (other.
_frac[0]>-0.5){
158 _frac.insert(_frac.end(), other.
_frac.begin(), other.
_frac.end());
196 _energy(energy),_position(x,y,z){}
198 _energy(energy),_position(position){}
199 float x()
const{
return _position.x();}
200 float y()
const{
return _position.y();}
201 float z()
const{
return _position.z();}
218 _sigma_x(1.), _sigma_y(1.), _hitp(
nullptr) {}
221 float t,
float a=1.0) :
222 _pos(x,y), _time(t), _amplitude(
a), _sigma_x(sigma_x),
223 _sigma_y(sigma_y), _hitp(
nullptr) {}
227 _pos(x,y), _time(t), _amplitude(
a), _sigma_x(sigma_x),
228 _sigma_y(sigma_y),_hitp(&hit) {}
231 float x()
const {
return _pos.x();}
232 float y()
const {
return _pos.y();}
235 float time()
const {
return _time;}
266 double thePixelEfficiency[20];
267 double thePixelColEfficiency[20];
268 double thePixelChipEfficiency[20];
269 std::vector<double> theLadderEfficiency_BPix[20];
270 std::vector<double> theModuleEfficiency_BPix[20];
271 double theInnerEfficiency_FPix[20];
272 double theOuterEfficiency_FPix[20];
281 std::map<uint32_t, size_t >
iPU;
285 static const int rocIdMaskBits = 0x1F;
299 float thePixelPseudoRadDamage[20];
426 const std::unique_ptr<SiG4UniversalFluctuation>
fluctuate;
427 const std::unique_ptr<GaussianTailNoiseGenerator>
theNoiser;
430 const std::map<int,CalParameters,std::less<int> >
calmap;
435 std::map<int,CalParameters,std::less<int> > initCal()
const;
436 void primary_ionization(
const PSimHit&
hit, std::vector<EnergyDepositUnit>& ionization_points, CLHEP::HepRandomEngine*)
const;
441 const std::vector<EnergyDepositUnit>& ionization_points,
442 std::vector<SignalPoint>& collection_points)
const;
443 void induce_signal(std::vector<PSimHit>::const_iterator inputBegin,
444 std::vector<PSimHit>::const_iterator inputEnd,
446 const size_t hitIndex,
447 const unsigned int tofBin,
449 const std::vector<SignalPoint>& collection_points);
450 void fluctuateEloss(
int particleId,
float momentum,
float eloss,
451 float length,
int NumberOfSegments,
453 CLHEP::HepRandomEngine*)
const;
455 float thePixelThreshold,
456 CLHEP::HepRandomEngine*);
457 void make_digis(
float thePixelThresholdInE,
460 std::vector<PixelDigi>& digis,
461 std::vector<PixelDigiSimLink>& simlinks,
466 CLHEP::HepRandomEngine*);
468 void pixel_inefficiency_db(uint32_t detID);
479 const DetId& detId)
const;
481 void module_killing_conf(uint32_t detID);
482 void module_killing_DB(uint32_t detID);
485 int PixelTempRewgt2D(
int id_gen,
int id_rewgt,
488 std::map<
int,
float, std::less<int> >& hit_signal,
489 const size_t hitIndex,
490 const unsigned int tofBin,
493 signal_map_type& theSignal,
494 unsigned short int processType);
495 void printCluster(array_2d& cluster);
496 void printCluster(
float arr[
BXM2][
BYM2]);
512 return 0.5*(1.0-std::copysign(
std::sqrt(1.
f- unsafe_expf<4>(-
xx*(1.
f+0.2733
f/(1.
f+0.147
f*
xx)) )),x));
const SiPixel2DTemplateDBObject * dbobject_den
void operator+=(const Amplitude &other)
Amplitude(float amp, const PSimHit *hitp, size_t hitIndex, unsigned int tofBin, float frac)
const float theThresholdInE_BPix_L2
signal_map_type::const_iterator signal_map_const_iterator
const bool use_deadmodule_DB_
edm::ESHandle< SiPixelFedCablingMap > map_
const float electronsPerVCAL
const double theThresholdSmearing_FPix
SignalPoint(float x, float y, float sigma_x, float sigma_y, float t, const PSimHit &hit, float a=1.0)
const std::unique_ptr< SiPixelGainCalibrationOfflineSimService > theSiPixelGainCalibrationService_
std::vector< float > track
const std::vector< float > & individualampl() const
EnergyDepositUnit(float energy, Local3DPoint position)
const float tanLorentzAnglePerTesla_FPix
PixelEfficiencies pixelEfficiencies_
const std::unique_ptr< SiG4UniversalFluctuation > fluctuate
const int theAdcFullScale
edm::ESHandle< SiPixelQualityProbabilities > scenarioProbabilityHandle
SignalPoint(float x, float y, float sigma_x, float sigma_y, float t, float a=1.0)
const LocalPoint & position() const
const double theThresholdSmearing_BPix_L1
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
const float theThresholdInE_FPix
std::unique_ptr< PixelFEDChannelCollection > PixelFEDChannelCollection_
const double theThresholdSmearing_BPix
std::vector< std::vector< double > > thePUEfficiency
const float electronsPerVCAL_Offset
const bool addThresholdSmearing
Amplitude(float amp, float frac)
const bool fluctuateCharge
edm::ESHandle< TrackerGeometry > geom_
double calcQ(float x) const
const float GeVperElectron
const double theThresholdSmearing_BPix_L2
edm::ESHandle< PixelFEDChannelCollectionMap > PixelFEDChannelCollectionMapHandle
const bool use_ineff_from_db_
const SiPixel2DTemplateDBObject * dbobject_num
const bool use_LorentzAngle_DB_
const PixelFEDChannelCollectionMap * quality_map
const std::map< int, CalParameters, std::less< int > > calmap
double theInstLumiScaleFactor
const Parameters DeadModules
boost::multi_array< float, 2 > array_2d
std::map< uint32_t, std::vector< double > > PixelGeomFactorsROCBigPixels
const float theTofUpperCut
SiPixelTemplate2D templ2D
const bool use_module_killing_
std::vector< double > pu_scale
std::unordered_map< std::string, PixelFEDChannelCollection > PixelFEDChannelCollectionMap
const bool PrintTemplates
const float theThresholdInE_BPix
std::string siPixelQualityLabel
const int NumberOfEndcapDisks
signal_map_type::iterator signal_map_iterator
SignalPoint & set_amplitude(float amp)
EnergyDepositUnit(float energy, float x, float y, float z)
const float theThresholdInE_BPix_L1
edm::ESHandle< SiPixelLorentzAngle > SiPixelLorentzAngle_
const float electronsPerVCAL_L1_Offset
boost::multi_array< float, 2 > array_2d
const bool UseReweighting
const bool doMissCalibrate
const bool AddPixelInefficiency
const bool addChargeVCALSmearing
const std::unique_ptr< GaussianTailNoiseGenerator > theNoiser
const float theNoiseInElectrons
std::map< int, Amplitude, std::less< int > > signal_map_type
const float theOffsetSmearing
std::vector< float > _frac
const float electronsPerVCAL_L1
edm::ESHandle< SiPixelQuality > SiPixelBadModule_
std::map< uint32_t, std::vector< double > > PixelGeomFactorsROCStdPixels
std::vector< bool > ydouble
GloballyPositioned< double > Frame
const float tanLorentzAnglePerTesla_BPix
std::vector< SiPixelTemplateStore2D > templateStores_
edm::ESHandle< SiPixelDynamicInefficiency > SiPixelDynamicInefficiency_
std::vector< bool > xdouble
std::vector< edm::ParameterSet > Parameters
const bool KillBadFEDChannels
const std::vector< SimHitInfoForLinks > & hitInfos() const
const float theGainSmearing
std::vector< SimHitInfoForLinks > _hitInfos
void operator+=(const float &)
static int position[264][3]
const float theReadoutNoise
std::map< uint32_t, double > ColGeomFactors
const float theTofLowerCut
std::map< uint32_t, double > PixelGeomFactors
std::map< uint32_t, double > ChipGeomFactors
const bool addNoisyPixels
const PixelAging pixelAging_
std::map< uint32_t, signal_map_type > signalMaps
std::map< uint32_t, size_t > iPU
const float theElectronPerADC
const bool makeDigiSimLinks_
const int NumberOfBarrelLayers