ATLAS Offline Software
MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MSVTXVALIDATIONMACROUTILS_H
6 #define MSVTXVALIDATIONMACROUTILS_H
7 
8 #include <vector>
9 #include <string>
10 
11 #include "GaudiKernel/SystemOfUnits.h"
14 
15 
17  // fiducial volume definition
18  constexpr double fidVol_barrel_etaCut = 0.7;
19  constexpr double fidVol_Lxy_low = 3*Gaudi::Units::m;
20  constexpr double fidVol_Lxy_up = 8*Gaudi::Units::m;
21 
22  constexpr double fidVol_endcaps_etaCut_low = 1.3;
23  constexpr double fidVol_endcaps_etaCut_up = 2.5;
24  constexpr double fidVol_z_low = 5*Gaudi::Units::m;
25  constexpr double fidVol_z_up = 15*Gaudi::Units::m;
26 
27  constexpr double match_max = 0.4;
28 
29  // Detector region separation into barrel and endcaps
30  bool inBarrel(double eta);
31  bool inBarrel(const Amg::Vector3D &vtx);
32  bool inEndcaps(double eta);
33  bool inEndcaps(const Amg::Vector3D &vtx);
34  bool inDetectorRegion(const Amg::Vector3D &vtx);
35  int getNvtxBarrel(const std::vector<Amg::Vector3D> &vertices);
36  int getNvtxEndcaps(const std::vector<Amg::Vector3D> &vertices);
37  int getNvtxDetectorRegion(const std::vector<Amg::Vector3D> &vertices);
38 
39  // MSVtx search fiducial volume
40  bool inFiducialVolBarrel(const Amg::Vector3D &vtx);
41  bool inFiducialVolEndcaps(const Amg::Vector3D &vtx);
42  bool inFiducialVol(const Amg::Vector3D &vtx);
43  int NvtxFiducialVol(const std::vector<Amg::Vector3D> &vertices);
44  bool isGoodVtx(const Amg::Vector3D &vtx);
45 
46  // Matching of vertices
47  double getMatchMetric(const Amg::Vector3D &vtx1, const Amg::Vector3D &vtx2);
48  Amg::Vector3D findBestMatch(const Amg::Vector3D &vtx1, const std::vector<Amg::Vector3D> &vtx2_vec);
49  bool isValidMatch(const Amg::Vector3D &match_candidate);
50  bool hasMatch(const Amg::Vector3D &vtx1, const std::vector<Amg::Vector3D> &vtx2_vec);
51 
52  // position vectors
53  std::vector<Amg::Vector3D> getVertexPos(const std::vector<double> &vtx_x, const std::vector<double> &vtx_y, const std::vector<double> &vtx_z);
54  std::vector<std::vector<Amg::Vector3D>> getConstituentPos(int Nvtx, const std::vector<int> &obj_vtx_link,
55  const std::vector<double> &obj_x, const std::vector<double> &obj_y, const std::vector<double> &obj_z);
56 }
57 
58 #endif // MSVTXVALIDATIONMACROUTILS_H
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
xAODP4Helpers.h
MuonVertexValidationMacroUtils::getMatchMetric
double getMatchMetric(const Amg::Vector3D &vtx1, const Amg::Vector3D &vtx2)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:94
MuonVertexValidationMacroUtils::getNvtxDetectorRegion
int getNvtxDetectorRegion(const std::vector< Amg::Vector3D > &vertices)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:49
MuonVertexValidationMacroUtils::fidVol_endcaps_etaCut_low
constexpr double fidVol_endcaps_etaCut_low
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.h:22
MuonVertexValidationMacroUtils::getVertexPos
std::vector< Amg::Vector3D > getVertexPos(const std::vector< double > &vtx_x, const std::vector< double > &vtx_y, const std::vector< double > &vtx_z)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:131
MuonVertexValidationMacroUtils::fidVol_z_low
constexpr double fidVol_z_low
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.h:24
MuonVertexValidationMacroUtils::isGoodVtx
bool isGoodVtx(const Amg::Vector3D &vtx)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:84
MuonVertexValidationMacroUtils::getConstituentPos
std::vector< std::vector< Amg::Vector3D > > getConstituentPos(int Nvtx, const std::vector< int > &obj_vtx_link, const std::vector< double > &obj_x, const std::vector< double > &obj_y, const std::vector< double > &obj_z)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:142
MuonVertexValidationMacroUtils::fidVol_Lxy_low
constexpr double fidVol_Lxy_low
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.h:19
MuonVertexValidationMacroUtils
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:8
MuonVertexValidationMacroUtils::fidVol_endcaps_etaCut_up
constexpr double fidVol_endcaps_etaCut_up
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.h:23
GeoPrimitives.h
MuonVertexValidationMacroUtils::match_max
constexpr double match_max
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.h:27
MuonVertexValidationMacroUtils::inDetectorRegion
bool inDetectorRegion(const Amg::Vector3D &vtx)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:32
MuonVertexValidationMacroUtils::getNvtxBarrel
int getNvtxBarrel(const std::vector< Amg::Vector3D > &vertices)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:37
MuonVertexValidationMacroUtils::isValidMatch
bool isValidMatch(const Amg::Vector3D &match_candidate)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:119
MuonVertexValidationMacroUtils::inFiducialVol
bool inFiducialVol(const Amg::Vector3D &vtx)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:71
MuonVertexValidationMacroUtils::inEndcaps
bool inEndcaps(double eta)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:22
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonVertexValidationMacroUtils::inFiducialVolEndcaps
bool inFiducialVolEndcaps(const Amg::Vector3D &vtx)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:64
MuonVertexValidationMacroUtils::fidVol_z_up
constexpr double fidVol_z_up
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.h:25
MuonVertexValidationMacroUtils::inFiducialVolBarrel
bool inFiducialVolBarrel(const Amg::Vector3D &vtx)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:57
MuonVertexValidationMacroUtils::inBarrel
bool inBarrel(double eta)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:12
MuonVertexValidationMacroUtils::NvtxFiducialVol
int NvtxFiducialVol(const std::vector< Amg::Vector3D > &vertices)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:76
MuonVertexValidationMacroUtils::getNvtxEndcaps
int getNvtxEndcaps(const std::vector< Amg::Vector3D > &vertices)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:43
MuonVertexValidationMacroUtils::fidVol_Lxy_up
constexpr double fidVol_Lxy_up
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.h:20
MuonVertexValidationMacroUtils::findBestMatch
Amg::Vector3D findBestMatch(const Amg::Vector3D &vtx, const std::vector< Amg::Vector3D > &candidates)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:100
MuonVertexValidationMacroUtils::hasMatch
bool hasMatch(const Amg::Vector3D &vtx1, const std::vector< Amg::Vector3D > &vtx2_vec)
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.cxx:124
MuonVertexValidationMacroUtils::fidVol_barrel_etaCut
constexpr double fidVol_barrel_etaCut
Definition: MuonSpectrometer/MuonValidation/MuonVertexValidation/util/Utils.h:18