Belle II Software prerelease-10-00-00a
ECLTrackClusterMatchingPerformanceModule.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#pragma once
9
10#include <framework/core/Module.h>
11#include <framework/dataobjects/EventMetaData.h>
12#include <framework/datastore/StoreArray.h>
13#include <framework/datastore/StoreObjPtr.h>
14#include <mdst/dataobjects/ECLCluster.h>
15#include <mdst/dataobjects/MCParticle.h>
16#include <mdst/dataobjects/Track.h>
17#include <mdst/dataobjects/TrackFitResult.h>
18#include <tracking/modules/standardTrackingPerformance/ParticleProperties.h>
19
20// forward declarations
21class TTree;
22class TFile;
23
24namespace Belle2 {
29
34
38 class ECLTrackClusterMatchingPerformanceModule : public Module {
39 public:
40 ECLTrackClusterMatchingPerformanceModule();
41
43 void initialize() override;
44
46 void event() override;
47
49 void terminate() override;
50
51 private:
52 std::string m_outputFileName;
54 double m_minWeight;
56
57 // Required input
62
65
66 TFile* m_outputFile{nullptr};
67 TTree* m_tracksTree{nullptr};
68 TTree* m_clusterTree{nullptr};
69
72
75
77 int m_iRun = 0;
78
80 int m_iEvent = 0;
81
83 double m_pValue = 0.0;
84
86 int m_charge = 0;
87
89 double m_d0 = 0.0;
90
92 double m_z0 = 0.0;
93
96
99
102
105
108
111
114
117
120
123
126
129
132
135
138
141
144
147
150
152 double m_clusterPhi = 0.0;
153
155 double m_clusterTheta = 0.0;
156
159
162
165
168
170 double m_clusterEnergy = 0.0;
171
173 double m_photonEnergy = 0.0;
174
176 double m_clusterE1E9 = 0.0;
177
180
183
186
188 double m_clusterDeltaL = 0.0;
189
192
195
197 void setupTree();
198
200 void writeData();
201
203 void addVariableToTree(const std::string& varName, double& varReference, TTree* tree);
204
206 void addVariableToTree(const std::string& varName, int& varReference, TTree* tree);
207
213 bool isPrimaryMcParticle(const MCParticle& mcParticle);
214
220 bool isChargedStable(const MCParticle& mcParticle);
221 };
222
224} // end of namespace
int m_sameclusters
boolean whether matched to ECL cluster with highest weight
double m_minClusterEnergy
minimal cluster energy in units of particle's true energy
double m_mcparticle_cluster_theta
theta of cluster matched to MCParticle
double m_matchedPhotonHypothesisClusterDeltaL
delta l of cluster with photon hypothesis
double m_d0
signed distance of the track to the IP in the r-phi plane
std::string m_trackClusterRelationName
name of relation array between tracks and ECL clusters
int m_mcparticle_cluster_match
boolean for match between MCParticle and ECL cluster
double m_matchedPhotonHypothesisClusterMinTrkDistance
minimal distance between cluster with photon hypothesis and track (not necessarily the matched one)
TTree * m_tracksTree
MCParticle based root tree with all output data.
void initialize() override
Register the needed StoreArrays and open th output TFile.
int m_matchedHadronHypothesisClusterDetectorRegion
detector region of cluster with hadron hypothesis matched to track
void addVariableToTree(const std::string &varName, double &varReference, TTree *tree)
add a variable with double format
void setClusterVariablesToDefaultValue()
sets cluster related variables to default values
double m_matchedHadronHypothesisClusterPhi
phi of cluster with hadron hypothesis matched to track
double m_matchedHadronHypothesisClusterMinTrkDistance
minimal distance between cluster with hadron hypothesis and track (not necessarily the matched one)
StoreArray< TrackFitResult > m_trackFitResults
Required input array of TrackFitResults.
void terminate() override
Write the tree into the opened root file.
double m_clusterErrorTiming
cluster's timing uncertainty containing 99% of true photons
ParticleProperties m_trackProperties
properties of a reconstructed track
bool isChargedStable(const MCParticle &mcParticle)
Tests if MCParticle is a charged stable particle.
int m_mcparticle_cluster_detectorregion
detector region of cluster matched to MCParticle
void setVariablesToDefaultValue()
Sets all variables to the default value, here -999.
int m_clusterIsPhoton
cluster fulfills requirements for being product of a photon
int m_matchedToPhotonHypothesisECLCluster
boolean for match between track and ECL cluster with photon hypothesis
double m_clusterE1E9
energy sum of central crystal over 3x3 array around central crystal
int m_matchedToHadronHypothesisECLCluster
boolean for match between track and ECL cluster with hadron hypothesis
StoreArray< Track > m_tracks
Required input array of Tracks.
bool isPrimaryMcParticle(const MCParticle &mcParticle)
Tests if MCParticle is a primary one.
StoreArray< ECLCluster > m_eclClusters
Required input array of ECLClusters.
double m_mcparticle_cluster_energy
amount of particle energy contained in cluster matched to MCParticle
double m_matchedHadronHypothesisClusterDeltaL
delta l of cluster with hadron hypothesis
TTree * m_clusterTree
root tree containing information on all truth-matched photon clusters.
double m_matchedPhotonHypothesisClusterPhi
phi of cluster with photon hypothesis matched to track
StoreArray< MCParticle > m_mcParticles
Required input array of MCParticles.
double m_matchedPhotonHypothesisClusterTheta
theta of cluster with photon hypothesis matched to track
double m_z0
distance of the track to the IP along the beam axis
void writeData()
write root tree to output file and close the file
double m_matchedHadronHypothesisClusterTheta
theta of cluster with hadron hypothesis matched to track
int m_matchedPhotonHypothesisClusterDetectorRegion
detector region of cluster with photon hypothesis matched to track
int m_clusterIsChargedStable
cluster has related MCParticle which is charged and stable
A Class to store the Monte Carlo particle information.
Definition MCParticle.h:32
Module()
Constructor.
Definition Module.cc:30
Accessor to arrays stored in the data store.
Definition StoreArray.h:113
Type-safe access to single objects in the data store.
Definition StoreObjPtr.h:96
Abstract base class for different kinds of events.
This struct is used by the StandardTrackingPerformanceModule to save information of reconstructed tra...