Belle II Software  release-05-02-19
ECLDatabaseImporter.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Torben Ferber (ferber@physics.ubc.ca) *
7  * Alon Hershenhorn (hershen@phsa.ubc.ca) *
8  * *
9  * This software is provided "as is" without any warranty. *
10  **************************************************************************/
11 #pragma once
12 
13 //framework
14 #include <framework/logging/Logger.h>
15 
16 //Root
17 #include <TFile.h>
18 
19 namespace Belle2 {
25 
29  class ECLDatabaseImporter {
30 
31  public:
32 
36  ECLDatabaseImporter(std::vector<std::string> inputFileNames, const std::string& m_name);
37 
41  virtual ~ECLDatabaseImporter() {};
42 
47 
52 
57 
62 
72 
77 
82 
83  private:
84 
85  std::vector<std::string> m_inputFileNames;
86  std::string m_name;
91  template <class rootClass> rootClass getRootObjectFromFile(TFile* file, const std::string& rootObjName) const
92  {
93  rootClass rootObj = (rootClass)file->Get(rootObjName.data());
94  if (!rootObj) {
95  std::string filename = file->GetName();
96  delete file;
97  B2FATAL("Could not find " << rootObjName << " in " << filename);
98  }
99  return rootObj;
100  }
101 
102 
106  //"ParameterNtuple" tree branch names
107  std::string m_bgFractionBinNumBranchName = "bgFractionBinNum";
108  std::string m_regNumBranchName = "regNum";
109  std::string m_phiBinNumBranchName = "phiBinNum";
110  std::string m_thetaBinNumBranchName = "thetaBinNum";
111  std::string m_energyBinNumBranchName = "energyBinNum";
112  std::string m_correctionFactorBranchName = "correctionFactor";
114  //"ConstantNtuple" tree branch names
115  const int m_numAvgRecEnEntries = 15;
116  std::string m_avgRecEnBranchName = "avgRecEn";
117  std::string m_lReg1ThetaBranchName = "lReg1Theta";
118  std::string m_hReg1ThetaBranchName = "hReg1Theta";
119  std::string m_lReg2ThetaBranchName = "lReg2Theta";
120  std::string m_hReg2ThetaBranchName = "hReg2Theta";
121  std::string m_lReg3ThetaBranchName = "lReg3Theta";
122  std::string m_hReg3ThetaBranchName = "hReg3Theta";
123  std::string m_numOfBfBinsBranchName = "numOfBfBins";
124  std::string m_numOfEnergyBinsBranchName = "numOfEnergyBins";
125  std::string m_numOfPhiBinsBranchName = "numOfPhiBins";
126  std::string m_numOfReg1ThetaBinsBranchName = "numOfReg1ThetaBins";
127  std::string m_numOfReg2ThetaBinsBranchName = "numOfReg2ThetaBins";
128  std::string m_numOfReg3ThetaBinsBranchName = "numOfReg3ThetaBins";
129  std::string m_phiPeriodicityBranchName = "phiPeriodicity";
131  };
132 
134 } // Belle2 namespace
Belle2::ECLDatabaseImporter::importShowerEnergyCorrectionTemporary
void importShowerEnergyCorrectionTemporary()
Import ECL corrections to showers energies.
Definition: ECLDatabaseImporter.cc:354
Belle2::ECLDatabaseImporter::m_numOfPhiBinsBranchName
std::string m_numOfPhiBinsBranchName
numOfPhiBins branch name
Definition: ECLDatabaseImporter.h:134
Belle2::ECLDatabaseImporter::m_bgFractionBinNumBranchName
std::string m_bgFractionBinNumBranchName
Branch names for shower corrector leakage correction root file.
Definition: ECLDatabaseImporter.h:116
Belle2::ECLDatabaseImporter::importShowerCorrectorLeakageCorrections
void importShowerCorrectorLeakageCorrections()
Import ECL leakage corrections to showers.
Definition: ECLDatabaseImporter.cc:145
Belle2::ECLDatabaseImporter::m_phiBinNumBranchName
std::string m_phiBinNumBranchName
phiBinNum branch name
Definition: ECLDatabaseImporter.h:118
Belle2::ECLDatabaseImporter::m_regNumBranchName
std::string m_regNumBranchName
regNum branch name
Definition: ECLDatabaseImporter.h:117
Belle2::ECLDatabaseImporter::~ECLDatabaseImporter
virtual ~ECLDatabaseImporter()
Destructor.
Definition: ECLDatabaseImporter.h:50
Belle2::ECLDatabaseImporter::m_numOfBfBinsBranchName
std::string m_numOfBfBinsBranchName
numOfBfBins branch name
Definition: ECLDatabaseImporter.h:132
Belle2::ECLDatabaseImporter::m_lReg1ThetaBranchName
std::string m_lReg1ThetaBranchName
lReg1Theta branch name
Definition: ECLDatabaseImporter.h:126
Belle2::ECLDatabaseImporter::m_numOfReg3ThetaBinsBranchName
std::string m_numOfReg3ThetaBinsBranchName
numOfReg3ThetaBins branch name
Definition: ECLDatabaseImporter.h:137
Belle2::ECLDatabaseImporter::m_inputFileNames
std::vector< std::string > m_inputFileNames
Input file name.
Definition: ECLDatabaseImporter.h:94
Belle2::ECLDatabaseImporter::importDigitEnergyCalibration
void importDigitEnergyCalibration()
Import ECL energy calibration constants to the database.
Definition: ECLDatabaseImporter.cc:59
Belle2::ECLDatabaseImporter::ECLDatabaseImporter
ECLDatabaseImporter(std::vector< std::string > inputFileNames, const std::string &m_name)
Constructor.
Definition: ECLDatabaseImporter.cc:49
Belle2::ECLDatabaseImporter::m_hReg2ThetaBranchName
std::string m_hReg2ThetaBranchName
hReg2Theta branch name
Definition: ECLDatabaseImporter.h:129
Belle2::ECLDatabaseImporter::m_numOfEnergyBinsBranchName
std::string m_numOfEnergyBinsBranchName
numOfEnergyBins branch name
Definition: ECLDatabaseImporter.h:133
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ECLDatabaseImporter::m_hReg1ThetaBranchName
std::string m_hReg1ThetaBranchName
hReg1Theta branch name
Definition: ECLDatabaseImporter.h:127
Belle2::ECLDatabaseImporter::m_numOfReg1ThetaBinsBranchName
std::string m_numOfReg1ThetaBinsBranchName
numOfReg1ThetaBins branch name
Definition: ECLDatabaseImporter.h:135
Belle2::ECLDatabaseImporter::importDigitTimeCalibration
void importDigitTimeCalibration()
Import ECL time calibration constants to the database.
Definition: ECLDatabaseImporter.cc:105
Belle2::ECLDatabaseImporter::m_correctionFactorBranchName
std::string m_correctionFactorBranchName
correctionFactor branch name
Definition: ECLDatabaseImporter.h:121
Belle2::ECLDatabaseImporter::importTrackClusterMatchingParameterizations
void importTrackClusterMatchingParameterizations()
Import parameterizations for the RMS between tracks and ECL clusters to the database.
Definition: ECLDatabaseImporter.cc:477
Belle2::ECLDatabaseImporter::m_lReg3ThetaBranchName
std::string m_lReg3ThetaBranchName
lReg3Theta branch name
Definition: ECLDatabaseImporter.h:130
Belle2::ECLDatabaseImporter::m_thetaBinNumBranchName
std::string m_thetaBinNumBranchName
thetaBinNum branch name
Definition: ECLDatabaseImporter.h:119
Belle2::ECLDatabaseImporter::m_name
std::string m_name
Database object (output) file name.
Definition: ECLDatabaseImporter.h:95
Belle2::ECLDatabaseImporter::m_numOfReg2ThetaBinsBranchName
std::string m_numOfReg2ThetaBinsBranchName
numOfReg2ThetaBins branch name
Definition: ECLDatabaseImporter.h:136
Belle2::ECLDatabaseImporter::m_avgRecEnBranchName
std::string m_avgRecEnBranchName
avgRecEn branch name
Definition: ECLDatabaseImporter.h:125
Belle2::ECLDatabaseImporter::m_phiPeriodicityBranchName
std::string m_phiPeriodicityBranchName
phiPeriodicity branch name
Definition: ECLDatabaseImporter.h:138
Belle2::ECLDatabaseImporter::m_hReg3ThetaBranchName
std::string m_hReg3ThetaBranchName
hReg3Theta branch name
Definition: ECLDatabaseImporter.h:131
Belle2::ECLDatabaseImporter::m_lReg2ThetaBranchName
std::string m_lReg2ThetaBranchName
lReg2Theta branch name
Definition: ECLDatabaseImporter.h:128
Belle2::ECLDatabaseImporter::m_energyBinNumBranchName
std::string m_energyBinNumBranchName
energyBinNum branch name
Definition: ECLDatabaseImporter.h:120
Belle2::ECLDatabaseImporter::importTrackClusterMatchingThresholds
void importTrackClusterMatchingThresholds()
Import threshold values for track ECL cluster matching to the database.
Definition: ECLDatabaseImporter.cc:432
Belle2::ECLDatabaseImporter::importShowerShapesSecondMomentCorrections
void importShowerShapesSecondMomentCorrections()
Import ECL shower shape corrections to second moment to the database.
Definition: ECLDatabaseImporter.cc:312
Belle2::ECLDatabaseImporter::m_numAvgRecEnEntries
const int m_numAvgRecEnEntries
Number of entries in avgRecEn array.
Definition: ECLDatabaseImporter.h:124
Belle2::ECLDatabaseImporter::getRootObjectFromFile
rootClass getRootObjectFromFile(TFile *file, const std::string &rootObjName) const
Extract a root object rootObjName from a root file file.
Definition: ECLDatabaseImporter.h:100