ATLAS Offline Software
PhiSlice.h
Go to the documentation of this file.
1 // emacs: this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef PHI_SLICE_H
8 #define PHI_SLICE_H
9 
10 #include <vector>
11 
12 class PhiSlice
13 {
14 public:
15  //Default constructor
16  PhiSlice() = delete;
17 
18  //Constructor with input parameters
19  PhiSlice( int SliceIndex,
20  double ZBinWidth, double InversePhiBinWidth,
21  double ZTolerance, double KTolerance, double PTolerance,
22  double ZMinimum, double ZMaximum,
23  int LayerMaximum, int BarrelMaximum );
24 
25  //Destructor
26  ~PhiSlice();
27 
28  //Store a space point
29  void AddPoint( double RhoValue, double ZValue, double PhiValue, long LayerIndex );
30 
31  //Make the wide layer structure
32  void MakeWideLayers( std::vector< std::vector<double> >* AllLayerRhos, std::vector< std::vector<double> >* AllLayerZs,
33  std::vector< std::vector<double> >* AllLayerPhis, std::vector< std::vector<int> >* AllSliceWidths,
34  int FilledLayerTotal, std::vector<long> * FilledLayerIndices );
35 
36  //Add points to the z-axis histograms (not thread safe if acting on global histograms)
37  void GetHistogram( std::vector<long>* HitHistogram, std::vector<double>* WeightHistogram,
38  std::vector<long>* OtherChargeHitHistogram, std::vector<double>* OtherChargeWeightHistogram,
39  const std::vector< std::vector<long> > & ExtraSlices,
40  const long PhiToSubtract,
41  int InnerLayerLimit,
42  const int TripletMode,
43  const bool ChargeAware,
44  std::vector< std::vector<long> >* AllHits = 0,
45  std::vector< std::vector<double> >* AllWeights = 0 );
46 
47  //Add points to internal z-axis histogram (thread safe, incompatible with histogram-per-slice mode)
48  void MakeHistogram( std::vector< std::vector<long> >& ExtraSlices,
49  long PhiToSubtract,
50  int InnerLayerLimit,
51  int TripletMode,
52  bool ChargeAware );
53 
54  //Merge internal and global z-axis histogram (not thread safe)
55  void AddHistogram( std::vector<long>* HitHistogram, std::vector<double>* WeightHistogram,
56  std::vector<long>* OtherChargeHitHistogram, std::vector<double>* OtherChargeWeightHistogram );
57 
58 private:
59  //Look for a third spacepoint
60  int FindTriplet( int OuterFilledLayer, int OuterPointIndex,
61  double CurrentZValue, double CurrentKValue, double CurrentPValue,
62  const std::vector< std::vector<long> >& ExtraSlices,
63  const long PhiToSubtract,
64  bool FastTriplet,
65  int OuterSliceIndex );
66 
67  //Fill neighbouring slices for histogram-per-slice mode
68  void FillNeighbours( int InnerLayerIndex, int OuterSliceIndex, int TripletsFound, int AxisZIndex, double AxisZ,
69  const std::vector< std::vector<long> >& ExtraSlices,
70  const long PhiToSubtract,
71  const bool ChargeAware,
72  std::vector< std::vector<long> >* AllHits,
73  std::vector< std::vector<double> >* AllWeights );
74 
75  std::vector< std::vector<double> > m_layerRhos, m_layerZs, m_layerPhis;
76  std::vector< std::vector<double> >* m_allLayerRhos = nullptr;
77  std::vector< std::vector<double> >* m_allLayerZs = nullptr;
78  std::vector< std::vector<double> >* m_allLayerPhis = nullptr;
79  std::vector< std::vector<int> >* m_allSliceWidths = nullptr;
80  std::vector<long>* m_filledLayerIndices = nullptr;
85  double m_zTolerance;
86  double m_kTolerance;
87  double m_pTolerance;
88  double m_zMinimum;
89  double m_zMaximum;
90  int m_zBins;
95  //int m_layerMaximum;
98 };
99 
100 #endif
PhiSlice::m_layerZs
std::vector< std::vector< double > > m_layerZs
Definition: PhiSlice.h:75
PhiSlice::m_allLayerPhis
std::vector< std::vector< double > > * m_allLayerPhis
Definition: PhiSlice.h:78
PhiSlice::FillNeighbours
void FillNeighbours(int InnerLayerIndex, int OuterSliceIndex, int TripletsFound, int AxisZIndex, double AxisZ, const std::vector< std::vector< long > > &ExtraSlices, const long PhiToSubtract, const bool ChargeAware, std::vector< std::vector< long > > *AllHits, std::vector< std::vector< double > > *AllWeights)
Definition: PhiSlice.cxx:458
PhiSlice::m_sliceEnd
std::vector< long > m_sliceEnd
Definition: PhiSlice.h:81
PhiSlice::m_internalHistogramsAreValid
bool m_internalHistogramsAreValid
Definition: PhiSlice.h:97
PhiSlice::MakeWideLayers
void MakeWideLayers(std::vector< std::vector< double > > *AllLayerRhos, std::vector< std::vector< double > > *AllLayerZs, std::vector< std::vector< double > > *AllLayerPhis, std::vector< std::vector< int > > *AllSliceWidths, int FilledLayerTotal, std::vector< long > *FilledLayerIndices)
Definition: PhiSlice.cxx:72
PhiSlice::m_zeroOffset
int m_zeroOffset
Definition: PhiSlice.h:92
PhiSlice::FindTriplet
int FindTriplet(int OuterFilledLayer, int OuterPointIndex, double CurrentZValue, double CurrentKValue, double CurrentPValue, const std::vector< std::vector< long > > &ExtraSlices, const long PhiToSubtract, bool FastTriplet, int OuterSliceIndex)
Definition: PhiSlice.cxx:353
PhiSlice::m_filledLayerIndices
std::vector< long > * m_filledLayerIndices
Definition: PhiSlice.h:80
PhiSlice::m_allLayerZs
std::vector< std::vector< double > > * m_allLayerZs
Definition: PhiSlice.h:77
PhiSlice::GetHistogram
void GetHistogram(std::vector< long > *HitHistogram, std::vector< double > *WeightHistogram, std::vector< long > *OtherChargeHitHistogram, std::vector< double > *OtherChargeWeightHistogram, const std::vector< std::vector< long > > &ExtraSlices, const long PhiToSubtract, int InnerLayerLimit, const int TripletMode, const bool ChargeAware, std::vector< std::vector< long > > *AllHits=0, std::vector< std::vector< double > > *AllWeights=0)
Definition: PhiSlice.cxx:181
PhiSlice::m_pTolerance
double m_pTolerance
Definition: PhiSlice.h:87
PhiSlice::m_hitHistogram
std::vector< long > m_hitHistogram
Definition: PhiSlice.h:81
PhiSlice::m_otherChargeHitHistogram
std::vector< long > m_otherChargeHitHistogram
Definition: PhiSlice.h:81
PhiSlice::m_invZBinWidth
double m_invZBinWidth
Definition: PhiSlice.h:83
PhiSlice::m_allLayerRhos
std::vector< std::vector< double > > * m_allLayerRhos
Definition: PhiSlice.h:76
PhiSlice::m_layerPhis
std::vector< std::vector< double > > m_layerPhis
Definition: PhiSlice.h:75
PhiSlice
Definition: PhiSlice.h:13
PhiSlice::m_weightHistogram
std::vector< double > m_weightHistogram
Definition: PhiSlice.h:82
PhiSlice::m_allSliceWidths
std::vector< std::vector< int > > * m_allSliceWidths
Definition: PhiSlice.h:79
PhiSlice::m_sliceStart
std::vector< long > m_sliceStart
Definition: PhiSlice.h:81
PhiSlice::m_halfZBins
int m_halfZBins
Definition: PhiSlice.h:91
PhiSlice::m_layerRhos
std::vector< std::vector< double > > m_layerRhos
Definition: PhiSlice.h:75
PhiSlice::m_zMinimum
double m_zMinimum
Definition: PhiSlice.h:88
PhiSlice::AddHistogram
void AddHistogram(std::vector< long > *HitHistogram, std::vector< double > *WeightHistogram, std::vector< long > *OtherChargeHitHistogram, std::vector< double > *OtherChargeWeightHistogram)
Definition: PhiSlice.cxx:154
PhiSlice::PhiSlice
PhiSlice()=delete
PhiSlice::m_zMaximum
double m_zMaximum
Definition: PhiSlice.h:89
PhiSlice::m_zTolerance
double m_zTolerance
Definition: PhiSlice.h:85
PhiSlice::m_invPhiBinWidth
double m_invPhiBinWidth
Definition: PhiSlice.h:84
PhiSlice::AddPoint
void AddPoint(double RhoValue, double ZValue, double PhiValue, long LayerIndex)
Definition: PhiSlice.cxx:53
PhiSlice::m_sliceIndex
int m_sliceIndex
Definition: PhiSlice.h:93
PhiSlice::m_barrelMaximum
int m_barrelMaximum
Definition: PhiSlice.h:96
PhiSlice::m_otherChargeWeightHistogram
std::vector< double > m_otherChargeWeightHistogram
Definition: PhiSlice.h:82
PhiSlice::MakeHistogram
void MakeHistogram(std::vector< std::vector< long > > &ExtraSlices, long PhiToSubtract, int InnerLayerLimit, int TripletMode, bool ChargeAware)
Definition: PhiSlice.cxx:127
PhiSlice::m_zBins
int m_zBins
Definition: PhiSlice.h:90
PhiSlice::~PhiSlice
~PhiSlice()
Definition: PhiSlice.cxx:48
PhiSlice::m_kTolerance
double m_kTolerance
Definition: PhiSlice.h:86
PhiSlice::m_filledLayerTotal
int m_filledLayerTotal
Definition: PhiSlice.h:94