ATLAS Offline Software
LArOFCFlat.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //Dear emacs, this is -*-c++-*-
6 #ifndef LARCOOLCONDITIONS_LAROFCFLAT_H
7 #define LARCOOLCONDITIONS_LAROFCFLAT_H
8 
9 #include "LArElecCalib/ILArOFC.h"
14 #include <vector>
15 
17 
18 class LArOFCFlat: public ILArOFC, public LArCondFlatBase {
19 
20  private:
21  LArOFCFlat();
22 
23  public:
26 
27  LArOFCFlat(const CondAttrListCollection* attrList);
28  virtual ~LArOFCFlat( );
29 
30  bool good() const { return m_isInitialized && m_nChannels>0; }
31 
32 
33 
34  // retrieving coefficients using online ID
35 
36  virtual OFCRef_t OFC_a(const HWIdentifier& CellID,
37  int gain,
38  int tbin=0) const ;
39 
40  virtual OFCRef_t OFC_b(const HWIdentifier& CellID,
41  int gain,
42  int tbin=0) const ;
43 
44 
45 
46  OFCRef_t OFC_a(const IdentifierHash& hs,int gain) const {
47  const float* pStart=m_pOFCa[gain]+(hs*m_nSamples);
48  if (*pStart==static_cast<float>(ERRORCODE))
49  return OFCRef_t(NULL,NULL);
50  else
51  return OFCRef_t(pStart,pStart+m_nSamples);
52  }
53 
54  OFCRef_t OFC_b(const IdentifierHash& hs,int gain) const {
55  const float* pStart=m_pOFCb[gain]+(hs*m_nSamples);
56  if (*pStart==static_cast<float>(ERRORCODE))
57  return OFCRef_t(NULL,NULL);
58  else
59  return OFCRef_t(pStart,pStart+m_nSamples);
60  }
61 
62 
63  // retrieving time offset using online/offline ID
64 
65  virtual float timeOffset(const HWIdentifier& CellID, int gain) const;
66 
67  //For the TB / cosmic case: retrieve the number of time-bins (aka "phases")
68  virtual unsigned nTimeBins(const HWIdentifier& CellID, int gain) const;
69 
70  //For the TB / cosmic case: retrieve the witdth of the time bin (default 24 bins in 25 ns)
71  virtual float timeBinWidth(const HWIdentifier& CellID, int gain) const;
72 
73 
74  private:
75  std::vector<const float*> m_pOFCa;
76  std::vector<const float*> m_pOFCb;
77  std::vector<const float*> m_pTimeOffset;
78 
79  unsigned m_nChannels;
80  unsigned m_nSamples;
81 };
82 
83 #include "AthenaKernel/CondCont.h"
84 CLASS_DEF( LArOFCFlat, 20294702, 1)
86 
87 
88 #endif
LArOFCFlat::m_pTimeOffset
std::vector< const float * > m_pTimeOffset
Definition: LArOFCFlat.h:77
CondCont.h
Hold mappings of ranges to condition objects.
LArCondFlatBase
Definition: LArCondFlatBase.h:15
LArOFCFlat::ERRORCODE
@ ERRORCODE
Definition: LArOFCFlat.h:25
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArOFCFlat::m_pOFCb
std::vector< const float * > m_pOFCb
Definition: LArOFCFlat.h:76
LArOFCFlat::OFC_b
virtual OFCRef_t OFC_b(const HWIdentifier &CellID, int gain, int tbin=0) const
Definition: LArOFCFlat.cxx:83
LArCondFlatBase::m_isInitialized
bool m_isInitialized
Definition: LArCondFlatBase.h:23
ILArOFC.h
LArOFCFlat::m_nSamples
unsigned m_nSamples
Definition: LArOFCFlat.h:80
HWIdentifier
Definition: HWIdentifier.h:13
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
LArCalibErrorCode.h
Defines a common ERRORCODE enum for LAr-Calibration objects.
LArOFCFlat::nTimeBins
virtual unsigned nTimeBins(const HWIdentifier &CellID, int gain) const
Definition: LArOFCFlat.cxx:94
LArOFCFlat::m_pOFCa
std::vector< const float * > m_pOFCa
Definition: LArOFCFlat.h:75
LArOFCFlat::timeBinWidth
virtual float timeBinWidth(const HWIdentifier &CellID, int gain) const
Definition: LArOFCFlat.cxx:99
LArOFCFlat::OFCRef_t
ILArOFC::OFCRef_t OFCRef_t
Definition: LArOFCFlat.h:24
CONDCONT_DEF
CONDCONT_DEF(LArOFCFlat, 117247562, ILArOFC)
LArOFCFlat::good
bool good() const
Definition: LArOFCFlat.h:30
LArOFCFlat::LArOFCFlat
LArOFCFlat()
Definition: LArOFCFlat.cxx:9
CreatePhysValWebPage.hs
hs
Definition: CreatePhysValWebPage.py:107
LArOFCFlat
Definition: LArOFCFlat.h:18
LArCondFlatBase.h
LArOFCFlat::~LArOFCFlat
virtual ~LArOFCFlat()
Definition: LArOFCFlat.cxx:15
ILArOFC
Definition: ILArOFC.h:14
LArOFCFlat::OFC_a
OFCRef_t OFC_a(const IdentifierHash &hs, int gain) const
Definition: LArOFCFlat.h:46
IdentifierHash.h
LArOFCFlat::m_nChannels
unsigned m_nChannels
Definition: LArOFCFlat.h:79
LArOFCFlat::OFC_b
OFCRef_t OFC_b(const IdentifierHash &hs, int gain) const
Definition: LArOFCFlat.h:54
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
LArElecCalib::ERRORCODE
@ ERRORCODE
Definition: LArCalibErrorCode.h:17
LArOFCFlat::timeOffset
virtual float timeOffset(const HWIdentifier &CellID, int gain) const
Definition: LArOFCFlat.cxx:88
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
LArOnlineID.h
LArVectorProxy
Proxy for accessing a range of float values like a vector.
Definition: LArVectorProxy.h:38
LArOFCFlat::OFC_a
virtual OFCRef_t OFC_a(const HWIdentifier &CellID, int gain, int tbin=0) const
access to OFCs by online ID, gain, and tbin (!=0 for testbeam)
Definition: LArOFCFlat.cxx:78