ATLAS Offline Software
TrigZFinderInternal.h
Go to the documentation of this file.
1 // emacs: this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
8 //
9 // filename: TrigZFinderInternal.h
10 //
11 // author: Nikos Konstantinidis <n.konstantinidis@ucl.ac.uk>
12 //
13 //
14 // Description: NON ATHENA Internals for the ZFinder primary z vertex finding AlgTool
15 //
16 // -------------------------------
17 // ATLAS Collaboration
19 
20 
21 #ifndef TRIGZFINDERINTERNAL_H
22 #define TRIGZFINDERINTERNAL_H
23 
24 #include <cmath>
25 #include <vector>
26 #include <string>
27 
28 #include "ZFinderConstants.h"
31 
32 
33 
35 
36 public:
37 
38  struct vertex {
39  vertex( double z, double weight ) : _z(z), _weight(weight) { }
40  double _z;
41  double _weight;
42  };
43 
44 public:
45 
46  TrigZFinderInternal( const std::string&, const std::string& );
47  virtual ~TrigZFinderInternal(){};
48  // void initializeInternal(long maxLayers=20, long lastBarrel=7);
49  void initializeInternal(long maxLayers, long lastBarrel);
50 
51  std::vector<vertex>* findZInternal( const std::vector< TrigSiSpacePointBase >& spVec,
52  const IRoiDescriptor& roi ) const;
53 
54  void setLayers(long maxLayers, long lastBarrelLayer) {
55  m_IdScan_MaxNumLayers = maxLayers; // dphiEC depends on this value
56  m_IdScan_LastBrlLayer = lastBarrelLayer; // dphiBrl depends on this value
57  }
58 
59 protected: // member functions
60 
61  const std::string& getType() const { return m_type; }
62  const std::string& getName() const { return m_name; }
63 
64 
65  // fills phi, rho, z, layer of spacepoints to simple vectors
66 
67  long fillVectors( const std::vector<TrigSiSpacePointBase>& spVec,
68  const IRoiDescriptor& roi,
69  std::vector<double>& phi,
70  std::vector<double>& rho,
71  std::vector<double>& zed,
72  std::vector<long>& lyr,
73  std::vector<long>& filledLayers,
74  long& numPhiSlices ) const;
75 
76 
77  double computeZV(double r1, double z1, double r2, double z2) const;
78  double computeZV(double r1, double p1, double z1, double r2, double p2, double z2) const;
79 
80 
81 protected: // data members
82 
86 
87 
88  // To be read in from jobOptions by IdScanMain
89 
90  double m_invPhiSliceSize = 0.0; // the inverse size of the phi slices
91  long m_NumPhiSlices = 0L; // the number of phi slices, given the width of the RoI
92 
93  double m_phiBinSize; // the size of the phi slices
94  bool m_forcePhiBinSize = false; // respect the config of phi bin even if below reasonable threshold
95  double m_usedphiBinSize; // the size of the phi slices
96  double m_ROIphiWidth; // the phi width of the ROI
97  double m_minZBinSize; // z-histo bin size: m_minZBinSize+|etaRoI|*m_zBinSizeEtaCoeff (to account for worse resolution in high eta)
98  double m_zBinSizeEtaCoeff; // z-histo bin size: m_minZBinSize+|etaRoI|*m_zBinSizeEtaCoeff (to account for worse resolution in high eta)
99 
100  long m_numberOfPeaks; // how many z-positions to return in findZ
101 
102  bool m_pixOnly; // use only Pixel space points
103 
104  std::string m_type; // type information for internal book keeping
105  std::string m_name; // name information for the same
106 
107 
108  bool m_chargeAware ; // maintain separate sets of z histos for + & - tracks
109  bool m_zHistoPerPhi; // maintain one set of z histos per each phi slice
110 
111  double m_dphideta; // how, as a function of eta, the number of phi neighbours decreases
112  double m_neighborMultiplier; // extra factor to manually increase the number of phi neighbors
113 
114  std::vector< std::vector<long> > m_extraPhi; // ( IdScan_MaxNumLayers, std::vector<long>(IdScan_MaxNumLayers) ); // number of phi neighbours to look at
115 
116 
117  int m_nFirstLayers; // When the pairs of SPs are made, the inner SP comes from up to this "filled layer"
118 
119  double m_vrtxDistCut; // The minimum fractional distance between two output vertices
120  double m_vrtxMixing ; // If two vertices are found to be too close, "mix" the second into first
121  int m_nvrtxSeparation; // The minimum number of zbins that any two output vertices should by separated by
122  bool m_preferCentralZ; // Among peaks of same height, should precedence go to the one with smaller |z|
123 
124  bool m_trustSPprovider; // Should we re-extract the RoI phi range from the phis of the SPs from the SPP
125 
126  double m_returnval = 0.0; // return value for algorithm
127 
129 
131  double m_tripletDZ;
132  double m_tripletDK;
133  double m_halfTripletDK; // replaces m_tripletDK internally to avoid unnecessary multiplication by 2 in curvature calculation, without changing the interface
134  double m_tripletDP;
135 
137 
139  double m_percentile;
140 
141 
143 
145 
146  std::vector<int> m_new2old; //transform table for new layer numbering scheme
147 
148 };
149 
150 
151 #endif
152 
TrigZFinderInternal::m_tripletDP
double m_tripletDP
Definition: TrigZFinderInternal.h:134
TrigZFinderInternal::m_numberOfPeaks
long m_numberOfPeaks
Definition: TrigZFinderInternal.h:100
TrigZFinderInternal::m_pixOnly
bool m_pixOnly
Definition: TrigZFinderInternal.h:102
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
TrigZFinderInternal::m_extraPhi
std::vector< std::vector< long > > m_extraPhi
Definition: TrigZFinderInternal.h:114
TrigZFinderInternal::getType
const std::string & getType() const
Definition: TrigZFinderInternal.h:61
TrigZFinderInternal::m_zBinSizeEtaCoeff
double m_zBinSizeEtaCoeff
Definition: TrigZFinderInternal.h:98
TrigZFinderInternal::m_trustSPprovider
bool m_trustSPprovider
Definition: TrigZFinderInternal.h:124
TrigZFinderInternal::m_preferCentralZ
bool m_preferCentralZ
Definition: TrigZFinderInternal.h:122
TrigZFinderInternal
Definition: TrigZFinderInternal.h:34
TrigZFinderInternal::m_phiBinSize
double m_phiBinSize
Definition: TrigZFinderInternal.h:93
TrigZFinderInternal::m_chargeAware
bool m_chargeAware
Definition: TrigZFinderInternal.h:108
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
TrigZFinderInternal::m_IdScan_LastBrlLayer
long m_IdScan_LastBrlLayer
Definition: TrigZFinderInternal.h:85
TrigZFinderInternal::m_vrtxDistCut
double m_vrtxDistCut
Definition: TrigZFinderInternal.h:119
TrigZFinderInternal::findZInternal
std::vector< vertex > * findZInternal(const std::vector< TrigSiSpacePointBase > &spVec, const IRoiDescriptor &roi) const
Definition: TrigZFinderInternal.cxx:378
TrigZFinderInternal::vertex::vertex
vertex(double z, double weight)
Definition: TrigZFinderInternal.h:39
TrigZFinderInternal::m_maxLayer
int m_maxLayer
Definition: TrigZFinderInternal.h:136
TrigZFinderInternal::vertex
Definition: TrigZFinderInternal.h:38
TrigZFinderInternal::m_usedphiBinSize
double m_usedphiBinSize
Definition: TrigZFinderInternal.h:95
TrigZFinderInternal::m_weightThreshold
double m_weightThreshold
to apply a threshold to the found vertex candidates
Definition: TrigZFinderInternal.h:144
TrigZFinderInternal::m_fullScanMode
bool m_fullScanMode
Definition: TrigZFinderInternal.h:128
TrigZFinderInternal::TrigZFinderInternal
TrigZFinderInternal(const std::string &, const std::string &)
Definition: TrigZFinderInternal.cxx:13
TrigZFinderInternal::m_type
std::string m_type
Definition: TrigZFinderInternal.h:104
TrigZFinderInternal::m_zHistoPerPhi
bool m_zHistoPerPhi
Definition: TrigZFinderInternal.h:109
TrigZFinderInternal::m_nFirstLayers
int m_nFirstLayers
Definition: TrigZFinderInternal.h:117
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
TrigZFinderInternal::m_ROIphiWidth
double m_ROIphiWidth
Definition: TrigZFinderInternal.h:96
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
TrigZFinderInternal::m_vrtxMixing
double m_vrtxMixing
Definition: TrigZFinderInternal.h:120
TrigZFinderInternal::m_neighborMultiplier
double m_neighborMultiplier
Definition: TrigZFinderInternal.h:112
TrigZFinderInternal::m_invPhiSliceSize
double m_invPhiSliceSize
Definition: TrigZFinderInternal.h:90
z
#define z
TrigSiSpacePointBase.h
TrigZFinderInternal::m_IdScan_MaxNumLayers
long m_IdScan_MaxNumLayers
maximum number of layers and last barrel layer
Definition: TrigZFinderInternal.h:84
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
TrigZFinderInternal::vertex::_weight
double _weight
Definition: TrigZFinderInternal.h:41
TrigZFinderInternal::m_new2old
std::vector< int > m_new2old
Definition: TrigZFinderInternal.h:146
TrigZFinderInternal::computeZV
double computeZV(double r1, double z1, double r2, double z2) const
Definition: TrigZFinderInternal.cxx:166
TrigZFinderInternal::m_tripletMode
int m_tripletMode
Definition: TrigZFinderInternal.h:130
TrigZFinderInternal::m_nvrtxSeparation
int m_nvrtxSeparation
Definition: TrigZFinderInternal.h:121
TrigZFinderInternal::initializeInternal
void initializeInternal(long maxLayers, long lastBarrel)
Definition: TrigZFinderInternal.cxx:58
TrigZFinderInternal::m_forcePhiBinSize
bool m_forcePhiBinSize
Definition: TrigZFinderInternal.h:94
TrigZFinderInternal::m_minVtxSignificance
double m_minVtxSignificance
Definition: TrigZFinderInternal.h:138
TrigZFinderInternal::setLayers
void setLayers(long maxLayers, long lastBarrelLayer)
Definition: TrigZFinderInternal.h:54
TrigZFinderInternal::m_halfTripletDK
double m_halfTripletDK
Definition: TrigZFinderInternal.h:133
TrigZFinderInternal::m_tripletDZ
double m_tripletDZ
Definition: TrigZFinderInternal.h:131
TrigZFinderInternal::m_percentile
double m_percentile
Definition: TrigZFinderInternal.h:139
TrigZFinderInternal::vertex::_z
double _z
Definition: TrigZFinderInternal.h:40
TrigZFinderInternal::m_dphideta
double m_dphideta
Definition: TrigZFinderInternal.h:111
ZFinderConstants.h
TrigZFinderInternal::getName
const std::string & getName() const
Definition: TrigZFinderInternal.h:62
IRoiDescriptor.h
TrigZFinderInternal::~TrigZFinderInternal
virtual ~TrigZFinderInternal()
Definition: TrigZFinderInternal.h:47
TrigZFinderInternal::m_returnval
double m_returnval
Definition: TrigZFinderInternal.h:126
TrigZFinderInternal::m_tripletDK
double m_tripletDK
Definition: TrigZFinderInternal.h:132
TrigZFinderInternal::m_name
std::string m_name
Definition: TrigZFinderInternal.h:105
TrigZFinderInternal::m_minZBinSize
double m_minZBinSize
Definition: TrigZFinderInternal.h:97
fitman.rho
rho
Definition: fitman.py:532
TrigZFinderInternal::m_NumPhiSlices
long m_NumPhiSlices
Definition: TrigZFinderInternal.h:91
TrigZFinderInternal::fillVectors
long fillVectors(const std::vector< TrigSiSpacePointBase > &spVec, const IRoiDescriptor &roi, std::vector< double > &phi, std::vector< double > &rho, std::vector< double > &zed, std::vector< long > &lyr, std::vector< long > &filledLayers, long &numPhiSlices) const
Definition: TrigZFinderInternal.cxx:203