20 if (use_ineff_from_db_)
21 theSiPixelGainCalibrationService_->setESObjects(es);
23 if (use_deadmodule_DB_)
24 siPixelBadModule_ = &es.
getData(siPixelBadModuleToken_);
26 if (use_LorentzAngle_DB_)
27 siPixelLorentzAngle_ = &es.
getData(siPixelLorentzAngleToken_);
30 fedCablingMap_ = &es.
getData(fedCablingMapToken_);
31 geom_ = &es.
getData(geomToken_);
36 conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm"),
38 odd_row_interchannelCoupling_next_row_(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
39 .getParameter<double>(
"Odd_row_interchannelCoupling_next_row")),
40 even_row_interchannelCoupling_next_row_(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
41 .getParameter<double>(
"Even_row_interchannelCoupling_next_row")),
42 odd_column_interchannelCoupling_next_column_(
43 conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
44 .getParameter<double>(
"Odd_column_interchannelCoupling_next_column")),
45 even_column_interchannelCoupling_next_column_(
46 conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
47 .getParameter<double>(
"Even_column_interchannelCoupling_next_column")),
48 apply_timewalk_(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm").getParameter<
bool>(
"ApplyTimewalk")),
58 LogDebug(
"PixelDigitizerAlgorithm") <<
"Algorithm constructed "
59 <<
"Configuration parameters:"
60 <<
"Threshold/Gain = "
64 <<
" The delta cut-off is set to " <<
tMax_ <<
" pix-inefficiency "
72 double time =
hit.tof() - tCorr;
88 const float pitch_first = 0.0025;
89 const float pitch_second = 0.0100;
92 const double pitch_tolerance(0.0005);
94 if (
std::abs(topol->
pitch().first - pitch_first) > pitch_tolerance ||
95 std::abs(topol->
pitch().second - pitch_second) > pitch_tolerance)
102 int numRows = topol->
nrows();
105 for (
auto&
s : theSignal) {
106 float signalInElectrons =
s.second.ampl();
112 float signalInElectrons_odd_column_Xtalk_next_column =
114 float signalInElectrons_even_column_Xtalk_next_column =
118 s.second.set(signalInElectrons - signalInElectrons_odd_row_Xtalk_next_row -
119 signalInElectrons_even_row_Xtalk_next_row - signalInElectrons_odd_column_Xtalk_next_column -
120 signalInElectrons_even_column_Xtalk_next_column);
122 if (hitChan.first != 0) {
123 auto XtalkPrev = std::make_pair(hitChan.first - 1, hitChan.second);
126 if (hitChan.first % 2 == 1)
127 signalNew.emplace(chanXtalkPrev,
130 signalNew.emplace(chanXtalkPrev,
133 if (hitChan.first < numRows - 1) {
134 auto XtalkNext = std::make_pair(hitChan.first + 1, hitChan.second);
137 if (hitChan.first % 2 == 1)
138 signalNew.emplace(chanXtalkNext,
141 signalNew.emplace(chanXtalkNext,
145 if (hitChan.second != 0) {
146 auto XtalkPrev = std::make_pair(hitChan.first, hitChan.second - 1);
149 if (hitChan.second % 2 == 1)
150 signalNew.emplace(chanXtalkPrev,
153 signalNew.emplace(chanXtalkPrev,
156 if (hitChan.second < numColumns - 1) {
157 auto XtalkNext = std::make_pair(hitChan.first, hitChan.second + 1);
160 if (hitChan.second % 2 == 1)
161 signalNew.emplace(chanXtalkNext,
164 signalNew.emplace(chanXtalkNext,
168 for (
auto const&
l : signalNew) {
170 auto iter = theSignal.find(
chan);
171 if (iter != theSignal.end()) {
172 iter->second +=
l.second.ampl();
181 if (
x_.size() !=
y_.size())
183 <<
"Timewalk model error: the number of charge values does not match the number of delay values!";
188 if (it == x_.begin())
194 double x_low = *(--it);
195 double p = (
x - x_low) / (x_high - x_low);
200 threshold_values =
pset.getParameter<std::vector<double>>(
"ThresholdValues");
201 const auto& curve_psetvec =
pset.getParameter<std::vector<edm::ParameterSet>>(
"Curves");
202 if (threshold_values.size() != curve_psetvec.size())
204 <<
"Timewalk model error: the number of threshold values does not match the number of curves.";
205 for (
const auto& curve_pset : curve_psetvec)
206 curves.emplace_back(curve_pset);
210 auto index = find_closest_index(threshold_values, q_threshold);
211 return curves[
index](q_in);
215 double value)
const {
217 if (it == vec.begin())
219 else if (it == vec.end())
220 return vec.size() - 1;
223 auto it_lower = --it;
224 auto closest = (
value - *it_lower > *it_upper -
value) ? it_upper : it_lower;
237 float corrected_time = hitInfo->
time();