Belle II Software development
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 {
36 public:
38
40 void initialize() override;
41
43 void event() override;
44
46 void terminate() override;
47
48 private:
49 std::string m_outputFileName;
51 double m_minWeight;
54 // Required input
62
63 TFile* m_outputFile{nullptr};
64 TTree* m_tracksTree{nullptr};
65 TTree* m_clusterTree{nullptr};
69
72
74 int m_iRun = 0;
75
77 int m_iEvent = 0;
78
80 double m_pValue = 0.0;
81
83 int m_charge = 0;
84
86 double m_d0 = 0.0;
87
89 double m_z0 = 0.0;
90
93
96
99
102
105
108
111
114
117
120
123
126
129
132
135
138
141
144
147
149 double m_clusterPhi = 0.0;
150
152 double m_clusterTheta = 0.0;
153
156
159
162
165
167 double m_clusterEnergy = 0.0;
168
170 double m_photonEnergy = 0.0;
171
173 double m_clusterE1E9 = 0.0;
174
177
180
183
185 double m_clusterDeltaL = 0.0;
186
189
192
194 void setupTree();
195
197 void writeData();
198
200 void addVariableToTree(const std::string& varName, double& varReference, TTree* tree);
201
203 void addVariableToTree(const std::string& varName, int& varReference, TTree* tree);
204
210 bool isPrimaryMcParticle(const MCParticle& mcParticle);
211
217 bool isChargedStable(const MCParticle& mcParticle);
218 };
219
221} // end of namespace
This module takes the MCParticle collection as input and checks if the related reconstructed track is...
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_lastCDCLayer
number of last CDC layer used for track fit
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
Base class for Modules.
Definition: Module.h:72
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...