Belle II Software  release-06-00-14
StandardTrackingPerformanceModule.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 <tracking/modules/standardTrackingPerformance/ParticleProperties.h>
13 
14 // forward declarations
15 class TTree;
16 class TFile;
17 
18 namespace Belle2 {
23  class MCParticle;
24 
25  template< class T >
26  class StoreArray;
27 
28 
36  public:
38 
40  void initialize() override;
41 
43  void event() override;
44 
46  void terminate() override;
47 
48  private:
49  std::string m_outputFileName;
51  std::vector< int > m_signalDaughterPDGs;
53  TFile* m_outputFile;
54  TTree* m_dataTree;
57  std::vector<const MCParticle*> m_interestingChargedStableMcParcticles;
58 
60  std::vector<MCParticle*> m_signalMCParticles;
61 
64 
66  double m_pValue;
67 
70 
73 
76 
81 
83  void setupTree();
84 
86  void writeData();
87 
89  void addVariableToTree(const std::string& varName, double& varReference);
90 
92  void addVariableToTree(const std::string& varName, int& varReference);
93 
94 
100  bool isPrimaryMcParticle(const MCParticle& mcParticle);
101 
107  bool isChargedStable(const MCParticle& mcParticle);
108 
114 
116  void findSignalMCParticles(const StoreArray< MCParticle >& mcParticles);
117 
121  void addChargedStable(const MCParticle& mcParticle);
122 
128  std::vector<MCParticle*> removeFinalStateRadiation(const std::vector<MCParticle*>& in_daughters);
129 
135  bool isSignalDecay(const MCParticle& mcParticle);
136  };
137 
138 
140 } // end of namespace
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
Base class for Modules.
Definition: Module.h:72
This module takes the MCParticle and the genfit::Track collection as input and writes out a root file...
double m_nReconstructedChargedStableTracks
total number of reconstructed track candidates
void initialize() override
Register the needed StoreArrays and open th output TFile.
void event() override
Fill the tree with the event data.
std::vector< const MCParticle * > m_interestingChargedStableMcParcticles
vector with all interesting charged stable MCParticles in the event
std::vector< MCParticle * > m_signalMCParticles
vector with all MCParticles of the searched signal decay
double m_nGeneratedChargedStableMcParticles
total number of genrated charged stable MCParticles
void terminate() override
Write the tree into the opened root file.
void addChargedStable(const MCParticle &mcParticle)
Add all charged stable particles to a vector which originate from.
ParticleProperties m_trackProperties
properties of a reconstructed track
bool isChargedStable(const MCParticle &mcParticle)
Tests if MCPArticle is a charged stable particle.
void setVariablesToDefaultValue()
Sets all variables to the default value, here -999.
bool isPrimaryMcParticle(const MCParticle &mcParticle)
Tests if MCParticle is a primary one.
void addVariableToTree(const std::string &varName, double &varReference)
add a variable with double format
TTree * m_dataTree
root tree with all output data.
std::vector< MCParticle * > removeFinalStateRadiation(const std::vector< MCParticle * > &in_daughters)
Remove all photons from a MCParticle vector.
double m_nFittedChargedStabletracks
total number of fitted tracks
void writeData()
write root tree to output file and close the file
void findSignalMCParticles(const StoreArray< MCParticle > &mcParticles)
Find a MCParticle of a decay chain specified by the user (not implemented yet).
bool isSignalDecay(const MCParticle &mcParticle)
Tests if mcParticle has the searched decay chain.
std::string m_recoTracksStoreArrayName
genfit::Track collection name
std::vector< int > m_signalDaughterPDGs
PDG codes of the B daughters of the interesting decay channel.
void findChargedStableMcParticles()
Find all interesting charged final state particles.
Abstract base class for different kinds of events.
This struct is used by the StandardTrackingPerformanceModule to save information of reconstructed tra...