Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//==========================================================================
// AIDA Detector description implementation
//--------------------------------------------------------------------------
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
// All rights reserved.
//
// For the licensing terms see $DD4hepINSTALL/LICENSE.
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
//
// @author R.Ete (main author)
//
//====================================================================
// Framework include files
#include "LCIOEventParameters.h"
using namespace std;
using namespace dd4hep;
using namespace dd4hep::sim;
/// Initializing constructor
LCIOEventParameters::LCIOEventParameters()
: m_runNumber(0), m_eventNumber(0)
{
}
/// Default destructor
LCIOEventParameters::~LCIOEventParameters() {
}
/// Set the event parameters
void LCIOEventParameters::setParameters(int rNumber,
int evtNumber,
const EVENT::LCParameters& parameters)
{
m_runNumber = rNumber;
m_eventNumber = evtNumber;
copyLCParameters(parameters, m_eventParameters);
}
/// Get the run number
int LCIOEventParameters::runNumber() const {
return m_runNumber;
}
/// Get the event number
int LCIOEventParameters::eventNumber() const {
return m_eventNumber;
}
/// Get the event parameters
const IMPL::LCParametersImpl& LCIOEventParameters::eventParameters() const {
return m_eventParameters;
}
/// Copy the paramaters from source to destination
void LCIOEventParameters::copyLCParameters(const EVENT::LCParameters& source,
EVENT::LCParameters& destination)
{
EVENT::StringVec intKeys; source.getIntKeys(intKeys);
EVENT::StringVec floatKeys; source.getFloatKeys(floatKeys);
EVENT::StringVec stringKeys; source.getStringKeys(stringKeys);
for(unsigned int i=0; i<intKeys.size(); ++i ) {
EVENT::IntVec intVec;
source.getIntVals(intKeys.at(i),intVec);
destination.setValues(intKeys.at(i),intVec);
}
for(unsigned int i=0; i<floatKeys.size(); ++i ) {
EVENT::FloatVec floatVec;
source.getFloatVals(floatKeys.at(i),floatVec);
destination.setValues(floatKeys.at(i),floatVec);
}
for(unsigned int i=0; i<stringKeys.size(); ++i ) {
EVENT::StringVec stringVec;
source.getStringVals(stringKeys.at(i),stringVec);
destination.setValues(stringKeys.at(i),stringVec);
}
}