![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <TgcDigitizationTool.h>
|
StatusCode | getNextEvent (const EventContext &ctx) |
| Get next event and extract collection of hit collections. More...
|
|
StatusCode | digitizeCore (const EventContext &ctx) |
| Core part of digitization used by processAllSubEvents and mergeEvent. More...
|
|
Definition at line 41 of file TgcDigitizationTool.h.
◆ TgcDigitizationTool()
TgcDigitizationTool::TgcDigitizationTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ digitizeCore()
StatusCode TgcDigitizationTool::digitizeCore |
( |
const EventContext & |
ctx | ) |
|
|
private |
Core part of digitization used by processAllSubEvents and mergeEvent.
NOTE:
Since not every hit might end up resulting in a digit, this construction might take place after the hit loop in a loop of its own!
Definition at line 290 of file TgcDigitizationTool.cxx.
294 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->
getEngine(ctx);
306 ATH_CHECK(sdoContainer.record(std::make_unique<MuonSimDataCollection>()));
318 ASDpos = readHandle_ASDpos.cptr();
321 "ASD Position parameters /TGC/DIGIT/ASDPOS must be available for "
322 "TGC_Digitization. Check the configuration!");
328 TOffset = readHandle_TimeOffset.cptr();
331 "Timing Offset parameters /TGC/DIGIT/TOFFSET must be available for "
332 "TGC_Digitization. Check the configuration!");
338 Crosstalk = readHandle_Crosstalk.cptr();
341 "/TGC/DIGIT/XTALK is not provided. Probabilities of TGC channel "
342 "crosstalk will be zero.");
345 std::vector<std::unique_ptr<TgcDigitCollection> > collections;
349 ATH_MSG_DEBUG(
"TgcDigitizationTool::digitizeCore next element");
355 double globalHitTime =
hitTime(phit);
356 double tof = phit->globalTime();
358 &hit, globalHitTime, ASDpos, TOffset, Crosstalk, rndmEngine);
364 for (it_digiHits = digiHits->
begin();
365 it_digiHits != digiHits->
end(); ++it_digiHits) {
375 Identifier newDigiId = (*it_digiHits)->identify();
376 uint16_t newBcTag = (*it_digiHits)->bcTag();
384 "Unable to get TGC hash id from TGC Digit collection "
385 <<
"context begin_index = " << tgcContext.
begin_index()
386 <<
" context end_index = " << tgcContext.
end_index()
387 <<
" the identifier is ");
392 auto newDigit = std::make_unique<TgcDigit>(newDigiId, newBcTag);
395 bool duplicate =
false;
396 if (coll_hash >= collections.size()) {
397 collections.resize(coll_hash + 1);
399 digitCollection = collections[coll_hash].get();
400 if (
nullptr == digitCollection) {
401 collections[coll_hash] =
402 std::make_unique<TgcDigitCollection>(elemId, coll_hash);
403 digitCollection = collections[coll_hash].get();
406 <<
" BC tag = " << newBcTag
407 <<
" Coll. key = " << coll_hash);
408 digitCollection->
push_back(std::move(newDigit));
412 for (it_tgcDigit = digitCollection->
begin();
413 it_tgcDigit != digitCollection->
end(); ++it_tgcDigit) {
414 if (newDigiId == (*it_tgcDigit)->identify() &&
415 newBcTag == (*it_tgcDigit)->bcTag()) {
421 <<
" BC tag = " << newBcTag);
427 digitCollection->
push_back(std::move(newDigit));
430 <<
" BC tag = " << newBcTag);
435 static const double invalid_pos = -99999.;
452 std::vector<MuonSimData::Deposit> deposits;
453 deposits.emplace_back(
459 sdoContainer->insert(std::make_pair(newDigiId,
simData));
467 for (
size_t coll_hash = 0; coll_hash < collections.size(); ++coll_hash) {
468 if (collections[coll_hash]) {
470 collections[coll_hash].release(), coll_hash));
474 return StatusCode::SUCCESS;
◆ filterPassed()
virtual bool PileUpToolBase::filterPassed |
( |
| ) |
const |
|
inlineoverridevirtualinherited |
◆ finalize()
StatusCode TgcDigitizationTool::finalize |
( |
| ) |
|
|
finaloverridevirtual |
◆ getNextEvent()
StatusCode TgcDigitizationTool::getNextEvent |
( |
const EventContext & |
ctx | ) |
|
|
private |
Get next event and extract collection of hit collections.
Definition at line 227 of file TgcDigitizationTool.cxx.
232 using TimedHitCollList =
240 if (!hitCollection.isValid()) {
242 << hitCollection.name() <<
" from store "
243 << hitCollection.store());
244 return StatusCode::FAILURE;
250 ATH_MSG_DEBUG(
"TGCSimHitCollection found with " << hitCollection->size()
253 return StatusCode::SUCCESS;
257 TimedHitCollList hitCollList;
262 return StatusCode::FAILURE;
264 if (hitCollList.empty()) {
266 return StatusCode::FAILURE;
269 <<
" TGCSimHitCollections with key "
279 while (iColl != endColl) {
283 << p_collection->
size()
287 return StatusCode::SUCCESS;
◆ initialize()
StatusCode TgcDigitizationTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Initialize.
Reimplemented from PileUpToolBase.
Definition at line 35 of file TgcDigitizationTool.cxx.
38 ATH_MSG_DEBUG(
"Retrieved MuonDetectorManager from DetectorStore.");
48 return StatusCode::FAILURE;
57 return StatusCode::FAILURE;
82 CHECK(service(
"GeoModelSvc", geoModel));
86 CHECK(service(
"RDBAccessSvc", rdbAccess));
91 if (atlasCommonRec->size() == 0)
94 std::string configVal = (*atlasCommonRec)[0]->getString(
"CONFIG");
95 if (configVal ==
"RUN1")
97 else if (configVal ==
"RUN2")
99 else if (configVal ==
"RUN3")
102 else if (configVal ==
"RUN4")
107 "Unexpected value for geometry config read from the database: "
109 return StatusCode::FAILURE;
121 return StatusCode::SUCCESS;
◆ mergeEvent()
StatusCode TgcDigitizationTool::mergeEvent |
( |
const EventContext & |
ctx | ) |
|
|
finaloverridevirtual |
called at the end of the subevts loop.
Not (necessarily) able to access SubEvents (IPileUpTool)
Definition at line 180 of file TgcDigitizationTool.cxx.
192 while (TGCHitColl != TGCHitCollEnd) {
193 delete (*TGCHitColl);
198 return StatusCode::SUCCESS;
◆ prepareEvent()
StatusCode TgcDigitizationTool::prepareEvent |
( |
const EventContext & |
ctx, |
|
|
unsigned int |
|
|
) |
| |
|
finaloverridevirtual |
◆ processAllSubEvents() [1/2]
StatusCode TgcDigitizationTool::processAllSubEvents |
( |
const EventContext & |
ctx | ) |
|
|
finaloverridevirtual |
alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.
Reads GEANT4 hits from StoreGate in each of detector components corresponding to TGC modules which are triplets or doublets. A triplet has tree sensitive volumes and a double has two. This method calls TgcDigitMaker::executeDigi, which digitizes every hit, for every readout element, i.e., a sensitive volume of a chamber.
Reimplemented from PileUpToolBase.
Definition at line 202 of file TgcDigitizationTool.cxx.
212 return StatusCode::SUCCESS;
◆ processAllSubEvents() [2/2]
virtual StatusCode IPileUpTool::processAllSubEvents |
|
inherited |
dummy implementation to allow compilation while all Digitization packages are migrated to use this new interface.
◆ processBunchXing()
called for each active bunch-crossing to process current SubEvents bunchXing is in ns
Reimplemented from PileUpToolBase.
Definition at line 134 of file TgcDigitizationTool.cxx.
137 ATH_MSG_DEBUG(
"TgcDigitizationTool::processBunchXing() " << bunchXing);
141 TimedHitCollList hitCollList;
145 bunchXing, bSubEvents, eSubEvents)
147 hitCollList.empty()) {
149 return StatusCode::FAILURE;
152 <<
" TGCSimHitCollection with key "
160 for (; iColl != endColl; ++iColl) {
169 << timeIndex.time() <<
" index: " << timeIndex.index()
170 <<
" type: " << timeIndex.type());
176 return StatusCode::SUCCESS;
◆ resetFilter()
virtual void PileUpToolBase::resetFilter |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ toProcess()
virtual bool PileUpToolBase::toProcess |
( |
int |
bunchXing | ) |
const |
|
inlineoverridevirtualinherited |
◆ m_digitizer
◆ m_doFourBunchDigitization
Gaudi::Property<bool> TgcDigitizationTool::m_doFourBunchDigitization |
|
private |
Initial value:{
this, "FourBunchDigitization", true,
"Do the four bunch digitization since Run-3"}
Definition at line 98 of file TgcDigitizationTool.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_hitIdHelper
◆ m_hitsContainerKey
Initial value:{
this, "InputObjectName", "TGC_Hits", "name of the input object"}
Definition at line 101 of file TgcDigitizationTool.h.
◆ m_idHelper
◆ m_includePileUpTruth
Gaudi::Property<bool> TgcDigitizationTool::m_includePileUpTruth |
|
private |
Initial value:{this, "IncludePileUpTruth", true,
"Include pile-up truth info"}
Definition at line 123 of file TgcDigitizationTool.h.
◆ m_inputHitCollectionName
std::string TgcDigitizationTool::m_inputHitCollectionName {""} |
|
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_mdManager
◆ m_mergeSvc
◆ m_onlyUseContainerName
Gaudi::Property<bool> TgcDigitizationTool::m_onlyUseContainerName |
|
private |
Initial value:{
this, "OnlyUseContainerName", true,
"Don't use the ReadHandleKey directly. Just extract the container name "
"from it."}
Definition at line 94 of file TgcDigitizationTool.h.
◆ m_outputDigitCollectionKey
Initial value:{
this, "OutputObjectName", "TGC_DIGITS",
"WriteHandleKey for Output TgcDigitContainer"}
Definition at line 113 of file TgcDigitizationTool.h.
◆ m_outputSDO_CollectionKey
Initial value:{
this, "OutputSDOName", "TGC_SDO",
"WriteHandleKey for Output MuonSimDataCollection"}
Definition at line 117 of file TgcDigitizationTool.h.
◆ m_readCondKey_ASDpos
Initial value:{
this, "TGCDigitASDposKey", "",
"ReadCondHandleKey for TGCDigitASDposData"}
Definition at line 104 of file TgcDigitizationTool.h.
◆ m_readCondKey_Crosstalk
Initial value:{
this, "TGCDigitCrosstalkKey", "",
"ReadCondHandleKey for TGCDigitCrosstalkData"}
Definition at line 110 of file TgcDigitizationTool.h.
◆ m_readCondKey_TimeOffset
Initial value:{
this, "TGCDigitTimeOffsetKey", "",
"ReadCondHandleKey for TGCDigitTimeOffsetData"}
Definition at line 107 of file TgcDigitizationTool.h.
◆ m_rndmSvc
◆ m_TGCHitCollList
◆ m_thpcTGC
◆ 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.
Const iterator class for DataVector/DataList.
virtual IRDBRecordset_ptr getRecordsetPtr(const std::string &node, const std::string &tag, const std::string &tag2node="", const std::string &connName="ATLASDD")=0
Provides access to the Recordset object containing HVS-tagged data.
IdContext channel_context() const
id for channel
AtlasHitsVector< TGCSimHit > TGCSimHitCollection
size_type end_index(void) const
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
bool empty() const
Test if the key is blank.
bool nextDetectorElement(const_iterator &b, const_iterator &e)
sets an iterator range with the hits of current detector element returns a bool when done
std::list< value_t > type
type of the collection of timed data object
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
const Amg::Vector3D & localPosition() const
StatusCode initialize()
Initializes TgcHitIdHelper, TgcIdHelper and random number of a stream for the digitization.
void setLevel(MSG::Level lvl)
Change the current logging level.
void insert(const PileUpTimeEventIndex &timeEventIndex, const AtlasHitsVector< HIT > *inputCollection)
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
#define CHECK(...)
Evaluate an expression and check for errors.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
static const TgcHitIdHelper * GetHelper()
void show() const
Print out in hex form.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
const Amg::Transform3D & localToGlobalTransf(const Identifier &id) const
Returns the local -> global transformation x-axis: Parallel to the wires (strips) if the Identifier b...
Identifier elementID(int stationName, int stationEta, int stationPhi) const
size_type begin_index(void) const
const TgcIdHelper * tgcIdHelper() const
A wrapper class for event-slot-local random engines.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
static HepMcParticleLink getRedirectedLink(const HepMcParticleLink &particleLink, uint32_t eventIndex, const EventContext &ctx)
Return a HepMcParticleLink pointing at the same particle, but in a different GenEvent.
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
size_type module_hash_max() const
the maximum hash value
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
TgcDigitCollection * executeDigi(const TGCSimHit *hit, const double globalHitTime, const TgcDigitASDposData *ASDpos, const TgcDigitTimeOffsetData *TOffset, const TgcDigitCrosstalkData *Crosstalk, CLHEP::HepRandomEngine *rndmEngine)
A single hit can be digitized in the two directions independently: R and phi directions.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
unsigned short eventId() const
the index of the component event in PileUpEventInfo.
#define ATH_MSG_WARNING(x)
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const override
Create hash id from compact id (return == 0 for OK)
IdContext module_context() const
id for module
float hitTime(const AFP_SIDSimHit &hit)
virtual const std::string & atlasVersion() const =0
a struct encapsulating the identifier of a pile-up event
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.