ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArRawConditions
src
LArShapeComplete.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
#include "
LArRawConditions/LArShapeComplete.h
"
7
8
const
std::vector<float>
LArShapeComplete::m_empty
;
9
10
LArShapeComplete::LArShapeComplete
(){
11
}
12
13
LArShapeComplete::~LArShapeComplete
() {}
14
15
/* Fill transient object in ATHENA *****************************************
16
*/
17
void
LArShapeComplete::set
(
const
HWIdentifier
& CellID,
int
gain,
18
const
std::vector<std::vector<float> >& vShape,
19
const
std::vector<std::vector<float> >& vShapeDer,
20
float
timeOffset
,
float
timeBinWidth
)
21
{
22
LArShapeP2
t (
timeOffset
,
timeBinWidth
, vShape, vShapeDer);
23
setPdata
(CellID, t, gain) ;
24
}
25
26
/* retrieve Shape for a given tbin using online ID ****************************
27
*/
28
LArShapeComplete::ShapeRef_t
29
LArShapeComplete::Shape
(
const
HWIdentifier
& CellID,
30
int
gain,
31
int
tbin,
32
int
/*mode*/
)
const
33
{
34
// 'mode' setting is ignored
35
CONTAINER::ConstReference
t =
get
(CellID,gain) ;
36
if
(!t.isValid() || tbin<0 || tbin>=(
int
)t.shapeSize())
37
return
m_empty
;
38
return
t.shape (tbin);
39
}
40
41
/* retrieve Shape derivative for a given tbin using online ID ****************************
42
*/
43
LArShapeComplete::ShapeRef_t
44
LArShapeComplete::ShapeDer
(
const
HWIdentifier
& CellID,
45
int
gain,
46
int
tbin,
47
int
/*mode*/
)
const
48
{
49
// 'mode' setting is ignored
50
CONTAINER::ConstReference
t =
get
(CellID,gain) ;
51
if
(!t.isValid() || tbin<0 || tbin>=(
int
)t.shapeDerSize())
52
return
m_empty
;
53
return
t.shapeDer (tbin);
54
}
55
56
57
58
//retrieving time offset using onlineID
59
float
LArShapeComplete::timeOffset
(
const
HWIdentifier
& CellID,
int
gain)
const
{
60
if
(gain<0 || gain>3) {
61
std::cout <<
"ERROR! LArShapeComplete::timeOffset time offset called for gain "
<< gain << std::endl;
62
std::cout.flush();
63
return
0;
64
}
65
66
CONTAINER::ConstReference
t =
get
(CellID,gain) ;
67
if
(!t.isValid())
return
0;
68
return
t.timeOffset();
69
}
70
71
//For the TB / cosmic case: retrieve the number of time-bins (aka "phases")
72
unsigned
LArShapeComplete::nTimeBins
(
const
HWIdentifier
& CellID,
int
gain)
const
{
73
if
(gain<0 || gain>3) {
74
std::cout <<
"ERROR! LArShapeComplete::nTimeBins time offset called for gain "
<< gain << std::endl;
75
std::cout.flush();
76
}
77
CONTAINER::ConstReference
t =
get
(CellID,gain) ;
78
if
(!t.isValid())
return
0;
79
return
t.shapeSize();
//Check also b-coefficient?
80
}
81
82
//For the TB / cosmic case: retrieve the width of the time bin (default 24 bins in 25 ns)
83
float
LArShapeComplete::timeBinWidth
(
const
HWIdentifier
& CellID,
int
gain)
const
{
84
if
(gain<0 || gain>3) {
85
std::cout <<
"ERROR! LArShapeComplete::timeBinWidth time offset called for gain "
<< gain << std::endl;
86
std::cout.flush();
87
}
88
CONTAINER::ConstReference
t =
get
(CellID,gain) ;
89
if
(!t.isValid())
return
0;
90
return
t.timeBinWidth();
91
}
LArShapeComplete.h
HWIdentifier
Definition
HWIdentifier.h:13
LArConditionsContainer< LArShapeP2 >::setPdata
void setPdata(const HWIdentifier id, const LArShapeP2 &payload, unsigned int gain=0)
LArConditionsContainer< LArShapeP2 >::get
ConstReference get(const HWIdentifier id, unsigned int gain=0) const
LArConditionsContainer< LArShapeP2 >::ConstReference
Subset::ConstReference ConstReference
Definition
LArConditionsContainer.h:80
LArShapeComplete::set
void set(const HWIdentifier &CellID, int gain, const std::vector< std::vector< float > > &vShape, const std::vector< std::vector< float > > &vShapeDer, float timeOffset=0, float timeBinWidth=25./24.)
Definition
LArShapeComplete.cxx:17
LArShapeComplete::LArShapeComplete
LArShapeComplete()
Definition
LArShapeComplete.cxx:10
LArShapeComplete::~LArShapeComplete
virtual ~LArShapeComplete()
Definition
LArShapeComplete.cxx:13
LArShapeComplete::ShapeDer
virtual ShapeRef_t ShapeDer(const HWIdentifier &CellID, int gain, int tbin=0, int mode=0) const override
Definition
LArShapeComplete.cxx:44
LArShapeComplete::timeBinWidth
virtual float timeBinWidth(const HWIdentifier &CellID, int gain) const
Definition
LArShapeComplete.cxx:83
LArShapeComplete::nTimeBins
virtual unsigned nTimeBins(const HWIdentifier &CellID, int gain) const
Definition
LArShapeComplete.cxx:72
LArShapeComplete::timeOffset
virtual float timeOffset(const HWIdentifier &CellID, int gain) const
Definition
LArShapeComplete.cxx:59
LArShapeComplete::Shape
virtual ShapeRef_t Shape(const HWIdentifier &CellID, int gain, int tbin=0, int mode=0) const override
Definition
LArShapeComplete.cxx:29
LArShapeComplete::m_empty
static const std::vector< float > m_empty
Definition
LArShapeComplete.h:67
LArShapeComplete::ShapeRef_t
ILArShape::ShapeRef_t ShapeRef_t
Definition
LArShapeComplete.h:30
LArShapeP2
c-struct reproducing the structure of the persistent data
Definition
LArShapeP2.h:21
Generated on
for ATLAS Offline Software by
1.17.0