Belle II Software  release-05-02-19
StandardTrackingPerformanceModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Michael Ziegler *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #ifndef STANDARDTRACKINGPERFORMANCEMODULE_H_
11 #define STANDARDTRACKINGPERFORMANCEMODULE_H_
12 
13 #include <framework/core/Module.h>
14 #include <tracking/modules/standardTrackingPerformance/ParticleProperties.h>
15 
16 // forward declarations
17 class TTree;
18 class TFile;
19 
20 namespace Belle2 {
25  class MCParticle;
26 
27  template< class T >
28  class StoreArray;
29 
30 
38  public:
40 
42  void initialize() override;
43 
45  void event() override;
46 
48  void terminate() override;
49 
50  private:
51  std::string m_outputFileName;
53  std::vector< int > m_signalDaughterPDGs;
55  TFile* m_outputFile;
56  TTree* m_dataTree;
59  std::vector<const MCParticle*> m_interestingChargedStableMcParcticles;
60 
62  std::vector<MCParticle*> m_signalMCParticles;
63 
66 
68  double m_pValue;
69 
72 
75 
78 
83 
85  void setupTree();
86 
88  void writeData();
89 
91  void addVariableToTree(const std::string& varName, double& varReference);
92 
94  void addVariableToTree(const std::string& varName, int& varReference);
95 
96 
102  bool isPrimaryMcParticle(const MCParticle& mcParticle);
103 
109  bool isChargedStable(const MCParticle& mcParticle);
110 
116 
118  void findSignalMCParticles(const StoreArray< MCParticle >& mcParticles);
119 
123  void addChargedStable(const MCParticle& mcParticle);
124 
130  std::vector<MCParticle*> removeFinalStateRadiation(const std::vector<MCParticle*>& in_daughters);
131 
137  bool isSignalDecay(const MCParticle& mcParticle);
138  };
139 
140 
142 } // end of namespace
143 
144 
145 
146 #endif /* STANDARDTRACKINGPERFORMANCEMODULE_H_ */
Belle2::StandardTrackingPerformanceModule::terminate
void terminate() override
Write the tree into the opened root file.
Definition: StandardTrackingPerformanceModule.cc:199
Belle2::StandardTrackingPerformanceModule::findSignalMCParticles
void findSignalMCParticles(const StoreArray< MCParticle > &mcParticles)
Find a MCParticle of a decay chain specified by the user (not implemented yet).
Definition: StandardTrackingPerformanceModule.cc:275
Belle2::StandardTrackingPerformanceModule::setupTree
void setupTree()
add branches to data tree
Definition: StandardTrackingPerformanceModule.cc:215
Belle2::StandardTrackingPerformanceModule::m_pValue
double m_pValue
pValue of track fit
Definition: StandardTrackingPerformanceModule.h:68
Belle2::StandardTrackingPerformanceModule::event
void event() override
Fill the tree with the event data.
Definition: StandardTrackingPerformanceModule.cc:79
Belle2::StandardTrackingPerformanceModule::m_dataTree
TTree * m_dataTree
root tree with all output data.
Definition: StandardTrackingPerformanceModule.h:56
Belle2::StandardTrackingPerformanceModule::m_recoTracksStoreArrayName
std::string m_recoTracksStoreArrayName
genfit::Track collection name
Definition: StandardTrackingPerformanceModule.h:52
Belle2::ParticleProperties
This struct is used by the StandardTrackingPerformanceModule to save information of reconstructed tra...
Definition: ParticleProperties.h:30
Belle2::StandardTrackingPerformanceModule::writeData
void writeData()
write root tree to output file and close the file
Definition: StandardTrackingPerformanceModule.cc:261
Belle2::StandardTrackingPerformanceModule::m_nReconstructedChargedStableTracks
double m_nReconstructedChargedStableTracks
total number of reconstructed track candidates
Definition: StandardTrackingPerformanceModule.h:74
Belle2::StandardTrackingPerformanceModule::m_signalMCParticles
std::vector< MCParticle * > m_signalMCParticles
vector with all MCParticles of the searched signal decay
Definition: StandardTrackingPerformanceModule.h:62
Belle2::StandardTrackingPerformanceModule::addVariableToTree
void addVariableToTree(const std::string &varName, double &varReference)
add a variable with double format
Definition: StandardTrackingPerformanceModule.cc:357
Belle2::StandardTrackingPerformanceModule::m_nGeneratedChargedStableMcParticles
double m_nGeneratedChargedStableMcParticles
total number of genrated charged stable MCParticles
Definition: StandardTrackingPerformanceModule.h:71
Belle2::StandardTrackingPerformanceModule::isChargedStable
bool isChargedStable(const MCParticle &mcParticle)
Tests if MCPArticle is a charged stable particle.
Definition: StandardTrackingPerformanceModule.cc:209
Belle2::StandardTrackingPerformanceModule::removeFinalStateRadiation
std::vector< MCParticle * > removeFinalStateRadiation(const std::vector< MCParticle * > &in_daughters)
Remove all photons from a MCParticle vector.
Definition: StandardTrackingPerformanceModule.cc:316
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::StandardTrackingPerformanceModule::findChargedStableMcParticles
void findChargedStableMcParticles()
Find all interesting charged final state particles.
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::StandardTrackingPerformanceModule::m_signalDaughterPDGs
std::vector< int > m_signalDaughterPDGs
PDG codes of the B daughters of the interesting decay channel.
Definition: StandardTrackingPerformanceModule.h:53
Belle2::StandardTrackingPerformanceModule::initialize
void initialize() override
Register the needed StoreArrays and open th output TFile.
Definition: StandardTrackingPerformanceModule.cc:56
Belle2::StandardTrackingPerformanceModule
This module takes the MCParticle and the genfit::Track collection as input and writes out a root file...
Definition: StandardTrackingPerformanceModule.h:37
Belle2::StandardTrackingPerformanceModule::isSignalDecay
bool isSignalDecay(const MCParticle &mcParticle)
Tests if mcParticle has the searched decay chain.
Definition: StandardTrackingPerformanceModule.cc:291
Belle2::StandardTrackingPerformanceModule::m_interestingChargedStableMcParcticles
std::vector< const MCParticle * > m_interestingChargedStableMcParcticles
vector with all interesting charged stable MCParticles in the event
Definition: StandardTrackingPerformanceModule.h:59
Belle2::StandardTrackingPerformanceModule::m_trackProperties
ParticleProperties m_trackProperties
properties of a reconstructed track
Definition: StandardTrackingPerformanceModule.h:65
Belle2::StandardTrackingPerformanceModule::setVariablesToDefaultValue
void setVariablesToDefaultValue()
Sets all variables to the default value, here -999.
Definition: StandardTrackingPerformanceModule.cc:350
Belle2::StandardTrackingPerformanceModule::m_outputFileName
std::string m_outputFileName
name of output root file
Definition: StandardTrackingPerformanceModule.h:51
Belle2::StandardTrackingPerformanceModule::addChargedStable
void addChargedStable(const MCParticle &mcParticle)
Add all charged stable particles to a vector which originate from.
Definition: StandardTrackingPerformanceModule.cc:326
Belle2::MCParticle
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:43
Belle2::StoreArray< MCParticle >
Belle2::StandardTrackingPerformanceModule::m_nFittedChargedStabletracks
double m_nFittedChargedStabletracks
total number of fitted tracks
Definition: StandardTrackingPerformanceModule.h:77
Belle2::StandardTrackingPerformanceModule::m_outputFile
TFile * m_outputFile
output root file
Definition: StandardTrackingPerformanceModule.h:55
Belle2::StandardTrackingPerformanceModule::isPrimaryMcParticle
bool isPrimaryMcParticle(const MCParticle &mcParticle)
Tests if MCParticle is a primary one.
Definition: StandardTrackingPerformanceModule.cc:204