Belle II Software  release-08-01-10
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 #include <framework/datastore/StoreArray.h>
15 #include <mdst/dataobjects/MCParticle.h>
16 #include <mdst/dataobjects/Track.h>
17 
18 // forward declarations
19 class TTree;
20 class TFile;
21 
22 namespace Belle2 {
27  class MCParticle;
28 
29  template< class T >
30  class StoreArray;
31 
32 
40  public:
42 
44  void initialize() override;
45 
47  void event() override;
48 
50  void terminate() override;
51 
52  private:
53  std::string m_outputFileName;
55  std::vector< int > m_signalDaughterPDGs;
57  TFile* m_outputFile;
58  TTree* m_dataTree;
63  std::vector<const MCParticle*> m_interestingChargedStableMcParcticles;
64 
66  std::vector<MCParticle*> m_signalMCParticles;
67 
70 
72  double m_pValue;
73 
76 
79 
82 
87 
89  void setupTree();
90 
92  void writeData();
93 
95  void addVariableToTree(const std::string& varName, double& varReference);
96 
98  void addVariableToTree(const std::string& varName, int& varReference);
99 
100 
106  bool isPrimaryMcParticle(const MCParticle& mcParticle);
107 
113  bool isChargedStable(const MCParticle& mcParticle);
114 
120 
122  void findSignalMCParticles();
123 
127  void addChargedStable(const MCParticle& mcParticle);
128 
134  std::vector<MCParticle*> removeFinalStateRadiation(const std::vector<MCParticle*>& in_daughters);
135 
141  bool isSignalDecay(const MCParticle& mcParticle);
142  };
143 
144 
146 } // 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.
void findSignalMCParticles()
Find a MCParticle of a decay chain specified by the user (not implemented yet).
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
bool isSignalDecay(const MCParticle &mcParticle)
Tests if mcParticle has the searched decay chain.
std::string m_recoTracksStoreArrayName
genfit::Track collection name
StoreArray< MCParticle > m_MCParticles
MCParticles StoreArray.
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...