Belle II Software  release-05-02-19
ECLTrackClusterMatchingPerformanceModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Frank Meier *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <framework/core/Module.h>
13 #include <framework/datastore/StoreArray.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
21 class TTree;
22 class TFile;
23 
24 namespace 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
60  TFile* m_outputFile{nullptr};
61  TTree* m_tracksTree{nullptr};
62  TTree* m_clusterTree{nullptr};
66 
68  int m_iExperiment = 0;
69 
71  int m_iRun = 0;
72 
74  int m_iEvent = 0;
75 
77  double m_pValue = 0.0;
78 
80  int m_charge = 0;
81 
83  double m_d0 = 0.0;
84 
86  double m_z0 = 0.0;
87 
89  int m_lastCDCLayer = 0;
90 
93 
96 
99 
102 
105 
108 
111 
114 
117 
120 
123 
126 
129 
132 
135 
138 
141 
143  int m_sameclusters = 0;
144 
146  double m_clusterPhi = 0.0;
147 
149  double m_clusterTheta = 0.0;
150 
153 
156 
159 
162 
164  double m_clusterEnergy = 0.0;
165 
167  double m_photonEnergy = 0.0;
168 
170  double m_clusterE1E9 = 0.0;
171 
174 
176  double m_clusterErrorTiming = 0.0;
177 
180 
182  double m_clusterDeltaL = 0.0;
183 
186 
189 
191  void setupTree();
192 
194  void writeData();
195 
197  void addVariableToTree(const std::string& varName, double& varReference, TTree* tree);
198 
200  void addVariableToTree(const std::string& varName, int& varReference, TTree* tree);
201 
207  bool isPrimaryMcParticle(const MCParticle& mcParticle);
208 
214  bool isChargedStable(const MCParticle& mcParticle);
215  };
216 
218 } // end of namespace
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedToHadronHypothesisECLCluster
int m_matchedToHadronHypothesisECLCluster
boolean for match between track and ECL cluster with hadron hypothesis
Definition: ECLTrackClusterMatchingPerformanceModule.h:140
Belle2::ECLTrackClusterMatchingPerformanceModule::m_iRun
int m_iRun
Run number.
Definition: ECLTrackClusterMatchingPerformanceModule.h:71
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterEnergy
double m_clusterEnergy
cluster energy
Definition: ECLTrackClusterMatchingPerformanceModule.h:164
Belle2::ECLTrackClusterMatchingPerformanceModule::m_mcParticles
StoreArray< MCParticle > m_mcParticles
Required input array of MCParticles.
Definition: ECLTrackClusterMatchingPerformanceModule.h:56
Belle2::ECLTrackClusterMatchingPerformanceModule::m_eclClusters
StoreArray< ECLCluster > m_eclClusters
Required input array of ECLClusters.
Definition: ECLTrackClusterMatchingPerformanceModule.h:55
Belle2::ECLTrackClusterMatchingPerformanceModule::terminate
void terminate() override
Write the tree into the opened root file.
Definition: ECLTrackClusterMatchingPerformanceModule.cc:249
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedPhotonHypothesisClusterPhi
double m_matchedPhotonHypothesisClusterPhi
phi of cluster with photon hypothesis matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:98
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedPhotonHypothesisClusterDeltaL
double m_matchedPhotonHypothesisClusterDeltaL
delta l of cluster with photon hypothesis
Definition: ECLTrackClusterMatchingPerformanceModule.h:104
Belle2::ECLTrackClusterMatchingPerformanceModule::addVariableToTree
void addVariableToTree(const std::string &varName, double &varReference, TTree *tree)
add a variable with double format
Definition: ECLTrackClusterMatchingPerformanceModule.cc:459
Belle2::ECLTrackClusterMatchingPerformanceModule::m_mcparticle_cluster_match
int m_mcparticle_cluster_match
boolean for match between MCParticle and ECL cluster
Definition: ECLTrackClusterMatchingPerformanceModule.h:134
Belle2::ECLTrackClusterMatchingPerformanceModule::m_sameclusters
int m_sameclusters
boolean whether matched to ECL cluster with highest weight
Definition: ECLTrackClusterMatchingPerformanceModule.h:143
Belle2::ECLTrackClusterMatchingPerformanceModule::m_photonEnergy
double m_photonEnergy
photon energy
Definition: ECLTrackClusterMatchingPerformanceModule.h:167
Belle2::ECLTrackClusterMatchingPerformanceModule
This module takes the MCParticle collection as input and checks if the related reconstructed track is...
Definition: ECLTrackClusterMatchingPerformanceModule.h:35
Belle2::ParticleProperties
This struct is used by the StandardTrackingPerformanceModule to save information of reconstructed tra...
Definition: ParticleProperties.h:30
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterHypothesis
int m_clusterHypothesis
hypothesis ID of cluster
Definition: ECLTrackClusterMatchingPerformanceModule.h:152
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedHadronHypothesisClusterMinTrkDistance
double m_matchedHadronHypothesisClusterMinTrkDistance
minimal distance between cluster with hadron hypothesis and track (not necessarily the matched one)
Definition: ECLTrackClusterMatchingPerformanceModule.h:116
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedPhotonHypothesisClusterTheta
double m_matchedPhotonHypothesisClusterTheta
theta of cluster with photon hypothesis matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:95
Belle2::ECLTrackClusterMatchingPerformanceModule::m_outputFileName
std::string m_outputFileName
name of output root file
Definition: ECLTrackClusterMatchingPerformanceModule.h:49
Belle2::ECLTrackClusterMatchingPerformanceModule::writeData
void writeData()
write root tree to output file and close the file
Definition: ECLTrackClusterMatchingPerformanceModule.cc:363
Belle2::ECLTrackClusterMatchingPerformanceModule::m_pValue
double m_pValue
pValue of track fit
Definition: ECLTrackClusterMatchingPerformanceModule.h:77
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterTheta
double m_clusterTheta
polar angle of cluster
Definition: ECLTrackClusterMatchingPerformanceModule.h:149
Belle2::ECLTrackClusterMatchingPerformanceModule::m_lastCDCLayer
int m_lastCDCLayer
number of last CDC layer used for track fit
Definition: ECLTrackClusterMatchingPerformanceModule.h:89
Belle2::ECLTrackClusterMatchingPerformanceModule::m_mcparticle_cluster_theta
double m_mcparticle_cluster_theta
theta of cluster matched to MCParticle
Definition: ECLTrackClusterMatchingPerformanceModule.h:125
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterErrorTiming
double m_clusterErrorTiming
cluster's timing uncertainty containing 99% of true photons
Definition: ECLTrackClusterMatchingPerformanceModule.h:176
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterPhi
double m_clusterPhi
azimuthal angle of cluster
Definition: ECLTrackClusterMatchingPerformanceModule.h:146
Belle2::ECLTrackClusterMatchingPerformanceModule::event
void event() override
Fill the tree with the event data.
Definition: ECLTrackClusterMatchingPerformanceModule.cc:64
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedPhotonHypothesisClusterMinTrkDistance
double m_matchedPhotonHypothesisClusterMinTrkDistance
minimal distance between cluster with photon hypothesis and track (not necessarily the matched one)
Definition: ECLTrackClusterMatchingPerformanceModule.h:101
Belle2::ECLTrackClusterMatchingPerformanceModule::m_charge
int m_charge
charge
Definition: ECLTrackClusterMatchingPerformanceModule.h:80
Belle2::ECLTrackClusterMatchingPerformanceModule::initialize
void initialize() override
Register the needed StoreArrays and open th output TFile.
Definition: ECLTrackClusterMatchingPerformanceModule.cc:46
Belle2::ECLTrackClusterMatchingPerformanceModule::m_minClusterEnergy
double m_minClusterEnergy
minimal cluster energy in units of particle's true energy
Definition: ECLTrackClusterMatchingPerformanceModule.h:50
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedToPhotonHypothesisECLCluster
int m_matchedToPhotonHypothesisECLCluster
boolean for match between track and ECL cluster with photon hypothesis
Definition: ECLTrackClusterMatchingPerformanceModule.h:137
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterDeltaL
double m_clusterDeltaL
delta l
Definition: ECLTrackClusterMatchingPerformanceModule.h:182
Belle2::ECLTrackClusterMatchingPerformanceModule::m_d0
double m_d0
signed distance of the track to the IP in the r-phi plane
Definition: ECLTrackClusterMatchingPerformanceModule.h:83
Belle2::ECLTrackClusterMatchingPerformanceModule::m_trackFitResults
StoreArray< TrackFitResult > m_trackFitResults
Required input array of TrackFitResults.
Definition: ECLTrackClusterMatchingPerformanceModule.h:58
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::ECLTrackClusterMatchingPerformanceModule::m_z0
double m_z0
distance of the track to the IP along the beam axis
Definition: ECLTrackClusterMatchingPerformanceModule.h:86
Belle2::ECLTrackClusterMatchingPerformanceModule::isChargedStable
bool isChargedStable(const MCParticle &mcParticle)
Tests if MCParticle is a charged stable particle.
Definition: ECLTrackClusterMatchingPerformanceModule.cc:259
Belle2::ECLTrackClusterMatchingPerformanceModule::m_mcparticle_cluster_detectorregion
int m_mcparticle_cluster_detectorregion
detector region of cluster matched to MCParticle
Definition: ECLTrackClusterMatchingPerformanceModule.h:122
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterDetectorRegion
int m_clusterDetectorRegion
cluster detection region
Definition: ECLTrackClusterMatchingPerformanceModule.h:173
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterTree
TTree * m_clusterTree
root tree containing information on all truth-matched photon clusters.
Definition: ECLTrackClusterMatchingPerformanceModule.h:62
Belle2::ECLTrackClusterMatchingPerformanceModule::m_iEvent
int m_iEvent
Event number.
Definition: ECLTrackClusterMatchingPerformanceModule.h:74
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedHadronHypothesisClusterTheta
double m_matchedHadronHypothesisClusterTheta
theta of cluster with hadron hypothesis matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:110
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedPhotonHypothesisClusterDetectorRegion
int m_matchedPhotonHypothesisClusterDetectorRegion
detector region of cluster with photon hypothesis matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:92
Belle2::ECLTrackClusterMatchingPerformanceModule::m_tracksTree
TTree * m_tracksTree
MCParticle based root tree with all output data.
Definition: ECLTrackClusterMatchingPerformanceModule.h:61
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedHadronHypothesisClusterDeltaL
double m_matchedHadronHypothesisClusterDeltaL
delta l of cluster with hadron hypothesis
Definition: ECLTrackClusterMatchingPerformanceModule.h:119
Belle2::ECLTrackClusterMatchingPerformanceModule::setClusterVariablesToDefaultValue
void setClusterVariablesToDefaultValue()
sets cluster related variables to default values
Definition: ECLTrackClusterMatchingPerformanceModule.cc:430
Belle2::ECLTrackClusterMatchingPerformanceModule::m_mcparticle_cluster_energy
double m_mcparticle_cluster_energy
amount of particle energy contained in cluster matched to MCParticle
Definition: ECLTrackClusterMatchingPerformanceModule.h:131
Belle2::ECLTrackClusterMatchingPerformanceModule::m_outputFile
TFile * m_outputFile
output root file
Definition: ECLTrackClusterMatchingPerformanceModule.h:60
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterIsPhoton
int m_clusterIsPhoton
cluster fulfills requirements for being product of a photon
Definition: ECLTrackClusterMatchingPerformanceModule.h:158
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterE1E9
double m_clusterE1E9
energy sum of central crystal over 3x3 array around central crystal
Definition: ECLTrackClusterMatchingPerformanceModule.h:170
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterIsTrack
int m_clusterIsTrack
cluster is matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:155
Belle2::ECLTrackClusterMatchingPerformanceModule::m_mcparticle_cluster_phi
double m_mcparticle_cluster_phi
phi of cluster matched to MCParticle
Definition: ECLTrackClusterMatchingPerformanceModule.h:128
Belle2::ECLTrackClusterMatchingPerformanceModule::m_trackClusterRelationName
std::string m_trackClusterRelationName
name of relation array between tracks and ECL clusters
Definition: ECLTrackClusterMatchingPerformanceModule.h:52
Belle2::ECLTrackClusterMatchingPerformanceModule::isPrimaryMcParticle
bool isPrimaryMcParticle(const MCParticle &mcParticle)
Tests if MCParticle is a primary one.
Definition: ECLTrackClusterMatchingPerformanceModule.cc:254
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterIsChargedStable
int m_clusterIsChargedStable
cluster has related MCParticle which is charged and stable
Definition: ECLTrackClusterMatchingPerformanceModule.h:161
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedHadronHypothesisClusterPhi
double m_matchedHadronHypothesisClusterPhi
phi of cluster with hadron hypothesis matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:113
Belle2::ECLTrackClusterMatchingPerformanceModule::setVariablesToDefaultValue
void setVariablesToDefaultValue()
Sets all variables to the default value, here -999.
Definition: ECLTrackClusterMatchingPerformanceModule.cc:381
Belle2::ECLTrackClusterMatchingPerformanceModule::setupTree
void setupTree()
add branches to data tree
Definition: ECLTrackClusterMatchingPerformanceModule.cc:265
Belle2::ECLTrackClusterMatchingPerformanceModule::m_tracks
StoreArray< Track > m_tracks
Required input array of Tracks.
Definition: ECLTrackClusterMatchingPerformanceModule.h:57
Belle2::MCParticle
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:43
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::ECLTrackClusterMatchingPerformanceModule::m_clusterMinTrkDistance
double m_clusterMinTrkDistance
distance to closest track
Definition: ECLTrackClusterMatchingPerformanceModule.h:179
Belle2::ECLTrackClusterMatchingPerformanceModule::m_matchedHadronHypothesisClusterDetectorRegion
int m_matchedHadronHypothesisClusterDetectorRegion
detector region of cluster with hadron hypothesis matched to track
Definition: ECLTrackClusterMatchingPerformanceModule.h:107
Belle2::ECLTrackClusterMatchingPerformanceModule::m_trackProperties
ParticleProperties m_trackProperties
properties of a reconstructed track
Definition: ECLTrackClusterMatchingPerformanceModule.h:65
Belle2::ECLTrackClusterMatchingPerformanceModule::m_minWeight
double m_minWeight
fraction of cluster energy
Definition: ECLTrackClusterMatchingPerformanceModule.h:51
Belle2::ECLTrackClusterMatchingPerformanceModule::m_iExperiment
int m_iExperiment
Experiment number.
Definition: ECLTrackClusterMatchingPerformanceModule.h:68