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()) {
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 }
Phase2TrackerDigitizerAlgorithm::theThresholdInE_Barrel_
const float theThresholdInE_Barrel_
Definition: Phase2TrackerDigitizerAlgorithm.h:144
MessageLogger.h
Phase2TrackerDigitizerAlgorithm::theTofUpperCut_
const float theTofUpperCut_
Definition: Phase2TrackerDigitizerAlgorithm.h:153
PSPDigitizerAlgorithm::~PSPDigitizerAlgorithm
~PSPDigitizerAlgorithm() override
Definition: PSPDigitizerAlgorithm.cc:39
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
PSPDigitizerAlgorithm::isAboveThreshold
bool isAboveThreshold(const DigitizerUtility::SimHitInfo *hitInfo, float charge, float thr) const override
Definition: PSPDigitizerAlgorithm.cc:50
Phase2TrackerDigitizerAlgorithm::theTofLowerCut_
const float theTofLowerCut_
Definition: Phase2TrackerDigitizerAlgorithm.h:152
PSPDigitizerAlgorithm::init
void init(const edm::EventSetup &es) override
Definition: PSPDigitizerAlgorithm.cc:15
Phase2TrackerDigitizerAlgorithm::theAdcFullScale_
const int theAdcFullScale_
Definition: Phase2TrackerDigitizerAlgorithm.h:138
PSPDigitizerAlgorithm::PSPDigitizerAlgorithm
PSPDigitizerAlgorithm(const edm::ParameterSet &conf, edm::ConsumesCollector iC)
Definition: PSPDigitizerAlgorithm.cc:23
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
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
Phase2TrackerDigitizerAlgorithm::theElectronPerADC_
const float theElectronPerADC_
Definition: Phase2TrackerDigitizerAlgorithm.h:137
edm::EventSetup
Definition: EventSetup.h:58
PSPDigitizerAlgorithm::select_hit
bool select_hit(const PSimHit &hit, double tCorr, double &sigScale) const override
Definition: PSPDigitizerAlgorithm.cc:43
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
PSPDigitizerAlgorithm.h
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
PSPDigitizerAlgorithm::siPhase2OTLorentzAngleToken_
edm::ESGetToken< SiPhase2OuterTrackerLorentzAngle, SiPhase2OuterTrackerLorentzAngleSimRcd > siPhase2OTLorentzAngleToken_
Definition: PSPDigitizerAlgorithm.h:21
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
hit
Definition: SiStripHitEffFromCalibTree.cc:88