|
ATLAS Offline Software
|
Go to the documentation of this file.
17 #include "CLHEP/Random/RandGaussZiggurat.h"
18 #include "CLHEP/Random/RandFlat.h"
31 constexpr std::array<double,17> sigmas{0.0,0.50,0.50,0.50,0.50,0.50,0.60,0.60,0.60,0.60,0.65,0.70,0.75,0.80,0.80,0.80,0.80};
32 return sigmas.at(tot);
50 return StatusCode::SUCCESS;
55 return StatusCode::SUCCESS;
59 CLHEP::HepRandomEngine* rndmEngine) {
78 const EventContext& ctx{Gaudi::Hive::currentContext()};
84 int maxFEI4SmallHit = 2;
87 std::vector<std::unique_ptr<Pixel1RawData>> p_rdo_small_fei4;
88 int nSmallHitsFEI4 = 0;
92 std::vector<std::vector<int> > FEI4Map(maxRow + 16, std::vector<int>(maxCol + 16));
109 i_chargedDiode != chargedDiodes.
orderedEnd(); ++i_chargedDiode) {
117 double corrQ = 1.11 *
118 (1.0 - (-7.09 * 1000.0) / (23.72 * 1000.0 +
charge) + (-0.22 * 1000.0) /
119 (-0.42 * 1000.0 +
charge));
158 double totsig = calibData->
getTotRes(moduleHash, FE, tot);
159 int nToT =
static_cast<int>(CLHEP::RandGaussZiggurat::shoot(rndmEngine, tot, totsig));
163 double totIBLsig = getSigma(nToT);
165 if (CLHEP::RandFlat::shoot(rndmEngine,0.0,1.0)<
std::exp(-0.5/totIBLsig/totIBLsig)) {
166 if (CLHEP::RandFlat::shoot(rndmEngine,0.0,1.0)<0.5) { nToT--; }
175 if (nToT == 2 && maxFEI4SmallHit == 2) {
179 nToT=std::clamp(nToT, 1, overflowToT);
181 if (nToT <= moduleData->getToTThreshold(barrel_ec, layerIndex)) {
199 int bunch = (
flag >> 8) & 0xff;
206 if (iicol >= maxCol) {
207 iicol = iicol - maxCol;
212 auto p_rdo = std::make_unique<Pixel1RawData>(id_readout, nToT, bunch, 0, bunch);
213 if (nToT > maxFEI4SmallHit) {
214 rdoCollection.
push_back(p_rdo.release());
215 FEI4Map[iirow][iicol] = 2;
217 p_rdo_small_fei4.push_back(std::move(p_rdo));
218 row.push_back(iirow);
219 col.push_back(iicol);
220 FEI4Map[iirow][iicol] = 1;
227 if (nSmallHitsFEI4 > 0) {
231 for (
int ismall = 0; ismall < nSmallHitsFEI4; ismall++) {
232 int rowPDR =
row[ismall] / 2;
233 int colPDR =
col[ismall] / 2;
234 for (
int rowBigHit = 2 * rowPDR; rowBigHit != 2 * rowPDR + 2 && rowBigHit < maxRow; ++rowBigHit) {
235 for (
int colBigHit = 2 * colPDR; colBigHit != 2 * colPDR + 2 && colBigHit < maxCol; ++colBigHit) {
237 "rowBig = " << rowBigHit <<
" colBig = " << colBigHit <<
" Map Content = " <<
238 FEI4Map[rowBigHit][colBigHit]);
239 if (FEI4Map[rowBigHit][colBigHit] == 2 && !
recorded) {
248 if (FEI4Map[
row[ismall] + 1][
col[ismall]] == 2) {
254 if (FEI4Map[
row[ismall] - 1][
col[ismall]] == 2) {
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
float getToT(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float Q) const
const InDetDD::SolidStateDetectorElementBase * element() const
static bool isDisabled(SiChargedDiode &chDiode)
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
double getCrossTalk(int barrel_ec, int layer) const
PixelChargeCalib::Thresholds getThresholds(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
constexpr uint32_t invalidFrontEnd
const InDetDD::SiReadoutCellId & getReadoutCell() const
Structs for holding charge calibration parameterisation and data.
SiChargedDiodeOrderedIterator orderedEnd()
int phiIndex() const
Get phi index. Equivalent to strip().
float getTotRes(unsigned int moduleHash, unsigned int FE, float Q) const
static void disabled(SiChargedDiode &chDiode, bool flag, bool mask=false)
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline)
double getG4Time(const SiTotalCharge &totalCharge)
double randomThreshold(const PixelChargeCalib::Thresholds &t, CLHEP::HepRandomEngine *pEngine)
const InDetDD::SiCellId & diode() const
virtual Identifier identifierFromCellId(const SiCellId &cellId) const =0
Identifier <-> SiCellId (ie strip number or pixel eta_index,phi_index) Identifier from SiCellId (ie s...
Identifier getId(const InDetDD::SiCellId &id) const
const SiTotalCharge & totalCharge() const
int etaIndex() const
Get eta index.
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
list recorded
if USE_PDG_VALUES = True, load PDG value of sin2thetaW and particle masses/widths from parameter dict...
::StatusCode StatusCode
StatusCode definition for legacy code.
static void belowThreshold(SiChargedDiode &chDiode, bool flag, bool mask=false)
static void SetBunch(SiChargedDiode &chDiode, int bunch, MsgStream *log=nullptr)
int layer_disk(const Identifier &id) const
static bool isMaskOut(SiChargedDiode &chDiode)
double charge(const T &p)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
PixelReadoutTechnology getReadoutTechnology() const
void crossTalk(double crossTalk, SiChargedDiodeCollection &chargedDiodes)
int rowsPerCircuit() const
Number of cell rows per circuit:
constexpr int getFEI4OverflowToT() const
SiChargedDiodeOrderedSet::iterator SiChargedDiodeOrderedIterator
SiChargedDiodeOrderedIterator orderedBegin()
void randomNoise(SiChargedDiodeCollection &chargedDiodes, const PixelModuleData *moduleData, int nBcid, const PixelChargeCalibCondData *chargeCalibData, CLHEP::HepRandomEngine *rndmEngine, InDetDD::IPixelReadoutManager *pixelReadout)
int columnsPerCircuit() const
Number of cell columns per circuit:
void randomDisable(SiChargedDiodeCollection &chargedDiodes, const PixelModuleData *moduleData, CLHEP::HepRandomEngine *rndmEngine)
virtual Identifier identify() const override final
identifier of this detector element (inline)
void thermalNoise(double thermalNoise, SiChargedDiodeCollection &chargedDiodes, CLHEP::HepRandomEngine *rndmEngine)
virtual Identifier identify() const override final