CMS 3D CMS Logo

SSDigitizerAlgorithm.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 
21 // Geometry
26 
27 using namespace edm;
28 
30  es.get<TrackerDigiGeometryRecord>().get(geom_);
31 }
33  Phase2TrackerDigitizerAlgorithm(conf.getParameter<ParameterSet>("AlgorithmCommon"),
34  conf.getParameter<ParameterSet>("SSDigitizerAlgorithm"))
35 {
36  pixelFlag = false;
37  LogInfo("SSDigitizerAlgorithm ") << "SSDigitizerAlgorithm constructed "
38  << "Configuration parameters:"
39  << "Threshold/Gain = "
40  << "threshold in electron Endcap = "
42  << "threshold in electron Barrel = "
44  <<" " << theElectronPerADC << " " << theAdcFullScale
45  << " The delta cut-off is set to " << tMax
46  << " pix-inefficiency "<<AddPixelInefficiency;
47 }
49  LogDebug("SSDigitizerAlgorithm") << "SSDigitizerAlgorithm deleted";
50 }
51 void SSDigitizerAlgorithm::accumulateSimHits(std::vector<PSimHit>::const_iterator inputBegin,
52  std::vector<PSimHit>::const_iterator inputEnd,
53  const size_t inputBeginGlobalIndex,
54  const unsigned int tofBin,
55  const Phase2TrackerGeomDetUnit* pixdet,
56  const GlobalVector& bfield) {
57  // produce SignalPoint's for all SimHit's in detector
58  // Loop over hits
59  uint32_t detId = pixdet->geographicalId().rawId();
60  size_t simHitGlobalIndex = inputBeginGlobalIndex; // This needs to be stored to create the digi-sim link later
61  for (auto it = inputBegin; it != inputEnd; ++it, ++simHitGlobalIndex) {
62  // skip hits not in this detector.
63  if ((*it).detUnitId() != detId)
64  continue;
65 
66  LogDebug("SSDigitizerAlgorithm")
67  << (*it).particleType() << " " << (*it).pabs() << " "
68  << (*it).energyLoss() << " " << (*it).tof() << " "
69  << (*it).trackId() << " " << (*it).processType() << " "
70  << (*it).detUnitId()
71  << (*it).entryPoint() << " " << (*it).exitPoint() ;
72 
73  std::vector<DigitizerUtility::EnergyDepositUnit> ionization_points;
74  std::vector<DigitizerUtility::SignalPoint> collection_points;
75 
76  // fill collection_points for this SimHit, indpendent of topology
77  // Check the TOF cut
78  if (((*it).tof() - pixdet->surface().toGlobal((*it).localPosition()).mag()/30.) >= theTofLowerCut &&
79  ((*it).tof() - pixdet->surface().toGlobal((*it).localPosition()).mag()/30.) <= theTofUpperCut) {
80  primary_ionization(*it, ionization_points); // fills _ionization_points
81  drift(*it, pixdet, bfield, ionization_points, collection_points); // transforms _ionization_points to collection_points
82 
83  // compute induced signal on readout elements and add to _signal
84 
85  induce_signal(*it, simHitGlobalIndex, tofBin, pixdet, collection_points); // *ihit needed only for SimHit<-->Digi link
86  }
87  }
88 }
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
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:50
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
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
SSDigitizerAlgorithm(const edm::ParameterSet &conf)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
void init(const edm::EventSetup &es) override
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:71