ATLAS Offline Software
MSVertexTrackletTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #pragma once
6 
7 #include <utility>
8 #include <vector>
9 
11 
14 
15 #include "GaudiKernel/SystemOfUnits.h"
16 #include "GaudiKernel/ServiceHandle.h"
19 
22 
27 
29 #include "MSVertexUtils/Tracklet.h"
31 
32 
33 namespace Muon {
34 
35  class MSVertexTrackletTool : virtual public IMSVertexTrackletTool, public AthAlgTool {
36  public:
37  MSVertexTrackletTool(const std::string& type, const std::string& name, const IInterface* parent);
38  virtual ~MSVertexTrackletTool() = default;
39 
40  virtual StatusCode initialize() override;
41 
42  StatusCode findTracklets(std::vector<Tracklet>& tracklets, const EventContext& ctx) const override;
43 
44  private:
45  SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_mdtTESKey{this, "mdtTES", "MDT_DriftCircles"};
46  SG::WriteHandleKey<xAOD::TrackParticleContainer> m_TPContainer{this, "xAODTrackParticleContainer", "MSonlyTracklets"};
47 
48  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
49 
50  // hit properties
51  // longitudinal (transverse) separation used in the barrel (endcaps)
52  Gaudi::Property<double> m_d12_max{this, "d12_max", 50.*Gaudi::Units::millimeter, "max separation in mm between hits in tube 1 and 2"};
53  Gaudi::Property<double> m_d13_max{this, "d13_max", 80.*Gaudi::Units::millimeter, "max separation in mm between hits in tube 1 and 3"};
54  Gaudi::Property<double> m_errorCutOff{this, "errorCutOff", 0.001, "minimal hit error"};
55  // tracklet segment properties
56  Gaudi::Property<double> m_SeedResidual{this, "SeedResidual", 5., "max residual for tracklet seeds"};
57  Gaudi::Property<double> m_minSegFinderChi2{this, "MinSegFinderChi2Prob", 0.05, "tracklet segment fitter chi^2 probability cut"};
58  // tracklet properties
59  Gaudi::Property<double> m_BarrelDeltaAlphaCut{this, "BarrelDeltaAlphaCut", 0.2*Gaudi::Units::radian, "maximum delta_alpha allowed in barrel MS chambers"};
60  Gaudi::Property<double> m_EndcapDeltaAlphaCut{this, "EndcapDeltaAlphaCut", 0.015*Gaudi::Units::radian, "maximum delta_alpha allowed in the endcap MS chambers"};
61  Gaudi::Property<double> m_maxDeltabCut{this, "maxDeltabCut", 3*Gaudi::Units::millimeter, "maximum delta_b allowed"};
62  Gaudi::Property<double> m_minpTot{this, "minpTot", 800.*Gaudi::Units::MeV, "minimum measurable total momentum in MeV"};
63  Gaudi::Property<double> m_maxpTot{this, "maxpTot", 10000.*Gaudi::Units::MeV, "maximum measurable total momentum in MeV beyond which tracklets are assumed to be straight"};
64  Gaudi::Property<double> m_straightTrackletpTot{this, "straightTrackletpTot", 1.0e5*Gaudi::Units::MeV, "total momentum in MeV assigned to straight tracklets"};
65  Gaudi::Property<double> m_straightTrackletInvPerr{this, "straightTrackletInvPerr", 5.0e-5/Gaudi::Units::MeV, "error in the inverse momentum in MeV^-1 assigned to straight tracklets"};
66  Gaudi::Property<bool> m_tightTrackletRequirement{this, "tightTrackletRequirement", false, "tight tracklet requirement (affects efficiency - disabled by default)"};
67 
68  // MDT routines
69  bool IgnoreMDTChamber(const Muon::MdtPrepData* mdtHit) const;
70  int SortMDThits(std::vector<std::vector<const Muon::MdtPrepData*> >& SortedMdt, const EventContext& ctx) const;
71  void addMDTHits(std::vector<const Muon::MdtPrepData*>& hits, std::vector<std::vector<const Muon::MdtPrepData*> >& SortedMdt) const;
72  // single multilayer segment fitting, residuals, and cleaning
73  std::vector<TrackletSegment> TrackletSegmentFitter(const std::vector<const Muon::MdtPrepData*>& mdts) const;
74  std::vector<std::pair<double, double> > SegSeeds(const std::vector<const Muon::MdtPrepData*>& mdts) const;
75  std::vector<TrackletSegment> TrackletSegmentFitterCore(const std::vector<const Muon::MdtPrepData*>& mdts, const std::vector<std::pair<double, double> >& SeedParams) const;
76  static double SeedResiduals(const std::vector<const Muon::MdtPrepData*>& mdts, double slope, double inter) ;
77  std::vector<TrackletSegment> CleanSegments(const std::vector<TrackletSegment>& segs) const;
78  // Tracklet routines
79  bool DeltabCalc(const TrackletSegment& ML1seg, const TrackletSegment& ML2seg) const;
80  double TrackMomentum(const Identifier trkID, const double deltaAlpha) const ;
81  double TrackMomentumError(const TrackletSegment& ml1, const TrackletSegment& ml2) const;
82  double TrackMomentumError(const TrackletSegment& ml1) const;
83  std::vector<Tracklet> ResolveAmbiguousTracklets(std::vector<Tracklet>& tracks) const;
84  static void convertToTrackParticles(std::vector<Tracklet>& tracklets, SG::WriteHandle<xAOD::TrackParticleContainer>& container) ;
85  };
86 
87 } // namespace Muon
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
Muon::MSVertexTrackletTool::m_EndcapDeltaAlphaCut
Gaudi::Property< double > m_EndcapDeltaAlphaCut
Definition: MSVertexTrackletTool.h:60
IMSVertexTrackletTool.h
Muon::MSVertexTrackletTool::TrackMomentum
double TrackMomentum(const Identifier trkID, const double deltaAlpha) const
Definition: MSVertexTrackletTool.cxx:920
Muon::MSVertexTrackletTool::SeedResiduals
static double SeedResiduals(const std::vector< const Muon::MdtPrepData * > &mdts, double slope, double inter)
Definition: MSVertexTrackletTool.cxx:569
Muon::MSVertexTrackletTool::m_TPContainer
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_TPContainer
Definition: MSVertexTrackletTool.h:46
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
TrackParameters.h
Muon::MSVertexTrackletTool::CleanSegments
std::vector< TrackletSegment > CleanSegments(const std::vector< TrackletSegment > &segs) const
Definition: MSVertexTrackletTool.cxx:738
Muon::MSVertexTrackletTool::m_errorCutOff
Gaudi::Property< double > m_errorCutOff
Definition: MSVertexTrackletTool.h:54
Muon::MSVertexTrackletTool::m_straightTrackletInvPerr
Gaudi::Property< double > m_straightTrackletInvPerr
Definition: MSVertexTrackletTool.h:65
Muon::MSVertexTrackletTool::~MSVertexTrackletTool
virtual ~MSVertexTrackletTool()=default
EventPrimitivesHelpers.h
Muon::MSVertexTrackletTool::m_straightTrackletpTot
Gaudi::Property< double > m_straightTrackletpTot
Definition: MSVertexTrackletTool.h:64
Muon::MSVertexTrackletTool::initialize
virtual StatusCode initialize() override
Definition: MSVertexTrackletTool.cxx:34
Muon::MSVertexTrackletTool::findTracklets
StatusCode findTracklets(std::vector< Tracklet > &tracklets, const EventContext &ctx) const override
Definition: MSVertexTrackletTool.cxx:44
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::MSVertexTrackletTool::MSVertexTrackletTool
MSVertexTrackletTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MSVertexTrackletTool.cxx:27
python.SystemOfUnits.millimeter
float millimeter
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration # This software is distribute...
Definition: SystemOfUnits.py:62
Muon::MSVertexTrackletTool::DeltabCalc
bool DeltabCalc(const TrackletSegment &ML1seg, const TrackletSegment &ML2seg) const
Definition: MSVertexTrackletTool.cxx:887
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
python.SystemOfUnits.MeV
float MeV
Definition: SystemOfUnits.py:172
Muon::MSVertexTrackletTool::convertToTrackParticles
static void convertToTrackParticles(std::vector< Tracklet > &tracklets, SG::WriteHandle< xAOD::TrackParticleContainer > &container)
Definition: MSVertexTrackletTool.cxx:330
Muon::MSVertexTrackletTool::TrackletSegmentFitterCore
std::vector< TrackletSegment > TrackletSegmentFitterCore(const std::vector< const Muon::MdtPrepData * > &mdts, const std::vector< std::pair< double, double > > &SeedParams) const
Definition: MSVertexTrackletTool.cxx:584
Muon::MSVertexTrackletTool::m_d12_max
Gaudi::Property< double > m_d12_max
Definition: MSVertexTrackletTool.h:52
GeoPrimitives.h
MdtPrepDataContainer.h
SG::WriteHandleKey< xAOD::TrackParticleContainer >
TrackParticleAuxContainer.h
TrackletSegment
New segment class for single ML segments.
Definition: TrackletSegment.h:20
Muon::MSVertexTrackletTool::TrackMomentumError
double TrackMomentumError(const TrackletSegment &ml1, const TrackletSegment &ml2) const
Definition: MSVertexTrackletTool.cxx:950
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
Muon::IMSVertexTrackletTool
The IMSVertexTrackletTool is a pure virtual interface.
Definition: IMSVertexTrackletTool.h:17
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Muon::MSVertexTrackletTool::m_SeedResidual
Gaudi::Property< double > m_SeedResidual
Definition: MSVertexTrackletTool.h:56
Muon::MSVertexTrackletTool::m_minSegFinderChi2
Gaudi::Property< double > m_minSegFinderChi2
Definition: MSVertexTrackletTool.h:57
Muon::MSVertexTrackletTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MSVertexTrackletTool.h:48
Muon::MSVertexTrackletTool::IgnoreMDTChamber
bool IgnoreMDTChamber(const Muon::MdtPrepData *mdtHit) const
Definition: MSVertexTrackletTool.cxx:356
Muon::MSVertexTrackletTool::m_mdtTESKey
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_mdtTESKey
Definition: MSVertexTrackletTool.h:45
Muon::MSVertexTrackletTool::m_maxpTot
Gaudi::Property< double > m_maxpTot
Definition: MSVertexTrackletTool.h:63
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
Muon::MSVertexTrackletTool::SortMDThits
int SortMDThits(std::vector< std::vector< const Muon::MdtPrepData * > > &SortedMdt, const EventContext &ctx) const
Definition: MSVertexTrackletTool.cxx:380
Muon::MSVertexTrackletTool::addMDTHits
void addMDTHits(std::vector< const Muon::MdtPrepData * > &hits, std::vector< std::vector< const Muon::MdtPrepData * > > &SortedMdt) const
Definition: MSVertexTrackletTool.cxx:432
Muon::MSVertexTrackletTool::m_d13_max
Gaudi::Property< double > m_d13_max
Definition: MSVertexTrackletTool.h:53
Muon::MdtPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition: MdtPrepData.h:33
Muon::MSVertexTrackletTool::m_BarrelDeltaAlphaCut
Gaudi::Property< double > m_BarrelDeltaAlphaCut
Definition: MSVertexTrackletTool.h:59
TrackParticle.h
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
Muon::MSVertexTrackletTool::m_maxDeltabCut
Gaudi::Property< double > m_maxDeltabCut
Definition: MSVertexTrackletTool.h:61
Muon::MSVertexTrackletTool
Definition: MSVertexTrackletTool.h:35
Muon::MSVertexTrackletTool::TrackletSegmentFitter
std::vector< TrackletSegment > TrackletSegmentFitter(const std::vector< const Muon::MdtPrepData * > &mdts) const
Definition: MSVertexTrackletTool.cxx:453
Muon::MSVertexTrackletTool::m_minpTot
Gaudi::Property< double > m_minpTot
Definition: MSVertexTrackletTool.h:62
Muon::MSVertexTrackletTool::ResolveAmbiguousTracklets
std::vector< Tracklet > ResolveAmbiguousTracklets(std::vector< Tracklet > &tracks) const
Definition: MSVertexTrackletTool.cxx:1008
Muon::MSVertexTrackletTool::m_tightTrackletRequirement
Gaudi::Property< bool > m_tightTrackletRequirement
Definition: MSVertexTrackletTool.h:66
Muon::MSVertexTrackletTool::SegSeeds
std::vector< std::pair< double, double > > SegSeeds(const std::vector< const Muon::MdtPrepData * > &mdts) const
Definition: MSVertexTrackletTool.cxx:465
AthAlgTool
Definition: AthAlgTool.h:26
TrackParticleContainer.h
IMuonIdHelperSvc.h
Tracklet.h
python.SystemOfUnits.radian
float radian
Definition: SystemOfUnits.py:119
TrackletSegment.h
ServiceHandle< Muon::IMuonIdHelperSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14