CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
SSDigitizerAlgorithm Class Reference

#include <SSDigitizerAlgorithm.h>

Inheritance diagram for SSDigitizerAlgorithm:
Phase2TrackerDigitizerAlgorithm

Public Member Functions

void init (const edm::EventSetup &es) override
 
bool isAboveThreshold (const DigitizerUtility::SimHitInfo *hitInfo, float charge, float thr) const override
 
bool select_hit (const PSimHit &hit, double tCorr, double &sigScale) const override
 
 SSDigitizerAlgorithm (const edm::ParameterSet &conf, edm::ConsumesCollector iC)
 
 ~SSDigitizerAlgorithm () override
 
- Public Member Functions inherited from Phase2TrackerDigitizerAlgorithm
virtual void accumulateSimHits (const std::vector< PSimHit >::const_iterator inputBegin, const std::vector< PSimHit >::const_iterator inputEnd, const size_t inputBeginGlobalIndex, const uint32_t tofBin, const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield)
 
virtual void digitize (const Phase2TrackerGeomDetUnit *pixdet, std::map< int, DigitizerUtility::DigiSimInfo > &digi_map, const TrackerTopology *tTopo)
 
virtual void initializeEvent (CLHEP::HepRandomEngine &eng)
 
void loadAccumulator (uint32_t detId, const std::map< int, float > &accumulator)
 
 Phase2TrackerDigitizerAlgorithm (const edm::ParameterSet &conf_common, const edm::ParameterSet &conf_specific, edm::ConsumesCollector iC)
 
virtual ~Phase2TrackerDigitizerAlgorithm ()
 

Private Types

enum  {
  SquareWindow, SampledMode, LatchedMode, SampledOrLachedMode,
  HIPFindingMode
}
 

Private Member Functions

double cbc3PulsePolarExpansion (double x) const
 
double getSignalScale (double xval) const
 
bool select_hit_latchedMode (const PSimHit &hit, double tCorr, double &sigScale) const
 
bool select_hit_sampledMode (const PSimHit &hit, double tCorr, double &sigScale) const
 
double signalShape (double x) const
 
void storeSignalShape ()
 

Private Attributes

float deadTime_
 
const edm::ESGetToken
< TrackerGeometry,
TrackerDigiGeometryRecord
geomToken_
 
int hitDetectionMode_
 
std::vector< double > pulseShapeParameters_
 
std::vector< double > pulseShapeVec_
 
edm::ESGetToken
< SiPhase2OuterTrackerLorentzAngle,
SiPhase2OuterTrackerLorentzAngleSimRcd
siPhase2OTLorentzAngleToken_
 

Static Private Attributes

static constexpr float bx_time {25}
 
static constexpr size_t interpolationPoints {1000}
 
static constexpr int interpolationStep {10}
 

Additional Inherited Members

- Protected Types inherited from Phase2TrackerDigitizerAlgorithm
using Frame = GloballyPositioned< double >
 
using Parameters = std::vector< edm::ParameterSet >
 
using signal_map_type = std::map< int, DigitizerUtility::Amplitude, std::less< int > >
 
using signalMaps = std::map< uint32_t, signal_map_type >
 
- Protected Member Functions inherited from Phase2TrackerDigitizerAlgorithm
virtual void add_cross_talk (const Phase2TrackerGeomDetUnit *pixdet)
 
virtual void add_noise (const Phase2TrackerGeomDetUnit *pixdet)
 
virtual void add_noisy_cells (const Phase2TrackerGeomDetUnit *pixdet, float thePixelThreshold)
 
float calcQ (float x)
 
int convertSignalToAdc (uint32_t detID, float signal_in_elec, float threshold)
 
virtual std::vector
< DigitizerUtility::SignalPoint
drift (const PSimHit &hit, const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield, const std::vector< DigitizerUtility::EnergyDepositUnit > &ionization_points) const
 
LocalVector DriftDirection (const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield, const DetId &detId) const
 
virtual std::vector< float > fluctuateEloss (int particleId, float momentum, float eloss, float length, int NumberOfSegments) const
 
virtual void induce_signal (const PSimHit &hit, const size_t hitIndex, const uint32_t tofBin, const Phase2TrackerGeomDetUnit *pixdet, const std::vector< DigitizerUtility::SignalPoint > &collection_points)
 
virtual void module_killing_conf (uint32_t detID)
 
virtual void module_killing_DB (const Phase2TrackerGeomDetUnit *pixdet)
 
