Belle II Software  release-06-02-00
MCTrackCandClassifierModule.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 
11 #include <framework/core/Module.h>
12 #include <string>
13 #include <TFile.h>
14 #include <TList.h>
15 #include <TH1F.h>
16 #include <TH3F.h>
17 #include <time.h>
18 
19 #include <tracking/dataobjects/MCParticleInfo.h>
20 #include <vxd/dataobjects/VXDTrueHit.h>
21 
22 namespace Belle2 {
41 
42  public:
43 
46 
48  void initialize() override;
49 
51  void beginRun() override;
52 
54  void event() override;
55 
57  void endRun() override;
58 
60  void terminate() override;
61 
62  protected:
64  std::string m_mcTrackCandsColName;
66  std::string m_mcParticlesName;
68  std::string m_rootFileName;
70  int m_nSigma;
72  bool m_usePXD;
78  bool m_applyLap;
84  int m_minHit;
86  double m_fraction;
87 
89  int nWedge = 0;
91  int nBarrel = 0;
92 
94  TFile* m_rootFilePtr = nullptr;
95 
96  TList* m_histoList = nullptr;
97  TH3F* m_h3_MCParticle = nullptr;
98  TH3F* m_h3_idealMCTrackCand = nullptr;
99  TH3F* m_h3_MCTrackCand = nullptr;
101  TH1F* m_h1_thetaMS_SVD = nullptr;
102  TH1F* m_h1_thetaMS_PXD = nullptr;
103  TH1F* m_h1_dR = nullptr;
104  TH1F* m_h1_dRoverR = nullptr;
105  TH1F* m_h1_distOVERdR = nullptr;
106  TH1F* m_h1_hitRadius_accepted = nullptr;
107  TH1F* m_h1_hitRadius_rejected = nullptr;
108  TH1F* m_h1_hitDistance_accepted = nullptr;
109  TH1F* m_h1_hitDistance_rejected = nullptr;
111  TH1F* m_h1_MCTrackCandNhits = nullptr;
112  TH1F* m_h1_firstRejectedHit = nullptr;
113  TH1F* m_h1_firstRejectedOVERMCHit = nullptr;
115  TH1F* m_h1_lapTime = nullptr;
116  TH1F* m_h1_timeDifference = nullptr;
117  TH1F* m_h1_diffOVERlap = nullptr;
119  TH1F* m_h1_nGoodTrueHits = nullptr;
120  TH1F* m_h1_nBadTrueHits = nullptr;
121  TH1F* m_h1_nGood1dInfo = nullptr;
122  TH1F* m_h1_nBad1dInfo = nullptr;
124  private:
125 
132  double semiPlane(TVector3 vertex, TVector3 center, TVector3 hit);
133 
139  bool isInSemiPlane(double semiPlane, double omega);
140 
146  double theDistance(TVector3 center, TVector3 hit);
147 
154  bool isInAnnulus(double hitDistance, double R, double dR);
155 
163  bool isFirstLap(double FirstHitTime, double HitTime, double LapTime);
164 
183  TH3F* createHistogram3D(const char* name, const char* title,
184  Int_t nbinsX, Double_t minX, Double_t maxX, const char* titleX,
185  Int_t nbinsY, Double_t minY, Double_t maxY, const char* titleY,
186  Int_t nbinsZ, Double_t minZ, Double_t maxZ, const char* titleZ,
187  TList* histoList = nullptr);
188 
204  TH3F* createHistogram3D(const char* name, const char* title,
205  Int_t nbinsX, Double_t* binsX, const char* titleX,
206  Int_t nbinsY, Double_t* binsY, const char* titleY,
207  Int_t nbinsZ, Double_t* binsZ, const char* titleZ,
208  TList* histoList = nullptr);
209 
217  TH1* duplicateHistogram(const char* newname, const char* newtitle,
218  TH1* h, TList* histoList = nullptr);
219 
229  TH1F* createHistogramsRatio(const char* name, const char* title,
230  TH1* hNum, TH1* hDen, bool isEffPlot,
231  int axisRef);
232 
236  void addEfficiencyPlots(TList* graphList = nullptr);
237 
241  void addInefficiencyPlots(TList* graphList = nullptr);
242 
248  float compute_dR(double thetaMS, double omega);
249 
256  float compute_thetaMS(MCParticleInfo& mcParticleInfo, VXDTrueHit* aTrueHit);
257  };
259 }
This struct is used by the TrackingPerformanceEvaluation Module to save information of reconstructed ...
The MCTrackCandClassifier Definition Module.
bool m_applySemiplane
Wether to require that the hit is in the expected semiplane.
bool m_applyWedge
Whether to require that the hit belong to the barrel part of the SVD.
void addInefficiencyPlots(TList *graphList=nullptr)
Function to create inefficiency plots and add them to list.
int nWedge
Counter for hits on wedged sensors.
bool isInAnnulus(double hitDistance, double R, double dR)
Function to check if hitDistance is within a given annulus.
void initialize() override
Initializes the Module.
std::string m_mcParticlesName
MCParticle list name.
double semiPlane(TVector3 vertex, TVector3 center, TVector3 hit)
Function to get semiplane.
int nBarrel
Counter for hits on barrel sensors.
TH1 * duplicateHistogram(const char *newname, const char *newtitle, TH1 *h, TList *histoList=nullptr)
Function to clone a histogram.
float compute_thetaMS(MCParticleInfo &mcParticleInfo, VXDTrueHit *aTrueHit)
Calculate thetaMS.
void terminate() override
Termination action.
bool m_applyLap
Whether to require that the hit belongs to the first lap in the transverse plane.
MCTrackCandClassifierModule()
Constructor of the module.
bool isFirstLap(double FirstHitTime, double HitTime, double LapTime)
Function to check if a hitTime is within a given lapTime, under consideration of m_fraction and with ...
void addEfficiencyPlots(TList *graphList=nullptr)
Function to create efficiency plots and add them to list.
TH3F * createHistogram3D(const char *name, const char *title, Int_t nbinsX, Double_t minX, Double_t maxX, const char *titleX, Int_t nbinsY, Double_t minY, Double_t maxY, const char *titleY, Int_t nbinsZ, Double_t minZ, Double_t maxZ, const char *titleZ, TList *histoList=nullptr)
Create a 3D ROOT Histogram.
TH1F * createHistogramsRatio(const char *name, const char *title, TH1 *hNum, TH1 *hDen, bool isEffPlot, int axisRef)
Function to create a ratio histogram from two histograms.
TFile * m_rootFilePtr
Pointer to root file used for storing histograms.
bool m_applyAnnulus
Whether to require that the hit is in the expected annulus.
std::string m_mcTrackCandsColName
TrackCand list name.
bool isInSemiPlane(double semiPlane, double omega)
Function to check if a omega value is in a given semiPlane.
double theDistance(TVector3 center, TVector3 hit)
Get distance between two points.
float compute_dR(double thetaMS, double omega)
Calculate dR.
bool m_removeBadHits
Whether to remove the clusters that do not satisfy the criteria from the idealMCTrackCands.
int m_minHit
Minimum number of 1D Clusters to classify the MCTrackCand as ideal.
Base class for Modules.
Definition: Module.h:72
Class VXDTrueHit - Records of tracks that either enter or leave the sensitive volume.
Definition: VXDTrueHit.h:36
Abstract base class for different kinds of events.