26 if (use_ineff_from_db_)
27 theSiPixelGainCalibrationService_->setESObjects(es);
29 if (use_deadmodule_DB_)
32 if (use_LorentzAngle_DB_)
42 conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")),
43 odd_row_interchannelCoupling_next_row_(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
44 .getParameter<double>(
"Odd_row_interchannelCoupling_next_row")),
45 even_row_interchannelCoupling_next_row_(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
46 .getParameter<double>(
"Even_row_interchannelCoupling_next_row")),
47 odd_column_interchannelCoupling_next_column_(
48 conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
49 .getParameter<double>(
"Odd_column_interchannelCoupling_next_column")),
50 even_column_interchannelCoupling_next_column_(
51 conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
52 .getParameter<double>(
"Even_column_interchannelCoupling_next_column")),
53 apply_timewalk_(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm").getParameter<
bool>(
"ApplyTimewalk")),
57 LogDebug(
"PixelDigitizerAlgorithm") <<
"Algorithm constructed "
58 <<
"Configuration parameters:"
59 <<
"Threshold/Gain = "
63 <<
" The delta cut-off is set to " <<
tMax_ <<
" pix-inefficiency "
71 double time =
hit.tof() - tCorr;
87 const float pitch_first = 0.0025;
88 const float pitch_second = 0.0100;
91 const double pitch_tolerance(0.0005);
93 if (
std::abs(topol->
pitch().first - pitch_first) > pitch_tolerance ||
94 std::abs(topol->
pitch().second - pitch_second) > pitch_tolerance)
101 int numRows = topol->
nrows();
104 for (
auto&
s : theSignal) {
105 float signalInElectrons =
s.second.ampl();
111 float signalInElectrons_odd_column_Xtalk_next_column =
113 float signalInElectrons_even_column_Xtalk_next_column =
117 s.second.set(signalInElectrons - signalInElectrons_odd_row_Xtalk_next_row -
118 signalInElectrons_even_row_Xtalk_next_row - signalInElectrons_odd_column_Xtalk_next_column -
119 signalInElectrons_even_column_Xtalk_next_column);
121 if (hitChan.first != 0) {
122 auto XtalkPrev = std::make_pair(hitChan.first - 1, hitChan.second);
125 if (hitChan.first % 2 == 1)
126 signalNew.emplace(chanXtalkPrev,
129 signalNew.emplace(chanXtalkPrev,
132 if (hitChan.first < numRows - 1) {
133 auto XtalkNext = std::make_pair(hitChan.first + 1, hitChan.second);
136 if (hitChan.first % 2 == 1)
137 signalNew.emplace(chanXtalkNext,
140 signalNew.emplace(chanXtalkNext,
144 if (hitChan.second != 0) {
145 auto XtalkPrev = std::make_pair(hitChan.first, hitChan.second - 1);
148 if (hitChan.second % 2 == 1)
149 signalNew.emplace(chanXtalkPrev,
152 signalNew.emplace(chanXtalkPrev,
155 if (hitChan.second < numColumns - 1) {
156 auto XtalkNext = std::make_pair(hitChan.first, hitChan.second + 1);
159 if (hitChan.second % 2 == 1)
160 signalNew.emplace(chanXtalkNext,
163 signalNew.emplace(chanXtalkNext,
167 for (
auto const&
l : signalNew) {
169 auto iter = theSignal.find(
chan);
170 if (iter != theSignal.end()) {
171 iter->second +=
l.second.ampl();
180 if (
x_.size() !=
y_.size())
182 <<
"Timewalk model error: the number of charge values does not match the number of delay values!";
187 if (it == x_.begin())
193 double x_low = *(--it);
194 double p = (
x - x_low) / (x_high - x_low);
199 threshold_values =
pset.getParameter<std::vector<double>>(
"ThresholdValues");
200 const auto& curve_psetvec =
pset.getParameter<std::vector<edm::ParameterSet>>(
"Curves");
201 if (threshold_values.size() != curve_psetvec.size())
203 <<
"Timewalk model error: the number of threshold values does not match the number of curves.";
204 for (
const auto& curve_pset : curve_psetvec)
205 curves.emplace_back(curve_pset);
209 auto index = find_closest_index(threshold_values, q_threshold);
210 return curves[
index](q_in);
214 double value)
const {
216 if (it == vec.begin())
218 else if (it == vec.end())
219 return vec.size() - 1;
222 auto it_lower = --it;
223 auto closest = (
value - *it_lower > *it_upper -
value) ? it_upper : it_lower;
236 float corrected_time = hitInfo->
time();