|  | ATLAS Offline Software
    | 
 
 
 
#include <TruthSegmentMaker.h>
|  | 
| struct | WriteDecorHolder | 
|  | Helper struct to ship the write DecorHandles and the reference to the output segment container through the class methods.  More... 
 | 
|  | 
|  | 
|  | ~TruthSegmentMaker ()=default | 
|  | 
| StatusCode | initialize () override final | 
|  | 
| 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 theStoreGateSvc.  More...
 | 
|  | 
| const ServiceHandle< StoreGateSvc > & | evtStore () const | 
|  | The standard StoreGateSvc(event store) Returns (kind of) a pointer to theStoreGateSvc.  More...
 | 
|  | 
| const ServiceHandle< StoreGateSvc > & | detStore () const | 
|  | The standard StoreGateSvc/DetectorStoreReturns (kind of) a pointer to theStoreGateSvc.  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, V, H > &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 | 
|  | 
|  | 
| Amg::Transform3D | toChamber (const ActsTrk::GeometryContext &gctx, const Identifier &chanId) const | 
|  | Returns the transform from the local simHit frame -> chamber frame.  More... 
 | 
|  | 
| xAOD::MuonSegment * | constructSegmentFromHits (const EventContext &ctx, const Amg::Transform3D &locToGlob, const SimHitVec_t &hits, WriteDecorHolder &writeShip) const | 
|  | Takes a list of related sim hits and transforms them into a truth segment.  More... 
 | 
|  | 
| void | buildSegmentsFromBkg (const EventContext &ctx, const Amg::Transform3D &locToGlob, const SimHitVec_t &simHits, WriteDecorHolder &writeShip) const | 
|  | Attempts to assemble truth segments from a list of loose sim hits, i.e., the hits are stemming from a muon but due to the pile-up truth record, no HepMCParticles are recorded.  More... 
 | 
|  | 
| float | muonPt (const xAOD::MuonSimHit &hit, const Amg::Vector3D &globDir) const | 
|  | Returns the muon pt from the sim hit.  More... 
 | 
|  | 
| float | hitUncertainty (const EventContext &ctx, const xAOD::MuonSimHit &hit) const | 
|  | Evaluates the hit uncertainty.  More... 
 | 
|  | 
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) | 
|  | specialization for handling Gaudi::Property<SG::VarHandleKey>  More... 
 | 
|  | 
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) | 
|  | specialization for handling Gaudi::Property<SG::VarHandleKeyArray>  More... 
 | 
|  | 
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) | 
|  | specialization for handling Gaudi::Property<SG::VarHandleBase>  More... 
 | 
|  | 
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) | 
|  | specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>  More... 
 | 
