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 // Geometry
25 
26 using namespace edm;
27 
30  : Phase2TrackerDigitizerAlgorithm(conf.getParameter<ParameterSet>("AlgorithmCommon"),
31  conf.getParameter<ParameterSet>("SSDigitizerAlgorithm")) {
32  pixelFlag = false;
33  LogInfo("SSDigitizerAlgorithm ") << "SSDigitizerAlgorithm 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 }
41 SSDigitizerAlgorithm::~SSDigitizerAlgorithm() { LogDebug("SSDigitizerAlgorithm") << "SSDigitizerAlgorithm deleted"; }
42 void SSDigitizerAlgorithm::accumulateSimHits(std::vector<PSimHit>::const_iterator inputBegin,
43  std::vector<PSimHit>::const_iterator inputEnd,
44  const size_t inputBeginGlobalIndex,
45  const unsigned int tofBin,
46  const Phase2TrackerGeomDetUnit* pixdet,
47  const GlobalVector& bfield) {
48  // produce SignalPoint's for all SimHit's in detector
49  // Loop over hits
50  uint32_t detId = pixdet->geographicalId().rawId();
51  size_t simHitGlobalIndex = inputBeginGlobalIndex; // This needs to be stored to create the digi-sim link later
52  for (auto it = inputBegin; it != inputEnd; ++it, ++simHitGlobalIndex) {
53  // skip hits not in this detector.
54  if ((*it).detUnitId() != detId)
55  continue;
56 
57  LogDebug("SSDigitizerAlgorithm") << (*it).particleType() << " " << (*it).pabs() << " " << (*it).energyLoss() << " "
58  << (*it).tof() << " " << (*it).trackId() << " " << (*it).processType() << " "
59  << (*it).detUnitId() << (*it).entryPoint() << " " << (*it).exitPoint();
60 
61  std::vector<DigitizerUtility::EnergyDepositUnit> ionization_points;
62  std::vector<DigitizerUtility::SignalPoint> collection_points;
63 
64  // fill collection_points for this SimHit, indpendent of topology
65  // Check the TOF cut
66  if (((*it).tof() - pixdet->surface().toGlobal((*it).localPosition()).mag() / 30.) >= theTofLowerCut &&
67  ((*it).tof() - pixdet->surface().toGlobal((*it).localPosition()).mag() / 30.) <= theTofUpperCut) {
68  primary_ionization(*it, ionization_points); // fills _ionization_points
69  // transforms _ionization_points to collection_points
70  drift(*it, pixdet, bfield, ionization_points, collection_points);
71 
72  // compute induced signal on readout elements and add to _signal
73 
74  // *ihit needed only for SimHit<-->Digi link
75  induce_signal(*it, simHitGlobalIndex, tofBin, pixdet, collection_points);
76  }
77  }
78 }
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:81
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:57
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
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:64
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:73