ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCalibTools
src
LArWaves2Ntuple.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArRawConditions/LArWaveCumul.h
"
6
7
#include "
LArCalibTools/LArWaves2Ntuple.h
"
8
9
LArWaves2Ntuple::LArWaves2Ntuple
(
const
std::string& name, ISvcLocator* pSvcLocator):
LArCond2NtupleBase
(name, pSvcLocator)
10
{
11
12
declareProperty
(
"SaveDerivedInfo"
,
m_saveDerivedInfo
=
false
);
13
}
14
15
LArWaves2Ntuple::~LArWaves2Ntuple
()
16
=
default
;
17
18
StatusCode
LArWaves2Ntuple::initialize
() {
19
20
StatusCode
sc
=
LArCond2NtupleBase::initialize
();
21
if
(
sc
.isFailure())
22
return
sc
;
23
24
sc
=
m_nt
->addItem(
"flag"
,
m_flag
,0,1000);
25
if
(
sc
!=StatusCode::SUCCESS) {
26
ATH_MSG_ERROR
(
"addItem 'Flag' failed"
);
27
return
StatusCode::FAILURE;
28
}
29
30
sc
=
m_nt
->addItem(
"timeIndex"
,
m_timeIndex
,0,100000);
31
if
(
sc
!=StatusCode::SUCCESS) {
32
ATH_MSG_ERROR
(
"addItem 'timeIndex' failed"
);
33
return
StatusCode::FAILURE;
34
}
35
36
sc
=
m_nt
->addItem(
"Dt"
,
m_dt
,0.,25.);
37
if
(
sc
!=StatusCode::SUCCESS) {
38
ATH_MSG_ERROR
(
"addItem 'Dt' failed"
);
39
return
StatusCode::FAILURE;
40
}
41
42
sc
=
m_nt
->addItem(
"Time"
,
m_timeIndex
,
m_time
);
43
if
(
sc
!=StatusCode::SUCCESS) {
44
ATH_MSG_ERROR
(
"addItem 'Time' failed"
);
45
return
StatusCode::FAILURE;
46
}
47
48
sc
=
m_nt
->addItem(
"Amplitude"
,
m_timeIndex
,
m_ampliPulse
);
49
if
(
sc
!=StatusCode::SUCCESS) {
50
ATH_MSG_ERROR
(
"addItem failed"
);
51
return
StatusCode::FAILURE;
52
}
53
54
sc
=
m_nt
->addItem(
"Error"
,
m_timeIndex
,
m_errorPulse
);
55
if
(
sc
!=StatusCode::SUCCESS) {
56
ATH_MSG_ERROR
(
"addItem 'Error' failed"
);
57
return
StatusCode::FAILURE;
58
}
59
60
sc
=
m_nt
->addItem(
"Triggers"
,
m_timeIndex
,
m_triggers
);
61
if
(
sc
!=StatusCode::SUCCESS) {
62
ATH_MSG_ERROR
(
"addItem 'Triggers' failed"
);
63
return
StatusCode::FAILURE;
64
}
65
66
if
(
m_saveDerivedInfo
) {
67
sc
=
m_nt
->addItem(
"Baseline"
,
m_baseline
,0.,1200.);
68
if
(
sc
!=StatusCode::SUCCESS) {
69
ATH_MSG_ERROR
(
"addItem 'Baseline' failed"
);
70
return
StatusCode::FAILURE;
71
}
72
73
sc
=
m_nt
->addItem(
"TmaxAmp"
,
m_tmaxAmp
,0.,4095.);
74
if
(
sc
!=StatusCode::SUCCESS) {
75
ATH_MSG_ERROR
(
"addItem 'TmaxAmp' failed"
);
76
return
StatusCode::FAILURE;
77
}
78
79
sc
=
m_nt
->addItem(
"MaxAmp"
,
m_maxAmp
,0.,4095.);
80
if
(
sc
!=StatusCode::SUCCESS) {
81
ATH_MSG_ERROR
(
"addItem 'MaxAmp' failed"
);
82
return
StatusCode::FAILURE;
83
}
84
85
sc
=
m_nt
->addItem(
"PosLobe"
,
m_posLobe
,0.,100.);
86
if
(
sc
!=StatusCode::SUCCESS) {
87
ATH_MSG_ERROR
(
"addItem 'PosLobe' failed"
);
88
return
StatusCode::FAILURE;
89
}
90
91
sc
=
m_nt
->addItem(
"T0"
,
m_rT0
,20.,100.);
92
if
(
sc
!=StatusCode::SUCCESS) {
93
ATH_MSG_ERROR
(
"addItem 'RT0' failed"
);
94
return
StatusCode::FAILURE;
95
}
96
97
sc
=
m_nt
->addItem(
"Width"
,
m_width
,0.,125.);
98
if
(
sc
!=StatusCode::SUCCESS) {
99
ATH_MSG_ERROR
(
"addItem 'Width' failed"
);
100
return
StatusCode::FAILURE;
101
}
102
}
103
return
StatusCode::SUCCESS;
104
}
105
106
107
bool
LArWaves2Ntuple::fillWave
(
const
HWIdentifier
chid,
const
LArWaveCumul
& wave) {
108
fillFromIdentifier
(chid);
109
m_flag
= wave.
getFlag
();
110
m_dt
= wave.
getDt
();
111
112
for
(
m_timeIndex
=0;
m_timeIndex
<(long)wave.
getSize
();
m_timeIndex
++ ) {
113
m_time
[
m_timeIndex
] = wave.
getTime
(
m_timeIndex
);
114
m_ampliPulse
[
m_timeIndex
] = wave.
getSample
(
m_timeIndex
);
115
m_errorPulse
[
m_timeIndex
] = wave.
getError
(
m_timeIndex
);
116
m_triggers
[
m_timeIndex
] = wave.
getTrigger
(
m_timeIndex
);
117
}
118
119
if
(
m_saveDerivedInfo
) {
// additional (derived) information, computed on the fly...
120
m_baseline
=
m_waveHelper
.getBaseline(wave,10);
121
m_maxAmp
=
m_waveHelper
.getMaxAmp(wave);
122
// please note the 'dt' normalization in the following!
123
m_tmaxAmp
=
m_dt
*
m_waveHelper
.getMax(wave);
124
m_width
=
m_dt
*
m_waveHelper
.getWidth(wave);
125
m_rT0
=
m_dt
*
m_waveHelper
.getT0(wave);
126
m_posLobe
= (
m_maxAmp
!= 0.)? (
m_dt
*
m_waveHelper
.getSumRegion(wave,0,
m_waveHelper
.getZeroCross(wave))/
m_maxAmp
): 0.;
127
}
128
return
true
;
129
}
130
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
LArWaveCumul.h
LArWaves2Ntuple.h
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
HWIdentifier
Definition
HWIdentifier.h:13
LArCond2NtupleBase::initialize
StatusCode initialize()
Definition
LArCond2NtupleBase.cxx:33
LArCond2NtupleBase::m_nt
NTuple::Tuple * m_nt
Definition
LArCond2NtupleBase.h:71
LArCond2NtupleBase::fillFromIdentifier
bool fillFromIdentifier(const HWIdentifier &id)
Definition
LArCond2NtupleBase.cxx:290
LArCond2NtupleBase::LArCond2NtupleBase
LArCond2NtupleBase(const std::string &name, ISvcLocator *pSvcLocator)
Definition
LArCond2NtupleBase.cxx:15
LArWaveCumul
Definition
LArWaveCumul.h:30
LArWaveCumul::getError
double getError(unsigned i) const
error per time bin
Definition
LArWaveCumul.h:143
LArWaveCumul::getTrigger
int getTrigger(unsigned i) const
trigger per time bin
Definition
LArWaveCumul.h:157
LArWave::getTime
double getTime(const unsigned i) const
time
Definition
LArWave.h:172
LArWave::getSize
size_t getSize() const
number of time samples
Definition
LArWave.h:62
LArWave::getSample
const double & getSample(const unsigned int i) const
Amplitude per time bin.
Definition
LArWave.h:53
LArWave::getDt
const double & getDt() const
delta time
Definition
LArWave.h:50
LArWave::getFlag
unsigned getFlag() const
flag: ...
Definition
LArWave.h:178
LArWaves2Ntuple::m_width
NTuple::Item< double > m_width
Definition
LArWaves2Ntuple.h:53
LArWaves2Ntuple::m_ampliPulse
NTuple::Array< double > m_ampliPulse
Definition
LArWaves2Ntuple.h:43
LArWaves2Ntuple::m_triggers
NTuple::Array< int > m_triggers
Definition
LArWaves2Ntuple.h:45
LArWaves2Ntuple::m_waveHelper
LArWaveHelper m_waveHelper
Definition
LArWaves2Ntuple.h:56
LArWaves2Ntuple::initialize
StatusCode initialize()
Definition
LArWaves2Ntuple.cxx:18
LArWaves2Ntuple::m_errorPulse
NTuple::Array< double > m_errorPulse
Definition
LArWaves2Ntuple.h:44
LArWaves2Ntuple::m_tmaxAmp
NTuple::Item< double > m_tmaxAmp
Definition
LArWaves2Ntuple.h:48
LArWaves2Ntuple::~LArWaves2Ntuple
~LArWaves2Ntuple()
LArWaves2Ntuple::m_time
NTuple::Array< double > m_time
Definition
LArWaves2Ntuple.h:42
LArWaves2Ntuple::m_rT0
NTuple::Item< double > m_rT0
Definition
LArWaves2Ntuple.h:52
LArWaves2Ntuple::m_dt
NTuple::Item< double > m_dt
Definition
LArWaves2Ntuple.h:41
LArWaves2Ntuple::m_baseline
NTuple::Item< double > m_baseline
Definition
LArWaves2Ntuple.h:50
LArWaves2Ntuple::LArWaves2Ntuple
LArWaves2Ntuple(const std::string &name, ISvcLocator *pSvcLocator)
Definition
LArWaves2Ntuple.cxx:9
LArWaves2Ntuple::fillWave
bool fillWave(const HWIdentifier chid, const LArWaveCumul &wave)
Definition
LArWaves2Ntuple.cxx:107
LArWaves2Ntuple::m_flag
NTuple::Item< long > m_flag
Definition
LArWaves2Ntuple.h:39
LArWaves2Ntuple::m_maxAmp
NTuple::Item< double > m_maxAmp
Definition
LArWaves2Ntuple.h:49
LArWaves2Ntuple::m_saveDerivedInfo
bool m_saveDerivedInfo
Definition
LArWaves2Ntuple.h:37
LArWaves2Ntuple::m_posLobe
NTuple::Item< double > m_posLobe
Definition
LArWaves2Ntuple.h:51
LArWaves2Ntuple::m_timeIndex
NTuple::Item< long > m_timeIndex
Definition
LArWaves2Ntuple.h:40
Generated on
for ATLAS Offline Software by
1.17.0