|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "CLHEP/Random/RandomEngine.h"
17 const std::string&
name,
18 const IInterface* pIID) :
43 return StatusCode::FAILURE;
53 return StatusCode::SUCCESS;
60 return StatusCode::SUCCESS;
78 "Could not get Pixel SiHitCollection container " << hitCollection.
name() <<
" from store " <<
79 hitCollection.
store());
80 return StatusCode::FAILURE;
88 TimedHitCollList hitCollList;
93 for (
auto & iColl : hitCollList) {
107 ATH_MSG_DEBUG(
"SiTrackerHitCollection found with" << p_collection->
size() <<
" hits");
114 return StatusCode::SUCCESS;
125 if (not pixelDetEleHandle.
isValid() or elements ==
nullptr) {
127 return StatusCode::FAILURE;
130 std::unique_ptr<SiChargedDiodeCollection> chargedDiodes = std::make_unique<SiChargedDiodeCollection>();
131 std::vector<std::pair<double, double> > trfHitRecord;
132 std::vector<double> initialConditions;
134 std::vector<bool> processedElements;
140 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->
getEngine(ctx);
151 (*firstHit)->getLayerDisk(),
152 (*firstHit)->getPhiModule(), (*firstHit)->getEtaModule());
158 if (sielement ==
nullptr) {
160 " Barrel=" << (*firstHit)->getBarrelEndcap() <<
" Layer=" << (*firstHit)->getLayerDisk() <<
" Eta=" <<
161 (*firstHit)->getEtaModule() <<
" Phi=" << (*firstHit)->getPhiModule());
162 ATH_MSG_ERROR(
"detector manager could not find element with id = " <<
id);
175 if (std::abs((*phit)->meanTime()) < 10000.0 *
CLHEP::ns) {
178 (*phit)->getPhiModule(), (*phit)->getEtaModule())));
188 for (
unsigned int itool = 0; itool <
m_chargeTool.size(); itool++) {
190 if (
m_chargeTool[itool]->induceCharge(*phit, *chargedDiodes, *sielement, *p_design, trfHitRecord,
191 initialConditions, rndmEngine, ctx) == StatusCode::FAILURE) {
195 initialConditions.clear();
196 trfHitRecord.clear();
202 ATH_MSG_DEBUG(
"in digitize elements with hits: ec - layer - eta - phi " <<
209 assert(idHash < processedElements.size());
210 processedElements[idHash] =
true;
217 for (
unsigned int itool = 0; itool <
m_fesimTool.size(); itool++) {
219 m_fesimTool[itool]->process(*chargedDiodes, *RDOColl, rndmEngine);
224 addSDO(chargedDiodes.get());
225 chargedDiodes->
clear();
236 for (
unsigned int i = 0;
i < processedElements.size();
i++) {
237 if (!processedElements[
i]) {
240 ATH_MSG_ERROR(
"PixelDetector element id hash is invalid = " <<
i);
245 ATH_MSG_DEBUG(
"In digitize of untouched elements: layer - phi - eta " <<
248 element->
identify()) <<
" - " <<
"size: " << processedElements.size());
256 for (
unsigned int itool = 0; itool <
m_fesimTool.size(); itool++) {
258 m_fesimTool[itool]->process(*chargedDiodes, *RDOColl, rndmEngine);
263 addSDO(chargedDiodes.get());
264 chargedDiodes->
clear();
271 return StatusCode::SUCCESS;
282 std::vector<InDetSimData::Deposit> deposits;
290 const list_t& charges = (*i_chargedDiode).second.totalCharge().chargeComposition();
292 bool real_particle_hit =
false;
294 list_t::const_iterator EndOfChargeList = charges.end();
295 for (list_t::const_iterator i_ListOfCharges = charges.begin(); i_ListOfCharges != EndOfChargeList;
301 if (!real_particle_hit) {
302 real_particle_hit = trkLink.
isValid();
305 std::vector<InDetSimData::Deposit>::reverse_iterator theDeposit = deposits.rend();
306 std::vector<InDetSimData::Deposit>::reverse_iterator depositsR_end = deposits.rend();
307 std::vector<InDetSimData::Deposit>::reverse_iterator i_Deposit = deposits.rbegin();
308 for (; i_Deposit != depositsR_end; ++i_Deposit) {
309 if ((*i_Deposit).first == trkLink) {
310 theDeposit = i_Deposit;
316 if (theDeposit != depositsR_end) (*theDeposit).second += i_ListOfCharges->charge();
318 deposits.emplace_back(trkLink, i_ListOfCharges->charge());
324 std::move(deposits), (*i_chargedDiode).second.flag());
349 return StatusCode::SUCCESS;
367 return StatusCode::SUCCESS;
375 ATH_MSG_VERBOSE(
"PixelDigitizationTool::processBunchXing() " << bunchXing);
379 return StatusCode::SUCCESS;
382 return StatusCode::SUCCESS;
389 TimedHitCollList hitCollList;
392 bSubEvents, eSubEvents).isSuccess()) &&
393 hitCollList.empty()) {
395 return StatusCode::FAILURE;
403 for (; iColl != endColl; ++iColl) {
408 "time index info. time: " << timeIndex.
time() <<
" index: " << timeIndex.
index() <<
" type: " <<
413 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
void setIdentifier(Identifier id)
const_pointer_type cptr()
Dereference the pointer.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
virtual IdentifierHash identifyHash() const override final
const std::string & name() const
Return the StoreGate ID for the referenced object.
SiChargedDiodeIterator end()
index_type index() const
the index of the component event in PileUpEventInfo
#define ATH_MSG_VERBOSE(x)
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
std::vector< SiCharge > list_t
bool nextDetectorElement(const_iterator &b, const_iterator &e)
sets an iterator range with the hits of current detector element returns a bool when done
SiChargedDiodeIterator begin()
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
SiChargedDiodeMap::iterator SiChargedDiodeIterator
std::list< value_t > type
type of the collection of timed data object
virtual IdentifierHash identifyHash() const override final
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
a link optimized in size for a GenParticle in a McEventCollection
Identifier getId(const InDetDD::SiCellId &id) const
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
void insert(const PileUpTimeEventIndex &timeEventIndex, const AtlasHitsVector< HIT > *inputCollection)
void setDetectorElement(const InDetDD::SolidStateDetectorElementBase *SiElement)
void reserve(unsigned int numberOfHits)
reserve a timed vector numberOfHits in size.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string store() const
Return the name of the store holding the object we are proxying.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
bool isValid() const
Validity check.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
bool is_valid() const
Check if id is in a valid state.
int layer_disk(const Identifier &id) const
int eta_module(const Identifier &id) const
A wrapper class for event-slot-local random engines.
time_type time() const
bunch xing time in ns
InDetRawDataCollection< PixelRDORawData > PixelRDO_Collection
StatusCode initialize(bool used=true)
size_type wafer_hash_max(void) const
std::size_t numberOfSiHits(const xAOD::TrackParticle *tp)
return the number of Si hits in the track particle
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
AtlasHitsVector< SiHit > SiHitCollection
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
int phi_module(const Identifier &id) const
a struct encapsulating the identifier of a pile-up event
PileUpType type() const
the pileup type - minbias, cavern, beam halo, signal?
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
virtual Identifier identify() const override final
identifier of this detector element (inline)
virtual Identifier identify() const override final