ATLAS Offline Software
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 
7 
8 const std::vector<float> LArShapeComplete::m_empty;
9 
11 }
12 
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  */
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  */
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 }
LArConditionsContainer< LArShapeP2 >::setPdata
void setPdata(const HWIdentifier id, const LArShapeP2 &payload, unsigned int gain=0)
put payload in persistent data
LArShapeComplete::timeBinWidth
virtual float timeBinWidth(const HWIdentifier &CellID, int gain) const
Definition: LArShapeComplete.cxx:83
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArShapeComplete.h
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
HWIdentifier
Definition: HWIdentifier.h:13
LArShapeComplete::m_empty
static const std::vector< float > m_empty
Definition: LArShapeComplete.h:67
LArShapeComplete::~LArShapeComplete
virtual ~LArShapeComplete()
Definition: LArShapeComplete.cxx:13
LArShapeComplete::LArShapeComplete
LArShapeComplete()
Definition: LArShapeComplete.cxx:10
LArShapeComplete::timeOffset
virtual float timeOffset(const HWIdentifier &CellID, int gain) const
Definition: LArShapeComplete.cxx:59
LArConditionsContainer< LArShapeP2 >::get
ConstReference get(const HWIdentifier id, unsigned int gain=0) const
get data with online identifier
LArShapeComplete::nTimeBins
virtual unsigned nTimeBins(const HWIdentifier &CellID, int gain) const
Definition: LArShapeComplete.cxx:72
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
LArShapeP2
c-struct reproducing the structure of the persistent data
Definition: LArShapeP2.h:21
LArShapeComplete::ShapeDer
virtual ShapeRef_t ShapeDer(const HWIdentifier &CellID, int gain, int tbin=0, int mode=0) const override
Definition: LArShapeComplete.cxx:44
LArConditionsContainer< LArShapeP2 >::ConstReference
Subset::ConstReference ConstReference
Definition: LArConditionsContainer.h:80
LArShapeComplete::Shape
virtual ShapeRef_t Shape(const HWIdentifier &CellID, int gain, int tbin=0, int mode=0) const override
Definition: LArShapeComplete.cxx:29
LArVectorProxy
Proxy for accessing a range of float values like a vector.
Definition: LArVectorProxy.h:38