ATLAS Offline Software
Loading...
Searching...
No Matches
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
17
18// Framework
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
66std::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
86CLASS_DEF( TrigMonAlg , 254413856 , 1 )
87
88#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Summary of single agorithm execution. Algorithm is identified by position within parent sequence....
Definition TrigMonAlg.h:30
const std::vector< uint8_t > & getByte() const
Definition TrigMonAlg.h:50
uint8_t getNRoi() const
void addTimer(const TrigMonTimer &tbeg, const TrigMonTimer &tend)
uint8_t getRoiId(unsigned int i=0) const
bool isCached() const
const std::vector< uint32_t > & getWord() const
Definition TrigMonAlg.h:51
const TrigMonTimer stop() const
std::vector< uint8_t > m_byte
Definition TrigMonAlg.h:62
const std::set< uint8_t > getRoiIdSet() const
void addWord(unsigned int word)
double elapsed() const
Definition TrigMonAlg.h:57
void addRoiId(unsigned int roiId)
bool isCalled() const
const TrigMonTimer start() const
friend class TrigMonAlgCnv_p1
Definition TrigMonAlg.h:60
double getTimer() const
Definition TrigMonAlg.h:56
uint8_t getPosition() const
std::vector< uint32_t > m_word
Definition TrigMonAlg.h:63
double getElapsed(const TrigMonTimer &start) const