virtual void pixel_inefficiency (const SubdetEfficiencies &eff, const Phase2TrackerGeomDetUnit *pixdet, const TrackerTopology *tTopo)
 
virtual void pixel_inefficiency_db (uint32_t detID)
 
virtual std::vector
< DigitizerUtility::EnergyDepositUnit
primary_ionization (const PSimHit &hit) const
 
- Protected Attributes inherited from Phase2TrackerDigitizerAlgorithm
signalMaps _signal
 
const bool addNoise_
 
const bool addNoisyPixels_
 
const bool addPixelInefficiency_
 
const bool addThresholdSmearing_
 
const bool addXtalk_
 
const bool alpha2Order_
 
Parameters badPixels_
 
const float clusterWidth_
 
const Parameters deadModules_
 
const SiPixelFedCablingMapfedCablingMap_
 
const std::unique_ptr
< SiG4UniversalFluctuation
fluctuate_
 
const bool fluctuateCharge_
 
std::unique_ptr
< CLHEP::RandGaussQ > 
gaussDistribution_
 
const TrackerGeometrygeom_
 
const float GeVperElectron_
 
const float interstripCoupling_
 
const bool makeDigiSimLinks_
 
bool pixelFlag_
 
const double pseudoRadDamage_
 
const double pseudoRadDamageRadius_
 
CLHEP::HepRandomEngine * rengine_
 
const float Sigma0_
 
const float SigmaCoeff_
 
const
SiPhase2OuterTrackerLorentzAngle
siPhase2OTLorentzAngle_
 
const SiPixelQualitysiPixelBadModule_
 
const SiPixelLorentzAnglesiPixelLorentzAngle_
 
std::unique_ptr
< CLHEP::RandGaussQ > 
smearedThreshold_Barrel_
 
std::unique_ptr
< CLHEP::RandGaussQ > 
smearedThreshold_Endcap_
 
const SubdetEfficiencies subdetEfficiencies_
 
const float tanLorentzAnglePerTesla_Barrel_
 
const float tanLorentzAnglePerTesla_Endcap_
 
const int theAdcFullScale_
 
const float theElectronPerADC_
 
const double theHIPThresholdInE_Barrel_
 
const double theHIPThresholdInE_Endcap_
 
const float theNoiseInElectrons_
 
const std::unique_ptr
< GaussianTailNoiseGenerator
theNoiser_
 
const int thePhase2ReadoutMode_
 
const float theReadoutNoise_
 
const std::unique_ptr
< SiPixelGainCalibrationOfflineSimService
theSiPixelGainCalibrationService_
 
const float theThresholdInE_Barrel_
 
const float theThresholdInE_Endcap_
 
const double theThresholdSmearing_Barrel_
 
const double theThresholdSmearing_Endcap_
 
const float theTofLowerCut_
 
const float theTofUpperCut_
 
const double tMax_
 
const bool use_deadmodule_DB_
 
const bool use_ineff_from_db_
 
const bool use_LorentzAngle_DB_
 
const bool use_module_killing_
 

Detailed Description

Definition at line 9 of file SSDigitizerAlgorithm.h.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

SSDigitizerAlgorithm::SSDigitizerAlgorithm ( const edm::ParameterSet conf,
edm::ConsumesCollector  iC 
)

Definition at line 36 of file SSDigitizerAlgorithm.cc.

References Phase2TrackerDigitizerAlgorithm::addPixelInefficiency_, edm::ConsumesCollector::esConsumes(), LogDebug, Phase2TrackerDigitizerAlgorithm::pixelFlag_, siPhase2OTLorentzAngleToken_, storeSignalShape(), Phase2TrackerDigitizerAlgorithm::theAdcFullScale_, Phase2TrackerDigitizerAlgorithm::theElectronPerADC_, Phase2TrackerDigitizerAlgorithm::theThresholdInE_Barrel_, Phase2TrackerDigitizerAlgorithm::theThresholdInE_Endcap_, Phase2TrackerDigitizerAlgorithm::tMax_, and Phase2TrackerDigitizerAlgorithm::use_LorentzAngle_DB_.

