ATLAS Offline Software
MSVertexRecoTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MSVVERTEXRECOTOOL_H
6 #define MSVVERTEXRECOTOOL_H
7 
8 #include <string>
9 #include <utility>
10 #include <vector>
11 
15 #include "GaudiKernel/ServiceHandle.h"
16 #include "GaudiKernel/ToolHandle.h"
19 #include "MSVertexUtils/MSVertex.h"
20 #include "MSVertexUtils/Tracklet.h"
32 
33 namespace Muon {
34 
35  class MSVertexRecoTool : virtual public IMSVertexRecoTool, public AthAlgTool {
37 
38  public:
39  MSVertexRecoTool(const std::string &type, const std::string &name, const IInterface *parent);
40  virtual ~MSVertexRecoTool() = default;
41 
42  virtual StatusCode initialize(void) override;
43  StatusCode findMSvertices(std::vector<Tracklet> &traklets, std::vector<MSVertex *> &vertices,
44  const EventContext &ctx) const override;
45 
46  struct TrkCluster {
47  float eta;
48  float phi;
49  int ntrks;
50  int trks[100];
52  std::vector<Tracklet> tracks;
54  eta = 0;
55  phi = 0;
56  ntrks = 0;
57  for (unsigned int i = 0; i < 100; ++i) trks[i] = 0;
58  isSystematic = 0;
59  }
60  };
61 
62  private:
63  ToolHandle<Trk::IExtrapolator> m_extrapolator{this, "MyExtrapolator", "Trk::Extrapolator/AtlasExtrapolator"};
74  unsigned int m_maxGlobalTracklets;
75  unsigned int m_maxClusterTracklets;
78 
79  // barrel vertex reco algorithm
80  void MSVxFinder(const std::vector<Tracklet> &tracklets, std::unique_ptr<MSVertex> &vtx, const EventContext &ctx) const;
81  // endcap vertex reco algorithm
82  void MSStraightLineVx(const std::vector<Tracklet> &trks, std::unique_ptr<MSVertex> &vtx, const EventContext &ctx) const;
83  void MSStraightLineVx_oldMethod(const std::vector<Tracklet> &trks, std::unique_ptr<MSVertex> &vtx, const EventContext &ctx) const;
84  static void MakeDummyVertex(MSVertex *&) ;
85  float vxPhiFinder(const float theta, const float phi, const EventContext &ctx) const; // vertex phi location reco algorithm
86  void HitCounter(MSVertex *MSRecoVx, const EventContext &ctx) const; // counts MDT, RPC & TGC around a reco'd vertex
87  std::vector<TrkCluster> findTrackClusters(const std::vector<Tracklet> &tracklets)
88  const; // group tracklets into clusters -- vertex reco runs on each cluster of tracklets
89  TrkCluster ClusterizeTracks(std::vector<Tracklet> &tracks) const; // core algorithm for creating the clusters
90  static StatusCode FillOutputContainer(std::vector<MSVertex *> &, SG::WriteHandle<xAOD::VertexContainer> &xAODVxContainer,
93  static Amg::Vector3D VxMinQuad(const std::vector<Tracklet> &tracks) ; // endcap vertex reco core
94  static std::vector<Tracklet> RemoveBadTrk(const std::vector<Tracklet> &tracklets,
95  const Amg::Vector3D &Vx) ; // endcap vertex algo track selector
96  bool EndcapHasBadTrack(const std::vector<Tracklet> &tracklets, const Amg::Vector3D &Vx) const;
97  std::vector<Tracklet> getTracklets(const std::vector<Tracklet> &trks, const std::set<int> &tracklet_subset) const;
98 
99  SG::WriteHandleKey<xAOD::VertexContainer> m_xAODContainerKey{this, "xAODVertexContainer", "MSDisplacedVertex"};
100 
101  SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_rpcTESKey{this, "TESKey", "RPC_Measurements"};
102  SG::ReadHandleKey<Muon::TgcPrepDataContainer> m_tgcTESKey{this, "TGCKey", "TGC_Measurements"};
103  SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_mdtTESKey{this, "MDTKey", "MDT_DriftCircles"};
104 
108 
109  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
110  ServiceHandle<IAthRNGSvc> m_rndmSvc{this, "RndmSvc", "AthRNGSvc", "Random Number Service"}; // Random number service
111  };
112 
113 } // namespace Muon
114 #endif // MSVERTEXRECOTOOL_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
MdtReadoutElement.h
Muon::MSVertexRecoTool::vxPhiFinder
float vxPhiFinder(const float theta, const float phi, const EventContext &ctx) const
Definition: MSVertexRecoTool.cxx:1039
Muon::MSVertexRecoTool::FillOutputContainer
static StatusCode FillOutputContainer(std::vector< MSVertex * > &, SG::WriteHandle< xAOD::VertexContainer > &xAODVxContainer, SG::WriteDecorHandle< decortype, int > &, SG::WriteDecorHandle< decortype, int > &, SG::WriteDecorHandle< decortype, int > &)
Definition: MSVertexRecoTool.cxx:979
TrackParameters.h
Muon::MSVertexRecoTool::m_doSystematics
bool m_doSystematics
Definition: MSVertexRecoTool.h:77
Muon::IMSVertexRecoTool
The IMSVertexRecoTool is a pure virtual interface.
Definition: IMSVertexRecoTool.h:20
Muon::MSVertexRecoTool::~MSVertexRecoTool
virtual ~MSVertexRecoTool()=default
MSVertex.h
Muon::MSVertexRecoTool::TrkCluster::isSystematic
bool isSystematic
Definition: MSVertexRecoTool.h:51
Muon::MSVertexRecoTool::m_VxChi2ProbCUT
float m_VxChi2ProbCUT
Definition: MSVertexRecoTool.h:67
Muon::MSVertexRecoTool::TrkCluster::eta
float eta
Definition: MSVertexRecoTool.h:47
Muon::MSVertexRecoTool::m_VertexMaxRadialPlane
float m_VertexMaxRadialPlane
Definition: MSVertexRecoTool.h:69
Muon::MSVertexRecoTool::TrkCluster::ntrks
int ntrks
Definition: MSVertexRecoTool.h:49
IExtrapolator.h
Muon::MSVertexRecoTool::MSVertexRecoTool
MSVertexRecoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MSVertexRecoTool.cxx:33
RpcPrepDataContainer.h
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
MSVertex
Definition: MSVertex.h:12
Muon::MSVertexRecoTool::EndcapHasBadTrack
bool EndcapHasBadTrack(const std::vector< Tracklet > &tracklets, const Amg::Vector3D &Vx) const
Definition: MSVertexRecoTool.cxx:960
Muon::MSVertexRecoTool::findTrackClusters
std::vector< TrkCluster > findTrackClusters(const std::vector< Tracklet > &tracklets) const
Definition: MSVertexRecoTool.cxx:359
Muon::MSVertexRecoTool::TrkCluster::TrkCluster
TrkCluster()
Definition: MSVertexRecoTool.h:53
Muon::MSVertexRecoTool::m_TrackPhiAngle
float m_TrackPhiAngle
Definition: MSVertexRecoTool.h:66
Muon::MSVertexRecoTool::m_VertexMinRadialPlane
float m_VertexMinRadialPlane
Definition: MSVertexRecoTool.h:70
Muon::MSVertexRecoTool
Definition: MSVertexRecoTool.h:35
GeoPrimitives.h
Muon::MSVertexRecoTool::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Definition: MSVertexRecoTool.h:110
Muon::MSVertexRecoTool::m_mdtTESKey
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_mdtTESKey
Definition: MSVertexRecoTool.h:103
Muon::MSVertexRecoTool::m_BarrelTrackletUncert
float m_BarrelTrackletUncert
Definition: MSVertexRecoTool.h:64
MdtPrepDataContainer.h
Muon::MSVertexRecoTool::m_maxClusterTracklets
unsigned int m_maxClusterTracklets
Definition: MSVertexRecoTool.h:75
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
lumiFormat.i
int i
Definition: lumiFormat.py:85
Muon::MSVertexRecoTool::findMSvertices
StatusCode findMSvertices(std::vector< Tracklet > &traklets, std::vector< MSVertex * > &vertices, const EventContext &ctx) const override
Definition: MSVertexRecoTool.cxx:87
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TgcPrepDataContainer.h
Muon::MSVertexRecoTool::MSVxFinder
void MSVxFinder(const std::vector< Tracklet > &tracklets, std::unique_ptr< MSVertex > &vtx, const EventContext &ctx) const
Definition: MSVertexRecoTool.cxx:383
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
AthAlgTool.h
WriteDecorHandle.h
Handle class for adding a decoration to an object.
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Muon::MSVertexRecoTool::HitCounter
void HitCounter(MSVertex *MSRecoVx, const EventContext &ctx) const
Definition: MSVertexRecoTool.cxx:1128
IMSVertexRecoTool.h
Muon::MSVertexRecoTool::getTracklets
std::vector< Tracklet > getTracklets(const std::vector< Tracklet > &trks, const std::set< int > &tracklet_subset) const
Definition: MSVertexRecoTool.cxx:948
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
Muon::MSVertexRecoTool::MSStraightLineVx
void MSStraightLineVx(const std::vector< Tracklet > &trks, std::unique_ptr< MSVertex > &vtx, const EventContext &ctx) const
Definition: MSVertexRecoTool.cxx:745
Muon::MSVertexRecoTool::m_decor_nTGC
SG::WriteDecorHandleKey< decortype > m_decor_nTGC
Definition: MSVertexRecoTool.h:107
Muon::MSVertexRecoTool::m_minHighOccupancyChambers
int m_minHighOccupancyChambers
Definition: MSVertexRecoTool.h:71
Muon::MSVertexRecoTool::m_ChamberOccupancyMin
float m_ChamberOccupancyMin
Definition: MSVertexRecoTool.h:72
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
EventPrimitives.h
Muon::MSVertexRecoTool::MSStraightLineVx_oldMethod
void MSStraightLineVx_oldMethod(const std::vector< Tracklet > &trks, std::unique_ptr< MSVertex > &vtx, const EventContext &ctx) const
Definition: MSVertexRecoTool.cxx:870
Muon::MSVertexRecoTool::m_xAODContainerKey
SG::WriteHandleKey< xAOD::VertexContainer > m_xAODContainerKey
Definition: MSVertexRecoTool.h:99
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Muon::MSVertexRecoTool::TrkCluster::phi
float phi
Definition: MSVertexRecoTool.h:48
Muon::MSVertexRecoTool::TrkCluster::trks
int trks[100]
Definition: MSVertexRecoTool.h:50
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Muon::MSVertexRecoTool::m_rpcTESKey
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_rpcTESKey
Definition: MSVertexRecoTool.h:101
Muon::MSVertexRecoTool::m_useOldMSVxEndcapMethod
int m_useOldMSVxEndcapMethod
Definition: MSVertexRecoTool.h:73
Muon::MSVertexRecoTool::m_EndcapTrackletUncert
float m_EndcapTrackletUncert
Definition: MSVertexRecoTool.h:65
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
Muon::MSVertexRecoTool::m_decor_nMDT
SG::WriteDecorHandleKey< decortype > m_decor_nMDT
Definition: MSVertexRecoTool.h:105
VertexContainer.h
Muon::MSVertexRecoTool::VxMinQuad
static Amg::Vector3D VxMinQuad(const std::vector< Tracklet > &tracks)
Definition: MSVertexRecoTool.cxx:1010
Muon::MSVertexRecoTool::m_maxGlobalTracklets
unsigned int m_maxGlobalTracklets
Definition: MSVertexRecoTool.h:74
Muon::MSVertexRecoTool::initialize
virtual StatusCode initialize(void) override
Definition: MSVertexRecoTool.cxx:65
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Muon::MSVertexRecoTool::m_MaxTollDist
float m_MaxTollDist
Definition: MSVertexRecoTool.h:76
Muon::MSVertexRecoTool::ClusterizeTracks
TrkCluster ClusterizeTracks(std::vector< Tracklet > &tracks) const
Definition: MSVertexRecoTool.cxx:228
Muon::MSVertexRecoTool::TrkCluster
Definition: MSVertexRecoTool.h:46
Muon::MSVertexRecoTool::m_VxPlaneDist
float m_VxPlaneDist
Definition: MSVertexRecoTool.h:68
Muon::MSVertexRecoTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MSVertexRecoTool.h:109
AthAlgTool
Definition: AthAlgTool.h:26
Muon::MSVertexRecoTool::m_tgcTESKey
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_tgcTESKey
Definition: MSVertexRecoTool.h:102
Muon::MSVertexRecoTool::MakeDummyVertex
static void MakeDummyVertex(MSVertex *&)
Definition: MSVertexRecoTool.cxx:861
Muon::MSVertexRecoTool::TrkCluster::tracks
std::vector< Tracklet > tracks
Definition: MSVertexRecoTool.h:52
Muon::MSVertexRecoTool::decortype
xAOD::VertexContainer decortype
Definition: MSVertexRecoTool.h:36
IMuonIdHelperSvc.h
Tracklet.h
Muon::MSVertexRecoTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: MSVertexRecoTool.h:63
IAthRNGSvc.h
ServiceHandle< Muon::IMuonIdHelperSvc >
Muon::MSVertexRecoTool::m_decor_nRPC
SG::WriteDecorHandleKey< decortype > m_decor_nRPC
Definition: MSVertexRecoTool.h:106
Muon::MSVertexRecoTool::RemoveBadTrk
static std::vector< Tracklet > RemoveBadTrk(const std::vector< Tracklet > &tracklets, const Amg::Vector3D &Vx)
Definition: MSVertexRecoTool.cxx:924