|
ATLAS Offline Software
|
#include <MuonTruthDecorationAlg.h>
|
| MuonTruthDecorationAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute (const EventContext &ctx) const override |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
virtual bool | filterPassed (const EventContext &ctx) const |
|
virtual void | setFilterPassed (bool state, const EventContext &ctx) const |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
StatusCode | addTrackRecords (const EventContext &ctx, xAOD::TruthParticle &truthParticle) const |
|
StatusCode | addHitCounts (const EventContext &ctx, xAOD::TruthParticle &truthParticle, ChamberIdMap &ids) const |
|
void | addHitIDVectors (xAOD::TruthParticle &truthParticle, const MuonTruthDecorationAlg::ChamberIdMap &ids) const |
|
StatusCode | createSegments (const EventContext &ctx, const ElementLink< xAOD::TruthParticleContainer > &truthLink, SG::WriteHandle< xAOD::MuonSegmentContainer > &segmentContainer, const ChamberIdMap &ids) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
SG::ReadHandleKey< xAOD::TruthParticleContainer > | m_truthParticleContainerName {this, "TruthParticleContainerName", "TruthParticles"} |
|
SG::WriteHandleKey< xAOD::TruthParticleContainer > | m_muonTruthParticleContainerName |
|
SG::WriteHandleKey< xAOD::MuonSegmentContainer > | m_muonTruthSegmentContainerName {this, "MuonTruthSegmentName", "MuonTruthSegments"} |
|
SG::ReadHandleKeyArray< TrackRecordCollection > | m_trackRecordCollectionNames |
|
SG::ReadHandleKeyArray< PRD_MultiTruthCollection > | m_PRD_TruthNames |
|
SG::ReadHandleKeyArray< MuonSimDataCollection > | m_SDO_TruthNames |
|
SG::ReadHandleKey< CscSimDataCollection > | m_CSC_SDO_TruthNames {this, "CSCSDOs", "CSC_SDO"} |
|
ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"} |
|
ToolHandle< IMCTruthClassifier > | m_truthClassifier {this, "MCTruthClassifier", "MCTruthClassifier/MCTruthClassifier"} |
|
ToolHandle< Trk::IExtrapolator > | m_extrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"} |
|
Gaudi::Property< bool > | m_createTruthSegment {this, "CreateTruthSegments", true} |
|
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > | m_detMgrKey |
|
DataObjIDColl | m_extendedExtraObjects |
| Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
|
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 39 of file MuonTruthDecorationAlg.h.
◆ ChamberIdMap
◆ StoreGateSvc_t
◆ MuonTruthDecorationAlg()
Muon::MuonTruthDecorationAlg::MuonTruthDecorationAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ addHitCounts()
Definition at line 490 of file MuonTruthDecorationAlg.cxx.
494 std::vector<unsigned int> nprecHitsPerChamberLayer;
496 std::vector<unsigned int> nphiHitsPerChamberLayer;
498 std::vector<unsigned int> ntrigEtaHitsPerChamberLayer;
504 if (!
col.isPresent()) {
505 ATH_MSG_FATAL(
"PRD_MultiTruthCollection " <<
col.name() <<
" not in StoreGate");
506 return StatusCode::FAILURE;
509 for (
const auto& trajectory : *
col) {
511 if (
std::find(truthParticleHistory.begin(),truthParticleHistory.end(),
HepMC::barcode(trajectory.second)) == truthParticleHistory.end())
continue;
528 ids[chIndex].push_back(
id);
534 ++nphiHitsPerChamberLayer.at(
index);
536 ++nprecHitsPerChamberLayer.at(chIndex);
539 ++nprecHitsPerChamberLayer.at(chIndex);
544 ++nphiHitsPerChamberLayer.at(
index);
546 ++ntrigEtaHitsPerChamberLayer.at(
index);
551 ++nphiHitsPerChamberLayer.at(
index);
554 ++nprecHitsPerChamberLayer.at(chIndex);
672 nprecLayersAcc(truthParticle) = nprecLayers;
673 nphiLayersAcc(truthParticle) = nphiLayers;
674 ntrigEtaLayersAcc(truthParticle) = ntrigEtaLayers;
703 ATH_MSG_DEBUG(
"Precision layers " <<
static_cast<int>(nprecLayers) <<
" phi layers " <<
static_cast<int>(nphiLayers)
704 <<
" triggerEta layers " <<
static_cast<int>(ntrigEtaLayers));
706 if (nprecLayers > 0) {
709 for (
int index = 0; index < static_cast<int>(nprecHitsPerChamberLayer.size()); ++
index) {
710 if (nprecHitsPerChamberLayer[
index] > 0)
712 <<
" hits " << nprecHitsPerChamberLayer[
index];
715 if (nphiLayers > 0) {
717 for (
int index = 0; index < static_cast<int>(nphiHitsPerChamberLayer.size()); ++
index) {
718 if (nphiHitsPerChamberLayer[
index] > 0)
720 <<
" hits " << nphiHitsPerChamberLayer[
index];
724 if (ntrigEtaLayers > 0) {
726 for (
int index = 0; index < static_cast<int>(ntrigEtaHitsPerChamberLayer.size()); ++
index) {
727 if (ntrigEtaHitsPerChamberLayer[
index] > 0)
729 <<
" hits " << ntrigEtaHitsPerChamberLayer[
index];
734 return StatusCode::SUCCESS;
◆ addHitIDVectors()
Definition at line 737 of file MuonTruthDecorationAlg.cxx.
741 truthMdtHitsAcc(
"truthMdtHits");
743 truthTgcHitsAcc(
"truthTgcHits");
745 truthRpcHitsAcc(
"truthRpcHits");
746 std::vector<unsigned long long>& mdtTruthHits = truthMdtHitsAcc(truthParticle);
747 std::vector<unsigned long long>& tgcTruthHits = truthTgcHitsAcc(truthParticle);
748 std::vector<unsigned long long>& rpcTruthHits = truthRpcHitsAcc(truthParticle);
750 std::vector<unsigned long long> stgcTruthHits;
751 std::vector<unsigned long long> cscTruthHits;
752 std::vector<unsigned long long> mmTruthHits;
755 int nEI = 0, nEM = 0;
756 for (
const auto& lay :
ids) {
760 for (
const auto&
id : lay.second) {
762 mdtTruthHits.push_back(
id.get_compact());
764 cscTruthHits.push_back(
id.get_compact());
770 tgcTruthHits.push_back(
id.get_compact());
772 stgcTruthHits.push_back(
id.get_compact());
774 rpcTruthHits.push_back(
id.get_compact());
776 mmTruthHits.push_back(
id.get_compact());
781 truthCscHitsAcc(
"truthCscHits");
782 truthCscHitsAcc(truthParticle) = std::move(cscTruthHits);
786 truthStgcHitsAcc(
"truthStgcHits");
787 truthStgcHitsAcc(truthParticle) = std::move(stgcTruthHits);
791 truthMMHitsAcc(
"truthMMHits");
792 truthMMHitsAcc(truthParticle) = std::move(mmTruthHits);
794 ATH_MSG_VERBOSE(
"Added " << mdtTruthHits.size() <<
" mdt truth hits, " << cscTruthHits.size() <<
" csc truth hits, "
795 << rpcTruthHits.size() <<
" rpc truth hits, and " << tgcTruthHits.size() <<
" tgc truth hits");
◆ addTrackRecords()
StatusCode Muon::MuonTruthDecorationAlg::addTrackRecords |
( |
const EventContext & |
ctx, |
|
|
xAOD::TruthParticle & |
truthParticle |
|
) |
| const |
|
private |
Make sure that the parameter vector has the same size
Second loop, extrapolate between the points
extrapolation needs to be setup correctly
If the track record is named, then we should have a volume
Definition at line 331 of file MuonTruthDecorationAlg.cxx.
342 if (!trackRecordCollection.isPresent()) {
343 ATH_MSG_FATAL(
"Failed to retrieve "<<trackRecordCollection.key());
344 return StatusCode::FAILURE;
346 const std::string r_name = trackRecordCollection.key();
354 float&
x = xAcc(truthParticle);
355 float&
y = yAcc(truthParticle);
356 float&
z = zAcc(truthParticle);
357 float&
px = pxAcc(truthParticle);
358 float&
py = pyAcc(truthParticle);
359 float&
pz = pzAcc(truthParticle);
362 bool& found_truth = matchedAcc(truthParticle);
374 float& ex = exAcc(truthParticle);
375 float& ey = eyAcc(truthParticle);
376 float& ez = ezAcc(truthParticle);
377 float& epx = epxAcc(truthParticle);
378 float& epy = epyAcc(truthParticle);
379 float& epz = epzAcc(truthParticle);
382 ecovAcc(truthParticle) = emptyVec;
385 eisAcc(truthParticle) =
false;
386 ex = ey = ez = epx = epy = epz = dummy_val;
389 for (
const auto& trackRecord : *trackRecordCollection) {
391 CLHEP::Hep3Vector
pos = trackRecord.GetPosition();
392 CLHEP::Hep3Vector
mom = trackRecord.GetMomentum();
393 ATH_MSG_VERBOSE(
"Found associated " << r_name <<
" pt " <<
mom.perp() <<
" position: r " <<
pos.perp() <<
" z " <<
pos.z());
401 if (!trackingGeometry)
continue;
406 r_pars.record_name = r_name;
408 if (r_name ==
"CaloEntryLayer")
409 volume = trackingGeometry->
trackingVolume(
"InDet::Containers::InnerDetector");
410 else if (r_name ==
"MuonEntryLayer")
412 else if (r_name ==
"MuonExitLayer")
413 volume = trackingGeometry->
trackingVolume(
"Muon::Containers::MuonSystem");
417 r_pars.volume = found_truth ? volume :
nullptr;
422 if (!trackingGeometry)
return StatusCode::SUCCESS;
428 cov(4, 4) = 1
e-3 / truthParticle.
p4().P();
433 if ( (!start_pars.record_name.empty() && !start_pars.volume) || !end_pars.volume)
continue;
437 const std::string& r_name = end_pars.record_name;
444 float& ex = exAcc(truthParticle);
445 float& ey = eyAcc(truthParticle);
446 float& ez = ezAcc(truthParticle);
447 float& epx = epxAcc(truthParticle);
448 float& epy = epyAcc(truthParticle);
449 float& epz = epzAcc(truthParticle);
452 std::vector<float>& covMat = ecovAcc(truthParticle);
454 std::unique_ptr<Trk::TrackParameters> exPars{
461 eisAcc(truthParticle) =
true;
462 ex = exPars->position().x();
463 ey = exPars->position().y();
464 ez = exPars->position().z();
465 epx = exPars->momentum().x();
466 epy = exPars->momentum().y();
467 epz = exPars->momentum().z();
472 <<
" truth: r " << end_pars.pos.perp() <<
" z "
473 << end_pars.pos.z() <<
" p "
474 << end_pars.mom.mag() << std::endl
475 <<
" extrp: r " << exPars->position().perp() <<
" z "
476 << exPars->position().z() <<
" p "
477 << exPars->momentum().mag() <<
" res p "
478 << (end_pars.mom.mag() -
479 exPars->momentum().mag())
480 <<
" error " << errorp <<
" cov "
483 << (end_pars.mom.mag() -
484 exPars->momentum().mag()) /
487 return StatusCode::SUCCESS;
◆ cardinality()
unsigned int AthReentrantAlgorithm::cardinality |
( |
| ) |
const |
|
overridevirtualinherited |
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 55 of file AthReentrantAlgorithm.cxx.
◆ createSegments()
Definition at line 168 of file MuonTruthDecorationAlg.cxx.
174 std::vector<SG::ReadHandle<MuonSimDataCollection> > sdoCollections(6);
177 if (!
col.isPresent()) {
178 ATH_MSG_ERROR(
"MuonSimDataCollection " <<
col.name() <<
" not in StoreGate");
179 return StatusCode::FAILURE;
186 if (
index >= (
int)sdoCollections.size()) {
189 sdoCollections[
index] = std::move(
col);
195 std::map<Muon::MuonStationIndex::ChIndex, int> matchMap;
198 for (
const auto& lay :
ids) {
201 bool firstPosSet{
false}, secondPosSet{
false};
204 uint8_t nprecLayers{0}, nphiLayers{0}, ntrigEtaLayers{0};
205 std::set<int> phiLayers, etaLayers, precLayers;
208 for (
const auto&
id : lay.second) {
224 precLayers.insert(iid);
239 if (
index < (
int)sdoCollections.size() && !sdoCollections[
index]->empty()) {
240 auto pos = sdoCollections[
index]->find(
id);
242 gpos =
pos->second.globalPosition();
243 if (gpos.perp() > 0.1) ok =
true;
252 return std::abs(
p1.z()) < std::abs(
p2.z());
254 return p1.perp() <
p2.perp();
259 }
else if (!secondPosSet) {
262 if (isSmaller(secondPos, firstPos))
std::swap(firstPos, secondPos);
265 if (isSmaller(gpos, firstPos))
267 else if (isSmaller(secondPos, gpos))
272 auto pos = cscCollection->find(
id);
273 if (
pos == cscCollection->end()) {
277 ATH_MSG_DEBUG(
"found csc sdo with " <<
pos->second.getdeposits().size() <<
" deposits");
278 Amg::Vector3D locpos(0,
pos->second.getdeposits()[0].second.ypos(),
pos->second.getdeposits()[0].second.zpos());
284 }
else if (!secondPosSet) {
287 if (secondPos.perp() < firstPos.perp())
std::swap(firstPos, secondPos);
289 if (gpos.perp() < firstPos.perp())
291 else if (secondPos.perp() < gpos.perp())
296 if (precLayers.size() > 2) {
297 matchMap[lay.first] =
index;
298 if (!phiLayers.empty()) nphiLayers = phiLayers.size();
299 ntrigEtaLayers = etaLayers.size();
300 nprecLayers = precLayers.size();
301 ATH_MSG_DEBUG(
" total counts: precision " <<
static_cast<int>(nprecLayers) <<
" phi layers " <<
static_cast<int>(nphiLayers)
302 <<
" eta trig layers " <<
static_cast<int>(ntrigEtaLayers)
304 <<
" truthLink " << truthLink);
307 segment->setNHits(nprecLayers, nphiLayers, ntrigEtaLayers);
309 truthParticleLinkAcc(
"truthParticleLink");
310 truthParticleLinkAcc(*
segment) = truthLink;
316 segment->setIdentifier(sector, chIndex, eta, technology);
318 if (firstPosSet && secondPosSet) {
321 ATH_MSG_DEBUG(
" got position : r " << gpos.perp() <<
" z " << gpos.z() <<
" and direction: theta " << gdir.theta()
322 <<
" phi " << gdir.phi());
323 segment->setPosition(gpos.x(), gpos.y(), gpos.z());
324 segment->setDirection(gdir.x(), gdir.y(), gdir.z());
328 return StatusCode::SUCCESS;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode Muon::MuonTruthDecorationAlg::execute |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
add track records
Definition at line 85 of file MuonTruthDecorationAlg.cxx.
88 if (!truthContainer.isPresent())
return StatusCode::SUCCESS;
89 if (!truthContainer.isValid()) {
90 ATH_MSG_WARNING(
"truth container " << truthContainer.name() <<
" not valid");
91 return StatusCode::FAILURE;
96 ATH_CHECK(muonTruthContainer.record(std::make_unique<xAOD::TruthParticleContainer>(),
97 std::make_unique<xAOD::TruthParticleAuxContainer>()));
103 segmentContainer.record(std::make_unique<xAOD::MuonSegmentContainer>(), std::make_unique<xAOD::MuonSegmentAuxContainer>()));
104 ATH_MSG_DEBUG(
"Recorded MuonSegmentContainer with key: " << segmentContainer.name());
109 if (!
MC::isStable(truth) || !truth->isMuon() || truth->pt() < 1000.)
continue;
111 muonTruthContainer->push_back(truthParticle);
112 truthParticle->
setPdgId(truth->pdgId());
114 truthParticle->
setStatus(truth->status());
115 truthParticle->
setPx(truth->px());
116 truthParticle->
setPy(truth->py());
117 truthParticle->
setPz(truth->pz());
118 truthParticle->
setE(truth->e());
119 truthParticle->
setM(truth->m());
120 if (truth->hasProdVtx()) truthParticle->
setProdVtxLink(truth->prodVtxLink());
122 truthLink.toPersistent();
123 ATH_MSG_DEBUG(
"Found stable muon: " << truth->pt() <<
" eta " << truth->eta() <<
" phi " << truth->phi() <<
" mass "
124 << truth->m() <<
" barcode " <<
HepMC::barcode(truth) <<
" truthParticle->barcode "
133 std::pair<MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin> truthClass =
135 iType = truthClass.first;
136 iOrigin = truthClass.second;
138 dec_truthOrigin(*truthParticle) = iOrigin;
139 dec_truthType(*truthParticle) = iType;
152 bool goodMuon = bad_origins.find(iOrigin) == bad_origins.end();
154 ATH_MSG_DEBUG(
"good muon with type " << iType <<
" and origin" << iOrigin);
162 ATH_MSG_DEBUG(
"Registered " << muonTruthContainer->size() <<
" truth muons ");
165 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthReentrantAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 79 of file AthReentrantAlgorithm.cxx.
86 return Algorithm::extraOutputDeps();
◆ filterPassed()
virtual bool AthReentrantAlgorithm::filterPassed |
( |
const EventContext & |
ctx | ) |
const |
|
inlinevirtualinherited |
◆ initialize()
StatusCode Muon::MuonTruthDecorationAlg::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ isClonable()
bool AthReentrantAlgorithm::isClonable |
( |
| ) |
const |
|
overridevirtualinherited |
Specify if the algorithm is clonable.
Reentrant algorithms are clonable.
Reimplemented in Simulation::BeamEffectsAlg, InDet::SiTrackerSpacePointFinder, InDet::SCT_Clusterization, InDet::SiSPSeededTrackFinder, SCTRawDataProvider, InDet::GNNSeedingTrackMaker, SCT_PrepDataToxAOD, RoIBResultToxAOD, InDet::SiSPGNNTrackMaker, SCT_CablingCondAlgFromCoraCool, SCT_ReadCalibDataTestAlg, SCT_CablingCondAlgFromText, SCT_ReadCalibChipDataTestAlg, SCT_TestCablingAlg, SCT_ConfigurationConditionsTestAlg, ITkPixelCablingAlg, ITkStripCablingAlg, SCTEventFlagWriter, SCT_ConditionsSummaryTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_TdaqEnabledTestAlg, SCT_SiliconConditionsTestAlg, SCTSiLorentzAngleTestAlg, SCT_ByteStreamErrorsTestAlg, SCT_ConditionsParameterTestAlg, SCT_FlaggedConditionTestAlg, SCT_StripVetoTestAlg, SCT_RawDataToxAOD, and SCTSiPropertiesTestAlg.
Definition at line 44 of file AthReentrantAlgorithm.cxx.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
virtual void AthReentrantAlgorithm::setFilterPassed |
( |
bool |
state, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
inlinevirtualinherited |
◆ sysExecute()
StatusCode AthReentrantAlgorithm::sysExecute |
( |
const EventContext & |
ctx | ) |
|
|
overridevirtualinherited |
Execute an algorithm.
We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.
Definition at line 67 of file AthReentrantAlgorithm.cxx.
69 return Gaudi::Algorithm::sysExecute (ctx);
◆ sysInitialize()
StatusCode AthReentrantAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
Override sysInitialize.
Override sysInitialize from the base class.
Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc
Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc
Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.
Reimplemented in InputMakerBase, and HypoBase.
Definition at line 96 of file AthReentrantAlgorithm.cxx.
107 if ( cs.retrieve().isFailure() ) {
109 return StatusCode::SUCCESS;
111 if (cs->regHandle(
this,*
h).isFailure()) {
112 sc = StatusCode::FAILURE;
113 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_createTruthSegment
Gaudi::Property<bool> Muon::MuonTruthDecorationAlg::m_createTruthSegment {this, "CreateTruthSegments", true} |
|
private |
◆ m_CSC_SDO_TruthNames
◆ m_detMgrKey
Initial value:{this, "DetectorManagerKey", "MuonDetectorManager",
"Key of input MuonDetectorManager condition data"}
Definition at line 90 of file MuonTruthDecorationAlg.h.
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects |
|
privateinherited |
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 153 of file AthReentrantAlgorithm.h.
◆ m_extrapolator
◆ m_idHelperSvc
◆ m_muonTruthParticleContainerName
Initial value:{this, "MuonTruthParticleContainerName",
"MuonTruthParticles"}
Definition at line 67 of file MuonTruthDecorationAlg.h.
◆ m_muonTruthSegmentContainerName
◆ m_PRD_TruthNames
Initial value:{
this,
"PRD_TruthMaps",
{"CSC_TruthMap", "RPC_TruthMap", "TGC_TruthMap", "MDT_TruthMap"},
"remove NSW by default for now, can always be changed in the configuration"}
Definition at line 73 of file MuonTruthDecorationAlg.h.
◆ m_SDO_TruthNames
Initial value:{
this, "SDOs", {"RPC_SDO", "TGC_SDO", "MDT_SDO"}, "remove NSW by default for now, can always be changed in the configuration"}
Definition at line 78 of file MuonTruthDecorationAlg.h.
◆ m_trackRecordCollectionNames
Initial value:{
this, "TrackRecordCollectionNames", {"CaloEntryLayer", "MuonEntryLayer", "MuonExitLayer"}}
Definition at line 71 of file MuonTruthDecorationAlg.h.
◆ m_truthClassifier
◆ m_truthParticleContainerName
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
static const std::string & chName(ChIndex index)
convert ChIndex into a string
@ phiLayer1Hits
number of phi hits in the first trigger layer (BML1 ot T4)
void setStatus(int value)
Set status code.
StatusCode addTrackRecords(const EventContext &ctx, xAOD::TruthParticle &truthParticle) const
@ etaLayer1Hits
number of eta hits in the first trigger layer (BML1 ot T4)
SG::ReadHandleKeyArray< MuonSimDataCollection > m_SDO_TruthNames
bool hasPositiveDiagElems(const AmgSymMatrix(N) &mat)
Returns true if all diagonal elements of the covariance matrix are finite aka sane in the above defin...
@ phiLayer3Hits
number of phi hits in the third trigger layer (BOL1 ot T2)
void compress(const AmgSymMatrix(N) &covMatrix, std::vector< float > &vec)
@ phiLayer4Hits
number of phi hits in the fourth trigger layer (T3)
std::string find(const std::string &s)
return a remapped string
float pz() const
The z component of the particle's momentum.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
void setE(float value)
Set the energy of the particle.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
void setBarcode(int value)
Set barcode.
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
float px() const
The x component of the particle's momentum.
SG::WriteHandleKey< xAOD::MuonSegmentContainer > m_muonTruthSegmentContainerName
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Class describing a MuonSegment.
bool msgLvl(const MSG::Level lvl) const
void setPx(float value)
Set the x component of the particle's momentum.
float py() const
The y component of the particle's momentum.
SG::ReadHandleKeyArray< TrackRecordCollection > m_trackRecordCollectionNames
#define ATH_MSG_VERBOSE(x)
bool empty() const
Test if the key is blank.
MuonSegment_v1 MuonSegment
Reference the current persistent version:
bool is_valid() const
Check if id is in a valid state.
PhiIndex
enum to classify the different phi layers in the muon spectrometer
StatusCode createSegments(const EventContext &ctx, const ElementLink< xAOD::TruthParticleContainer > &truthLink, SG::WriteHandle< xAOD::MuonSegmentContainer > &segmentContainer, const ChamberIdMap &ids) const
std::map< Muon::MuonStationIndex::ChIndex, std::vector< Identifier > > ChamberIdMap
#define AmgSymMatrix(dim)
@ innerLargeHits
number of precision hits in the inner large layer
virtual void setOwner(IDataHandleHolder *o)=0
@ etaLayer3Hits
number of eta hits in the third trigger layer (BOL1 ot T2)
@ middleLargeHits
number of precision hits in the middle large layer
@ phiLayer2Hits
number of phi hits in the second trigger layer (BML2 ot T1)
@ etaLayer2Hits
number of eta hits in the second trigger layer (BML2 ot T1)
void setM(float value)
Also store the mass.
ToolHandle< Trk::IExtrapolator > m_extrapolator
AthReentrantAlgorithm()
Default constructor:
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
void addHitIDVectors(xAOD::TruthParticle &truthParticle, const MuonTruthDecorationAlg::ChamberIdMap &ids) const
@ extendedLargeHits
number of precision hits in the extended large layer
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
TruthParticle_v1 TruthParticle
Typedef to implementation.
void setPy(float value)
Set the y component of the particle's momentum.
static const std::string & phiName(PhiIndex index)
convert PhiIndex into a string
std::deque< int > simulation_history(const T &p, const int direction)
Function to calculate all the descendants(direction=1)/ancestors(direction=-1) of the particle.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
StatusCode addHitCounts(const EventContext &ctx, xAOD::TruthParticle &truthParticle, ChamberIdMap &ids) const
SG::ReadHandleKeyArray< PRD_MultiTruthCollection > m_PRD_TruthNames
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_muonTruthParticleContainerName
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
ElementLink implementation for ROOT usage.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Amg::Vector3D localToGlobalCoords(const Amg::Vector3D &x, const Identifier &id) const
localToGlobalCoords and Transf connect the Gas Gap Frame (defined as a Sensitive Detector) to the Glo...
Class describing a truth vertex in the MC record.
void setPdgId(int pid)
Set PDG ID code.
@ middleSmallHits
number of precision hits in the middle small layer
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
virtual StatusCode sysInitialize() override
Override sysInitialize.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
@ outerSmallHits
number of precision hits in the outer small layer
Eigen::Matrix< double, 3, 1 > Vector3D
@ outerLargeHits
number of precision hits in the outer large layer
ToolHandle< IMCTruthClassifier > m_truthClassifier
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
#define ATH_MSG_WARNING(x)
SG::ReadHandleKey< CscSimDataCollection > m_CSC_SDO_TruthNames
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
void setPz(float value)
Set the z component of the particle's momentum.
const TrackingVolume * trackingVolume(const std::string &name) const
return the tracking Volume by name, 0 if it doesn't exist
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
ChIndex
enum to classify the different chamber layers in the muon spectrometer
void setProdVtxLink(const ElementLink< TruthVertexContainer > &link)
Set the production vertex of the particle.
bool is_sim_descendant(const T1 &p1, const T2 &p2)
Method to check if the first particle is a descendant of the second in the simulation,...
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
@ extendedSmallHits
number of precision hits in the extended small layer
@ innerSmallHits
number of precision hits in the inner small layer
TechnologyIndex
enum to classify the different layers in the muon spectrometer
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerName
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
@ etaLayer4Hits
number of eta hits in the fourth trigger layer (T3)
double charge() const
Physical charge.
Gaudi::Property< bool > m_createTruthSegment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)