38  conf.getParameter<ParameterSet>("SSDigitizerAlgorithm"),
39  iC),
40  hitDetectionMode_(conf.getParameter<ParameterSet>("SSDigitizerAlgorithm").getParameter<int>("HitDetectionMode")),
41  pulseShapeParameters_(conf.getParameter<ParameterSet>("SSDigitizerAlgorithm")
42  .getParameter<std::vector<double> >("PulseShapeParameters")),
43  deadTime_(conf.getParameter<ParameterSet>("SSDigitizerAlgorithm").getParameter<double>("CBCDeadTime")),
44  geomToken_(iC.esConsumes()) {
47  pixelFlag_ = false;
48  LogDebug("SSDigitizerAlgorithm ") << "SSDigitizerAlgorithm constructed "
49  << "Configuration parameters:"
50  << "Threshold/Gain = "
51  << "threshold in electron Endcap = " << theThresholdInE_Endcap_
52  << "threshold in electron Barrel = " << theThresholdInE_Barrel_ << " "
53  << theElectronPerADC_ << " " << theAdcFullScale_ << " The delta cut-off is set to "
54  << tMax_ << " pix-inefficiency " << addPixelInefficiency_;
56 }
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Phase2TrackerDigitizerAlgorithm(const edm::ParameterSet &conf_common, const edm::ParameterSet &conf_specific, edm::ConsumesCollector iC)
std::vector< double > pulseShapeParameters_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< SiPhase2OuterTrackerLorentzAngle, SiPhase2OuterTrackerLorentzAngleSimRcd > siPhase2OTLorentzAngleToken_
#define LogDebug(id)
SSDigitizerAlgorithm::~SSDigitizerAlgorithm ( )
override

Definition at line 57 of file SSDigitizerAlgorithm.cc.

References LogDebug.

57 { LogDebug("SSDigitizerAlgorithm") << "SSDigitizerAlgorithm deleted"; }
#define LogDebug(id)

Member Function Documentation

double SSDigitizerAlgorithm::cbc3PulsePolarExpansion ( double  x) const
private

Definition at line 113 of file SSDigitizerAlgorithm.cc.

References funct::cos(), hcaldqm::quantity::fN, mps_fire::i, dqmiolumiharvest::j, funct::pow(), pulseShapeParameters_, alignCSCRings::r, funct::sin(), metsig::tau, theta(), and phase1PixelTopology::xOffset.

Referenced by signalShape().

