 |
ATLAS Offline Software
|
#include <PixelDigitizationTool.h>
Definition at line 38 of file PixelDigitizationTool.h.
◆ PixelDigitizationTool() [1/3]
PixelDigitizationTool::PixelDigitizationTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
pIID |
|
) |
| |
◆ PixelDigitizationTool() [2/3]
PixelDigitizationTool::PixelDigitizationTool |
( |
| ) |
|
|
private |
◆ PixelDigitizationTool() [3/3]
◆ addSDO()
Definition at line 282 of file PixelDigitizationTool.cxx.
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());
326 assert( event_data.m_simDataColl.isValid());
327 event_data.m_simDataColl->try_emplace(collection->
getId((*i_chargedDiode).first),
328 std::move(deposits), (*i_chargedDiode).second.flag());
◆ digitizeEvent()
StatusCode PixelDigitizationTool::digitizeEvent |
( |
const EventContext & |
ctx, |
|
|
EventData & |
event_data |
|
) |
| const |
|
protected |
Definition at line 121 of file PixelDigitizationTool.cxx.
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);
148 assert(event_data.m_timedHits);
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);
223 assert(event_data.m_rdoContainer.isValid());
227 addSDO(chargedDiodes.get(), event_data);
228 chargedDiodes->
clear();
230 event_data.m_timedHits.reset();
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);
262 assert( event_data.m_rdoContainer.isValid());
266 addSDO(chargedDiodes.get(),event_data);
267 chargedDiodes->
clear();
274 return StatusCode::SUCCESS;
◆ filterPassed()
virtual bool PileUpToolBase::filterPassed |
( |
| ) |
const |
|
inlineoverridevirtualinherited |
◆ finalize()
StatusCode PixelDigitizationTool::finalize |
( |
| ) |
|
|
overridevirtual |
◆ getCurrentEventData()
EventData& PixelDigitizationTool::getCurrentEventData |
( |
| ) |
|
|
inlineprotected |
◆ initialize()
StatusCode PixelDigitizationTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ mergeEvent()
StatusCode PixelDigitizationTool::mergeEvent |
( |
const EventContext & |
ctx | ) |
|
|
overridevirtual |
◆ operator=()
◆ prepareEvent() [1/2]
StatusCode PixelDigitizationTool::prepareEvent |
( |
const EventContext & |
ctx, |
|
|
EventData & |
event_data |
|
) |
| const |
|
protected |
Definition at line 336 of file PixelDigitizationTool.cxx.
342 ATH_MSG_DEBUG(
"PixelRDO_Container " << event_data.m_rdoContainer.name() <<
" registered in StoreGate");
345 ATH_CHECK(event_data.m_simDataColl.record(std::make_unique<InDetSimDataCollection>()));
346 ATH_MSG_DEBUG(
"InDetSimDataCollection " << event_data.m_simDataColl.name() <<
" registered in StoreGate");
349 event_data.m_timedHits = std::make_unique<TimedHitCollection<SiHit> >();
351 event_data.m_HardScatterSplittingSkipper =
false;
352 return StatusCode::SUCCESS;
◆ prepareEvent() [2/2]
virtual StatusCode PixelDigitizationTool::prepareEvent |
( |
const EventContext & |
ctx, |
|
|
unsigned int |
|
|
) |
| |
|
inlineoverridevirtual |
◆ processAllSubEvents() [1/2]
virtual StatusCode PixelDigitizationTool::processAllSubEvents |
( |
const EventContext & |
ctx | ) |
|
|
inlineoverridevirtual |
◆ processAllSubEvents() [2/2]
virtual StatusCode IPileUpTool::processAllSubEvents |
|
inherited |
dummy implementation to allow compilation while all Digitization packages are migrated to use this new interface.
◆ processAllSubEventsConst()
StatusCode PixelDigitizationTool::processAllSubEventsConst |
( |
const EventContext & |
ctx | ) |
const |
Definition at line 65 of file PixelDigitizationTool.cxx.
76 if (!hitCollection.isValid()) {
78 "Could not get Pixel SiHitCollection container " << hitCollection.name() <<
" from store " <<
79 hitCollection.store());
80 return StatusCode::FAILURE;
83 assert(event_data.m_timedHits);
85 event_data.m_timedHits->reserve(1);
86 event_data.m_timedHits->insert(0, hitCollection.cptr());
87 ATH_MSG_DEBUG(
"SiHitCollection found with " << hitCollection->size() <<
" hits");
89 TimedHitCollList hitCollList;
94 for (
auto & iColl : hitCollList) {
97 event_data.m_HardScatterSplittingSkipper =
true;
104 event_data.m_HardScatterSplittingSkipper =
true;
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;
◆ processBunchXing()
Reimplemented from PileUpToolBase.
Definition at line 376 of file PixelDigitizationTool.cxx.
378 ATH_MSG_VERBOSE(
"PixelDigitizationTool::processBunchXing() " << bunchXing);
382 event_data.m_HardScatterSplittingSkipper =
true;
383 return StatusCode::SUCCESS;
386 return StatusCode::SUCCESS;
389 event_data.m_HardScatterSplittingSkipper =
true;
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: " <<
414 assert(event_data.m_timedHits);
415 event_data.m_timedHits->insert(timeIndex, hitCollPtr);
418 return StatusCode::SUCCESS;
◆ resetFilter()
virtual void PileUpToolBase::resetFilter |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ toProcess()
virtual bool PileUpToolBase::toProcess |
( |
int |
bunchXing | ) |
const |
|
inlineoverridevirtualinherited |
◆ m_chargeTool
ToolHandleArray<SensorSimTool> PixelDigitizationTool::m_chargeTool |
|
private |
◆ m_createNoiseSDO
Gaudi::Property<bool> PixelDigitizationTool::m_createNoiseSDO |
|
protected |
Initial value:{
this, "CreateNoiseSDO", false, "Set create noise SDO flag"
}
Definition at line 130 of file PixelDigitizationTool.h.
◆ m_detID
◆ m_energyDepositionTool
Initial value:{
this, "EnergyDepositionTool", "EnergyDepositionTool", "Energy deposition tool"
}
Definition at line 119 of file PixelDigitizationTool.h.
◆ m_eventData
std::unique_ptr<EventData> PixelDigitizationTool::m_eventData |
|
protected |
◆ m_fesimTool
Initial value:{
this, "FrontEndSimTools", {}, "List of Front-End simulation tools"
}
Definition at line 116 of file PixelDigitizationTool.h.
◆ m_filterPassed
bool PileUpToolBase::m_filterPassed {true} |
|
protectedinherited |
◆ m_firstXing
Gaudi::Property<int> PileUpToolBase::m_firstXing |
|
protectedinherited |
Initial value:{this, "FirstXing", -999,
"First bunch-crossing in which det is live"}
Definition at line 54 of file PileUpToolBase.h.
◆ m_HardScatterSplittingMode
Gaudi::Property<int> PixelDigitizationTool::m_HardScatterSplittingMode |
|
private |
Initial value:{
this, "HardScatterSplittingMode", 0, "Control pileup & signal splitting"
}
Definition at line 87 of file PixelDigitizationTool.h.
◆ m_hitCollPtrs
◆ m_hitsContainerKey
Initial value:{
this, "InputObjectName", "", "Input HITS collection name"
}
Definition at line 72 of file PixelDigitizationTool.h.
◆ m_inputObjectName
std::string PixelDigitizationTool::m_inputObjectName |
|
private |
◆ m_lastXing
Gaudi::Property<int> PileUpToolBase::m_lastXing |
|
protectedinherited |
Initial value:{this, "LastXing", 999,
"Last bunch-crossing in which det is live"}
Definition at line 56 of file PileUpToolBase.h.
◆ m_mergeSvc
◆ m_onlyHitElements
Gaudi::Property<bool> PixelDigitizationTool::m_onlyHitElements |
|
private |
Initial value:{
this, "OnlyHitElements", false, "Process only elements with hits"
}
Definition at line 104 of file PixelDigitizationTool.h.
◆ m_onlyUseContainerName
Gaudi::Property<bool> PixelDigitizationTool::m_onlyUseContainerName |
|
private |
Initial value:{
this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."
}
Definition at line 69 of file PixelDigitizationTool.h.
◆ m_pixelDetEleCollKey
Initial value:{
this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"
}
Definition at line 75 of file PixelDigitizationTool.h.
◆ m_pixelIDName
Gaudi::Property<std::string> PixelDigitizationTool::m_pixelIDName {this, "PixelIDName", "PixelID", "Pixel ID name"} |
|
private |
◆ m_rdoContainerKey
Initial value:{
this, "RDOCollName", "PixelRDOs", "RDO collection name"
}
Definition at line 81 of file PixelDigitizationTool.h.
◆ m_rndmSvc
◆ m_simDataCollKey
Initial value:{
this, "SDOCollName", "PixelSDO_Map", "SDO collection name"
}
Definition at line 84 of file PixelDigitizationTool.h.
◆ m_vetoPileUpTruthLinks
Gaudi::Property<int> PileUpToolBase::m_vetoPileUpTruthLinks |
|
protectedinherited |
Initial value:{this, "VetoPileUpTruthLinks", true,
"Ignore links to suppressed pile-up truth"}
Definition at line 58 of file PileUpToolBase.h.
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
void setIdentifier(Identifier id)
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
virtual IdentifierHash identifyHash() const override final
SiChargedDiodeIterator end()
#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 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.
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.
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
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
virtual Identifier identify() const override final
identifier of this detector element (inline)
virtual Identifier identify() const override final