|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "CLHEP/Random/RandomEngine.h"
8 #include "CLHEP/Random/RandGaussZiggurat.h"
9 #include "CLHEP/Random/RandFlat.h"
10 #include "CLHEP/Random/RandPoisson.h"
30 for (
SiChargedDiodeIterator i_chargedDiode = oldChargedDiodes.begin(); i_chargedDiode != oldChargedDiodes.end();
33 std::vector<InDetDD::SiCellId> neighbours;
35 for (std::vector<InDetDD::SiCellId>::const_iterator p_neighbour = neighbours.begin();
36 p_neighbour != neighbours.end(); ++p_neighbour) {
62 CLHEP::HepRandomEngine* rndmEngine) {
64 i_chargedDiode != chargedDiodes.
orderedEnd(); ++i_chargedDiode) {
66 (*i_chargedDiode)->add(
charge);
83 const double totalNoiseOccupancy = moduleData->
getNoiseOccupancy(barrel_ec,layerIndex) * nBcid;
85 const std::vector<float> &noiseShape = moduleData->
getNoiseShape(barrel_ec, layerIndex);
94 return randomNoise(chargedDiodes, totalNoiseOccupancy, noiseShape, overflowToT, chargeCalibData, rndmEngine, pixelReadout);
108 const auto totalCells = nCircuits * nColumns *
nRows;
109 int nNoise = CLHEP::RandPoisson::shoot(rndmEngine, totalCells * totalNoiseOccupancy);
112 for (
int i = 0;
i < nNoise;
i++) {
113 int circuit = CLHEP::RandFlat::shootInt(rndmEngine, nCircuits);
114 int column = CLHEP::RandFlat::shootInt(rndmEngine, nColumns);
115 int row = CLHEP::RandFlat::shootInt(rndmEngine,
nRows);
125 float x =
static_cast<float>(CLHEP::RandFlat::shoot(rndmEngine, 0., 1.));
127 for (
size_t j = 1; j < noiseShape.size(); j++) {
128 if (
x > noiseShape[j - 1] &&
x <= noiseShape[j]) {
133 float noiseToTm =
bin + 1.5f;
134 float noiseToT = CLHEP::RandGaussZiggurat::shoot(rndmEngine, noiseToTm, 1.
f);
135 if (noiseToT < 1.
f) {
continue; }
136 noiseToT =
std::min(noiseToT, overflowToT);
139 float chargeShape = chargeCalibData->
getCharge(
type, moduleHash, circuit, noiseToT);
148 CLHEP::HepRandomEngine* rndmEngine) {
153 return randomDisable(chargedDiodes, disableProbability, rndmEngine);
158 CLHEP::HepRandomEngine* rndmEngine){
160 i_chargedDiode != chargedDiodes.
orderedEnd(); ++i_chargedDiode) {
161 if (CLHEP::RandFlat::shoot(rndmEngine) < disableProbability) {
172 return totalCharge.
time();
185 if (findfirst == 0) {
186 return totalCharge.
time();
const InDetDD::SolidStateDetectorElementBase * element() const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
double intersectionLength(const SiCellId &diode1, const SiCellId &diode2) const
Compute the intersection length of two diodes: return: the intersection length when the two diodes ar...
bool isValid() const
Test if its in a valid state.
SiChargedDiodeOrderedIterator orderedEnd()
std::unordered_map< InDetDD::SiCellId, SiChargedDiode, SiChargedDiodeHash, std::equal_to< InDetDD::SiCellId >, SG::ArenaPoolSTLAllocator< std::pair< const InDetDD::SiCellId, SiChargedDiode > > > SiChargedDiodeMap
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
static void disabled(SiChargedDiode &chDiode, bool flag, bool mask=false)
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline)
double getG4Time(const SiTotalCharge &totalCharge)
SiChargedDiodeMap::iterator SiChargedDiodeIterator
const list_t & chargeComposition() 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...
const SiTotalCharge & totalCharge() const
virtual PixelDiodeType getDiodeType(Identifier id) const =0
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
int numberOfCircuits() const
Total number of circuits:
int getFEI3Latency(int barrel_ec, int layer) const
int layer_disk(const Identifier &id) const
double charge(const T &p)
PixelReadoutTechnology getReadoutTechnology() const
void crossTalk(double crossTalk, SiChargedDiodeCollection &chargedDiodes)
void add(const InDetDD::SiCellId &diode, const T &charge)
double getDisableProbability(int barrel_ec, int layer) const
SiChargedDiodeMap & chargedDiodes()
int rowsPerCircuit() const
Number of cell rows per circuit:
const std::vector< float > & getNoiseShape(int barrel_ec, int layer) const
constexpr int getFEI4OverflowToT() const
double getNoiseOccupancy(int barrel_ec, int layer) const
SiChargedDiodeOrderedSet::iterator SiChargedDiodeOrderedIterator
float getCharge(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float ToT) const
virtual void neighboursOfCell(const SiCellId &cellId, std::vector< SiCellId > &neighbours) const
Get the neighbouring diodes of a given diode: Cell for which the neighbours must be found List of cel...
Store pixel constant parameters in PixelModuleData.
SiChargedDiodeOrderedIterator orderedBegin()
void randomNoise(SiChargedDiodeCollection &chargedDiodes, const PixelModuleData *moduleData, int nBcid, const PixelChargeCalibCondData *chargeCalibData, CLHEP::HepRandomEngine *rndmEngine, InDetDD::IPixelReadoutManager *pixelReadout)
unsigned constexpr int nRows
const HepMcParticleLink & particleLink() const
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
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