10#include <ecl/dataobjects/ECLElementNumbers.h>
11#include <ecl/dbobjects/ECLDigitWaveformParameters.h>
14#include <framework/database/DBImportObjPtr.h>
15#include <framework/logging/Logger.h>
32 TString FileName =
"DigitWaveformParameters.root";
34 TFile* WaveformParameterFileInput =
new TFile(FileName,
"READ");
35 if (!WaveformParameterFileInput or WaveformParameterFileInput->IsZombie()) {
36 B2FATAL(
"Could not open file " << FileName);
38 WaveformParameterFileInput->cd();
39 TTree* WaveformParametersTree = (TTree*) WaveformParameterFileInput->Get(
"ParTree");
41 double treePhotonPar11[11];
42 double treeHadronPar11[11];
43 double treeDiodePar11[11];
45 WaveformParametersTree->SetBranchAddress(
"PhotonPar", &treePhotonPar11);
46 WaveformParametersTree->SetBranchAddress(
"HadronPar", &treeHadronPar11);
47 WaveformParametersTree->SetBranchAddress(
"DiodePar", &treeDiodePar11);
54 WaveformParametersTree->GetEntry(ID);
55 float tempPhotonPar11[11];
56 float tempHadronPar11[11];
57 float tempDiodePar11[11];
58 for (
unsigned int k = 0; k < 11; k++) {
59 tempPhotonPar11[k] = (float)treePhotonPar11[k];
60 tempHadronPar11[k] = (float)treeHadronPar11[k];
61 tempDiodePar11[k] = (float)treeDiodePar11[k];
63 std::cout <<
"cellID: " << ID + 1 <<
" " << tempPhotonPar11[0] <<
" " << tempHadronPar11[0] <<
" " << tempDiodePar11[0] <<
66 if (tempPhotonPar11[0] == 0 || tempHadronPar11[0] == 0
67 || tempDiodePar11[0] == 0) std::cout <<
"WARNING CELLID MISSING: " << ID + 1 << std::endl;
69 importer->setTemplateParameters(ID + 1, tempPhotonPar11, tempHadronPar11, tempDiodePar11);
72 std::cout <<
"Successfully wrote payload ECLDigitWaveformParameters" << std::endl;
Class for importing a single object to the database.
static IntervalOfValidity always()
Function that returns an interval of validity that is always valid, c.f.
const int c_NCrystals
Number of crystals.
Abstract base class for different kinds of events.