1 #ifndef SiPixelDigitizerAlgorithm_h
2 #define SiPixelDigitizerAlgorithm_h
28 #include "boost/multi_array.hpp"
36 class HepRandomEngine;
68 const std::vector<PSimHit>::const_iterator inputEnd,
69 const size_t inputBeginGlobalIndex,
70 const unsigned int tofBin,
74 CLHEP::HepRandomEngine*);
76 std::vector<PixelDigi>& digis,
77 std::vector<PixelDigiSimLink>& simlinks,
79 CLHEP::HepRandomEngine*);
88 std::unique_ptr<PixelFEDChannelCollection>
chooseScenario(
const std::vector<PileupSummaryInfo>& ps,
89 CLHEP::HepRandomEngine* engine);
101 if (
_frac[0] < -0.5) {
110 if (
_frac[0] < -0.5) {
113 _hitInfos.emplace_back(hitp, hitIndex, tofBin);
118 operator float()
const {
return _amp; }
127 if (other.
_frac[0] > -0.5) {
136 void set(
const float amplitude) {
279 std::map<uint32_t, size_t>
iPU;
407 const std::unique_ptr<SiG4UniversalFluctuation>
fluctuate;
408 const std::unique_ptr<GaussianTailNoiseGenerator>
theNoiser;
411 const std::map<int, CalParameters, std::less<int> >
calmap;
415 std::map<int, CalParameters, std::less<int> >
initCal()
const;
417 std::vector<EnergyDepositUnit>& ionization_points,
418 CLHEP::HepRandomEngine*)
const;
423 const std::vector<EnergyDepositUnit>& ionization_points,
424 std::vector<SignalPoint>& collection_points)
const;
425 void induce_signal(std::vector<PSimHit>::const_iterator inputBegin,
426 std::vector<PSimHit>::const_iterator inputEnd,
428 const size_t hitIndex,
429 const size_t FirstHitIndex,
430 const unsigned int tofBin,
432 const std::vector<SignalPoint>& collection_points);
437 int NumberOfSegments,
439 CLHEP::HepRandomEngine*)
const;
444 std::vector<PixelDigi>& digis,
445 std::vector<PixelDigiSimLink>& simlinks,
450 CLHEP::HepRandomEngine*);
478 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));
void init(const edm::EventSetup &es)
void operator+=(const Amplitude &other)
Amplitude(float amp, const PSimHit *hitp, size_t hitIndex, unsigned int tofBin, float frac)
const float theThresholdInE_BPix_L2
double theOuterEfficiency_FPix[20]
void pixel_inefficiency_db(uint32_t detID)
signal_map_type::const_iterator signal_map_const_iterator
const bool use_deadmodule_DB_
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)
std::map< int, CalParameters, std::less< int > > initCal() const
const std::unique_ptr< SiPixelGainCalibrationOfflineSimService > theSiPixelGainCalibrationService_
LocalVector DriftDirection(const PixelGeomDetUnit *pixdet, const GlobalVector &bfield, const DetId &detId) const
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
PixelEfficiencies(const edm::ParameterSet &conf, bool AddPixelInefficiency, int NumberOfBarrelLayers, int NumberOfEndcapDisks)
SignalPoint(float x, float y, float sigma_x, float sigma_y, float t, float a=1.0)
static const int rocIdMaskBits
const LocalPoint & position() const
const double theThresholdSmearing_BPix_L1
edm::ESGetToken< SiPixelQualityProbabilities, SiPixelStatusScenarioProbabilityRcd > scenarioProbabilityToken_
bool killBadFEDChannels() const
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)
void module_killing_conf(uint32_t detID)
const bool fluctuateCharge
std::map< uint32_t, size_t > iPU
float thePixelPseudoRadDamage[20]
~SiPixelDigitizerAlgorithm()
double calcQ(float x) const
const float GeVperElectron
const double theThresholdSmearing_BPix_L2
const SiPixelDynamicInefficiency * SiPixelDynamicInefficiency_
std::unique_ptr< SiPixelChargeReweightingAlgorithm > TheNewSiPixelChargeReweightingAlgorithmClass
const bool use_ineff_from_db_
void make_digis(float thePixelThresholdInE, uint32_t detID, const PixelGeomDetUnit *pixdet, std::vector< PixelDigi > &digis, std::vector< PixelDigiSimLink > &simlinks, const TrackerTopology *tTopo) const
void induce_signal(std::vector< PSimHit >::const_iterator inputBegin, std::vector< PSimHit >::const_iterator inputEnd, const PSimHit &hit, const size_t hitIndex, const size_t FirstHitIndex, const unsigned int tofBin, const PixelGeomDetUnit *pixdet, const std::vector< SignalPoint > &collection_points)
const bool use_LorentzAngle_DB_
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > SiPixelBadModuleToken_
SiPixelDigitizerAlgorithm(const edm::ParameterSet &conf, edm::ConsumesCollector iC)
const PixelFEDChannelCollectionMap * quality_map
double theInstLumiScaleFactor
const Parameters DeadModules
boost::multi_array< float, 2 > array_2d
float pixel_aging(const PixelAging &aging, const PixelGeomDetUnit *pixdet, const TrackerTopology *tTopo) const
std::map< uint32_t, std::vector< double > > PixelGeomFactorsROCBigPixels
double thePixelChipEfficiency[20]
const float theTofUpperCut
const bool use_module_killing_
std::vector< double > pu_scale
void module_killing_DB(uint32_t detID)
void digitize(const PixelGeomDetUnit *pixdet, std::vector< PixelDigi > &digis, std::vector< PixelDigiSimLink > &simlinks, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
const float theThresholdInE_BPix
double theInnerEfficiency_FPix[20]
const SiPixelLorentzAngle * SiPixelLorentzAngle_
const int NumberOfEndcapDisks
std::vector< double > theModuleEfficiency_BPix[20]
void init_from_db(const TrackerGeometry *, const SiPixelDynamicInefficiency *)
edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd > SiPixelLorentzAngleToken_
signal_map_type::iterator signal_map_iterator
void init_DynIneffDB(const edm::EventSetup &)
SignalPoint & set_amplitude(float amp)
std::unique_ptr< PixelFEDChannelCollection > chooseScenario(PileupMixingContent *puInfo, CLHEP::HepRandomEngine *)
EnergyDepositUnit(float energy, float x, float y, float z)
const float theThresholdInE_BPix_L1
const float electronsPerVCAL_L1_Offset
boost::multi_array< float, 2 > array_2d
void setSimAccumulator(const std::map< uint32_t, std::map< int, int > > &signalMap)
const bool UseReweighting
edm::ESGetToken< PixelFEDChannelCollectionMap, SiPixelFEDChannelContainerESProducerRcd > PixelFEDChannelCollectionMapToken_
const std::map< int, CalParameters, std::less< int > > calmap
void fluctuateEloss(int particleId, float momentum, float eloss, float length, int NumberOfSegments, float elossVector[], CLHEP::HepRandomEngine *) const
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
const SiPixelQuality * SiPixelBadModule_
const SiPixelFedCablingMap * map_
std::vector< float > _frac
const float electronsPerVCAL_L1
std::map< uint32_t, std::vector< double > > PixelGeomFactorsROCStdPixels
void primary_ionization(const PSimHit &hit, std::vector< EnergyDepositUnit > &ionization_points, CLHEP::HepRandomEngine *) const
double thePixelColEfficiency[20]
void calculateInstlumiFactor(PileupMixingContent *puInfo)
std::unordered_map< std::string, PixelFEDChannelCollection > PixelFEDChannelCollectionMap
void accumulateSimHits(const std::vector< PSimHit >::const_iterator inputBegin, const std::vector< PSimHit >::const_iterator inputEnd, const size_t inputBeginGlobalIndex, const unsigned int tofBin, const PixelGeomDetUnit *pixdet, const GlobalVector &bfield, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
GloballyPositioned< double > Frame
const float tanLorentzAnglePerTesla_BPix
const SiPixelQualityProbabilities * scenarioProbability_
float missCalibrate(uint32_t detID, const TrackerTopology *tTopo, const PixelGeomDetUnit *pixdet, int col, int row, float amp) const
bool matches(const DetId &, const DetId &, const std::vector< uint32_t > &)
std::vector< edm::ParameterSet > Parameters
const bool KillBadFEDChannels
const std::vector< SimHitInfoForLinks > & hitInfos() const
std::vector< double > theLadderEfficiency_BPix[20]
const float theGainSmearing
std::vector< SimHitInfoForLinks > _hitInfos
void operator+=(const float &)
static int position[264][3]
const float theReadoutNoise
const TrackerGeometry * geom_
void set(const float amplitude)
edm::ESGetToken< SiPixelDynamicInefficiency, SiPixelDynamicInefficiencyRcd > SiPixelDynamicInefficiencyToken_
std::map< uint32_t, double > ColGeomFactors
double thePixelEfficiency[20]
PixelAging(const edm::ParameterSet &conf, bool AddPixelAging, int NumberOfBarrelLayers, int NumberOfEndcapDisks)
const float theTofLowerCut
void drift(const PSimHit &hit, const PixelGeomDetUnit *pixdet, const GlobalVector &bfield, const TrackerTopology *tTopo, const std::vector< EnergyDepositUnit > &ionization_points, std::vector< SignalPoint > &collection_points) const
std::map< uint32_t, double > PixelGeomFactors
std::map< uint32_t, double > ChipGeomFactors
const bool addNoisyPixels
const edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > mapToken_
const PixelAging pixelAging_
std::map< uint32_t, signal_map_type > signalMaps
const float theElectronPerADC
const bool makeDigiSimLinks_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
const int NumberOfBarrelLayers
void add_noise(const PixelGeomDetUnit *pixdet, float thePixelThreshold, CLHEP::HepRandomEngine *)
void pixel_inefficiency(const PixelEfficiencies &eff, const PixelGeomDetUnit *pixdet, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)