CMS 3D CMS Logo

PSSDigitizerAlgorithm.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  geom_ = &es.getData(geomToken_);
20 }
22  : Phase2TrackerDigitizerAlgorithm(conf.getParameter<ParameterSet>("AlgorithmCommon"),
23  conf.getParameter<ParameterSet>("PSSDigitizerAlgorithm"),
24  iC),
25  geomToken_(iC.esConsumes()) {
28  pixelFlag_ = false;
29  LogDebug("PSSDigitizerAlgorithm") << "Algorithm constructed "
30  << "Configuration parameters: "
31  << "Threshold/Gain = "
32  << "threshold in electron Endcap = " << theThresholdInE_Endcap_
33  << "threshold in electron Barrel = " << theThresholdInE_Barrel_ << " "
34  << theElectronPerADC_ << " " << theAdcFullScale_ << " The delta cut-off is set to "
35  << tMax_ << " pix-inefficiency " << addPixelInefficiency_;
36 }
37 PSSDigitizerAlgorithm::~PSSDigitizerAlgorithm() { LogDebug("PSSDigitizerAlgorithm") << "Algorithm deleted"; }
38 //
39 // -- Select the Hit for Digitization (sigScale will be implemented in future)
40 //
41 bool PSSDigitizerAlgorithm::select_hit(const PSimHit& hit, double tCorr, double& sigScale) const {
42  double toa = hit.tof() - tCorr;
43  return (toa > theTofLowerCut_ && toa < theTofUpperCut_);
44 }
45 //
46 // -- Compare Signal with Threshold
47 //
49  float charge,
50  float thr) const {
51  return (charge >= thr);
52 }
PSSDigitizerAlgorithm::init
void init(const edm::EventSetup &es) override
Definition: PSSDigitizerAlgorithm.cc:15
Phase2TrackerDigitizerAlgorithm::theThresholdInE_Barrel_
const float theThresholdInE_Barrel_
Definition: Phase2TrackerDigitizerAlgorithm.h:144
MessageLogger.h
PSSDigitizerAlgorithm::siPhase2OTLorentzAngleToken_
edm::ESGetToken< SiPhase2OuterTrackerLorentzAngle, SiPhase2OuterTrackerLorentzAngleSimRcd > siPhase2OTLorentzAngleToken_
Definition: PSSDigitizerAlgorithm.h:21
PSSDigitizerAlgorithm.h
Phase2TrackerDigitizerAlgorithm::theTofUpperCut_
const float theTofUpperCut_
Definition: Phase2TrackerDigitizerAlgorithm.h:153
edm
HLT enums.
Definition: AlignableModifier.h:19
Phase2TrackerDigitizerAlgorithm::use_LorentzAngle_DB_
const bool use_LorentzAngle_DB_
Definition: Phase2TrackerDigitizerAlgorithm.h:116
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
Phase2TrackerDigitizerAlgorithm::theTofLowerCut_
const float theTofLowerCut_
Definition: Phase2TrackerDigitizerAlgorithm.h:152
Phase2TrackerDigitizerAlgorithm::theAdcFullScale_
const int theAdcFullScale_
Definition: Phase2TrackerDigitizerAlgorithm.h:138
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
PSSDigitizerAlgorithm::PSSDigitizerAlgorithm
PSSDigitizerAlgorithm(const edm::ParameterSet &conf, edm::ConsumesCollector iC)
Definition: PSSDigitizerAlgorithm.cc:21
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
Phase2TrackerDigitizerAlgorithm
Definition: Phase2TrackerDigitizerAlgorithm.h:54
Phase2TrackerDigitizerAlgorithm::pixelFlag_
bool pixelFlag_
Definition: Phase2TrackerDigitizerAlgorithm.h:235
Phase2TrackerDigitizerAlgorithm::tMax_
const double tMax_
Definition: Phase2TrackerDigitizerAlgorithm.h:176
PSSDigitizerAlgorithm::~PSSDigitizerAlgorithm
~PSSDigitizerAlgorithm() override
Definition: PSSDigitizerAlgorithm.cc:37
Phase2TrackerDigitizerAlgorithm::theElectronPerADC_
const float theElectronPerADC_
Definition: Phase2TrackerDigitizerAlgorithm.h:137
edm::EventSetup
Definition: EventSetup.h:58
Phase2TrackerDigitizerAlgorithm::theThresholdInE_Endcap_
const float theThresholdInE_Endcap_
Definition: Phase2TrackerDigitizerAlgorithm.h:143
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
DigitizerUtility::SimHitInfo
Definition: DigitizerUtility.h:14
PixelGeomDetUnit.h
PSSDigitizerAlgorithm::isAboveThreshold
bool isAboveThreshold(const DigitizerUtility::SimHitInfo *hitInfo, float charge, float thr) const override
Definition: PSSDigitizerAlgorithm.cc:48
ConsumesCollector.h
ParameterSet.h
PSimHit
Definition: PSimHit.h:15
Phase2TrackerDigitizerAlgorithm::addPixelInefficiency_
const bool addPixelInefficiency_
Definition: Phase2TrackerDigitizerAlgorithm.h:163
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
PSSDigitizerAlgorithm::select_hit
bool select_hit(const PSimHit &hit, double tCorr, double &sigScale) const override
Definition: PSSDigitizerAlgorithm.cc:41
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
hit
Definition: SiStripHitEffFromCalibTree.cc:88