Belle II Software  release-08-01-10
PXDValidationAlgorithm.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 #include <calibration/CalibrationAlgorithm.h>
11 #include <vxd/dataobjects/VxdID.h>
12 #include <vector>
13 
14 #include <TH1F.h>
15 #include <TH2F.h>
16 
17 
18 namespace Belle2 {
27  public:
28 
31 
33  virtual ~PXDValidationAlgorithm() override;
34 
37 
40 
42  bool saveD0Z0;
43 
45  int binsD0Z0;
46 
48  void setBoundaries(const std::vector<Calibration::ExpRun>& boundaries) {m_requestedBoundaries = boundaries;}
49 
51  std::vector<Calibration::ExpRun> getBoundaries() const {return m_requestedBoundaries;}
52 
53  protected:
54 
56  virtual EResult calibrate() override;
57 
59  virtual bool isBoundaryRequired(const Calibration::ExpRun& /*currentRun*/) override;
60 
62  // We reset the temporary boundaries list to be the same as the requested one.
63  virtual void boundaryFindingSetup(std::vector<Calibration::ExpRun> /*runs*/, int /* iteration = 0*/) override
64  {
66  };
67 
68  private:
69 
71  std::vector<Calibration::ExpRun> m_requestedBoundaries;
72 
74  std::shared_ptr<TFile> m_file;
75 
77  std::shared_ptr<TTree> m_tree;
78 
80  int m_exp;
81 
83  int m_run;
84 
86  std::vector<unsigned short> m_pxdid;
87 
89  std::vector<unsigned short> m_uBin;
90 
92  std::vector<unsigned short> m_vBin;
93 
95  std::vector<unsigned long> m_nTrackPoints;
96 
98  std::vector<unsigned long> m_nTrackClusters;
99 
101  std::vector<unsigned long> m_nSelTrackPoints;
102 
104  std::vector<unsigned long> m_nSelTrackClusters;
105 
107  std::vector<float> m_d0;
108 
110  std::vector<float> m_z0;
111 
113  TH1F* m_hD0;
114 
116  TH1F* m_hZ0;
117 
120 
123 
126 
129 
130  };
132 } // namespace Belle2
133 
134 
Base class for calibration algorithms.
std::vector< Calibration::ExpRun > m_boundaries
When using the boundaries functionality from isBoundaryRequired, this is used to store the boundaries...
EResult
The result of calibration.
Class implementing the PXD calibration validation algorithm.
TH1F * m_hD0
Histogram of corrected d0 for each 2-track event.
TH2F * m_hTrackPointsLayer2
Histogram of intersection points for layer 2.
TH2F * m_hTrackClustersLayer1
Histogram of track matched clusters for layer 1.
TH2F * m_hTrackPointsLayer1
Histogram of intersection points for layer 1.
std::vector< unsigned long > m_nTrackClusters
Vector of number of track matched clusters.
virtual void boundaryFindingSetup(std::vector< Calibration::ExpRun >, int) override
What we do before isBoundaryRequired gets called.
virtual ~PXDValidationAlgorithm() override
Destructor.
TH2F * m_hTrackClustersLayer2
Histogram of track matched clusters for layer 2.
std::vector< unsigned long > m_nTrackPoints
Vector of number of track points.
void setBoundaries(const std::vector< Calibration::ExpRun > &boundaries)
Setter for boundaries.
std::vector< float > m_z0
Vector of delta z0 over sqrt(2)
bool saveD0Z0
Flag to save delta d0 (z0) over sqrt(2) to TTree;.
std::vector< unsigned long > m_nSelTrackPoints
Vector of number of track points outside of defective pixels.
PXDValidationAlgorithm()
Constructor set the prefix to PXDValidationAlgorithm.
int minTrackPoints
Minimum number of track points per sensor.
std::shared_ptr< TFile > m_file
Pointer for TFile.
bool save2DHists
Flag to save 2D histograms for efficiency;.
std::vector< unsigned short > m_uBin
Vector of uBin.
std::vector< float > m_d0
Vector of delta d0 over sqrt(2)
virtual EResult calibrate() override
Run algo on data.
int binsD0Z0
Bin size for d0/z0 histogram.
std::vector< unsigned long > m_nSelTrackClusters
Vector of number of track clusters outside of defective pixels.
std::vector< unsigned short > m_vBin
Vector of vBin.
std::vector< Calibration::ExpRun > getBoundaries() const
getter for current boundaries
std::shared_ptr< TTree > m_tree
Pointer for TTree of the validation info.
std::vector< Calibration::ExpRun > m_requestedBoundaries
During findPayloadBoundaries and isBoundaryRequired this is used to define the boundaries we want.
virtual bool isBoundaryRequired(const Calibration::ExpRun &) override
Decide if a run should be a payload boundary. Only used in certain Python Algorithm Starategies.
TH1F * m_hZ0
Histogram of corrected z0 for each 2-track event.
std::vector< unsigned short > m_pxdid
Vector of PXD module id (DHE id)
Abstract base class for different kinds of events.