Belle II Software  release-06-02-00
ECLMatchingPerformanceExpertModule.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 <ecl/dataobjects/ECLCalDigit.h>
11 #include <ecl/geometry/ECLNeighbours.h>
12 #include <framework/core/Module.h>
13 #include <framework/dataobjects/EventMetaData.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <framework/datastore/StoreObjPtr.h>
16 #include <mdst/dataobjects/ECLCluster.h>
17 #include <mdst/dataobjects/Track.h>
18 #include <mdst/dataobjects/TrackFitResult.h>
19 #include <tracking/dataobjects/ExtHit.h>
20 #include <tracking/dataobjects/RecoTrack.h>
21 #include <tracking/modules/standardTrackingPerformance/ParticleProperties.h>
22 
23 // forward declarations
24 class TTree;
25 class TFile;
26 
27 namespace Belle2 {
33  template< class T >
34  class StoreArray;
35 
36 
45  public:
47 
49  void initialize() override;
50 
52  void event() override;
53 
55  void terminate() override;
56 
57  private:
58  std::string m_outputFileName;
71 
76  TFile* m_outputFile{nullptr};
77  TTree* m_dataTree{nullptr};
81 
83  int m_iExperiment = 0;
84 
86  int m_iRun = 0;
87 
89  int m_iEvent = 0;
90 
93 
95  double m_pValue = 0.0;
96 
98  int m_charge = 0;
99 
101  double m_d0 = 0.0;
102 
104  double m_z0 = 0.0;
105 
108 
111 
113  double m_distance = 0.0;
114 
116  double m_trackLength = 0.0;
117 
119  double m_deposited_energy = 0.0;
120 
122  double m_innerdistance = 0.0;
123 
126 
129 
132 
135 
138 
141 
144 
147 
150 
153 
156 
158  int m_enter = 0;
159 
161  int m_exit = 0;
162 
165 
167  double m_enteringcelltheta = 0.0;
168 
170  int m_ndf = 0;
171 
176 
178  void setupTree();
179 
181  void writeData();
182 
184  void addVariableToTree(const std::string& varName, double& varReference);
185 
187  void addVariableToTree(const std::string& varName, int& varReference);
188 
190  void findECLCalDigitMatchInNeighbouringCell(ECL::ECLNeighbours* eclneighbours, int& matchedToNeighbours, const int& cell);
191 
193  void findECLCalDigitMatch(const int& cell, int& matched);
194  };
195 
196 
198 } // end of namespace
This module takes the Track collection as input and checks if one of the related ExtHits matches with...
double m_minCalDigitEnergy
noise threshold of deposited energy in crystal
ECL::ECLNeighbours * m_eclNeighbours3x3
Neighbour map of 9 crystals.
double m_d0
signed distance of the track to the IP in the r-phi plane
int m_matchedToDecreasedPhiIncreasedTheta
boolean for match between track and neighbouring cell with lower phi value
ECL::ECLNeighbours * m_eclNeighbours1x1
Neighbour map of 1 crystal.
void initialize() override
Register the needed StoreArrays and open the output TFile.
int m_matchedToIncreasedPhiDecreasedTheta
boolean for match between track and neighbouring cell with higher phi value
int m_matchedToECLCluster
boolean for match between track and ECL cluster
void event() override
Fill the tree with the event data.
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...
int m_matchedToIncreasedTheta
boolean for match between track and neighbouring cell with higher phi value
int m_matchedToIncreasedPhi
boolean for match between track and neighbouring cell with higher phi value
double m_enteringcelltheta
theta of first crystal that is entered by track
StoreArray< TrackFitResult > m_trackFitResults
Required input array of TrackFitResults.
void terminate() override
Write the tree into the opened root file.
double m_distance
minimal distance between track and ECLCluster
ECL::ECLNeighbours * m_eclNeighbours5x5
Neighbour map of 25 crystals.
int m_matchedToDecreasedPhiDecreasedTheta
boolean for match between track and neighbouring cell with lower phi value
ParticleProperties m_trackProperties
properties of a reconstructed track
void setVariablesToDefaultValue()
Sets all variables to the default value, here -999.
double m_innerdistance
minimal distance between track at center of ECL and ECLCalDigit with at least 10 MeV
void findECLCalDigitMatch(const int &cell, int &matched)
determine whether energy has been deposited in crystal with ID cell and write result to matched
int m_ndf
number of degrees of freedom of the track (should be #CDC hits - 5 (helix parameters))
StoreArray< Track > m_tracks
Required input array of Tracks.
int m_matchedTo5x5Neighbours
boolean for match between track and one of 25 ECLCalDigit neighbouring cells
StoreArray< ECLCluster > m_eclClusters
Required input array of ECLClusters.
void addVariableToTree(const std::string &varName, double &varReference)
add a variable with double format
int m_matchedTo3x3Neighbours
boolean for match between track and one of 9 ECLCalDigit neighbouring cells
double m_innerDistanceEnergy
minimal deposited energy for search of closest crystal
int m_hypothesisOfMatchedECLCluster
hypothesis of matched ECL cluster
StoreArray< RecoTrack > m_recoTracks
Required input array of RecoTracks.
StoreArray< ExtHit > m_extHits
Required input array of ExtHits.
int m_matchedToDecreasedPhi
boolean for match between track and neighbouring cell with lower phi value
int m_matchedToDecreasedTheta
boolean for match between track and neighbouring cell with lower phi value
int m_matchedToIncreasedPhiIncreasedTheta
boolean for match between track and neighbouring cell with higher phi value
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
int m_enteringcellid
cell id of first crystal that is entered by track
int m_matchedTo1x1Neighbours
boolean for match between track and ECLCalDigit cell
StoreObjPtr< EventMetaData > m_EventMetaData
Event metadata.
StoreArray< ECLCalDigit > m_eclCalDigits
Required input array of ECLCalDigits.
Class to get the neighbours for a given cell id.
Definition: ECLNeighbours.h:23
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:95
Abstract base class for different kinds of events.
This struct is used by the StandardTrackingPerformanceModule to save information of reconstructed tra...