Belle II Software development
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/* ECL headers. */
11#include <ecl/dataobjects/ECLCalDigit.h>
12#include <ecl/geometry/ECLNeighbours.h>
13
14/* Basf2 headers. */
15#include <framework/core/Module.h>
16#include <framework/dataobjects/EventMetaData.h>
17#include <framework/datastore/StoreArray.h>
18#include <framework/datastore/StoreObjPtr.h>
19#include <mdst/dataobjects/ECLCluster.h>
20#include <mdst/dataobjects/Track.h>
21#include <mdst/dataobjects/TrackFitResult.h>
22#include <tracking/dataobjects/ExtHit.h>
23#include <tracking/dataobjects/RecoTrack.h>
24#include <tracking/modules/standardTrackingPerformance/ParticleProperties.h>
25
26// forward declarations
27class TTree;
28class TFile;
29
30namespace Belle2 {
36 template< class T >
37 class StoreArray;
38
39
48 public:
50
52 void initialize() override;
53
55 void event() override;
56
58 void terminate() override;
59
60 private:
61 std::string m_outputFileName;
74
79 TFile* m_outputFile{nullptr};
80 TTree* m_dataTree{nullptr};
84
87
89 int m_iRun = 0;
90
92 int m_iEvent = 0;
93
96
98 double m_pValue = 0.0;
99
101 int m_charge = 0;
102
104 double m_d0 = 0.0;
105
107 double m_z0 = 0.0;
108
111
114
116 double m_distance = 0.0;
117
119 double m_trackLength = 0.0;
120
122 double m_deposited_energy = 0.0;
123
125 double m_innerdistance = 0.0;
126
129
132
135
138
141
144
147
150
153
156
159
161 int m_enter = 0;
162
164 int m_exit = 0;
165
168
171
173 int m_ndf = 0;
174
179
181 void setupTree();
182
184 void writeData();
185
187 void addVariableToTree(const std::string& varName, double& varReference);
188
190 void addVariableToTree(const std::string& varName, int& varReference);
191
193 void findECLCalDigitMatchInNeighbouringCell(ECL::ECLNeighbours* eclneighbours, int& matchedToNeighbours, const int& cell);
194
196 void findECLCalDigitMatch(const int& cell, int& matched);
197 };
198
199
201} // 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:25
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...