52 {
53 const InDetDD::PixelModuleDesign* p_design =
54 static_cast<const InDetDD::PixelModuleDesign*
>(&(chargedDiodes.
element())->design());
55
57 return;
58 }
59
60 const PixelID* pixelId =
static_cast<const PixelID*
>(chargedDiodes.
element()->
getIdHelper());
63
66
68 return;
69 }
70
71 SG::ReadCondHandle<PixelModuleData> moduleDataHandle(
m_moduleDataKey, ctx);
72 const PixelModuleData *moduleData = *moduleDataHandle;
73 SG::ReadCondHandle<PixelChargeCalibCondData> calibDataHandle(
m_chargeDataKey, ctx);
74 const PixelChargeCalibCondData *calibData = *calibDataHandle;
75
76 int maxFEI4SmallHit = 2;
78
79 std::vector<std::unique_ptr<Pixel1RawData>> p_rdo_small_fei4;
80 int nSmallHitsFEI4 = 0;
81 std::vector<int>
row, col;
84 std::vector<std::vector<int> > FEI4Map(maxRow + 16, std::vector<int>(maxCol + 16));
85
86
88
90
92
93
95 }
96
97
99
101 i_chargedDiode != chargedDiodes.
orderedEnd(); ++i_chargedDiode) {
102 SiChargedDiode& diode = **i_chargedDiode;
103
104 Identifier diodeID = chargedDiodes.
getId(diode.
diode());
106
107
108
109 double corrQ = 1.11 *
110 (1.0 - (-7.09 * 1000.0) / (23.72 * 1000.0 +
charge) + (-0.22 * 1000.0) /
111 (-0.42 * 1000.0 +
charge));
112 if (corrQ < 1.0) {
113 corrQ = 1.0;
114 }
116
117
118
122
123
124 const auto & thresholds = calibData->
getThresholds(type, moduleHash, FE);
126
127
128
130 int bunchSim;
132 bunchSim =
135 } else {
137 }
138
141 } else {
143 }
144 } else {
146 }
147
148
150 double totsig = calibData->
getTotRes(moduleHash, FE, tot);
151 int nToT = static_cast<int>(CLHEP::RandGaussZiggurat::shoot(rndmEngine, tot, totsig));
152
153
154 if (totsig==0.0) {
155 double totIBLsig = getSigma(nToT);
156 if (totIBLsig) {
157 if (CLHEP::RandFlat::shoot(rndmEngine,0.0,1.0)<std::exp(-0.5/totIBLsig/totIBLsig)) {
158 if (CLHEP::RandFlat::shoot(rndmEngine,0.0,1.0)<0.5) { nToT--; }
159 else { nToT++; }
160 }
161 }
162 }
163
164
165
166
167 if (nToT == 2 && maxFEI4SmallHit == 2) {
168 nToT = 1;
169 }
170
171 nToT=std::clamp(nToT, 1, overflowToT);
172
173 if (nToT <= moduleData->getToTThreshold(barrel_ec, layerIndex)) {
175 }
176
177
179 continue;
180 }
182 continue;
183 }
184
187 continue;
188 }
189
191 int bunch = (
flag >> 8) & 0xff;
192
195
198 if (iicol >= maxCol) {
199 iicol = iicol - maxCol;
200 }
201
202
204 auto p_rdo = std::make_unique<Pixel1RawData>(id_readout, nToT, bunch, 0, bunch);
205 if (nToT > maxFEI4SmallHit) {
206 rdoCollection.
push_back(p_rdo.release());
207 FEI4Map[iirow][iicol] = 2;
208 } else {
209 p_rdo_small_fei4.push_back(std::move(p_rdo));
210 row.push_back(iirow);
211 col.push_back(iicol);
212 FEI4Map[iirow][iicol] = 1;
213 nSmallHitsFEI4++;
214 }
215 }
216 }
217
218
219 if (nSmallHitsFEI4 > 0) {
221
222
223 for (int ismall = 0; ismall < nSmallHitsFEI4; ismall++) {
224 int rowPDR =
row[ismall] / 2;
225 int colPDR = col[ismall] / 2;
226 for (int rowBigHit = 2 * rowPDR; rowBigHit != 2 * rowPDR + 2 && rowBigHit < maxRow; ++rowBigHit) {
227 for (int colBigHit = 2 * colPDR; colBigHit != 2 * colPDR + 2 && colBigHit < maxCol; ++colBigHit) {
229 "rowBig = " << rowBigHit << " colBig = " << colBigHit << " Map Content = " <<
230 FEI4Map[rowBigHit][colBigHit]);
231 if (FEI4Map[rowBigHit][colBigHit] == 2 && !recorded) {
234 }
235 }
236 }
237
238
239 if (!recorded && row[ismall] < maxRow - 1) {
240 if (FEI4Map[row[ismall] + 1][col[ismall]] == 2) {
243 }
244 }
245 if (!recorded && row[ismall] != 0) {
246 if (FEI4Map[row[ismall] - 1][col[ismall]] == 2) {
249 }
250 }
251 }
252 }
253 }
double charge(const T &p)
SiChargedDiodeOrderedSet::iterator SiChargedDiodeOrderedIterator
value_type push_back(value_type pElem)
PixelReadoutTechnology getReadoutTechnology() const
int rowsPerCircuit() const
Number of cell rows per circuit:
int columnsPerCircuit() const
Number of cell columns per circuit:
int phiIndex() const
Get phi index. Equivalent to strip().
int etaIndex() const
Get eta index.
virtual Identifier identify() const override final
identifier of this detector element (inline)
virtual Identifier identifierFromCellId(const SiCellId &cellId) const =0
Identifier <-> SiCellId (ie strip number or pixel eta_index,phi_index) Identifier from SiCellId (ie s...
constexpr int getFEI4OverflowToT() const
PixelChargeCalib::Thresholds getThresholds(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
float getToT(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float Q) const
float getTotRes(unsigned int moduleHash, unsigned int FE, float Q) const
int layer_disk(const Identifier &id) const
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0).
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
double getCrossTalk(int barrel_ec, int layer) const
virtual Identifier identify() const override final
SiChargedDiodeOrderedIterator orderedEnd()
SiChargedDiodeOrderedIterator orderedBegin()
Identifier getId(const InDetDD::SiCellId &id) const
const InDetDD::SolidStateDetectorElementBase * element() const
const InDetDD::SiCellId & diode() const
const SiTotalCharge & totalCharge() const
const InDetDD::SiReadoutCellId & getReadoutCell() const
static bool isMaskOut(SiChargedDiode &chDiode)
static void SetBunch(SiChargedDiode &chDiode, int bunch, MsgStream *log=nullptr)
static void disabled(SiChargedDiode &chDiode, bool flag, bool mask=false)
static void belowThreshold(SiChargedDiode &chDiode, bool flag, bool mask=false)
static bool isDisabled(SiChargedDiode &chDiode)
static std::string release
list recorded
if USE_PDG_VALUES = True, load PDG value of sin2thetaW and particle masses/widths from parameter dict...
constexpr uint32_t invalidFrontEnd
const T * getIdHelper(StoreGateSvc *pDetStore, const std::string &helperName)
void randomDisable(SiChargedDiodeCollection &chargedDiodes, const PixelModuleData *moduleData, CLHEP::HepRandomEngine *rndmEngine)
void crossTalk(double crossTalk, SiChargedDiodeCollection &chargedDiodes)
void thermalNoise(double thermalNoise, SiChargedDiodeCollection &chargedDiodes, CLHEP::HepRandomEngine *rndmEngine)
double randomThreshold(const PixelChargeCalib::Thresholds &t, CLHEP::HepRandomEngine *pEngine)
void randomNoise(SiChargedDiodeCollection &chargedDiodes, const PixelModuleData *moduleData, int nBcid, const PixelChargeCalibCondData *chargeCalibData, CLHEP::HepRandomEngine *rndmEngine, InDetDD::IPixelReadoutManager *pixelReadout)
double getG4Time(const SiTotalCharge &totalCharge)
row
Appending html table to final .html summary file.