Belle II Software  release-08-01-10
LowEnergyPi0VetoExpertModule.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 /* Analysis headers. */
12 #include <analysis/dataobjects/ParticleList.h>
13 
14 /* Basf2 headers. */
15 #include <framework/core/Module.h>
16 #include <framework/database/DBObjPtr.h>
17 #include <mva/dataobjects/DatabaseRepresentationOfWeightfile.h>
18 #include <mva/interface/Expert.h>
19 #include <mva/interface/Weightfile.h>
20 
21 /* C++ headers. */
22 #include <string>
23 
24 namespace Belle2 {
37 
38  public:
39 
44 
49 
53  void initialize() override;
54 
58  void beginRun() override;
59 
63  void event() override;
64 
68  void endRun() override;
69 
73  void terminate() override;
74 
75  private:
76 
81  void init_mva(MVA::Weightfile& weightfile);
82 
89  float getMaximumVeto(const Particle* gamma1, const Particle* pi0Gamma);
90 
97 
99  std::string m_GammaListName;
100 
102  std::string m_Pi0ListName;
103 
105  bool m_Belle1;
106 
109 
112 
114  std::string m_identifier = "LowEnergyPi0Veto";
115 
117  std::unique_ptr<DBObjPtr<DatabaseRepresentationOfWeightfile>> m_weightfile_representation;
118 
120  std::unique_ptr<MVA::Expert> m_expert;
121 
123  std::unique_ptr<MVA::SingleDataset> m_dataset;
124 
125  };
126 
128 }
Calculation of low-energy pi0 veto value.
std::unique_ptr< MVA::SingleDataset > m_dataset
Pointer to the current dataset.
StoreObjPtr< ParticleList > m_ListGamma
Gamma candidates.
void event() override
This method is called for each event.
void endRun() override
This method is called if the current run ends.
void terminate() override
This method is called at the end of the event processing.
std::unique_ptr< MVA::Expert > m_expert
Pointer to the current MVA expert.
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation
Database pointer to the database representation of the weightfile.
void beginRun() override
Called when entering a new run.
bool m_VetoPi0Daughters
Calculate veto for pi0 daughter photons (maximum over all pairs excluding this pi0).
StoreObjPtr< ParticleList > m_ListPi0
Pi0 candidates.
void init_mva(MVA::Weightfile &weightfile)
Initialize mva expert, dataset and features Called everytime the weightfile in the database changes i...
std::string m_GammaListName
Gamma particle list name.
std::string m_Pi0ListName
Pi0 particle list name.
float getMaximumVeto(const Particle *gamma1, const Particle *pi0Gamma)
Get maximum veto value over all gamma pairs including the photon gamma1.
std::string m_identifier
Database identifier or file used to load the weights.
The Weightfile class serializes all information about a training into an xml tree.
Definition: Weightfile.h:38
Base class for Modules.
Definition: Module.h:72
Class to store reconstructed particles.
Definition: Particle.h:75
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.