ATLAS Offline Software
Loading...
Searching...
No Matches
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
14#include <vector>
15
17
18class 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
84CLASS_DEF( LArOFCFlat, 20294702, 1)
86
87
88#endif
Hold mappings of ranges to condition objects.
#define CONDCONT_DEF(...)
Definition CondCont.h:1413
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Defines a common ERRORCODE enum for LAr-Calibration objects.
This class is a collection of AttributeLists where each one is associated with a channel number.
LArVectorProxy OFCRef_t
This class defines the interface for accessing Optimal Filtering coefficients for each channel provid...
Definition ILArOFC.h:26
This is a "hash" representation of an Identifier.
LArCondFlatBase(const std::string &name)
virtual OFCRef_t OFC_b(const HWIdentifier &CellID, int gain, int tbin=0) const
virtual unsigned nTimeBins(const HWIdentifier &CellID, int gain) const
virtual float timeOffset(const HWIdentifier &CellID, int gain) const
unsigned m_nSamples
Definition LArOFCFlat.h:80
unsigned m_nChannels
Definition LArOFCFlat.h:79
OFCRef_t OFC_a(const IdentifierHash &hs, int gain) const
Definition LArOFCFlat.h:46
OFCRef_t OFC_b(const IdentifierHash &hs, int gain) const
Definition LArOFCFlat.h:54
virtual ~LArOFCFlat()
ILArOFC::OFCRef_t OFCRef_t
Definition LArOFCFlat.h:24
std::vector< const float * > m_pOFCa
Definition LArOFCFlat.h:75
std::vector< const float * > m_pOFCb
Definition LArOFCFlat.h:76
bool good() const
Definition LArOFCFlat.h:30
virtual float timeBinWidth(const HWIdentifier &CellID, int gain) const
std::vector< const float * > m_pTimeOffset
Definition LArOFCFlat.h:77
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)