Belle II Software prerelease-11-00-00a
DataWriterModule.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
9#pragma once
10
11#include <framework/core/Module.h>
12#include <framework/datastore/StoreArray.h>
13
14#include <TTree.h>
15#include <TFile.h>
16#include <string>
17
18namespace Belle2 {
23 class MCParticle;
24 class KLMCluster;
25 class ECLCluster;
26
31 class DataWriterModule : public Module {
32
33 public:
34
37
39 virtual ~DataWriterModule();
40
42 virtual void initialize() override;
43
45 virtual void beginRun() override;
46
48 virtual void event() override;
49
51 virtual void endRun() override;
52
54 virtual void terminate() override;
55
56 protected:
57
58 private:
59
61 std::string m_outPath = "KlIdBKGClassifierTrainingTuples.root";
62
64 // KLM cluster variables for pure KLM and KLM+ECL Klongs
68 Float_t m_KLMnLayer;
72 Float_t m_KLMglobalZ;
74 Float_t m_KLMtime;
80 Float_t m_KLMenergy;
82 Float_t m_KLMinvM;
84 Float_t m_KLMTruth;
91
100
101
102 // variables of closest ECL cluster with respect to KLM cluster
106 Float_t m_KLMECLE;
108 Float_t m_KLMECLdeltaL; // new
110 Float_t m_KLMECLminTrackDist; //new
122 Float_t m_KLMKLid;
124 Float_t m_KLMMCMom;
126 Float_t m_KLMMCPhi;
130 Float_t m_KLMMom;
132 Float_t m_KLMPhi;
134 Float_t m_KLMTheta;
135
141 Float_t m_KLMMCPDG ;
149 Float_t m_KLMECLZ40;
151 Float_t m_KLMECLZ51;
162
163
164 // ECL cluster variables for pure ECL Klongs
166 Float_t m_ECLE;
168 Float_t m_ECLE9oE25;
170 Float_t m_ECLTiming;
172 Float_t m_ECLR;
174 Float_t m_ECLEerror;
176 Float_t m_ECLminTrkDistance; // new
178 Float_t m_ECLdeltaL; // new
179
180
182 Float_t m_ECLZ51;
184 Float_t m_ECLZ40;
186 Float_t m_ECLE1oE9;
188 Float_t m_ECL2ndMom;
192 Float_t m_ECLLAT;
194 Float_t m_ECLZMVA;
196 Float_t m_ECLKLid;
202 Float_t m_ECLMCPDG ;
215 Float_t m_ECLMCMom;
217 Float_t m_ECLMCPhi;
221 Float_t m_ECLMom;
223 Float_t m_ECLPhi;
225 Float_t m_ECLTheta;
227 Float_t m_ECLZ;
229 Float_t m_ECLTruth;
231 Float_t m_isBeamBKG;
234
236 Float_t m_isSignal;
237
238
245
247 TFile* m_f = nullptr; //
249 TTree* m_treeKLM = nullptr;
251 TTree* m_treeECLhadron = nullptr;
253 TTree* m_treeECLgamma = nullptr;
254
257
260
261
262 }; // end class
263
264} // end namespace Belle2
Float_t m_KLMnLayer
number of layers hit in KLM cluster
bool m_useKLM
write out KLM data
Float_t m_ECLnumChrystals
number of crystals in the cluster
Float_t m_KLMInitialTrackSepAngle
angular distance from track to cluster at track starting point
Float_t m_KLMTrackSepDist
distance from track separation object
Float_t m_KLMnCluster
varibales to write out.
Float_t m_KLMMCPhi
phi of matched mc particle
Float_t m_ECLMCLifetime
MC particles lifetime.
Float_t m_ECLE1oE9
central crystal devided by 3x3 area with it in its center
Float_t m_KLMTheta
measured theta
Float_t m_KLMECLdeltaL
distance between track entry point and cluster center, might be removed
Float_t m_KLMTrackSepAngle
angular distance from track separation object
Float_t m_ECLMCPrimaryPDG
pdg code of higher order MC particle, a cluster related to a photon that originates from a pi0 decay ...
StoreArray< KLMCluster > m_klmClusters
Store array.
Float_t m_KLMECLminTrackDist
track distance between associated ECL cluster and track extrapolated into ECL
Float_t m_ECLE9oE25
energy of 9/25 chrystall rings (E dispersion shape)
virtual void initialize() override
init
Float_t m_KLMMCLifetime
MC partilces life time.
std::string m_outPath
Output path variable.
Float_t m_ECLLAT
lateral shower shape
virtual void event() override
process event
Float_t m_KLMMom
measured momentum
Float_t m_KLMECLZ51
zernike moment 5,1 of closest ECL cluster
Float_t m_ECLdeltaL
distance between track entrace into cluster and cluster center
Float_t m_KLMMCPDG
pdg code of matched MCparticle
Float_t m_ECLminTrkDistance
more sophisticated distaqnce to track in ECL
Float_t m_ECLMCPDG
pdg code of the MCparticle directly related to the cluster
Float_t m_ECLMCWeight
mc weight
Float_t m_ECLKLid
classifier output
Float_t m_KLMTrackRotationAngle
angle between track at poca and trackbeginning
Float_t m_ECLEerror
uncertainty on E measurement in ECL
Float_t m_ECLR
distance of cluster to IP
Float_t m_ECLMom
measured momentum
Float_t m_ECLMCPhi
MC particle phi; -999 if not MCparticle.
virtual void endRun() override
end run
Float_t m_KLMTruth
target variable for KLM classification
Float_t m_KLMAngleToMC
angle between KLMcluster and Mcparticle
Float_t m_KLMECLE9oE25
E in surrounding 9 crystals divided by surrounding 25 crydtalls.
Float_t m_ECLMCStatus
mc status, seen in detector etc.
Float_t m_ECLE
measured energy
Float_t m_KLMECLZMVA
zernike mva output for closest ECL cluster (based on around 10 z-moments)
virtual void terminate() override
terminate
TTree * m_treeECLhadron
tree containing ntuples for ECL cluster with N2 (hadron hypothesis)
Float_t m_KLMtrackToECL
primitive distance cluster <-> track for associated ECL cluster
Float_t m_ECLZ40
Zernike moment 4,0 see Belle2 note on that.
Float_t m_ECLZ
measured Z-coordinate
Float_t m_ECLUncertaintyPhi
measured uncertainty of phi
Float_t m_ECL2ndMom
second moment, shower shape
Float_t m_KLMECLUncertaintyTheta
theta uncertainty of closest ECL cluster
Float_t m_ECLZMVA
output of a BDT that was fitted on some Zernike Moments on a connected region
TTree * m_treeECLgamma
tree containing ntuples for ECL cluster with N1 (photon hypothesis)
bool m_useECL
write out KLM data
Float_t m_KLMMCStatus
MC particles status.
virtual void beginRun() override
beginn run
Float_t m_isBeamBKG
is beam bkg
Float_t m_KLMMCTheta
theta of matched mc particle
Float_t m_ECLTiming
timing of ECL
Float_t m_KLMMCWeight
mc weight
Float_t m_KLMECLTiming
timing of associated ECL cluster
Float_t m_KLMECLDist
distance associated ECL <-> KLM cluster
Float_t m_KLMglobalZ
global Z position in KLM
StoreArray< ECLCluster > m_eclClusters
Store array.
Float_t m_isSignal
isSignal for the classifier
Float_t m_KLMnInnermostLayer
number of innermost layers hit
Float_t m_ECLTruth
ECL trarget variable.
Float_t m_KLMtime
timing of KLM Cluster
Float_t m_KLMECLTerror
uncertainty on time in associated ECL cluster
Float_t m_KLMinvM
invariant mass calculated from root vector
Float_t m_KLMnextCluster
distance to next KLM cluster
Float_t m_ECLUncertaintyEnergy
measured energy uncertainty
Float_t m_ECLTheta
measured theta
Float_t m_ECLUncertaintyTheta
measured uncertainty on theta
Float_t m_KLMECLHypo
hypotheis id of closest ecl cluster 5: gamma, 6:hadron
StoreArray< MCParticle > m_mcParticles
Store array.
TTree * m_treeKLM
tree for klm data
Float_t m_ECLDeltaTime
KlId for that object.
Float_t m_ECLPhi
measured phi
Float_t m_KLMhitDepth
hit depth in KLM, distance to IP
Float_t m_ECLZ51
Zernike moment 5,1 see Belle2 note on that.
Float_t m_KLMTrackClusterSepAngle
angle between trach momentum and cluster (measured from ip)
Float_t m_KLMPhi
measured phi
virtual ~DataWriterModule()
Destructor.
Float_t m_ECLMCMom
MC particle momentum; -999 if not MCparticle.
Float_t m_KLMavInterClusterDist
average distance between all KLM clusters
Float_t m_KLMECLEerror
uncertainty on E in associated ECL cluster
Float_t m_KLMMCMom
momentum of matched mc particle
Float_t m_KLMKLid
KlId for that object.
Float_t m_KLMenergy
Energy deposit in KLM (0.2 GeV * nHitCells)
Float_t m_KLMMCPrimaryPDG
pdg code of MCparticles mother, for example pi0 for some gammas
Float_t m_KLMECLZ40
zernike moment 4,0 of closest ecl cluster
Float_t m_KLMeclFlag
ecl flag for belle comparision
Float_t m_KLMECLUncertaintyPhi
phi uncertainty oof closeest ecl cluster
Float_t m_KLMECLE
energy measured in associated ECL cluster
Float_t m_ECLMCTheta
MC particle momentum; -999 if not MCparticle.
Float_t m_KLMtrackFlag
track flag for belle comparision
ECL cluster data.
Definition ECLCluster.h:27
KLM cluster data.
Definition KLMCluster.h:29
A Class to store the Monte Carlo particle information.
Definition MCParticle.h:32
Module()
Constructor.
Definition Module.cc:30
Accessor to arrays stored in the data store.
Definition StoreArray.h:113
Abstract base class for different kinds of events.