 |
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "CLHEP/Random/RandomEngine.h"
16 const std::string&
name,
17 const IInterface* pIID) :
42 return StatusCode::FAILURE;
52 return StatusCode::SUCCESS;
59 return StatusCode::SUCCESS;
78 "Could not get Pixel SiHitCollection container " << hitCollection.
name() <<
" from store " <<
79 hitCollection.
store());
80 return StatusCode::FAILURE;
89 TimedHitCollList hitCollList;
94 for (
auto & iColl : hitCollList) {
107 event_data.
m_timedHits->insert(iColl.first, p_collection);
108 ATH_MSG_DEBUG(
"SiTrackerHitCollection found with" << p_collection->
size() <<
" hits");
115 return StatusCode::SUCCESS;
126 if (not pixelDetEleHandle.
isValid() or elements ==
nullptr) {
128 return StatusCode::FAILURE;
131 std::unique_ptr<SiChargedDiodeCollection> chargedDiodes = std::make_unique<SiChargedDiodeCollection>();
132 std::vector<std::pair<double, double> > trfHitRecord;
133 std::vector<double> initialConditions;
135 std::vector<bool> processedElements;
141 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->
getEngine(ctx);
149 while (event_data.
m_timedHits->nextDetectorElement(firstHit, lastHit)) {
153 (*firstHit)->getLayerDisk(),
154 (*firstHit)->getPhiModule(), (*firstHit)->getEtaModule());
160 if (sielement ==
nullptr) {
162 " Barrel=" << (*firstHit)->getBarrelEndcap() <<
" Layer=" << (*firstHit)->getLayerDisk() <<
" Eta=" <<
163 (*firstHit)->getEtaModule() <<
" Phi=" << (*firstHit)->getPhiModule());
164 ATH_MSG_ERROR(
"detector manager could not find element with id = " <<
id);
177 if (std::abs((*phit)->meanTime()) < 10000.0 *
CLHEP::ns) {
180 (*phit)->getPhiModule(), (*phit)->getEtaModule())));
190 for (
unsigned int itool = 0; itool <
m_chargeTool.size(); itool++) {
192 if (
m_chargeTool[itool]->induceCharge(*phit, *chargedDiodes, *sielement, *p_design, trfHitRecord,
193 initialConditions, rndmEngine, ctx) == StatusCode::FAILURE) {
197 initialConditions.clear();
198 trfHitRecord.clear();
204 ATH_MSG_DEBUG(
"in digitize elements with hits: ec - layer - eta - phi " <<
211 assert(idHash < processedElements.size());
212 processedElements[idHash] =
true;
219 for (
unsigned int itool = 0; itool <
m_fesimTool.size(); itool++) {
221 m_fesimTool[itool]->process(*chargedDiodes, *RDOColl, rndmEngine);
227 addSDO(chargedDiodes.get(), event_data);
228 chargedDiodes->
clear();
238 for (
unsigned int i = 0;
i < processedElements.size();
i++) {
239 if (!processedElements[
i]) {
242 ATH_MSG_ERROR(
"PixelDetector element id hash is invalid = " <<
i);
247 ATH_MSG_DEBUG(
"In digitize of untouched elements: layer - phi - eta " <<
250 element->
identify()) <<
" - " <<
"size: " << processedElements.size());
258 for (
unsigned int itool = 0; itool <
m_fesimTool.size(); itool++) {
260 m_fesimTool[itool]->process(*chargedDiodes, *RDOColl, rndmEngine);
266 addSDO(chargedDiodes.get(),event_data);
267 chargedDiodes->
clear();
274 return StatusCode::SUCCESS;
285 std::vector<InDetSimData::Deposit> deposits;
293 const list_t& charges = (*i_chargedDiode).second.totalCharge().chargeComposition();
295 bool real_particle_hit =
false;
297 list_t::const_iterator EndOfChargeList = charges.end();
298 for (list_t::const_iterator i_ListOfCharges = charges.begin(); i_ListOfCharges != EndOfChargeList;
304 if (!real_particle_hit) {
305 real_particle_hit = trkLink.
isValid();
308 std::vector<InDetSimData::Deposit>::reverse_iterator theDeposit = deposits.rend();
309 std::vector<InDetSimData::Deposit>::reverse_iterator depositsR_end = deposits.rend();
310 std::vector<InDetSimData::Deposit>::reverse_iterator i_Deposit = deposits.rbegin();
311 for (; i_Deposit != depositsR_end; ++i_Deposit) {
312 if ((*i_Deposit).first == trkLink) {
313 theDeposit = i_Deposit;
319 if (theDeposit != depositsR_end) (*theDeposit).second += i_ListOfCharges->charge();
321 deposits.emplace_back(trkLink, i_ListOfCharges->charge());
328 std::move(deposits), (*i_chargedDiode).second.flag());
349 event_data.
m_timedHits = std::make_unique<TimedHitCollection<SiHit> >();
352 return StatusCode::SUCCESS;
370 return StatusCode::SUCCESS;
378 ATH_MSG_VERBOSE(
"PixelDigitizationTool::processBunchXing() " << bunchXing);
383 return StatusCode::SUCCESS;
386 return StatusCode::SUCCESS;
393 TimedHitCollList hitCollList;
396 bSubEvents, eSubEvents).isSuccess()) &&
397 hitCollList.empty()) {
399 return StatusCode::FAILURE;
407 for (; iColl != endColl; ++iColl) {
412 "time index info. time: " << timeIndex.
time() <<
" index: " << timeIndex.
index() <<
" type: " <<
415 event_data.
m_timedHits->insert(timeIndex, hitCollPtr);
418 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
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 setDetectorElement(const InDetDD::SolidStateDetectorElementBase *SiElement)
::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.
size_type wafer_hash_max() const
int layer_disk(const Identifier &id) const
int eta_module(const Identifier &id) const
virtual bool isValid() override final
Can the handle be successfully dereferenced?
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)
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