CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PSPDigitizerAlgorithm.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <cmath>
3 
5 
9 
10 // Geometry
12 
13 using namespace edm;
14 
16  if (use_LorentzAngle_DB_) { // Get Lorentz angle from DB record
17  siPhase2OTLorentzAngle_ = &es.getData(siPhase2OTLorentzAngleToken_);
18  }
19 
20  geom_ = &es.getData(geomToken_);
21 }
22 
24  : Phase2TrackerDigitizerAlgorithm(conf.getParameter<ParameterSet>("AlgorithmCommon"),
25  conf.getParameter<ParameterSet>("PSPDigitizerAlgorithm"),
26  iC),
27  geomToken_(iC.esConsumes()) {
30  pixelFlag_ = false;
31  LogDebug("PSPDigitizerAlgorithm") << "Algorithm constructed "
32  << "Configuration parameters:"
33  << "Threshold/Gain = "
34  << "threshold in electron Endcap = " << theThresholdInE_Endcap_
35  << "threshold in electron Barrel = " << theThresholdInE_Barrel_ << " "
36  << theElectronPerADC_ << " " << theAdcFullScale_ << " The delta cut-off is set to "
37  << tMax_ << " pix-inefficiency " << addPixelInefficiency_;
38 }
39 PSPDigitizerAlgorithm::~PSPDigitizerAlgorithm() { LogDebug("PSPDigitizerAlgorithm") << "Algorithm deleted"; }
40 //
41 // -- Select the Hit for Digitization (sigScale will be implemented in future)
42 //
43 bool PSPDigitizerAlgorithm::select_hit(const PSimHit& hit, double tCorr, double& sigScale) const {
44  double toa = hit.tof() - tCorr;
45  return (toa > theTofLowerCut_ && toa < theTofUpperCut_);
46 }
47 //
48 // -- Compare Signal with Threshold
49 //
51  float charge,
52  float thr) const {
53  return (charge >= thr);
54 }
float tof() const
deprecated name for timeOfFlight()
Definition: PSimHit.h:76
void init(const edm::EventSetup &es) override
edm::ESGetToken< SiPhase2OuterTrackerLorentzAngle, SiPhase2OuterTrackerLorentzAngleSimRcd > siPhase2OTLorentzAngleToken_
bool select_hit(const PSimHit &hit, double tCorr, double &sigScale) const override
bool getData(T &iHolder) const
Definition: EventSetup.h:128
PSPDigitizerAlgorithm(const edm::ParameterSet &conf, edm::ConsumesCollector iC)
bool isAboveThreshold(const DigitizerUtility::SimHitInfo *hitInfo, float charge, float thr) const override
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
#define LogDebug(id)