113  {
114  constexpr size_t max_par = 6;
115  if (pulseShapeParameters_.size() < max_par)
116  return -1;
117  double xOffset = pulseShapeParameters_[0];
118  double tau = pulseShapeParameters_[1];
119  double r = pulseShapeParameters_[2];
120  double theta = pulseShapeParameters_[3];
121  int nTerms = static_cast<int>(pulseShapeParameters_[4]);
122 
123  double fN = 0;
124  double xx = x - xOffset;
125  if (xx < 0)
126  return 0;
127 
128  for (int i = 0; i < nTerms; i++) {
129  double angularTerm = 0;
130  double temporalTerm = 0;
131  double rTerm = std::pow(r, i) / (std::pow(tau, 2. * i) * ::nFactorial(i + 2));
132  for (int j = 0; j <= i; j++) {
133  angularTerm += std::pow(std::cos(theta), (double)(i - j)) * std::pow(std::sin(theta), (double)j);
134  temporalTerm += ::aScalingConstant(i, j) * std::pow(xx, (double)(i - j)) * std::pow(tau, (double)j);
135  }
136  double fi = rTerm * angularTerm * temporalTerm;
137 
138  fN += fi;
139  }
140  return fN;
141 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
constexpr int16_t xOffset
std::vector< double > pulseShapeParameters_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
double SSDigitizerAlgorithm::getSignalScale ( double  xval) const
private

Definition at line 157 of file SSDigitizerAlgorithm.cc.

References reco::ceil(), mps_fire::i, interpolationStep, pulseShapeVec_, and hgcalPerformanceValidation::val.

Referenced by select_hit_latchedMode(), and select_hit_sampledMode().

157  {
158  double res = 0.0;
159  int len = pulseShapeVec_.size();
160 
161  if (xval < 0.0 || xval * interpolationStep >= len)
162  return res;
163 
164  unsigned int lower = std::floor(xval) * interpolationStep;
165  unsigned int upper = std::ceil(xval) * interpolationStep;
166  for (size_t i = lower + 1; i < upper * interpolationStep; i++) {
167  float val = i * 0.1;
168  if (val > xval) {
169  res = pulseShapeVec_[i - 1];
170  break;
171  }
172  }
173  return res;
174 }
constexpr int32_t ceil(float num)
std::vector< double > pulseShapeVec_
static constexpr int interpolationStep
void SSDigitizerAlgorithm::init ( const edm::EventSetup es)
overridevirtual

Implements Phase2TrackerDigitizerAlgorithm.

Definition at line 28 of file SSDigitizerAlgorithm.cc.

References edm::EventSetup::getData().

28  {
29  if (use_LorentzAngle_DB_) { // Get Lorentz angle from DB record
31  }
32 
33  geom_ = &es.getData(geomToken_);
34 }
bool getData(T &iHolder) const
Definition: EventSetup.h:122
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
const SiPhase2OuterTrackerLorentzAngle * siPhase2OTLorentzAngle_
edm::ESGetToken< SiPhase2OuterTrackerLorentzAngle, SiPhase2OuterTrackerLorentzAngleSimRcd > siPhase2OTLorentzAngleToken_
bool SSDigitizerAlgorithm::isAboveThreshold ( const DigitizerUtility::SimHitInfo hitInfo,
float  charge,
float  thr 
) const
overridevirtual

Reimplemented from Phase2TrackerDigitizerAlgorithm.

Definition at line 178 of file SSDigitizerAlgorithm.cc.

180  {
181  return (charge >= thr);
182 }
bool SSDigitizerAlgorithm::select_hit ( const PSimHit hit,
double  tCorr,
double &  sigScale 
) const
overridevirtual

Reimplemented from Phase2TrackerDigitizerAlgorithm.

Definition at line 61 of file SSDigitizerAlgorithm.cc.

References hitDetectionMode_, LatchedMode, mps_fire::result, SampledMode, select_hit_latchedMode(), select_hit_sampledMode(), Phase2TrackerDigitizerAlgorithm::theTofLowerCut_, Phase2TrackerDigitizerAlgorithm::theTofUpperCut_, and PSimHit::tof().

61  {
62  bool result = false;
64  result = select_hit_sampledMode(hit, tCorr, sigScale);
66  result = select_hit_latchedMode(hit, tCorr, sigScale);
67  else {
68  double toa = hit.tof() - tCorr;
69  result = (toa > theTofLowerCut_ && toa < theTofUpperCut_);
70  }
71  return result;
72 }
float tof() const
deprecated name for timeOfFlight()
Definition: PSimHit.h:76
tuple result
Definition: mps_fire.py:311
bool select_hit_latchedMode(const PSimHit &hit, double tCorr, double &sigScale) const
bool select_hit_sampledMode(const PSimHit &hit, double tCorr, double &sigScale) const
bool SSDigitizerAlgorithm::select_hit_latchedMode ( const PSimHit hit,
double  tCorr,
double &  sigScale 
) const
private

Definition at line 90 of file SSDigitizerAlgorithm.cc.

References EncodedEventId::bunchCrossing(), bx_time, deadTime_, PSimHit::detUnitId(), PSimHit::energyLoss(), PSimHit::eventId(), getSignalScale(), Phase2TrackerDigitizerAlgorithm::GeVperElectron_, mps_fire::i, DetId::subdetId(), Phase2TrackerDigitizerAlgorithm::theThresholdInE_Barrel_, Phase2TrackerDigitizerAlgorithm::theThresholdInE_Endcap_, StripSubdetector::TOB, and PSimHit::tof().

Referenced by select_hit().

90  {
91  float toa = hit.tof() - tCorr;
92  toa -= hit.eventId().bunchCrossing() * bx_time;
93 
94  float sampling_time = (-1) * (hit.eventId().bunchCrossing() + 1) * bx_time;
95 
96  DetId det_id = DetId(hit.detUnitId());
97  float theThresholdInE =
99 
100  bool lastPulse = true;
101  bool aboveThr = false;
102  for (float i = deadTime_; i <= bx_time; i++) {
103  sigScale = getSignalScale(sampling_time - toa + i);
104 
105  aboveThr = (sigScale * hit.energyLoss() / GeVperElectron_ > theThresholdInE);
106  if (!lastPulse && aboveThr)
107  return true;
108 
109  lastPulse = aboveThr;
110  }
111  return false;
112 }
float tof() const
deprecated name for timeOfFlight()
Definition: PSimHit.h:76
int bunchCrossing() const
get the detector field from this detid
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
EncodedEventId eventId() const
Definition: PSimHit.h:108
static constexpr auto TOB
double getSignalScale(double xval) const
Definition: DetId.h:17
static constexpr float bx_time
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Definition: PSimHit.h:79
unsigned int detUnitId() const
Definition: PSimHit.h:97
bool SSDigitizerAlgorithm::select_hit_sampledMode ( const PSimHit hit,
double  tCorr,
double &  sigScale 
) const
private

Definition at line 76 of file SSDigitizerAlgorithm.cc.

References bx_time, PSimHit::detUnitId(), PSimHit::energyLoss(), getSignalScale(), Phase2TrackerDigitizerAlgorithm::GeVperElectron_, DetId::subdetId(), Phase2TrackerDigitizerAlgorithm::theThresholdInE_Barrel_, Phase2TrackerDigitizerAlgorithm::theThresholdInE_Endcap_, StripSubdetector::TOB, and PSimHit::tof().

Referenced by select_hit().

76  {
77  double toa = hit.tof() - tCorr;
78  double sampling_time = bx_time;
79 
80  DetId det_id = DetId(hit.detUnitId());
81  float theThresholdInE =
83 
84  sigScale = getSignalScale(sampling_time - toa);
85  return (sigScale * hit.energyLoss() / GeVperElectron_ > theThresholdInE);
86 }
float tof() const
deprecated name for timeOfFlight()
Definition: PSimHit.h:76
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr auto TOB
double getSignalScale(double xval) const
Definition: DetId.h:17
static constexpr float bx_time
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Definition: PSimHit.h:79
unsigned int detUnitId() const
Definition: PSimHit.h:97
double SSDigitizerAlgorithm::signalShape ( double  x) const
private

Definition at line 142 of file SSDigitizerAlgorithm.cc.

References cbc3PulsePolarExpansion(), funct::exp(), funct::pow(), pulseShapeParameters_, metsig::tau, and phase1PixelTopology::xOffset.

Referenced by storeSignalShape().

142  {
143  double xOffset = pulseShapeParameters_[0];
144  double tau = pulseShapeParameters_[1];
145  double maxCharge = pulseShapeParameters_[5];
146 
147  double xx = x - xOffset;
148  return maxCharge * (std::exp(-xx / tau) * std::pow(xx / tau, 2.) * cbc3PulsePolarExpansion(x));
149 }
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
constexpr int16_t xOffset
std::vector< double > pulseShapeParameters_
double cbc3PulsePolarExpansion(double x) const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
void SSDigitizerAlgorithm::storeSignalShape ( )
private

Definition at line 150 of file SSDigitizerAlgorithm.cc.

References mps_fire::i, interpolationPoints, interpolationStep, pulseShapeVec_, signalShape(), and hgcalPerformanceValidation::val.

Referenced by SSDigitizerAlgorithm().

150  {
151  for (size_t i = 0; i < interpolationPoints; i++) {
152  float val = i / interpolationStep;
153 
154  pulseShapeVec_.push_back(signalShape(val));
155  }
156 }
static constexpr size_t interpolationPoints
double signalShape(double x) const
std::vector< double > pulseShapeVec_
static constexpr int interpolationStep

Member Data Documentation

constexpr float SSDigitizerAlgorithm::bx_time {25}
staticprivate

Definition at line 35 of file SSDigitizerAlgorithm.h.

Referenced by select_hit_latchedMode(), and select_hit_sampledMode().

float SSDigitizerAlgorithm::deadTime_
private

Definition at line 32 of file SSDigitizerAlgorithm.h.

Referenced by select_hit_latchedMode().

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SSDigitizerAlgorithm::geomToken_
private

Definition at line 34 of file SSDigitizerAlgorithm.h.

int SSDigitizerAlgorithm::hitDetectionMode_
private

Definition at line 29 of file SSDigitizerAlgorithm.h.

Referenced by select_hit().

constexpr size_t SSDigitizerAlgorithm::interpolationPoints {1000}
staticprivate

Definition at line 36 of file SSDigitizerAlgorithm.h.

Referenced by storeSignalShape().

constexpr int SSDigitizerAlgorithm::interpolationStep {10}
staticprivate

Definition at line 37 of file SSDigitizerAlgorithm.h.

Referenced by getSignalScale(), and storeSignalShape().

std::vector<double> SSDigitizerAlgorithm::pulseShapeParameters_
private

Definition at line 31 of file SSDigitizerAlgorithm.h.

Referenced by cbc3PulsePolarExpansion(), and signalShape().

std::vector<double> SSDigitizerAlgorithm::pulseShapeVec_
private

Definition at line 30 of file SSDigitizerAlgorithm.h.

Referenced by getSignalScale(), and storeSignalShape().

edm::ESGetToken<SiPhase2OuterTrackerLorentzAngle, SiPhase2OuterTrackerLorentzAngleSimRcd> SSDigitizerAlgorithm::siPhase2OTLorentzAngleToken_
private

Definition at line 33 of file SSDigitizerAlgorithm.h.

Referenced by SSDigitizerAlgorithm().