ATLAS Offline Software
L1CaloBsDecoderUtil.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef L1CALO_BS_DECODER_UTIL_H
5 #define L1CALO_BS_DECODER_UTIL_H
6 
7 #include <list>
8 
9 class L1CaloRdoRodInfo;
10 
11 namespace eformat {
12  template <class TPointer> class ROBFragment;
13 }
14 
16 {
17 public:
18 
20  std::list<L1CaloRdoRodInfo>& dat );
21 
22  template <typename Tar, typename Dat, typename Iter>
23  static Tar& findRdo( const Tar& target, Dat& data, Iter begin, Iter end );
24 
25  template <typename Tar, typename Dat>
26  static Tar& findRdo( const Tar& target, Dat& data );
27 
28 private:
30 };
31 
32 template <typename Tar, typename Dat, typename Iter> Tar&
33 L1CaloBsDecoderUtil::findRdo( const Tar& target, Dat& data, Iter begin, Iter end )
34 {
35  while ( (begin != end) && ( target < (*begin) ) )
36  ++begin;
37 
38  if ( begin == end )
39  return *(data.insert( end.base(), target ));
40 
41  if ( begin->sameDatum( target ) )
42  return *begin;
43 
44  return *(data.insert( begin.base(), target ));
45 }
46 
47 template <typename Tar, typename Dat> Tar&
49 {
50  return findRdo( target, data, data.rbegin(), data.rend() );
51 }
52 
53 #endif
54 
eformat
Definition: L1CaloBsDecoderUtil.h:11
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
L1CaloBsDecoderUtil
Definition: L1CaloBsDecoderUtil.h:16
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
L1CaloRdoRodInfo
Definition: L1CaloRdoRodInfo.h:11
L1CaloBsDecoderUtil::L1CaloBsDecoderUtil
L1CaloBsDecoderUtil()
Definition: L1CaloBsDecoderUtil.cxx:17
eformat::ROBFragment
Definition: L1CaloBsDecoderUtil.h:12
RunTileMonitoring.rod
rod
Definition: RunTileMonitoring.py:134
copySelective.target
string target
Definition: copySelective.py:37
L1CaloBsDecoderUtil::findRdo
static Tar & findRdo(const Tar &target, Dat &data, Iter begin, Iter end)
Definition: L1CaloBsDecoderUtil.h:33
L1CaloBsDecoderUtil::decodeRodInfo
static void decodeRodInfo(const eformat::ROBFragment< const uint32_t * > *rod, std::list< L1CaloRdoRodInfo > &dat)
Definition: L1CaloBsDecoderUtil.cxx:22