CMS 3D CMS Logo

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()),
28  addBiasRailInefficiency_(
29  conf.getParameter<ParameterSet>("PSPDigitizerAlgorithm").getParameter<bool>("AddBiasRailInefficiency")) {
32  pixelFlag_ = false;
33  LogDebug("PSPDigitizerAlgorithm") << "Algorithm constructed "
34  << "Configuration parameters:"
35  << "Threshold/Gain = "
36  << "threshold in electron Endcap = " << theThresholdInE_Endcap_
37  << "threshold in electron Barrel = " << theThresholdInE_Barrel_ << " "
38  << theElectronPerADC_ << " " << theAdcFullScale_ << " The delta cut-off is set to "
39  << tMax_ << " pix-inefficiency " << addPixelInefficiency_
40  << "Bias Rail Inefficiency " << addBiasRailInefficiency_;
41 }
42 PSPDigitizerAlgorithm::~PSPDigitizerAlgorithm() { LogDebug("PSPDigitizerAlgorithm") << "Algorithm deleted"; }
43 //
44 // -- Select the Hit for Digitization (sigScale will be implemented in future)
45 //
46 bool PSPDigitizerAlgorithm::select_hit(const PSimHit& hit, double tCorr, double& sigScale) const {
48  return false;
49  double toa = hit.tof() - tCorr;
50  return (toa > theTofLowerCut_ && toa < theTofUpperCut_);
51 }
52 //
53 // -- Compare Signal with Threshold
54 //
56  float charge,
57  float thr) const {
58  return (charge >= thr);
59 }
60 //
61 // Check whether the Hit is in the Inefficient Bias Rail Region
62 //
64  constexpr float implant = 0.1467; // Implant length (1.467 mm)
65  constexpr float bRail = 0.00375; // Bias Rail region which causes inefficiency (37.5micron)
66  // Do coordinate transformation of the local Y from module middle point considering 32 implants and 31 inter-impant regions with bias rail
67  constexpr float block_len = 16 * implant + 15.5 * bRail;
68  constexpr float block_unit = implant + bRail;
69  float yin = hit.entryPoint().y() + block_len;
70  float yout = hit.exitPoint().y() + block_len;
71  if (std::fmod(yin, block_unit) > implant || std::fmod(yout, block_unit) > implant)
72  return true;
73  else
74  return false;
75 }
76 //
77 // -- Read Bad Channels from the Condidion DB and kill channels/module accordingly
78 //
80  // this method is dummy at the moment. Will be implemented once we have the corresponding objectcondition DB
81 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
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:122
PSPDigitizerAlgorithm(const edm::ParameterSet &conf, edm::ConsumesCollector iC)
HLT enums.
bool isAboveThreshold(const DigitizerUtility::SimHitInfo *hitInfo, float charge, float thr) const override
bool isInBiasRailRegion(const PSimHit &hit) const
#define LogDebug(id)
void module_killing_DB(const Phase2TrackerGeomDetUnit *pixdet) override