Belle II Software  release-05-02-19
ECLClusterPSD.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Savino Longo (longos@uvic.ca) *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 // FRAMEWORK
14 #include <framework/core/Module.h>
15 #include <framework/datastore/StoreArray.h>
16 #include <framework/database/DBObjPtr.h>
17 
18 namespace Belle2 {
24  class DatabaseRepresentationOfWeightfile;
25  class ECLShower;
26  class ECLCalDigit;
27 
28  namespace MVA {
29  class Expert;
30  class SingleDataset;
31  }
32 
37  class ECLClusterPSDModule: public Module {
38 
39  public:
40 
44 
48 
50  virtual void initialize() override;
51 
53  virtual void beginRun() override;
54 
57  virtual void event() override;
58 
60  virtual void endRun() override;
61 
63  virtual void terminate() override;
64 
66  virtual const char* eclCalDigitArrayName() const
67  { return "ECLCalDigits" ; }
68 
70  virtual const char* eclShowerArrayName() const
71  { return "ECLShowers" ; }
72 
73  private:
79  const unsigned int maxdigits = 20;
80  const unsigned int m_numMVAvariables = 160;
81  std::string m_MVAidentifier;
82  std::unique_ptr<DBObjPtr<DatabaseRepresentationOfWeightfile>>
84  std::unique_ptr<MVA::Expert> m_expert;
85  std::unique_ptr<MVA::SingleDataset> m_dataset;
89  void initializeMVAweightFile(const std::string& identifier,
90  std::unique_ptr<DBObjPtr<DatabaseRepresentationOfWeightfile>>& weightFileRepresentation);
91 
93  void initializeMVA(const std::string& identifier,
94  std::unique_ptr<DBObjPtr<DatabaseRepresentationOfWeightfile>>& weightFileRepresentation, std::unique_ptr<MVA::Expert>& expert);
95 
96  double evaluateMVA(const ECLShower* cluster);
98  };
99 
102  public:
104  virtual const char* eclCalDigitArrayName() const override
105  { return "ECLCalDigitsPureCsI" ; }
106 
108  virtual const char* eclShowerArrayName() const override
109  { return "ECLShowersPureCsI" ; }
110 
111  };
112 
114 } // end Belle2 namespace
Belle2::ECLClusterPSDModule::m_MVAidentifier
std::string m_MVAidentifier
MVA - weight-file.
Definition: ECLClusterPSD.h:89
Belle2::ECLClusterPSDModule::evaluateMVA
double evaluateMVA(const ECLShower *cluster)
Evaluates mva.
Definition: ECLClusterPSD.cc:129
Belle2::ECLClusterPSDModule::~ECLClusterPSDModule
~ECLClusterPSDModule()
Destructor.
Definition: ECLClusterPSD.cc:62
Belle2::ECLClusterPSDModule::m_numMVAvariables
const unsigned int m_numMVAvariables
number of variables expected in the MVA weightfile
Definition: ECLClusterPSD.h:88
Belle2::ECLClusterPSDModule::initializeMVAweightFile
void initializeMVAweightFile(const std::string &identifier, std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile >> &weightFileRepresentation)
initialize MVA weight file from DB
Definition: ECLClusterPSD.cc:67
Belle2::ECLClusterPSDPureCsIModule::eclShowerArrayName
virtual const char * eclShowerArrayName() const override
PureCsI Name of the ECLShowersPureCsI.
Definition: ECLClusterPSD.h:116
Belle2::ECLClusterPSDModule::m_eclShowers
StoreArray< ECLShower > m_eclShowers
ECLShower's.
Definition: ECLClusterPSD.h:85
Belle2::ECLClusterPSDModule::initialize
virtual void initialize() override
Initialize variables.
Definition: ECLClusterPSD.cc:78
Belle2::ECLClusterPSDPureCsIModule::eclCalDigitArrayName
virtual const char * eclCalDigitArrayName() const override
PureCsI Name of the ECLCalDigitsPureCsI.
Definition: ECLClusterPSD.h:112
Belle2::ECLClusterPSDPureCsIModule
Class derived from ECL, only difference are the names.
Definition: ECLClusterPSD.h:109
Belle2::ECLClusterPSDModule::beginRun
virtual void beginRun() override
begin run.
Definition: ECLClusterPSD.cc:123
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::ECLClusterPSDModule::m_eclCalDigits
StoreArray< ECLCalDigit > m_eclCalDigits
ECLCalDigit's.
Definition: ECLClusterPSD.h:84
Belle2::ECLClusterPSDModule::m_dataset
std::unique_ptr< MVA::SingleDataset > m_dataset
Pointer to the current dataset.
Definition: ECLClusterPSD.h:93
Belle2::ECLClusterPSDModule
This module computes shower variables using pulse shape information from offline two component fits.
Definition: ECLClusterPSD.h:45
Belle2::ECLClusterPSDModule::terminate
virtual void terminate() override
terminate.
Definition: ECLClusterPSD.cc:290
Belle2::ECLClusterPSDModule::event
virtual void event() override
event per event.
Definition: ECLClusterPSD.cc:220
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ECLClusterPSDModule::m_weightfile_representation
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation
Database pointer to the Database representation of the MVA weightfile.
Definition: ECLClusterPSD.h:91
Belle2::ECLClusterPSDModule::maxdigits
const unsigned int maxdigits
Max number of digits mva can include.
Definition: ECLClusterPSD.h:87
Belle2::ECLClusterPSDModule::eclCalDigitArrayName
virtual const char * eclCalDigitArrayName() const
ECLCalDigits array name.
Definition: ECLClusterPSD.h:74
Belle2::ECLClusterPSDModule::eclShowerArrayName
virtual const char * eclShowerArrayName() const
ECLShowers array name.
Definition: ECLClusterPSD.h:78
Belle2::ECLClusterPSDModule::m_expert
std::unique_ptr< MVA::Expert > m_expert
Pointer to the current MVA Expert.
Definition: ECLClusterPSD.h:92
Belle2::ECLClusterPSDModule::ECLClusterPSDModule
ECLClusterPSDModule()
Constructor.
Definition: ECLClusterPSD.cc:49
Belle2::ECLClusterPSDModule::m_CrystalHadronEnergyThreshold
double m_CrystalHadronEnergyThreshold
hadron component energy threshold to classify as hadron.
Definition: ECLClusterPSD.h:82
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::ECLClusterPSDModule::endRun
virtual void endRun() override
end run.
Definition: ECLClusterPSD.cc:285
Belle2::ECLClusterPSDModule::m_CrystalHadronIntensityThreshold
double m_CrystalHadronIntensityThreshold
hadron component intensity threshold to classify as hadron.
Definition: ECLClusterPSD.h:83
Belle2::ECLClusterPSDModule::initializeMVA
void initializeMVA(const std::string &identifier, std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile >> &weightFileRepresentation, std::unique_ptr< MVA::Expert > &expert)
Load MVA weight file and set pointer of expert.
Definition: ECLClusterPSD.cc:87
Belle2::ECLShower
Class to store ECL Showers.
Definition: ECLShower.h:42