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 " 83 double time =
hit.tof() - tCorr;
99 const float pitch_first = 0.0025;
100 const float pitch_second = 0.0100;
103 const double pitch_tolerance(0.0005);
105 if (
std::abs(topol->
pitch().first - pitch_first) > pitch_tolerance ||
106 std::abs(topol->
pitch().second - pitch_second) > pitch_tolerance)
113 int numRows = topol->
nrows();
116 for (
auto&
s : theSignal) {
117 float signalInElectrons =
s.second.ampl();
123 float signalInElectrons_odd_column_Xtalk_next_column =
125 float signalInElectrons_even_column_Xtalk_next_column =
129 s.second.set(signalInElectrons - signalInElectrons_odd_row_Xtalk_next_row -
130 signalInElectrons_even_row_Xtalk_next_row - signalInElectrons_odd_column_Xtalk_next_column -
131 signalInElectrons_even_column_Xtalk_next_column);
133 if (hitChan.first != 0) {
134 auto XtalkPrev = std::make_pair(hitChan.first - 1, hitChan.second);
137 if (hitChan.first % 2 == 1)
138 signalNew.emplace(chanXtalkPrev,
141 signalNew.emplace(chanXtalkPrev,
144 if (hitChan.first < numRows - 1) {
145 auto XtalkNext = std::make_pair(hitChan.first + 1, hitChan.second);
148 if (hitChan.first % 2 == 1)
149 signalNew.emplace(chanXtalkNext,
152 signalNew.emplace(chanXtalkNext,
156 if (hitChan.second != 0) {
157 auto XtalkPrev = std::make_pair(hitChan.first, hitChan.second - 1);
160 if (hitChan.second % 2 == 1)
169 if (hitChan.second < numColumns - 1) {
170 auto XtalkNext = std::make_pair(hitChan.first, hitChan.second + 1);
173 if (hitChan.second % 2 == 1)
183 for (
auto const&
l : signalNew) {
185 auto iter = theSignal.find(
chan);
186 if (iter != theSignal.end()) {
187 iter->second +=
l.second.ampl();
196 if (
x_.size() !=
y_.size())
198 <<
"Timewalk model error: the number of charge values does not match the number of delay values!";
203 if (it == x_.begin())
209 double x_low = *(--it);
210 double p = (
x - x_low) / (x_high - x_low);
215 threshold_values =
pset.getParameter<std::vector<double>>(
"ThresholdValues");
216 const auto& curve_psetvec =
pset.getParameter<std::vector<edm::ParameterSet>>(
"Curves");
217 if (threshold_values.size() != curve_psetvec.size())
219 <<
"Timewalk model error: the number of threshold values does not match the number of curves.";
220 for (
const auto& curve_pset : curve_psetvec)
221 curves.emplace_back(curve_pset);
225 auto index = find_closest_index(threshold_values, q_threshold);
226 return curves[
index](q_in);
230 double value)
const {
232 if (it == vec.begin())
234 else if (it == vec.end())
235 return vec.size() - 1;
238 auto it_lower = --it;
252 float corrected_time = hitInfo->
time();
270 for (
const auto&
mod : disabledModules) {
271 if (detID ==
mod.DetID) {
283 for (
auto&
s : theSignal)
288 std::vector<GlobalPixel> badrocpositions;
289 for (
size_t j = 0; j < static_cast<size_t>(ncol);
j++) {
292 for (
auto const&
p :
path) {
297 badrocpositions.push_back(global);
304 for (
auto&
s : theSignal) {
305 std::pair<int, int> ip;
311 for (
auto const&
p : badrocpositions) {
313 if (
p.row ==
k.getParameter<
int>(
"row") && ip.first ==
k.getParameter<
int>(
"row") &&
314 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