CMS 3D CMS Logo

PSSDigitizerAlgorithm.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <cmath>
3 
7 
9 
11 #include "CLHEP/Random/RandGaussQ.h"
12 #include "CLHEP/Random/RandFlat.h"
13 
19 
20 // Geometry
25 
26 using namespace edm;
27 
29  es.get<TrackerDigiGeometryRecord>().get(geom_);
30 }
32  Phase2TrackerDigitizerAlgorithm(conf.getParameter<ParameterSet>("AlgorithmCommon"),
33  conf.getParameter<ParameterSet>("PSSDigitizerAlgorithm"))
34 {
35  pixelFlag = false;
36  LogInfo("PSSDigitizerAlgorithm") << "Algorithm constructed "
37  << "Configuration parameters:"
38  << "Threshold/Gain = "
39  << "threshold in electron Endcap = "
41  << "threshold in electron Barrel = "
43  << " " << theElectronPerADC << " " << theAdcFullScale
44  << " The delta cut-off is set to " << tMax
45  << " pix-inefficiency " << AddPixelInefficiency;
46 }
48  LogDebug("PSSDigitizerAlgorithm") << "Algorithm deleted";
49 }
50 void PSSDigitizerAlgorithm::accumulateSimHits(std::vector<PSimHit>::const_iterator inputBegin,
51  std::vector<PSimHit>::const_iterator inputEnd,
52  const size_t inputBeginGlobalIndex,
53  const unsigned int tofBin,
54  const Phase2TrackerGeomDetUnit* pixdet,
55  const GlobalVector& bfield) {
56  // produce SignalPoint's for all SimHit's in detector
57  // Loop over hits
58  uint32_t detId = pixdet->geographicalId().rawId();
59  size_t simHitGlobalIndex = inputBeginGlobalIndex; // This needs to be stored to create the digi-sim link later
60  for (auto it = inputBegin; it != inputEnd; ++it, ++simHitGlobalIndex) {
61  // skip hits not in this detector.
62  if ((*it).detUnitId() != detId)
63  continue;
64 
65  LogDebug("PSSDigitizerAlgorithm")
66  << (*it).particleType() << " " << (*it).pabs() << " "
67  << (*it).energyLoss() << " " << (*it).tof() << " "
68  << (*it).trackId() << " " << (*it).processType() << " "
69  << (*it).detUnitId()
70  << (*it).entryPoint() << " " << (*it).exitPoint();
71 
72  std::vector<DigitizerUtility::EnergyDepositUnit> ionization_points;
73  std::vector<DigitizerUtility::SignalPoint> collection_points;
74 
75  // fill collection_points for this SimHit, indpendent of topology
76  // Check the TOF cut
77  if (((*it).tof() - pixdet->surface().toGlobal((*it).localPosition()).mag()/30.) >= theTofLowerCut &&
78  ((*it).tof() - pixdet->surface().toGlobal((*it).localPosition()).mag()/30.) <= theTofUpperCut) {
79  primary_ionization(*it, ionization_points); // fills _ionization_points
80  drift(*it, pixdet, bfield, ionization_points, collection_points); // transforms _ionization_points to collection_points
81 
82  // compute induced signal on readout elements and add to _signal
83  induce_signal(*it, simHitGlobalIndex, tofBin, pixdet, collection_points); // *ihit needed only for SimHit<-->Digi link
84  }
85  }
86 }
87 
void primary_ionization(const PSimHit &hit, std::vector< DigitizerUtility::EnergyDepositUnit > &ionization_points) const
#define LogDebug(id)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
PSSDigitizerAlgorithm(const edm::ParameterSet &conf)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
void drift(const PSimHit &hit, const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield, const std::vector< DigitizerUtility::EnergyDepositUnit > &ionization_points, std::vector< DigitizerUtility::SignalPoint > &collection_points) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
void init(const edm::EventSetup &es) override
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
void induce_signal(const PSimHit &hit, const size_t hitIndex, const unsigned int tofBin, const Phase2TrackerGeomDetUnit *pixdet, const std::vector< DigitizerUtility::SignalPoint > &collection_points)
HLT enums.
T get() const
Definition: EventSetup.h:63
void accumulateSimHits(const std::vector< PSimHit >::const_iterator inputBegin, const std::vector< PSimHit >::const_iterator inputEnd, const size_t inputBeginGlobalIndex, const unsigned int tofBin, const Phase2TrackerGeomDetUnit *pixdet, const GlobalVector &bfield) override