|  | 
|  | 
| ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc {this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"} | 
|  | IdHelperSvc to decode the Identifiers.  More... 
 | 
|  | 
| SG::ReadHandleKeyArray< xAOD::MuonSimHitContainer > | m_readKeys {this, "SimHitKeys", {}} | 
|  | List of sim hit containers from which the truth segments shall be retrieved.  More... 
 | 
|  | 
| SG::ReadHandleKey< ActsTrk::GeometryContext > | m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"} | 
|  | Key to the geometry context.  More... 
 | 
|  | 
| SG::WriteHandleKey< xAOD::MuonSegmentContainer > | m_segmentKey {this, "WriteKey", "MuonTruthSegments"} | 
|  | Key under which the segment Container will be recorded in StoreGate.  More... 
 | 
|  | 
| SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > | m_eleLinkKey {this, "SimHitLink", m_segmentKey, "simHitLinks"} | 
|  | Decoration key of the associated sim hit links.  More... 
 | 
|  | 
| SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > | m_ptKey {this, "PtKey", m_segmentKey, "pt"} | 
|  | Decoration key of the associated particle pt.  More... 
 | 
|  | 
| SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > | m_locParKey {this, "LocParKey", m_segmentKey,"localSegPars"} | 
|  | Decoration key of the local parameters.  More... 
 | 
|  | 
| SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > | m_qKey {this, "qKey", m_segmentKey, "charge"} | 
|  | Decoration key of the muon charge More...
 
 | 
|  | 
| Gaudi::Property< bool > | m_useOnlyMuonHits {this, "useOnlyMuonHits", true} | 
|  | Build segments from muon hits only.  More... 
 | 
|  | 
| Gaudi::Property< bool > | m_includePileUpHits {this, "includePileUpHits", true} | 
|  | Construct segments from pile-up hits without GenParticleLink.  More... 
 | 
|  | 
| Gaudi::Property< float > | m_pileUpHitMinE {this, "energyThresholdPileUp", 1.*Gaudi::Units::GeV} | 
|  | Minimum energy threshold for pile up hits to be converted More...
 
 | 
|  | 
| Gaudi::Property< float > | m_pileUpHitELoss {this, "pileUpHitELoss", 5.*Gaudi::Units::MeV} | 
|  | Maximum energy loss between two pile-up hits.  More... 
 | 
|  | 
| Gaudi::Property< float > | m_pileUpHitAngleCone {this, "pileUpHitAngleCone", 1.*Gaudi::Units::deg} | 
|  | Maximum scattering angle between two pile-up hits.  More... 
 | 
|  | 
| Gaudi::Property< float > | m_pileUpHitDistance {this, "pileUpHitDistance", 2.*Gaudi::Units::m} | 
|  | Maximum separation between two pile-up hits.  More... 
 | 
|  | 
| Gaudi::Property< float > | m_idCylinderR {this, "IdCylinderR", 1.1*Gaudi::Units::m} | 
|  | ID / ITk cylinder radius.  More... 
 | 
|  | 
| Gaudi::Property< float > | m_idCylinderHalfZ {this, "IdCylinderHalfZ", 3.2*Gaudi::Units::m} | 
|  | ID / Itk cylinder half length.  More... 
 | 
|  | 
| const MuonGMR4::MuonDetectorManager * | m_detMgr {nullptr} | 
|  | Pointer to the muon readout geometry.  More... 
 | 
|  | 
| SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainer > | m_mdtCalibKey | 
|  | Data dependency on the Mdt calibration container to calculate the uncertainty.  More... 
 | 
|  | 
| SG::ReadCondHandleKey< NswErrorCalibData > | m_nswUncertKey | 
|  | Data dependency on the Nsw calibration container to estimate the uncertaintys.  More... 
 | 
|  | 
| 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 32 of file TruthSegmentMaker.h.
 
◆ EleLink_t
◆ FloatDecor_t
◆ HitLinkVec_t
◆ HitPosTuple_t
Tuple consisting out of pointer to the sim hit and the position & direction expressed in the chamber's frame. 
Definition at line 50 of file TruthSegmentMaker.h.
 
 
◆ LinkDecor_t
◆ SegParDecor_t
◆ SegPars_t
◆ SimHitVec_t
◆ StoreGateSvc_t
◆ ~TruthSegmentMaker()
  
  | 
        
          | MuonR4::TruthSegmentMaker::~TruthSegmentMaker | ( |  | ) |  |  | default | 
 
 
◆ buildSegmentsFromBkg()
Attempts to assemble truth segments from a list of loose sim hits, i.e., the hits are stemming from a muon but due to the pile-up truth record, no HepMCParticles are recorded. 
Hits are paired based on kinetic energy, and line compatibility 
- Parameters
- 
  
    | ctx | EventContext to access the uncertainty conditions data during segment building |  | locToGlob | Transform from the sector -> global frame |  | simHits | Collection of all sim hits in the sector without truth link |  | writeShip | Helper struct carrying the output segment container & the associated decorators |  
 
Closest beam spot approach
First compare the energies
Calculate the approach to the cylinder
Definition at line 111 of file TruthSegmentMaker.cxx.
  116         ATH_MSG_VERBOSE(
"Assemble segments from "<<simHits.size()<<
" background hits.");
 
  117         std::vector<char> alreadyUsed(simHits.size(), 0);
 
  118         for (std::size_t 
h = 0 ;
h < simHits.size(); ++
h) {
 
  119             if (alreadyUsed[
h]) {
 
  122             const auto& [refHit, refPos, refDir] = simHits[
h];
 
  127             std::vector<std::size_t> indicesOnSeg{
h};
 
  128             for (std::size_t 
h1 = 
h +1; 
h1 < simHits.size(); ++
h1) {
 
  129                 if (alreadyUsed[
h1]) {
 
  132                 const auto&[testHit, testPos, testDir] = simHits[
h1];
 
  135                 if (std::abs(refHit->kineticEnergy() - testHit->kineticEnergy()) > 
m_pileUpHitELoss) {
 
  141                 const double angleDir = 
Amg::angle(testDir, refDir);
 
  151                 indicesOnSeg.push_back(
h1);
 
  157                                                                           globPos, globDir).value_or(0.) * globDir;
 
  158             ATH_MSG_VERBOSE(
"Found "<<indicesOnSeg.size()<<
" matching hits. Closest perigee " 
  162                     std::back_inserter(hitsOnSeg), 
 
  163                     [&simHits](
const auto idx) {
 
  168                 std::ranges::for_each(indicesOnSeg,
 
  169                         [&alreadyUsed](
const auto idx) {
 
  170                              alreadyUsed[
idx] = 1;
 
 
 
 
◆ cardinality()
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 75 of file AthCommonReentrantAlgorithm.cxx.
 
 
◆ constructSegmentFromHits()
Takes a list of related sim hits and transforms them into a truth segment. 
If there're less than 3 precision hits, then no segment is created. 
- Parameters
- 
  
    | ctx | EventContext to fetch the hit uncertainties from store gate |  | locToGlob | Coordinate transform from sector frame -> global frame |  | hits | List of hits to be combined onto a single segment |  | writeShip | Helper struct carrying the output segment container & the associated decorators |  
 
Find the hit which is closest to the refernce plane to express the segment at the centre plane
Express the simulated hit in the center of the chamber
Associate the hits to the segment and calculate the expected hits
Definition at line 176 of file TruthSegmentMaker.cxx.
  182         auto refHit_itr = std::ranges::min_element(simHits, 
 
  184                     return std::abs(std::get<1>(
a).
z()) <std::abs(std::get<1>(
b).
z());
 
  187         const auto [simHit, localPos, chamberDir] = (*refHit_itr);
 
  189                             " pdgId: "<<simHit->pdgId()<<
", energy: "<<simHit->kineticEnergy()
 
  190                             <<
", genParticle: "<<simHit->genParticleLink().cptr());
 
  194         const double distance = Amg::intersect<3>(localPos, chamberDir, Amg::Vector3D::UnitZ(), 0.).value_or(0.);
 
  198         const Amg::Vector3D globDir = locToGlob.linear() * chamberDir;
 
  200         unsigned nMdt{0}, nRpcEta{0}, nRpcPhi{0}, nTgcEta{0}, nTgcPhi{0};
 
  201         unsigned nMm{0}, nStgcEta{0}, nStgcPhi{0};
 
  204         for (
const auto& [assocMe, 
pos, 
dir] : simHits) {
 
  213                     if (castRE->nEtaStrips()) ++nRpcEta;
 
  214                     if (castRE->nPhiStrips()) ++nRpcPhi;
 
  218                     const IdentifierHash gapHash = assocRE->
measurementHash(assocMe->identify());
 
  219                     if (castRE->numStrips(gapHash)){
 
  222                     if (castRE->numWireGangs(gapHash)) {
 
  237                 <<
" pdgId: "<<assocMe->pdgId()<<
", energy: "<<assocMe->kineticEnergy()
 
  238                 <<
", genParticle: "<<assocMe->genParticleLink().cptr()<<
", beta: "<<simHit->beta()
 
  242             associatedHits.
push_back(std::move(link));
 
  244         int nPrecisionHits = nMdt + nMm + nStgcEta;
 
  245         int nPhiLayers     = nTgcPhi + nRpcPhi + nStgcPhi;
 
  247         if (nPrecisionHits < 3) {
 
  251         xAOD::MuonSegment* truthSegment = 
out.segments.push_back(std::make_unique<xAOD::MuonSegment>());
 
  252         out.ptDecor(*truthSegment) = 
muonPt(*simHit, globDir);
 
  255         locPars[Acts::toUnderlying(ParamDefs::x0)] = chamberPos.x();
 
  256         locPars[Acts::toUnderlying(ParamDefs::y0)] = chamberPos.y();
 
  257         constexpr 
float betaLowLimit = 1.e-6;
 
  262         truthSegment->
setPosition(globPos.x(), globPos.y(), globPos.z());
 
  263         truthSegment->
setDirection(globDir.x(), globDir.y(), globDir.z());
 
  266         truthSegment->
setNHits(nPrecisionHits, nPhiLayers, nTgcEta + nRpcEta);
 
  272         if (nPhiLayers == 0){
 
  275             truthSegment->
setFitQuality(
chi2, (nPrecisionHits + nPhiLayers + nTgcEta + nRpcEta - 5));
 
  277         out.hitLinkDecor(*truthSegment) = std::move(associatedHits);
 
 
 
 
◆ 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 MuonR4::TruthSegmentMaker::execute | ( | const EventContext & | ctx | ) | const |  | override | 
 
Definition at line 281 of file TruthSegmentMaker.cxx.
  285         using HitsPerParticle = std::unordered_map<HepMC::ConstGenParticlePtr, SimHitVec_t>;
 
  286         using HitCollector = std::unordered_map<const MuonGMR4::SpectrometerSector*, HitsPerParticle>;
 
  287         HitCollector hitCollector{};
 
  295                 auto genLink = simHit->genParticleLink();
 
  297                 if (genLink.isValid()){
 
  298                     genParticle = genLink.cptr(); 
 
  303                                   " pdgId: "<<simHit->pdgId()<<
", energy: "<<simHit->kineticEnergy()
 
  304                                 <<
", genParticle: "<<genParticle);
 
  308                 hitCollector[
id][genParticle].emplace_back(simHit, 
 
  309                                                            toChTrf *xAOD::toEigen(simHit->localPosition()),
 
  310                                                            toChTrf.linear()* xAOD::toEigen(simHit->localDirection())); 
 
  315         ATH_CHECK(writeHandle.record(std::make_unique<xAOD::MuonSegmentContainer>(),
 
  316                                      std::make_unique<xAOD::MuonSegmentAuxContainer>()));
 
  318         WriteDecorHolder writerHolder{*writeHandle,*
this, ctx};
 
  320         for (
auto& [
chamber, collectedParts] : hitCollector) {
 
  322             for (
auto& [
particle, simHits]: collectedParts) {                
 
  325                     return std::get<1>(
a).z() < std::get<1>(
b).z();
 
  334         ATH_MSG_DEBUG(
"Constructed "<<writeHandle->size()<<
" truth segments in total ");
 
  335         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()
Return the list of extra output dependencies. 
This list is extended to include symlinks implied by inheritance relations. 
Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.
 
 
◆ filterPassed()
◆ hitUncertainty()
Evaluates the hit uncertainty. 
For the precision detectors, the uncertainties are fetched from the COOL DB. For the remaining detectors, the uncertainties are based on the strip pitch 
- Parameters
- 
  
    | ctx | EventContext to fetch the constants from store gate |  | hit | Reference to the sim hit |  
 
Definition at line 52 of file TruthSegmentMaker.cxx.
   54         switch (
const auto techIdx = 
m_idHelperSvc->technologyIndex(hitId)) {
 
   61                 const auto& rtCalib{calibCont->getCalibData(hitId, msgStream())->rtRelation};
 
   62                 const double driftTime = rtCalib->tr()->driftTime(hit.
localPosition().perp()).value_or(rtCalib->tr()->maxRadius());
 
   63                 return rtCalib->rtRes()->resolution(
driftTime);
 
   65                 const auto* 
re = 
m_detMgr->getRpcReadoutElement(hitId);
 
   66                 return re->stripEtaPitch() / std::sqrt(12.);
 
   68                 const auto* 
re = 
m_detMgr->getTgcReadoutElement(hitId);
 
   69                 const IdentifierHash measHash = 
re->measurementHash(hitId);
 
   70                 const auto& design = 
re->wireGangLayout(measHash);
 
   71                 return design.stripPitch()  / std::sqrt(12.);
 
   81                 if (techIdx == STGC) {
 
   82                     errorCalibInput.clusterAuthor = 3; 
 
   84                     errorCalibInput.clusterAuthor=66; 
 
   86                 return errorCalibDB->clusterUncertainty(errorCalibInput);
 
 
 
 
◆ initialize()
  
  | 
        
          | StatusCode MuonR4::TruthSegmentMaker::initialize | ( |  | ) |  |  | finaloverride | 
 
Definition at line 31 of file TruthSegmentMaker.cxx.
   35             ATH_MSG_ERROR(
"No simulated hit containers have been parsed to build the segments from ");
 
   36             return StatusCode::FAILURE;
 
   50         return StatusCode::SUCCESS;
 
 
 
 
◆ 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()
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ muonPt()
Returns the muon pt from the sim hit. 
Definition at line 93 of file TruthSegmentMaker.cxx.
   96             return link->momentum().perp();
 
 
 
 
◆ 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()
◆ sysExecute()
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 85 of file AthCommonReentrantAlgorithm.cxx.
 
 
◆ sysInitialize()
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 61 of file AthCommonReentrantAlgorithm.cxx.
  110   if (
sc.isFailure()) {
 
  118       if ( cs.retrieve().isFailure() ) {
 
  120         return StatusCode::SUCCESS;
 
  122       if (cs->regHandle(
this,*
h).isFailure()) {
 
  123         sc = StatusCode::FAILURE;
 
  124         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. 
 
 
◆ toChamber()
Returns the transform from the local simHit frame -> chamber frame. 
- Parameters
- 
  
    | gctx | Geometry context to align the chambers within ATLAS |  | chanId | Identifier of the channel for which the transform shall be fetched |  
 
Definition at line 101 of file TruthSegmentMaker.cxx.
 
 
◆ updateVHKA()
◆ m_detMgr
◆ m_detStore
◆ m_eleLinkKey
◆ m_evtStore
◆ m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. 
Empty if no symlinks were found. 
Definition at line 114 of file AthCommonReentrantAlgorithm.h.
 
 
◆ m_geoCtxKey
Key to the geometry context. 
Needed to align the hits inside ATLAS 
Definition at line 127 of file TruthSegmentMaker.h.
 
 
◆ m_idCylinderHalfZ
  
  | 
        
          | Gaudi::Property<float> MuonR4::TruthSegmentMaker::m_idCylinderHalfZ {this, "IdCylinderHalfZ", 3.2*Gaudi::Units::m} |  | private | 
 
 
◆ m_idCylinderR
  
  | 
        
          | Gaudi::Property<float> MuonR4::TruthSegmentMaker::m_idCylinderR {this, "IdCylinderR", 1.1*Gaudi::Units::m} |  | private | 
 
 
◆ m_idHelperSvc
◆ m_includePileUpHits
  
  | 
        
          | Gaudi::Property<bool> MuonR4::TruthSegmentMaker::m_includePileUpHits {this, "includePileUpHits", true} |  | private | 
 
Construct segments from pile-up hits without GenParticleLink. 
Definition at line 141 of file TruthSegmentMaker.h.
 
 
◆ m_locParKey
◆ m_mdtCalibKey
Initial value:{this, "MdtCalibKey", "MdtCalibConstants",
                                                                                "Conditions object containing the calibrations"}
Data dependency on the Mdt calibration container to calculate the uncertainty. 
Definition at line 157 of file TruthSegmentMaker.h.
 
 
◆ m_nswUncertKey
Initial value:{this, "NswErrorKey", "NswUncertData", 
                                                                  "Key of the parametrized NSW uncertainties"}
Data dependency on the Nsw calibration container to estimate the uncertaintys. 
Definition at line 160 of file TruthSegmentMaker.h.
 
 
◆ m_pileUpHitAngleCone
  
  | 
        
          | Gaudi::Property<float> MuonR4::TruthSegmentMaker::m_pileUpHitAngleCone {this, "pileUpHitAngleCone", 1.*Gaudi::Units::deg} |  | private | 
 
 
◆ m_pileUpHitDistance
  
  | 
        
          | Gaudi::Property<float> MuonR4::TruthSegmentMaker::m_pileUpHitDistance {this, "pileUpHitDistance", 2.*Gaudi::Units::m} |  | private | 
 
 
◆ m_pileUpHitELoss
  
  | 
        
          | Gaudi::Property<float> MuonR4::TruthSegmentMaker::m_pileUpHitELoss {this, "pileUpHitELoss", 5.*Gaudi::Units::MeV} |  | private | 
 
 
◆ m_pileUpHitMinE
  
  | 
        
          | Gaudi::Property<float> MuonR4::TruthSegmentMaker::m_pileUpHitMinE {this, "energyThresholdPileUp", 1.*Gaudi::Units::GeV} |  | private | 
 
 
◆ m_ptKey
◆ m_qKey
◆ m_readKeys
List of sim hit containers from which the truth segments shall be retrieved. 
Definition at line 125 of file TruthSegmentMaker.h.
 
 
◆ m_segmentKey
Key under which the segment Container will be recorded in StoreGate. 
Definition at line 129 of file TruthSegmentMaker.h.
 
 
◆ m_useOnlyMuonHits
  
  | 
        
          | Gaudi::Property<bool> MuonR4::TruthSegmentMaker::m_useOnlyMuonHits {this, "useOnlyMuonHits", true} |  | private | 
 
 
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
 
def retrieve(aClass, aKey=None)
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_eleLinkKey
Decoration key of the associated sim hit links.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
const SpectrometerSector * msSector() const
Returns the pointer to the envelope volume enclosing all chambers in the sector.
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
Identifier identify() const
Returns the global ATLAS identifier of the SimHit.
Scalar phi() const
phi method
double angle(const Amg::Vector3D &v1, const Amg::Vector3D &v2)
calculates the opening angle between two vectors
void setPosition(float x, float y, float z)
Sets the global position.
void buildSegmentsFromBkg(const EventContext &ctx, const Amg::Transform3D &locToGlob, const SimHitVec_t &simHits, WriteDecorHolder &writeShip) const
Attempts to assemble truth segments from a list of loose sim hits, i.e., the hits are stemming from a...
std::vector< HitPosTuple_t > SimHitVec_t
Scalar theta() const
theta method
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
Key to the geometry context.
std::vector< ALFA_RawData_p1 > t0
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)
TechnologyIndex
enum to classify the different layers in the muon spectrometer
@ Tgc
Resitive Plate Chambers.
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Gaudi::Property< float > m_idCylinderR
ID / ITk cylinder radius.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Class describing a MuonSegment.
const MuonGMR4::MuonDetectorManager * m_detMgr
Pointer to the muon readout geometry.
Gaudi::Property< float > m_pileUpHitMinE
Minimum energy threshold for pile up hits to be converted
virtual DetectorType detectorType() const =0
Returns the detector element type.
virtual IdentifierHash layerHash(const Identifier &measId) const =0
#define ATH_MSG_VERBOSE(x)
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_qKey
Decoration key of the muon charge
Property holding a SG store/key/clid from which a ReadHandle is made.
void setT0Error(float t0, float t0Error)
Sets the time error.
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_ptKey
Decoration key of the associated particle pt.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
xAOD::MuonSegment * constructSegmentFromHits(const EventContext &ctx, const Amg::Transform3D &locToGlob, const SimHitVec_t &hits, WriteDecorHolder &writeShip) const
Takes a list of related sim hits and transforms them into a truth segment.
void setNHits(int nPrecisionHits, int nPhiLayers, int nTrigEtaLayers)
Set the number of hits/layers.
Gaudi::Property< bool > m_useOnlyMuonHits
Build segments from muon hits only.
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_locParKey
Decoration key of the local parameters.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Gaudi::Property< float > m_idCylinderHalfZ
ID / Itk cylinder half length.
float kineticEnergy() const
Returns the kinetic energy of the traversing particle.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
const HepMcParticleLink & genParticleLink() const
Returns the link to the HepMC particle producing this hit.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
@ Mm
Maybe not needed in the migration.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::vector< EleLink_t > HitLinkVec_t
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Eigen::Affine3d Transform3D
Amg::Transform3D toChamber(const ActsTrk::GeometryContext &gctx, const Identifier &chanId) const
Returns the transform from the local simHit frame -> chamber frame.
Gaudi::Property< float > m_pileUpHitDistance
Maximum separation between two pile-up hits.
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
double chi2(TH1 *h0, TH1 *h1)
const Amg::Transform3D & localToGlobalTrans(const ActsTrk::GeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
ConstVectorMap< 3 > localDirection() const
Returns the local direction of the traversing 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.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Amg::Transform3D globalToLocalTrans(const ActsTrk::GeometryContext &gctx) const
Returns the global -> local transformation from the ATLAS global.
const GenParticle * ConstGenParticlePtr
Gaudi::Property< float > m_pileUpHitELoss
Maximum energy loss between two pile-up hits.
double charge(const T &p)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
#define THROW_EXCEPTION(MESSAGE)
xAOD::MeasVector< Acts::toUnderlying(SegmentFit::ParamDefs::nPars)> SegPars_t
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Gaudi::Property< bool > m_includePileUpHits
Construct segments from pile-up hits without GenParticleLink.
#define ATH_MSG_WARNING(x)
void setIdentifier(int sector, ::Muon::MuonStationIndex::ChIndex chamberIndex, int etaIndex, ::Muon::MuonStationIndex::TechnologyIndex technology)
Set the identifier.
const boost::regex re(r_e)
SG::ReadHandleKeyArray< xAOD::MuonSimHitContainer > m_readKeys
List of sim hit containers from which the truth segments shall be retrieved.
virtual IdentifierHash measurementHash(const Identifier &measId) const =0
Constructs the identifier hash from the full measurement Identifier.
ConstVectorMap< 3 > localPosition() const
Returns the local postion of the traversing particle.
@ Rpc
Monitored Drift Tubes.
Gaudi::Property< float > m_pileUpHitAngleCone
Maximum scattering angle between two pile-up hits.
void setDirection(float px, float py, float pz)
Sets the direction.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
std::tuple< const xAOD::MuonSimHit *, Amg::Vector3D, Amg::Vector3D > HitPosTuple_t
Tuple consisting out of pointer to the sim hit and the position & direction expressed in the chamber'...
double signedDistance(const Amg::Vector3D &posA, const Amg::Vector3D &dirA, const Amg::Vector3D &posB, const Amg::Vector3D &dirB)
Calculates the signed distance between two lines in 3D space.
virtual StatusCode sysInitialize() override
Override sysInitialize.
SG::WriteHandleKey< xAOD::MuonSegmentContainer > m_segmentKey
Key under which the segment Container will be recorded in StoreGate.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc to decode the Identifiers.
SG::ReadCondHandleKey< NswErrorCalibData > m_nswUncertKey
Data dependency on the Nsw calibration container to estimate the uncertaintys.
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainer > m_mdtCalibKey
Data dependency on the Mdt calibration container to calculate the uncertainty.
float hitUncertainty(const EventContext &ctx, const xAOD::MuonSimHit &hit) const
Evaluates the hit uncertainty.
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
constexpr int pow(int base, int exp) noexcept
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
float muonPt(const xAOD::MuonSimHit &hit, const Amg::Vector3D &globDir) const
Returns the muon pt from the sim hit.
float mass() const
Returns the rest-mass of the traversing particle.
ElementLink< xAOD::MuonSimHitContainer > EleLink_t
const MuonReadoutElement * getReadoutElement(const Identifier &id) const
Returns a generic Muon readout element.