ATLAS Offline Software
LArOFCSC.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_LAROFCSC_H
7 #define LARCOOLCONDITIONS_LAROFCSC_H
8 
9 #include "LArElecCalib/ILArOFC.h"
14 #include <vector>
15 
17 
18 class LArOFCSC: public ILArOFC, public LArCondSuperCellBase {
19 
20  private:
21  LArOFCSC();
22 
23  public:
26 
27  LArOFCSC(const CondAttrListCollection* attrList);
28  virtual ~LArOFCSC( );
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==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==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( LArOFCSC, 12142771, 1)
86 
87 
88 #endif
LArOFCSC::m_pOFCb
std::vector< const float * > m_pOFCb
Definition: LArOFCSC.h:76
CondCont.h
Hold mappings of ranges to condition objects.
LArOFCSC::good
bool good() const
Definition: LArOFCSC.h:30
LArOFCSC::m_pTimeOffset
std::vector< const float * > m_pTimeOffset
Definition: LArOFCSC.h:77
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArOFCSC::OFC_b
OFCRef_t OFC_b(const IdentifierHash &hs, int gain) const
Definition: LArOFCSC.h:54
ILArOFC.h
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.
LArOFCSC::OFC_a
OFCRef_t OFC_a(const IdentifierHash &hs, int gain) const
Definition: LArOFCSC.h:46
LArOFCSC::~LArOFCSC
virtual ~LArOFCSC()
Definition: LArOFCSC.cxx:16
CreatePhysValWebPage.hs
hs
Definition: CreatePhysValWebPage.py:107
LArOFCSC::OFCRef_t
ILArOFC::OFCRef_t OFCRef_t
Definition: LArOFCSC.h:24
LArOFCSC::m_nSamples
unsigned m_nSamples
Definition: LArOFCSC.h:80
LArOFCSC
Definition: LArOFCSC.h:18
CONDCONT_DEF
CONDCONT_DEF(LArOFCSC, 41952481, ILArOFC)
LArOFCSC::timeBinWidth
virtual float timeBinWidth(const HWIdentifier &CellID, int gain) const
Definition: LArOFCSC.cxx:101
LArOFCSC::nTimeBins
virtual unsigned nTimeBins(const HWIdentifier &CellID, int gain) const
Definition: LArOFCSC.cxx:96
LArOFCSC::OFC_b
virtual OFCRef_t OFC_b(const HWIdentifier &CellID, int gain, int tbin=0) const
Definition: LArOFCSC.cxx:85
ILArOFC
Definition: ILArOFC.h:14
LArCondSuperCellBase
Definition: LArCondSuperCellBase.h:19
IdentifierHash.h
LArOFCSC::m_pOFCa
std::vector< const float * > m_pOFCa
Definition: LArOFCSC.h:75
LArOFCSC::m_nChannels
unsigned m_nChannels
Definition: LArOFCSC.h:79
LArOFCSC::LArOFCSC
LArOFCSC()
Definition: LArOFCSC.cxx:9
LArCondSuperCellBase.h
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
LArOFCSC::timeOffset
virtual float timeOffset(const HWIdentifier &CellID, int gain) const
Definition: LArOFCSC.cxx:90
IdentifierHash
Definition: IdentifierHash.h:38
LArCondSuperCellBase::m_isInitialized
bool m_isInitialized
Definition: LArCondSuperCellBase.h:26
LArOnlineID.h
LArVectorProxy
Proxy for accessing a range of float values like a vector.
Definition: LArVectorProxy.h:38
LArOFCSC::ERRORCODE
@ ERRORCODE
Definition: LArOFCSC.h:25
LArOFCSC::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: LArOFCSC.cxx:80