ATLAS Offline Software
TrigMonAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGMON_ALG_H
6 #define TRIGMON_ALG_H
7 
18 // Framework
19 #include "AthenaKernel/CLASS_DEF.h"
20 
21 // C/C++
22 #include <stdint.h>
23 #include <set>
24 #include <vector>
25 
26 // Local
28 
30 {
31  public:
32 
33  TrigMonAlg();
34  TrigMonAlg(unsigned int position, bool is_cached);
36 
37  void addTimer(const TrigMonTimer &tbeg, const TrigMonTimer &tend);
38  void addRoiId(unsigned int roiId);
39  void addWord(unsigned int word);
40 
41  uint8_t getPosition() const;
42  uint8_t getNRoi() const;
43  uint8_t getRoiId(unsigned int i = 0) const;
44 
45  const std::set<uint8_t> getRoiIdSet() const;
46 
47  bool isCached() const;
48  bool isCalled() const;
49 
50  const std::vector<uint8_t>& getByte() const { return m_byte; }
51  const std::vector<uint32_t>& getWord() const { return m_word; }
52 
53  const TrigMonTimer start() const;
54  const TrigMonTimer stop() const;
55 
56  double getTimer() const { return stop().getElapsed(start()); }
57  double elapsed() const { return stop().getElapsed(start()); }
58 
59  private:
60  friend class TrigMonAlgCnv_p1;
61 
62  std::vector<uint8_t> m_byte; // Encoded bytes: position, caching state, rois
63  std::vector<uint32_t> m_word; // Encoded words: first two entries are timers)
64 };
65 
66 std::string str(const TrigMonAlg &);
67 
68 //
69 // Note: getPosition() returns a position at which this algorithm is executed
70 // by a parent sequence. TrigMonAlg is held by TrigMonSeq which uniquely
71 // identifies the parent sequence. There should be no more than 128 algorithms
72 // in a sequence since top bit stores cached state of this algorithm call.
73 //
74 
75 //
76 // m_byte[0] = encoded position and cache bit
77 // m_byte[i] = roi id, i = 1,..
78 //
79 // m_word[0] = encoded TrigMonTimer for start time
80 // m_word[1] = encoded TrigMonTimer for stop time
81 // m_word[i] = free, i =2, ...
82 //
83 // TODO: m_byte and m_word should really be merged together
84 //
85 
86 CLASS_DEF( TrigMonAlg , 254413856 , 1 )
87 
88 #endif
TrigMonAlg::isCached
bool isCached() const
Definition: TrigMonAlg.cxx:136
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
TrigMonAlg::getRoiId
uint8_t getRoiId(unsigned int i=0) const
Definition: TrigMonAlg.cxx:116
TrigMonAlg::getNRoi
uint8_t getNRoi() const
Definition: TrigMonAlg.cxx:107
TrigMonAlg::getByte
const std::vector< uint8_t > & getByte() const
Definition: TrigMonAlg.h:50
TrigMonAlg::~TrigMonAlg
~TrigMonAlg()
Definition: TrigMonAlg.h:35
TrigMonAlg::addRoiId
void addRoiId(unsigned int roiId)
Definition: TrigMonAlg.cxx:68
TrigMonAlg::elapsed
double elapsed() const
Definition: TrigMonAlg.h:57
TrigMonTimer
Definition: TrigMonTimer.h:27
TrigMonAlg::getRoiIdSet
const std::set< uint8_t > getRoiIdSet() const
Definition: TrigMonAlg.cxx:127
TrigMonAlg::addWord
void addWord(unsigned int word)
Definition: TrigMonAlg.cxx:83
python.TriggerHandler.tend
string tend
Definition: TriggerHandler.py:300
TrigMonAlg::stop
const TrigMonTimer stop() const
Definition: TrigMonAlg.cxx:167
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigMonTimer::getElapsed
double getElapsed(const TrigMonTimer &start) const
Definition: TrigMonTimer.cxx:75
TrigMonAlgCnv_p1
Definition: TrigMonAlgCnv_p1.h:16
TrigMonAlg::m_word
std::vector< uint32_t > m_word
Definition: TrigMonAlg.h:63
xAOD::roiId
setTeId setLumiBlock roiId
Definition: L2StandAloneMuon_v1.cxx:331
str
std::string str(const TrigMonAlg &)
Definition: TrigMonAlg.cxx:180
TrigMonAlg::m_byte
std::vector< uint8_t > m_byte
Definition: TrigMonAlg.h:62
TrigMonAlg::addTimer
void addTimer(const TrigMonTimer &tbeg, const TrigMonTimer &tend)
Definition: TrigMonAlg.cxx:47
TrigMonAlg::getWord
const std::vector< uint32_t > & getWord() const
Definition: TrigMonAlg.h:51
TrigMonAlg::getTimer
double getTimer() const
Definition: TrigMonAlg.h:56
TrigMonAlg::isCalled
bool isCalled() const
Definition: TrigMonAlg.cxx:145
TrigMonTimer.h
TrigMonAlg::start
const TrigMonTimer start() const
Definition: TrigMonAlg.cxx:154
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
TrigMonAlg::TrigMonAlg
TrigMonAlg()
Definition: TrigMonAlg.cxx:21
TrigMonAlg::getPosition
uint8_t getPosition() const
Definition: TrigMonAlg.cxx:98
TrigMonAlg
Summary of single agorithm execution. Algorithm is identified by position within parent sequence....
Definition: TrigMonAlg.h:30
CLASS_DEF.h
macros to associate a CLID to a type