Belle II Software  release-08-01-10
eclWriteWaveformParametersForMCLocalDB.cc
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 #include <framework/database/DBImportObjPtr.h>
9 #include <ecl/dbobjects/ECLDigitWaveformParametersForMC.h>
10 #include <iostream>
11 /*
12 MC photon parameters are given as averaged value.
13 Diode and hadron template parameters are computed using
14 eclComputePulseTemplates_StepX.cc scripts, consistent with procedure for data parameters.
15 */
16 
17 int main()
18 {
19 
20  Belle2::DBImportObjPtr<Belle2::ECLDigitWaveformParametersForMC> importer("ECLDigitWaveformParametersForMC");
21  importer.construct();
22 
23  const float PhotonMCPar11[11] = {27.7221, 0.5, 0.648324, 0.401711, 0.374167, 0.849417, 0.00144548, 4.70722, 0.815639, 0.555605, 0.2752};
24  const float HadronMCPar11[11] = {29.5092, 0.542623, 0.929354, 0.556139, 0.446967, 0.140175, 0.0312971, 3.12842, 0.791012, 0.619416, 0.385621};
25  const float DiodeMCPar11[11] = {28.7801, 0.578214, 0.00451387, 0.663087, 0.501441, 0.12073, 0.029675, 3.0666, 0.643883, 0.756048, 0.509381};
26 
27  importer->setTemplateParameters(PhotonMCPar11, HadronMCPar11, DiodeMCPar11);
28  importer.import(Belle2::IntervalOfValidity::always());
29 
30  std::cout << "Successfully wrote payload ECLDigitWaveformParametersForMC to local DB" << std::endl;
31 
32  return 1;
33 
34 }
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.
int main(int argc, char **argv)
Run all tests.
Definition: test_main.cc:91