ATLAS Offline Software
Loading...
Searching...
No Matches
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_endcaps_Lxy_up = 10*Gaudi::Units::m;
25 constexpr double fidVol_z_low = 5*Gaudi::Units::m;
26 constexpr double fidVol_z_up = 15*Gaudi::Units::m;
27
28 constexpr double match_max = 0.4;
29
30 // Detector region separation into barrel and endcaps
31 bool inBarrel(double eta);
32 bool inBarrel(const Amg::Vector3D &vtx);
33 bool inEndcaps(double eta);
34 bool inEndcaps(const Amg::Vector3D &vtx);
35 bool inDetectorRegion(const Amg::Vector3D &vtx);
36 int getNvtxBarrel(const std::vector<Amg::Vector3D> &vertices);
37 int getNvtxEndcaps(const std::vector<Amg::Vector3D> &vertices);
38 int getNvtxDetectorRegion(const std::vector<Amg::Vector3D> &vertices);
39
40 // MSVtx search fiducial volume
41 bool inFiducialVolBarrel(const Amg::Vector3D &vtx);
42 bool inFiducialVolEndcaps(const Amg::Vector3D &vtx);
43 bool inFiducialVol(const Amg::Vector3D &vtx);
44 int NvtxFiducialVol(const std::vector<Amg::Vector3D> &vertices);
45 bool isGoodVtx(const Amg::Vector3D &vtx);
46
47 // Matching of vertices
48 double getMatchMetric(const Amg::Vector3D &vtx1, const Amg::Vector3D &vtx2);
49 Amg::Vector3D findBestMatch(const Amg::Vector3D &vtx1, const std::vector<Amg::Vector3D> &vtx2_vec);
50 bool isValidMatch(const Amg::Vector3D &match_candidate);
51 bool hasMatch(const Amg::Vector3D &vtx1, const std::vector<Amg::Vector3D> &vtx2_vec);
52
53 // position vectors
54 std::vector<Amg::Vector3D> getVertexPos(const std::vector<double> &vtx_x, const std::vector<double> &vtx_y, const std::vector<double> &vtx_z);
55 std::vector<std::vector<Amg::Vector3D>> getConstituentPos(int Nvtx, const std::vector<int> &obj_vtx_link,
56 const std::vector<double> &obj_x, const std::vector<double> &obj_y, const std::vector<double> &obj_z);
57}
58
59#endif // MSVTXVALIDATIONMACROUTILS_H
Scalar eta() const
pseudorapidity method
Eigen::Matrix< double, 3, 1 > Vector3D
int getNvtxDetectorRegion(const std::vector< Amg::Vector3D > &vertices)
double getMatchMetric(const Amg::Vector3D &vtx1, const Amg::Vector3D &vtx2)
bool hasMatch(const Amg::Vector3D &vtx1, const std::vector< Amg::Vector3D > &vtx2_vec)
std::vector< Amg::Vector3D > getVertexPos(const std::vector< double > &vtx_x, const std::vector< double > &vtx_y, const std::vector< double > &vtx_z)
Amg::Vector3D findBestMatch(const Amg::Vector3D &vtx, const std::vector< Amg::Vector3D > &candidates)
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)