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  biasRailInefficiencyFlag_(
29  conf.getParameter<ParameterSet>("PSPDigitizerAlgorithm").getParameter<int>("BiasRailInefficiencyFlag")) {
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 " << biasRailInefficiencyFlag_;
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  bool result = false;
72 
73  // Flag= 1 corresponds to optimistic case when the entire trajectory is withon the bias rail region the SimHit will be rejected
74  if (biasRailInefficiencyFlag_ == 1 && (std::fmod(yin, block_unit) > implant && std::fmod(yout, block_unit) > implant))
75  result = true;
76  // Flag= 2 corresponds to pessimistic case i.e iven in a small part of the trajectory is inside the bias rain region the SimHit is rejected
77  else if (biasRailInefficiencyFlag_ == 2 &&
78  (std::fmod(yin, block_unit) > implant || std::fmod(yout, block_unit) > implant))
79  result = true;
80  return result;
81 }
82 //
83 // -- Read Bad Channels from the Condidion DB and kill channels/module accordingly
84 //
86  // this method is dummy at the moment. Will be implemented once we have the corresponding objectcondition DB
87 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
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 isAboveThreshold(const digitizerUtility::SimHitInfo *hitInfo, float charge, float thr) const override
PSPDigitizerAlgorithm(const edm::ParameterSet &conf, edm::ConsumesCollector iC)
HLT enums.
bool isInBiasRailRegion(const PSimHit &hit) const
#define LogDebug(id)
void module_killing_DB(const Phase2TrackerGeomDetUnit *pixdet) override