16#include "CLHEP/Random/RandFlat.h"
31 return StatusCode::SUCCESS;
36 return StatusCode::SUCCESS;
40 CLHEP::HepRandomEngine* rndmEngine)
const {
50 const EventContext& ctx{Gaudi::Hive::currentContext()};
70 for (
auto &[mapId,mapDiode]:chargedDiodes) {
72 double charge = mapDiode.charge();
85 if (mapDiode.totalCharge().fromTrack()) {
90 const int timeWalk = 25;
109 double totsig = calibData->
getTotRes(moduleHash, FE, tot);
110 int nToT =
generateToT(rndmEngine, tot,totsig, std::make_pair(0,overflowToT));
113 if (nToT <= thresh) {
130 int flag = mapDiode.flag();
131 int bunch = (flag >> 8) & 0xff;
#define ATH_CHECK
Evaluate an expression and check for errors.
double charge(const T &p)
Structs for holding charge calibration parameterisation and data.
This is an Identifier helper class for the Pixel subdetector.
InDetRawDataCollection< PixelRDORawData > PixelRDO_Collection
value_type push_back(value_type pElem)
This is a "hash" representation of an Identifier.
Identifier for the strip or pixel readout cell.
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...
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
This is an Identifier helper class for the Pixel subdetector.
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
virtual Identifier identify() const override final
Identifier getId(const InDetDD::SiCellId &id) const
const InDetDD::SolidStateDetectorElementBase * element() 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)
constexpr uint32_t invalidFrontEnd
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)
int generateToT(CLHEP::HepRandomEngine *rndmEngine, double mean, double sd, const std::pair< int, int > &range)
double getG4Time(const SiTotalCharge &totalCharge)