Belle II Software  release-05-02-19
ECLMatchingPerformanceExpertModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributor: Frank Meier *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <ecl/dataobjects/ECLCalDigit.h>
13 #include <ecl/geometry/ECLNeighbours.h>
14 #include <framework/core/Module.h>
15 #include <mdst/dataobjects/ECLCluster.h>
16 #include <mdst/dataobjects/Track.h>
17 #include <mdst/dataobjects/TrackFitResult.h>
18 #include <tracking/dataobjects/ExtHit.h>
19 #include <tracking/dataobjects/RecoTrack.h>
20 #include <tracking/modules/standardTrackingPerformance/ParticleProperties.h>
21 
22 // forward declarations
23 class TTree;
24 class TFile;
25 
26 namespace Belle2 {
32  template< class T >
33  class StoreArray;
34 
35 
44  public:
46 
48  void initialize() override;
49 
51  void event() override;
52 
54  void terminate() override;
55 
56  private:
57  std::string m_outputFileName;
72  TFile* m_outputFile{nullptr};
73  TTree* m_dataTree{nullptr};
77 
79  int m_iExperiment = 0;
80 
82  int m_iRun = 0;
83 
85  int m_iEvent = 0;
86 
89 
91  double m_pValue = 0.0;
92 
94  int m_charge = 0;
95 
97  double m_d0 = 0.0;
98 
100  double m_z0 = 0.0;
101 
104 
107 
109  double m_distance = 0.0;
110 
112  double m_trackLength = 0.0;
113 
115  double m_deposited_energy = 0.0;
116 
118  double m_innerdistance = 0.0;
119 
122 
125 
128 
131 
134 
137 
140 
143 
146 
149 
152 
154  int m_enter = 0;
155 
157  int m_exit = 0;
158 
161 
163  double m_enteringcelltheta = 0.0;
164 
166  int m_ndf = 0;
167 
172 
174  void setupTree();
175 
177  void writeData();
178 
180  void addVariableToTree(const std::string& varName, double& varReference);
181 
183  void addVariableToTree(const std::string& varName, int& varReference);
184 
186  void findECLCalDigitMatchInNeighbouringCell(ECL::ECLNeighbours* eclneighbours, int& matchedToNeighbours, const int& cell);
187 
189  void findECLCalDigitMatch(const int& cell, int& matched);
190  };
191 
192 
194 } // end of namespace
Belle2::ECLMatchingPerformanceExpertModule::m_tracks
StoreArray< Track > m_tracks
Required input array of Tracks.
Definition: ECLMatchingPerformanceExpertModule.h:65
Belle2::ECLMatchingPerformanceExpertModule::m_iExperiment
int m_iExperiment
Experiment number.
Definition: ECLMatchingPerformanceExpertModule.h:79
Belle2::ECLMatchingPerformanceExpertModule::m_matchedTo3x3Neighbours
int m_matchedTo3x3Neighbours
boolean for match between track and one of 9 ECLCalDigit neighbouring cells
Definition: ECLMatchingPerformanceExpertModule.h:124
Belle2::ECLMatchingPerformanceExpertModule::m_eclClusters
StoreArray< ECLCluster > m_eclClusters
Required input array of ECLClusters.
Definition: ECLMatchingPerformanceExpertModule.h:62
Belle2::ECLMatchingPerformanceExpertModule::m_eclCalDigits
StoreArray< ECLCalDigit > m_eclCalDigits
Required input array of ECLCalDigits.
Definition: ECLMatchingPerformanceExpertModule.h:61
Belle2::ECLMatchingPerformanceExpertModule::m_iRun
int m_iRun
Run number.
Definition: ECLMatchingPerformanceExpertModule.h:82
Belle2::ECLMatchingPerformanceExpertModule::m_matchedToIncreasedPhiDecreasedTheta
int m_matchedToIncreasedPhiDecreasedTheta
boolean for match between track and neighbouring cell with higher phi value
Definition: ECLMatchingPerformanceExpertModule.h:145
Belle2::ECLMatchingPerformanceExpertModule::m_ndf
int m_ndf
number of degrees of freedom of the track (should be #CDC hits - 5 (helix parameters))
Definition: ECLMatchingPerformanceExpertModule.h:166
Belle2::ECLMatchingPerformanceExpertModule::m_trackMultiplicity
int m_trackMultiplicity
Track Multiplicity.
Definition: ECLMatchingPerformanceExpertModule.h:88
Belle2::ECLMatchingPerformanceExpertModule::m_extHits
StoreArray< ExtHit > m_extHits
Required input array of ExtHits.
Definition: ECLMatchingPerformanceExpertModule.h:63
Belle2::ParticleProperties
This struct is used by the StandardTrackingPerformanceModule to save information of reconstructed tra...
Definition: ParticleProperties.h:30
Belle2::ECLMatchingPerformanceExpertModule::m_deposited_energy
double m_deposited_energy
energy loss of track in ECL
Definition: ECLMatchingPerformanceExpertModule.h:115
Belle2::ECLMatchingPerformanceExpertModule::m_matchedToIncreasedPhiIncreasedTheta
int m_matchedToIncreasedPhiIncreasedTheta
boolean for match between track and neighbouring cell with higher phi value
Definition: ECLMatchingPerformanceExpertModule.h:151
Belle2::ECLMatchingPerformanceExpertModule::m_matchedToDecreasedPhiDecreasedTheta
int m_matchedToDecreasedPhiDecreasedTheta
boolean for match between track and neighbouring cell with lower phi value
Definition: ECLMatchingPerformanceExpertModule.h:142
Belle2::ECLMatchingPerformanceExpertModule::m_enteringcelltheta
double m_enteringcelltheta
theta of first crystal that is entered by track
Definition: ECLMatchingPerformanceExpertModule.h:163
Belle2::ECLMatchingPerformanceExpertModule::m_matchedToECLCluster
int m_matchedToECLCluster
boolean for match between track and ECL cluster
Definition: ECLMatchingPerformanceExpertModule.h:103
Belle2::ECLMatchingPerformanceExpertModule::m_exit
int m_exit
number of times track leaves ECL
Definition: ECLMatchingPerformanceExpertModule.h:157
Belle2::ECLMatchingPerformanceExpertModule::m_hypothesisOfMatchedECLCluster
int m_hypothesisOfMatchedECLCluster
hypothesis of matched ECL cluster
Definition: ECLMatchingPerformanceExpertModule.h:106
Belle2::ECLMatchingPerformanceExpertModule::m_eclNeighbours3x3
ECL::ECLNeighbours * m_eclNeighbours3x3
Neighbour map of 9 crystals.
Definition: ECLMatchingPerformanceExpertModule.h:69
Belle2::ECLMatchingPerformanceExpertModule::addVariableToTree
void addVariableToTree(const std::string &varName, double &varReference)
add a variable with double format
Definition: ECLMatchingPerformanceExpertModule.cc:380
Belle2::ECLMatchingPerformanceExpertModule::m_z0
double m_z0
distance of the track to the IP along the beam axis
Definition: ECLMatchingPerformanceExpertModule.h:100
Belle2::ECLMatchingPerformanceExpertModule::m_trackLength
double m_trackLength
length of track in ECL
Definition: ECLMatchingPerformanceExpertModule.h:112
Belle2::ECLMatchingPerformanceExpertModule::m_d0
double m_d0
signed distance of the track to the IP in the r-phi plane
Definition: ECLMatchingPerformanceExpertModule.h:97
Belle2::ECLMatchingPerformanceExpertModule::initialize
void initialize() override
Register the needed StoreArrays and open the output TFile.
Definition: ECLMatchingPerformanceExpertModule.cc:43
Belle2::ECLMatchingPerformanceExpertModule::m_trackProperties
ParticleProperties m_trackProperties
properties of a reconstructed track
Definition: ECLMatchingPerformanceExpertModule.h:76
Belle2::ECLMatchingPerformanceExpertModule::m_innerDistanceEnergy
double m_innerDistanceEnergy
minimal deposited energy for search of closest crystal
Definition: ECLMatchingPerformanceExpertModule.h:59
Belle2::ECLMatchingPerformanceExpertModule::m_distance
double m_distance
minimal distance between track and ECLCluster
Definition: ECLMatchingPerformanceExpertModule.h:109
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::ECLMatchingPerformanceExpertModule::m_enteringcellid
int m_enteringcellid
cell id of first crystal that is entered by track
Definition: ECLMatchingPerformanceExpertModule.h:160
Belle2::ECLMatchingPerformanceExpertModule::m_eclNeighbours1x1
ECL::ECLNeighbours * m_eclNeighbours1x1
Neighbour map of 1 crystal.
Definition: ECLMatchingPerformanceExpertModule.h:68
Belle2::ECLMatchingPerformanceExpertModule
This module takes the Track collection as input and checks if one of the related ExtHits matches with...
Definition: ECLMatchingPerformanceExpertModule.h:43
Belle2::ECLMatchingPerformanceExpertModule::m_minCalDigitEnergy
double m_minCalDigitEnergy
noise threshold of deposited energy in crystal
Definition: ECLMatchingPerformanceExpertModule.h:58
Belle2::ECLMatchingPerformanceExpertModule::m_trackFitResults
StoreArray< TrackFitResult > m_trackFitResults
Required input array of TrackFitResults.
Definition: ECLMatchingPerformanceExpertModule.h:66
Belle2::ECLMatchingPerformanceExpertModule::m_enter
int m_enter
number of times track enters ECL
Definition: ECLMatchingPerformanceExpertModule.h:154
Belle2::ECL::ECLNeighbours
Class to get the neighbours for a given cell id.
Definition: ECLNeighbours.h:38
Belle2::ECLMatchingPerformanceExpertModule::terminate
void terminate() override
Write the tree into the opened root file.
Definition: ECLMatchingPerformanceExpertModule.cc:242
Belle2::ECLMatchingPerformanceExpertModule::m_matchedToIncreasedTheta
int m_matchedToIncreasedTheta
boolean for match between track and neighbouring cell with higher phi value
Definition: ECLMatchingPerformanceExpertModule.h:139
Belle2::ECLMatchingPerformanceExpertModule::m_matchedTo5x5Neighbours
int m_matchedTo5x5Neighbours
boolean for match between track and one of 25 ECLCalDigit neighbouring cells
Definition: ECLMatchingPerformanceExpertModule.h:127
Belle2::ECLMatchingPerformanceExpertModule::m_outputFileName
std::string m_outputFileName
name of output root file
Definition: ECLMatchingPerformanceExpertModule.h:57
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ECLMatchingPerformanceExpertModule::m_outputFile
TFile * m_outputFile
output root file
Definition: ECLMatchingPerformanceExpertModule.h:72
Belle2::ECLMatchingPerformanceExpertModule::event
void event() override
Fill the tree with the event data.
Definition: ECLMatchingPerformanceExpertModule.cc:66
Belle2::ECLMatchingPerformanceExpertModule::m_iEvent
int m_iEvent
Event number.
Definition: ECLMatchingPerformanceExpertModule.h:85
Belle2::ECLMatchingPerformanceExpertModule::m_matchedToDecreasedPhi
int m_matchedToDecreasedPhi
boolean for match between track and neighbouring cell with lower phi value
Definition: ECLMatchingPerformanceExpertModule.h:130
Belle2::ECLMatchingPerformanceExpertModule::m_recoTracks
StoreArray< RecoTrack > m_recoTracks
Required input array of RecoTracks.
Definition: ECLMatchingPerformanceExpertModule.h:64
Belle2::ECLMatchingPerformanceExpertModule::m_innerdistance
double m_innerdistance
minimal distance between track at center of ECL and ECLCalDigit with at least 10 MeV
Definition: ECLMatchingPerformanceExpertModule.h:118
Belle2::ECLMatchingPerformanceExpertModule::findECLCalDigitMatchInNeighbouringCell
void findECLCalDigitMatchInNeighbouringCell(ECL::ECLNeighbours *eclneighbours, int &matchedToNeighbours, const int &cell)
find a match between crystals in which energy was deposited and the cell or its neighbors that a trac...
Definition: ECLMatchingPerformanceExpertModule.cc:394
Belle2::ECLMatchingPerformanceExpertModule::m_pValue
double m_pValue
pValue of track fit
Definition: ECLMatchingPerformanceExpertModule.h:91
Belle2::ECLMatchingPerformanceExpertModule::m_matchedToDecreasedTheta
int m_matchedToDecreasedTheta
boolean for match between track and neighbouring cell with lower phi value
Definition: ECLMatchingPerformanceExpertModule.h:136
Belle2::ECLMatchingPerformanceExpertModule::m_matchedToIncreasedPhi
int m_matchedToIncreasedPhi
boolean for match between track and neighbouring cell with higher phi value
Definition: ECLMatchingPerformanceExpertModule.h:133
Belle2::ECLMatchingPerformanceExpertModule::setVariablesToDefaultValue
void setVariablesToDefaultValue()
Sets all variables to the default value, here -999.
Definition: ECLMatchingPerformanceExpertModule.cc:336
Belle2::ECLMatchingPerformanceExpertModule::m_matchedTo1x1Neighbours
int m_matchedTo1x1Neighbours
boolean for match between track and ECLCalDigit cell
Definition: ECLMatchingPerformanceExpertModule.h:121
Belle2::ECLMatchingPerformanceExpertModule::m_dataTree
TTree * m_dataTree
root tree with all output data.
Definition: ECLMatchingPerformanceExpertModule.h:73
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::ECLMatchingPerformanceExpertModule::m_matchedToDecreasedPhiIncreasedTheta
int m_matchedToDecreasedPhiIncreasedTheta
boolean for match between track and neighbouring cell with lower phi value
Definition: ECLMatchingPerformanceExpertModule.h:148
Belle2::ECLMatchingPerformanceExpertModule::m_charge
int m_charge
charge
Definition: ECLMatchingPerformanceExpertModule.h:94
Belle2::ECLMatchingPerformanceExpertModule::findECLCalDigitMatch
void findECLCalDigitMatch(const int &cell, int &matched)
determine whether energy has been deposited in crystal with ID cell and write result to matched
Definition: ECLMatchingPerformanceExpertModule.cc:410
Belle2::ECLMatchingPerformanceExpertModule::setupTree
void setupTree()
add branches to data tree
Definition: ECLMatchingPerformanceExpertModule.cc:250
Belle2::ECLMatchingPerformanceExpertModule::m_eclNeighbours5x5
ECL::ECLNeighbours * m_eclNeighbours5x5
Neighbour map of 25 crystals.
Definition: ECLMatchingPerformanceExpertModule.h:70
Belle2::ECLMatchingPerformanceExpertModule::writeData
void writeData()
write root tree to output file and close the file
Definition: ECLMatchingPerformanceExpertModule.cc:320