26 if (use_ineff_from_db_)
27 theSiPixelGainCalibrationService_->setESObjects(es);
29 if (use_deadmodule_DB_)
30 siPixelBadModule_ = &es.
getData(siPixelBadModuleToken_);
32 if (use_LorentzAngle_DB_)
33 siPixelLorentzAngle_ = &es.
getData(siPixelLorentzAngleToken_);
36 fedCablingMap_ = &es.
getData(fedCablingMapToken_);
37 geom_ = &es.
getData(geomToken_);
38 if (useChargeReweighting_) {
39 theSiPixelChargeReweightingAlgorithm_->init(es);
45 conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm"),
47 odd_row_interchannelCoupling_next_row_(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
48 .getParameter<double>(
"Odd_row_interchannelCoupling_next_row")),
49 even_row_interchannelCoupling_next_row_(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
50 .getParameter<double>(
"Even_row_interchannelCoupling_next_row")),
51 odd_column_interchannelCoupling_next_column_(
52 conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
53 .getParameter<double>(
"Odd_column_interchannelCoupling_next_column")),
54 even_column_interchannelCoupling_next_column_(
55 conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
56 .getParameter<double>(
"Even_column_interchannelCoupling_next_column")),
57 apply_timewalk_(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm").getParameter<
bool>(
"ApplyTimewalk")),
67 LogDebug(
"PixelDigitizerAlgorithm") <<
"Algorithm constructed " 68 <<
"Configuration parameters:" 69 <<
"Threshold/Gain = " 73 <<
" The delta cut-off is set to " <<
tMax_ <<
" pix-inefficiency " 84 double toa =
hit.tof() - tCorr;
100 const float pitch_first = 0.0025;
101 const float pitch_second = 0.0100;
104 const double pitch_tolerance(0.0005);
106 if (
std::abs(topol->
pitch().first - pitch_first) > pitch_tolerance ||
107 std::abs(topol->
pitch().second - pitch_second) > pitch_tolerance)
114 int numRows = topol->
nrows();
117 for (
auto&
s : theSignal) {
118 float signalInElectrons =
s.second.ampl();
124 float signalInElectrons_odd_column_Xtalk_next_column =
126 float signalInElectrons_even_column_Xtalk_next_column =
130 s.second.set(signalInElectrons - signalInElectrons_odd_row_Xtalk_next_row -
131 signalInElectrons_even_row_Xtalk_next_row - signalInElectrons_odd_column_Xtalk_next_column -
132 signalInElectrons_even_column_Xtalk_next_column);
134 if (hitChan.first != 0) {
135 auto XtalkPrev = std::make_pair(hitChan.first - 1, hitChan.second);
138 if (hitChan.first % 2 == 1)
139 signalNew.emplace(chanXtalkPrev,
142 signalNew.emplace(chanXtalkPrev,
145 if (hitChan.first < numRows - 1) {
146 auto XtalkNext = std::make_pair(hitChan.first + 1, hitChan.second);
149 if (hitChan.first % 2 == 1)
150 signalNew.emplace(chanXtalkNext,
153 signalNew.emplace(chanXtalkNext,
157 if (hitChan.second != 0) {
158 auto XtalkPrev = std::make_pair(hitChan.first, hitChan.second - 1);
161 if (hitChan.second % 2 == 1)
170 if (hitChan.second < numColumns - 1) {
171 auto XtalkNext = std::make_pair(hitChan.first, hitChan.second + 1);
174 if (hitChan.second % 2 == 1)
184 for (
auto const&
l : signalNew) {
186 auto iter = theSignal.find(
chan);
187 if (iter != theSignal.end()) {
188 iter->second +=
l.second.ampl();
197 if (
x_.size() !=
y_.size())
199 <<
"Timewalk model error: the number of charge values does not match the number of delay values!";
204 if (it == x_.begin())
210 double x_low = *(--it);
211 double p = (
x - x_low) / (x_high - x_low);
216 threshold_values =
pset.getParameter<std::vector<double>>(
"ThresholdValues");
217 const auto& curve_psetvec =
pset.getParameter<std::vector<edm::ParameterSet>>(
"Curves");
218 if (threshold_values.size() != curve_psetvec.size())
220 <<
"Timewalk model error: the number of threshold values does not match the number of curves.";
221 for (
const auto& curve_pset : curve_psetvec)
222 curves.emplace_back(curve_pset);
226 auto index = find_closest_index(threshold_values, q_threshold);
227 return curves[
index](q_in);
231 double value)
const {
233 if (it == vec.begin())
235 else if (it == vec.end())
236 return vec.size() - 1;
239 auto it_lower = --it;
253 float corrected_time = hitInfo->
time();
271 for (
const auto&
mod : disabledModules) {
272 if (detID ==
mod.DetID) {
284 for (
auto&
s : theSignal)
289 std::vector<GlobalPixel> badrocpositions;
290 for (
size_t j = 0; j < static_cast<size_t>(ncol);
j++) {
293 for (
auto const&
p :
path) {
298 badrocpositions.push_back(global);
305 for (
auto&
s : theSignal) {
306 std::pair<int, int> ip;
312 for (
auto const&
p : badrocpositions) {
314 if (
p.row ==
k.getParameter<
int>(
"row") && ip.first ==
k.getParameter<
int>(
"row") &&
315 std::abs(ip.second -
p.col) <
k.getParameter<
int>(
"col")) {
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > siPixelBadModuleToken_
const float theElectronPerADC_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
bool IsRocBad(const uint32_t &detid, const short &rocNb) const
void init(const edm::EventSetup &es) override
static std::pair< int, int > channelToPixel(int ch)
virtual int ncolumns() const =0
const SiPixelQuality * siPixelBadModule_
int closest(std::vector< int > const &vec, int value)
void module_killing_DB(const Phase2TrackerGeomDetUnit *pixdet) override
virtual int nrows() const =0
double even_row_interchannelCoupling_next_row_
std::vector< sipixelobjects::CablingPathToDetUnit > pathToDetUnit(uint32_t rawDetId) const final
const float theThresholdInE_Endcap_
std::map< int, digitizerUtility::Ph2Amplitude, std::less< int > > signal_map_type
identify pixel inside single ROC
const TimewalkModel timewalk_model_
const bool use_LorentzAngle_DB_
static int pixelToChannel(int row, int col)
global coordinates (row and column in DetUnit, as in PixelDigi)
const bool use_deadmodule_DB_
void add_cross_talk(const Phase2TrackerGeomDetUnit *pixdet) override
const std::vector< disabledModuleType > getBadComponentList() const
double operator()(double q_in, double q_threshold) const
GlobalPixel toGlobal(const LocalPixel &loc) const
static PackedDigiType pixelToChannel(unsigned int row, unsigned int col)
TimewalkCurve(const edm::ParameterSet &pset)
const bool addPixelInefficiency_
double even_column_interchannelCoupling_next_column_
const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &path) const final
Abs< T >::type abs(const T &t)
const float theThresholdInE_Barrel_
DetId geographicalId() const
The label of this GeomDet.
bool select_hit(const PSimHit &hit, double tCorr, double &sigScale) const override
const float theTofLowerCut_
TimewalkModel(const edm::ParameterSet &pset)
PixelDigitizerAlgorithm(const edm::ParameterSet &conf, edm::ConsumesCollector iC)
constexpr uint32_t rawId() const
get the raw id
double odd_column_interchannelCoupling_next_column_
row and collumn in ROC representation
double odd_row_interchannelCoupling_next_row_
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
bool isAboveThreshold(const digitizerUtility::SimHitInfo *hitInfo, float charge, float thr) const override
std::size_t find_closest_index(const std::vector< double > &vec, double value) const
static std::pair< unsigned int, unsigned int > channelToPixel(unsigned int ch)
const SiPixelFedCablingMap * fedCablingMap_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
const int theAdcFullScale_
edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleSimRcd > siPixelLorentzAngleToken_
virtual std::pair< float, float > pitch() const =0
T mod(const T &a, const T &b)
const float theTofUpperCut_
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
~PixelDigitizerAlgorithm() override
double operator()(double x) const