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_);
42 conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm"),
44 odd_row_interchannelCoupling_next_row_(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
45 .getParameter<double>(
"Odd_row_interchannelCoupling_next_row")),
46 even_row_interchannelCoupling_next_row_(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
47 .getParameter<double>(
"Even_row_interchannelCoupling_next_row")),
48 odd_column_interchannelCoupling_next_column_(
49 conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
50 .getParameter<double>(
"Odd_column_interchannelCoupling_next_column")),
51 even_column_interchannelCoupling_next_column_(
52 conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm")
53 .getParameter<double>(
"Even_column_interchannelCoupling_next_column")),
54 apply_timewalk_(conf.getParameter<
ParameterSet>(
"PixelDigitizerAlgorithm").getParameter<
bool>(
"ApplyTimewalk")),
64 LogDebug(
"PixelDigitizerAlgorithm") <<
"Algorithm constructed " 65 <<
"Configuration parameters:" 66 <<
"Threshold/Gain = " 70 <<
" The delta cut-off is set to " <<
tMax_ <<
" pix-inefficiency " 78 double time =
hit.tof() - tCorr;
94 const float pitch_first = 0.0025;
95 const float pitch_second = 0.0100;
98 const double pitch_tolerance(0.0005);
100 if (
std::abs(topol->
pitch().first - pitch_first) > pitch_tolerance ||
101 std::abs(topol->
pitch().second - pitch_second) > pitch_tolerance)
108 int numRows = topol->
nrows();
111 for (
auto&
s : theSignal) {
112 float signalInElectrons =
s.second.ampl();
118 float signalInElectrons_odd_column_Xtalk_next_column =
120 float signalInElectrons_even_column_Xtalk_next_column =
124 s.second.set(signalInElectrons - signalInElectrons_odd_row_Xtalk_next_row -
125 signalInElectrons_even_row_Xtalk_next_row - signalInElectrons_odd_column_Xtalk_next_column -
126 signalInElectrons_even_column_Xtalk_next_column);
128 if (hitChan.first != 0) {
129 auto XtalkPrev = std::make_pair(hitChan.first - 1, hitChan.second);
132 if (hitChan.first % 2 == 1)
133 signalNew.emplace(chanXtalkPrev,
136 signalNew.emplace(chanXtalkPrev,
139 if (hitChan.first < numRows - 1) {
140 auto XtalkNext = std::make_pair(hitChan.first + 1, hitChan.second);
143 if (hitChan.first % 2 == 1)
144 signalNew.emplace(chanXtalkNext,
147 signalNew.emplace(chanXtalkNext,
151 if (hitChan.second != 0) {
152 auto XtalkPrev = std::make_pair(hitChan.first, hitChan.second - 1);
155 if (hitChan.second % 2 == 1)
156 signalNew.emplace(chanXtalkPrev,
159 signalNew.emplace(chanXtalkPrev,
162 if (hitChan.second < numColumns - 1) {
163 auto XtalkNext = std::make_pair(hitChan.first, hitChan.second + 1);
166 if (hitChan.second % 2 == 1)
167 signalNew.emplace(chanXtalkNext,
170 signalNew.emplace(chanXtalkNext,
174 for (
auto const&
l : signalNew) {
176 auto iter = theSignal.find(
chan);
177 if (iter != theSignal.end()) {
178 iter->second +=
l.second.ampl();
187 if (
x_.size() !=
y_.size())
189 <<
"Timewalk model error: the number of charge values does not match the number of delay values!";
194 if (it == x_.begin())
200 double x_low = *(--it);
201 double p = (
x - x_low) / (x_high - x_low);
206 threshold_values =
pset.getParameter<std::vector<double>>(
"ThresholdValues");
207 const auto& curve_psetvec =
pset.getParameter<std::vector<edm::ParameterSet>>(
"Curves");
208 if (threshold_values.size() != curve_psetvec.size())
210 <<
"Timewalk model error: the number of threshold values does not match the number of curves.";
211 for (
const auto& curve_pset : curve_psetvec)
212 curves.emplace_back(curve_pset);
216 auto index = find_closest_index(threshold_values, q_threshold);
217 return curves[
index](q_in);
221 double value)
const {
223 if (it == vec.begin())
225 else if (it == vec.end())
226 return vec.size() - 1;
229 auto it_lower = --it;
230 auto closest = (
value - *it_lower > *it_upper -
value) ? it_upper : it_lower;
243 float corrected_time = hitInfo->
time();
261 for (
const auto&
mod : disabledModules) {
262 if (detID ==
mod.DetID) {
274 for (
auto&
s : theSignal)
279 std::vector<GlobalPixel> badrocpositions;
280 for (
size_t j = 0; j < static_cast<size_t>(ncol);
j++) {
283 for (
auto const&
p :
path) {
288 badrocpositions.push_back(global);
295 for (
auto&
s : theSignal) {
296 std::pair<int, int> ip;
302 for (
auto const&
p : badrocpositions) {
304 if (
p.row ==
k.getParameter<
int>(
"row") && ip.first ==
k.getParameter<
int>(
"row") &&
305 std::abs(ip.second -
p.col) <
k.getParameter<
int>(
"col")) {
edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > siPixelBadModuleToken_
const float theElectronPerADC_
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_
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_
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
bool isAboveThreshold(const DigitizerUtility::SimHitInfo *hitInfo, float charge, float thr) const override
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_
bool getData(T &iHolder) const
DetId geographicalId() const
The label of this GeomDet.
std::map< int, DigitizerUtility::Amplitude, std::less< int > > signal_map_type
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...
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