12 #include "CLHEP/Random/RandGaussQ.h" 13 #include "CLHEP/Random/RandFlat.h" 50 if (use_ineff_from_db_)
51 theSiPixelGainCalibrationService_->setESObjects(es);
53 if (use_deadmodule_DB_)
56 if (use_LorentzAngle_DB_)
66 conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")),
67 odd_row_interchannelCoupling_next_row(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm").getParameter<double>(
"Odd_row_interchannelCoupling_next_row")),
68 even_row_interchannelCoupling_next_row(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm").getParameter<double>(
"Even_row_interchannelCoupling_next_row")),
69 odd_column_interchannelCoupling_next_column(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm").getParameter<double>(
"Odd_column_interchannelCoupling_next_column")),
70 even_column_interchannelCoupling_next_column(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm").getParameter<double>(
"Even_column_interchannelCoupling_next_column"))
73 LogInfo(
"PixelDigitizerAlgorithm") <<
"Algorithm constructed " 74 <<
"Configuration parameters:" 75 <<
"Threshold/Gain = " 76 <<
"threshold in electron Endcap = " 78 <<
"threshold in electron Barrel = " 81 <<
" The delta cut-off is set to " <<
tMax 85 LogDebug(
"PixelDigitizerAlgorithm") <<
"Algorithm deleted";
88 std::vector<PSimHit>::const_iterator inputEnd,
89 const size_t inputBeginGlobalIndex,
90 const unsigned int tofBin,
96 size_t simHitGlobalIndex = inputBeginGlobalIndex;
97 for (
auto it = inputBegin; it != inputEnd; ++it, ++simHitGlobalIndex) {
99 if ((*it).detUnitId() != detId)
102 LogDebug (
"PixelDigitizerAlgorithm")
103 << (*it).particleType() <<
" " << (*it).pabs() <<
" " 104 << (*it).energyLoss() <<
" " << (*it).tof() <<
" " 105 << (*it).trackId() <<
" " << (*it).processType() <<
" " 107 << (*it).entryPoint() <<
" " << (*it).exitPoint();
109 std::vector<DigitizerUtility::EnergyDepositUnit> ionization_points;
110 std::vector<DigitizerUtility::SignalPoint> collection_points;
117 drift (*it, pixdet, bfield, ionization_points, collection_points);
120 induce_signal(*it, simHitGlobalIndex, tofBin, pixdet, collection_points);
135 const float pitch_first = 0.0025;
136 const float pitch_second = 0.0100;
138 if ( topol->
pitch().first != pitch_first || topol->
pitch().second != pitch_second )
return;
143 int numRows = topol->
nrows();
146 for (
auto &
s : theSignal) {
147 float signalInElectrons =
s.second.ampl();
157 s.second.set(signalInElectrons-signalInElectrons_odd_row_Xtalk_next_row-signalInElectrons_even_row_Xtalk_next_row-signalInElectrons_odd_column_Xtalk_next_column-signalInElectrons_even_column_Xtalk_next_column);
159 if (hitChan.first != 0) {
160 auto XtalkPrev = std::make_pair(hitChan.first-1, hitChan.second);
163 if (hitChan.first % 2 == 1) signalNew.emplace(chanXtalkPrev,
DigitizerUtility::Amplitude(signalInElectrons_even_row_Xtalk_next_row,
nullptr, -1.0));
166 if (hitChan.first < (numRows-1)) {
167 auto XtalkNext = std::make_pair(hitChan.first+1, hitChan.second);
170 if (hitChan.first % 2 == 1) signalNew.emplace(chanXtalkNext,
DigitizerUtility::Amplitude(signalInElectrons_odd_row_Xtalk_next_row,
nullptr, -1.0));
174 if (hitChan.second != 0) {
175 auto XtalkPrev = std::make_pair(hitChan.first, hitChan.second-1);
178 if (hitChan.second % 2 == 1) signalNew.emplace(chanXtalkPrev,
DigitizerUtility::Amplitude(signalInElectrons_even_column_Xtalk_next_column,
nullptr, -1.0));
181 if (hitChan.second < (numColumns-1)) {
182 auto XtalkNext = std::make_pair(hitChan.first, hitChan.second+1);
185 if (hitChan.second % 2 == 1) signalNew.emplace(chanXtalkNext,
DigitizerUtility::Amplitude(signalInElectrons_odd_column_Xtalk_next_column,
nullptr, -1.0));
186 else signalNew.emplace(chanXtalkNext,
DigitizerUtility::Amplitude(signalInElectrons_even_column_Xtalk_next_column,
nullptr, -1.0));
189 for (
auto const &
l : signalNew) {
191 auto iter = theSignal.find(chan);
192 if (iter != theSignal.end()) {
193 theSignal[
chan] +=
l.second.ampl();
void primary_ionization(const PSimHit &hit, std::vector< DigitizerUtility::EnergyDepositUnit > &ionization_points) const
const double even_row_interchannelCoupling_next_row
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
virtual int nrows() const =0
PixelDigitizerAlgorithm(const edm::ParameterSet &conf)
const float theThresholdInE_Endcap
void init(const edm::EventSetup &es) override
const float theElectronPerADC
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
const double odd_column_interchannelCoupling_next_column
constexpr uint32_t rawId() const
get the raw id
virtual std::pair< float, float > pitch() const =0
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 double even_column_interchannelCoupling_next_column
const float theTofUpperCut
const Plane & surface() const
The nominal surface of the GeomDet.
static int pixelToChannel(int row, int col)
const float theThresholdInE_Barrel
void add_cross_talk(const Phase2TrackerGeomDetUnit *pixdet) override
static PackedDigiType pixelToChannel(unsigned int row, unsigned int col)
const int theAdcFullScale
DetId geographicalId() const
The label of this GeomDet.
std::map< int, DigitizerUtility::Amplitude, std::less< int > > signal_map_type
const double odd_row_interchannelCoupling_next_row
void induce_signal(const PSimHit &hit, const size_t hitIndex, const unsigned int tofBin, const Phase2TrackerGeomDetUnit *pixdet, const std::vector< DigitizerUtility::SignalPoint > &collection_points)
const bool AddPixelInefficiency
static std::pair< int, int > channelToPixel(int ch)
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
virtual int ncolumns() const =0
const float theTofLowerCut
~PixelDigitizerAlgorithm() override