CMS 3D CMS Logo

PixelDigitizerAlgorithm.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <cmath>
3 
7 
10 
12 #include "CLHEP/Random/RandGaussQ.h"
13 #include "CLHEP/Random/RandFlat.h"
14 
20 
38 
39 // Geometry
45 
46 using namespace edm;
47 using namespace sipixelobjects;
48 
50  if (use_ineff_from_db_) // load gain calibration service fromdb...
51  theSiPixelGainCalibrationService_->setESObjects(es);
52 
53  if (use_deadmodule_DB_)
54  es.get<SiPixelQualityRcd>().get(SiPixelBadModule_);
55 
56  if (use_LorentzAngle_DB_) // Get Lorentz angle from DB record
57  es.get<SiPixelLorentzAngleSimRcd>().get(SiPixelLorentzAngle_);
58 
59  // gets the map and geometry from the DB (to kill ROCs)
60  es.get<SiPixelFedCablingMapRcd>().get(map_);
61  es.get<TrackerDigiGeometryRecord>().get(geom_);
62 }
63 
65  Phase2TrackerDigitizerAlgorithm(conf.getParameter<ParameterSet>("AlgorithmCommon"),
66  conf.getParameter<ParameterSet>("PixelDigitizerAlgorithm"))
67 {
68  pixelFlag = true;
69  LogInfo("PixelDigitizerAlgorithm") << "Algorithm constructed "
70  << "Configuration parameters:"
71  << "Threshold/Gain = "
72  << "threshold in electron Endcap = "
74  << "threshold in electron Barrel = "
76  << " " << theElectronPerADC << " " << theAdcFullScale
77  << " The delta cut-off is set to " << tMax
78  << " pix-inefficiency " << AddPixelInefficiency;
79 }
81  LogDebug("PixelDigitizerAlgorithm") << "Algorithm deleted";
82 }
83 void PixelDigitizerAlgorithm::accumulateSimHits(std::vector<PSimHit>::const_iterator inputBegin,
84  std::vector<PSimHit>::const_iterator inputEnd,
85  const size_t inputBeginGlobalIndex,
86  const unsigned int tofBin,
87  const Phase2TrackerGeomDetUnit* pixdet,
88  const GlobalVector& bfield) {
89  // produce SignalPoint's for all SimHit's in detector
90  // Loop over hits
91  uint32_t detId = pixdet->geographicalId().rawId();
92  size_t simHitGlobalIndex = inputBeginGlobalIndex; // This needs to be stored to create the digi-sim link later
93  for (auto it = inputBegin; it != inputEnd; ++it, ++simHitGlobalIndex) {
94  // skip hits not in this detector.
95  if ((*it).detUnitId() != detId)
96  continue;
97 
98  LogDebug ("PixelDigitizerAlgorithm")
99  << (*it).particleType() << " " << (*it).pabs() << " "
100  << (*it).energyLoss() << " " << (*it).tof() << " "
101  << (*it).trackId() << " " << (*it).processType() << " "
102  << (*it).detUnitId()
103  << (*it).entryPoint() << " " << (*it).exitPoint();
104 
105  std::vector<DigitizerUtility::EnergyDepositUnit> ionization_points;
106  std::vector<DigitizerUtility::SignalPoint> collection_points;
107 
108  // fill collection_points for this SimHit, indpendent of topology
109  // Check the TOF cut
110  if (((*it).tof() - pixdet->surface().toGlobal((*it).localPosition()).mag()/30.) >= theTofLowerCut &&
111  ((*it).tof() - pixdet->surface().toGlobal((*it).localPosition()).mag()/30.) <= theTofUpperCut) {
112  primary_ionization(*it, ionization_points); // fills _ionization_points
113  drift (*it, pixdet, bfield, ionization_points, collection_points); // transforms _ionization_points to collection_points
114 
115  // compute induced signal on readout elements and add to _signal
116  induce_signal(*it, simHitGlobalIndex, tofBin, pixdet, collection_points); // *ihit needed only for SimHit<-->Digi link
117  }
118  }
119 }
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
Map map_
PixelDigitizerAlgorithm(const edm::ParameterSet &conf)
void init(const edm::EventSetup &es) override
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 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
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:62