Belle II Software development
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 <framework/datastore/StoreArray.h>
13#include <pxd/dataobjects/PXDCluster.h>
14#include <svd/dataobjects/SVDCluster.h>
15#include <tracking/dataobjects/MCParticleInfo.h>
16#include <vxd/dataobjects/VXDTrueHit.h>
17#include <genfit/TrackCand.h>
18
19#include <string>
20#include <TFile.h>
21#include <TList.h>
22#include <TH1F.h>
23#include <TH3F.h>
24#include <time.h>
25
26
27namespace Belle2 {
43
44 public:
45
48
50 void initialize() override;
51
53 void beginRun() override;
54
56 void event() override;
57
59 void endRun() override;
60
62 void terminate() override;
63
64 protected:
68 std::string m_mcParticlesName;
70 std::string m_rootFileName;
88 double m_fraction;
89
91 int nWedge = 0;
93 int nBarrel = 0;
94
96 TFile* m_rootFilePtr = nullptr;
97
98 TList* m_histoList = nullptr;
99 TH3F* m_h3_MCParticle = nullptr;
100 TH3F* m_h3_idealMCTrackCand = nullptr;
101 TH3F* m_h3_MCTrackCand = nullptr;
103 TH1F* m_h1_thetaMS_SVD = nullptr;
104 TH1F* m_h1_thetaMS_PXD = nullptr;
105 TH1F* m_h1_dR = nullptr;
106 TH1F* m_h1_dRoverR = nullptr;
107 TH1F* m_h1_distOVERdR = nullptr;
108 TH1F* m_h1_hitRadius_accepted = nullptr;
109 TH1F* m_h1_hitRadius_rejected = nullptr;
113 TH1F* m_h1_MCTrackCandNhits = nullptr;
114 TH1F* m_h1_firstRejectedHit = nullptr;
117 TH1F* m_h1_lapTime = nullptr;
118 TH1F* m_h1_timeDifference = nullptr;
119 TH1F* m_h1_diffOVERlap = nullptr;
121 TH1F* m_h1_nGoodTrueHits = nullptr;
122 TH1F* m_h1_nBadTrueHits = nullptr;
123 TH1F* m_h1_nGood1dInfo = nullptr;
124 TH1F* m_h1_nBad1dInfo = nullptr;
126 private:
127
134 ROOT::Math::XYZVector m_magField;
142 double semiPlane(ROOT::Math::XYZVector vertex, ROOT::Math::XYZVector center, ROOT::Math::XYZVector hit);
143
149 bool isInSemiPlane(double semiPlane, double omega);
150
156 double theDistance(ROOT::Math::XYZVector center, ROOT::Math::XYZVector hit);
157
164 bool isInAnnulus(double hitDistance, double R, double dR);
165
173 bool isFirstLap(double FirstHitTime, double HitTime, double LapTime);
174
193 TH3F* createHistogram3D(const char* name, const char* title,
194 Int_t nbinsX, Double_t minX, Double_t maxX, const char* titleX,
195 Int_t nbinsY, Double_t minY, Double_t maxY, const char* titleY,
196 Int_t nbinsZ, Double_t minZ, Double_t maxZ, const char* titleZ,
197 TList* histoList = nullptr);
198
214 TH3F* createHistogram3D(const char* name, const char* title,
215 Int_t nbinsX, Double_t* binsX, const char* titleX,
216 Int_t nbinsY, Double_t* binsY, const char* titleY,
217 Int_t nbinsZ, Double_t* binsZ, const char* titleZ,
218 TList* histoList = nullptr);
219
227 TH1* duplicateHistogram(const char* newname, const char* newtitle,
228 TH1* h, TList* histoList = nullptr);
229
239 TH1F* createHistogramsRatio(const char* name, const char* title,
240 TH1* hNum, TH1* hDen, bool isEffPlot,
241 int axisRef);
242
246 void addEfficiencyPlots(TList* graphList = nullptr);
247
251 void addInefficiencyPlots(TList* graphList = nullptr);
252
258 float compute_dR(double thetaMS, double omega);
259
266 float compute_thetaMS(MCParticleInfo& mcParticleInfo, VXDTrueHit* aTrueHit);
267 };
269}
double R
typedef autogenerated by FFTW
This struct is used by the TrackingPerformanceEvaluation Module to save information of reconstructed ...
The MCTrackCandClassifier Definition Module.
bool m_applySemiplane
Whether 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.
ROOT::Math::XYZVector m_magField
magnetic field needed set particle info
StoreArray< genfit::TrackCand > m_GenfitMCTrackCands
MC Genfit TrackCands StoreArray.
int nWedge
Counter for hits on wedged sensors.
StoreArray< SVDCluster > m_SVDClusters
SVDClusters StoreArray.
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.
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.
StoreArray< genfit::TrackCand > m_GenfitIdealMCTrackCands
Ideal Genfit TrackCands StoreArray.
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.
StoreArray< PXDCluster > m_PXDClusters
PXDClusters StoreArray.
double semiPlane(ROOT::Math::XYZVector vertex, ROOT::Math::XYZVector center, ROOT::Math::XYZVector hit)
Function to get semiplane.
double theDistance(ROOT::Math::XYZVector center, ROOT::Math::XYZVector hit)
Get distance between two points.
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.
StoreArray< MCParticle > m_MCParticles
MCParticles StoreArray.
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.
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
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
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.