ATLAS Offline Software
Lvl1ItemsAndRoIs.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /**********************************************************************************
6  * @class : ConfigThreshold, ConfigJetEThreshold,
7  * HLTRoI, MuonRoI, EMTauRoI, JetEnergyRoI
8  *
9  * @brief LVL1 RoI and Item data classes which are filled by the Lvl1ResultAccessTool.
10  *
11  * @author Nicolas Berger <Nicolas.Berger@cern.ch> - CERN
12  * @author Till Eifert <Till.Eifert@cern.ch>
13  **********************************************************************************/
14 
15 #ifndef TRIGDECISIONMAKER_LVL1ITEMSANDROIS_H
16 #define TRIGDECISIONMAKER_LVL1ITEMSANDROIS_H
17 
18 #include "TrigT1Result/MuCTPIRoI.h"
19 #include "TrigT1Result/EMTauRoI.h"
21 
22 #include <vector>
23 #include <string>
24 
25 
26 namespace HLT {
27 
29 
33  struct ConfigThreshold {
34  ConfigThreshold(const std::string& n = "", unsigned int h=0, bool a = false, uint32_t m = 0)
35  : name(n), hashId(h), activeHLT(a), mask(m) { }
36  std::string name;
37  unsigned int hashId;
38  bool activeHLT;
39  uint32_t mask;
40  };
41 
46  ConfigJetEThreshold(const std::string& n = "", unsigned int h=0, bool a = false, uint32_t m = 0, JetRoIType t = Unknown)
47  : ConfigThreshold(n, h, a, m), type(t) { }
49  };
50 
55  template<class R> class HLTRoI {
56  public :
58 
59  const R& lvl1RoI() const { return m_lvl1RoI; }
60  const std::vector<const ConfigThreshold*>& thresholds() const { return m_thresholds; }
61  std::vector<const ConfigThreshold*>::const_iterator begin() const { return m_thresholds.begin(); }
62  std::vector<const ConfigThreshold*>::const_iterator end() const { return m_thresholds.end(); }
63  unsigned int size() const { return m_thresholds.size(); }
64  unsigned int thresholdMask() const { return m_thresholdMask; }
65 
66  protected:
67  void addThreshold(const ConfigThreshold* t) { m_thresholds.push_back(t); }
68  void setThresholdMask(unsigned int mask) { m_thresholdMask = mask; } // Update threshold mask word
69 
71  std::vector<const ConfigThreshold*> m_thresholds;
72  unsigned int m_thresholdMask;
73  };
74 
75 
79  class MuonRoI : public HLTRoI<ROIB::MuCTPIRoI> {
80  public :
82  m_thresholdMask = 0;
83  }
84  friend class Lvl1ResultAccessTool;
85  };
86 
90  class EMTauRoI : public HLTRoI<ROIB::EMTauRoI> {
91  public :
93  if ( m_lvl1RoI.roIType() == 0 ) m_thresholdMask = (m_lvl1RoI.roIWord() & 0xffff); // Valid for Run 1 RoIs
94  else m_thresholdMask = 0;
95  }
96  friend class Lvl1ResultAccessTool;
97  };
98 
102  class JetEnergyRoI : public HLTRoI<ROIB::JetEnergyRoI> {
103  public :
106 
107  if ( m_lvl1RoI.jetRoIVersion() == 1 ) m_thresholdMask = (m_lvl1RoI.roIWord() & 0xfff);
108  else m_thresholdMask = 0;
109 
110  }
111 
112  friend class Lvl1ResultAccessTool;
113 
114  JetRoIType type() const { return m_type; }
115  uint32_t word0() const { return m_word0; }
116  uint32_t word1() const { return m_word1; }
117  uint32_t word2() const { return m_word2; }
118 
119  private:
120 
121  bool setType(JetRoIType type) {
122  if ( m_type == Unknown ) {
124  return true;
125  }
127  return true;
128  if ( m_type != type) return false;
129  return true;
130  }
131 
134  return true;
135  }
137  uint32_t m_word0;
138  uint32_t m_word1;
139  uint32_t m_word2;
140 
141  };
142 
143 } // end namespace
144 
145 
146 #endif
HLT::HLTRoI::size
unsigned int size() const
size() method - for thresholds
Definition: Lvl1ItemsAndRoIs.h:71
HLT::MuonRoI::MuonRoI
MuonRoI(ROIB::MuCTPIRoI lvl1RoI)
constructor from MuCTPIRoI object
Definition: Lvl1ItemsAndRoIs.h:89
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
MuCTPIRoI.h
HLT::ConfigThreshold
Definition: Lvl1ItemsAndRoIs.h:41
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
HLT::HLTRoI::m_thresholds
std::vector< const ConfigThreshold * > m_thresholds
vector holding all configured thresholds
Definition: Lvl1ItemsAndRoIs.h:79
JetEnergyRoI.h
HLT::ConfigJetEThreshold
Definition: Lvl1ItemsAndRoIs.h:53
HLT::JetEnergyRoI
Definition: Lvl1ItemsAndRoIs.h:110
HLT::EMTauRoI::EMTauRoI
EMTauRoI(ROIB::EMTauRoI lvl1RoI)
constructor from EMTauRoI object
Definition: Lvl1ItemsAndRoIs.h:100
ROIB::JetEnergyRoI::jetRoIVersion
unsigned int jetRoIVersion() const
Jet RoI version (Run 1 or Run 2)
Definition: JetEnergyRoI.cxx:36
HLT::HLTRoI::m_lvl1RoI
R m_lvl1RoI
underlying LVL1 RoI object
Definition: Lvl1ItemsAndRoIs.h:78
ROIB::MuCTPIRoI
Class for storing the 32-bit muon RoI word.
Definition: MuCTPIRoI.h:39
HLT::JetEnergyRoI::word0
uint32_t word0() const
extra getter: extra RoI word 1
Definition: Lvl1ItemsAndRoIs.h:123
ROIB::JetEnergyRoI
Definition: JetEnergyRoI.h:20
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ROIB
Namespace of the LVL1 RoIB simulation.
Definition: ILvl1ResultAccessTool.h:19
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
HLT::ConfigThreshold::activeHLT
bool activeHLT
is this LVL1 threshold used in HLT ?
Definition: Lvl1ItemsAndRoIs.h:46
HLT::MuonRoI
Definition: Lvl1ItemsAndRoIs.h:87
HLT::HLTRoI::addThreshold
void addThreshold(const ConfigThreshold *t)
add threshold to this RoI object
Definition: Lvl1ItemsAndRoIs.h:75
HLT::JetEnergyRoI::m_type
JetRoIType m_type
additional member: JetRoI type, see JetRoIType enumeration
Definition: Lvl1ItemsAndRoIs.h:144
HLT::ConfigThreshold::name
std::string name
threshold name, e.g.
Definition: Lvl1ItemsAndRoIs.h:44
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
HLT::JetEnergyRoI::m_word2
uint32_t m_word2
additional member: extra RoI word 2
Definition: Lvl1ItemsAndRoIs.h:147
HLT::MissingEtRoI
@ MissingEtRoI
Definition: Lvl1ItemsAndRoIs.h:44
HLT::JetEnergyRoI::m_word0
uint32_t m_word0
additional member: 0th word
Definition: Lvl1ItemsAndRoIs.h:145
beamspotman.n
n
Definition: beamspotman.py:731
HLT::HLTRoI
Definition: Lvl1ItemsAndRoIs.h:63
HLT::HLTRoI::setThresholdMask
void setThresholdMask(unsigned int mask)
Definition: Lvl1ItemsAndRoIs.h:76
HLT::Unknown
@ Unknown
Definition: Lvl1ItemsAndRoIs.h:44
ROIB::EMTauRoI::roIWord
uint32_t roIWord() const
Definition: EMTauRoI.cxx:32
HLT::ConfigThreshold::hashId
unsigned int hashId
hash number of name, to speed up internal usage
Definition: Lvl1ItemsAndRoIs.h:45
HLT::TotalEtRoI
@ TotalEtRoI
Definition: Lvl1ItemsAndRoIs.h:44
HLT::HLTRoI::begin
std::vector< const ConfigThreshold * >::const_iterator begin() const
begin() method - for thresholds
Definition: Lvl1ItemsAndRoIs.h:69
EMTauRoI.h
HLT::HLTRoI::end
std::vector< const ConfigThreshold * >::const_iterator end() const
end() method - for thresholds
Definition: Lvl1ItemsAndRoIs.h:70
ROIB::JetEnergyRoI::roIWord
uint32_t roIWord() const
Method returning the RoI word.
Definition: JetEnergyRoI.cxx:32
HLT::ConfigThreshold::mask
uint32_t mask
bit position of this LVL1 threshold in the RoI word
Definition: Lvl1ItemsAndRoIs.h:47
HLT::JetEnergyRoI::JetEnergyRoI
JetEnergyRoI(ROIB::JetEnergyRoI lvl1RoI)
constructor from JetEnergyRoI object
Definition: Lvl1ItemsAndRoIs.h:112
HLT::JetRoIType
JetRoIType
Definition: Lvl1ItemsAndRoIs.h:36
HLT::JetEnergyRoI::setType
bool setType(JetRoIType type)
setter for JetRoI type
Definition: Lvl1ItemsAndRoIs.h:129
HLT::ConfigJetEThreshold::ConfigJetEThreshold
ConfigJetEThreshold(const std::string &n="", unsigned int h=0, bool a=false, uint32_t m=0, JetRoIType t=Unknown)
Definition: Lvl1ItemsAndRoIs.h:54
HLT::MissingOrTotalEtRoI
@ MissingOrTotalEtRoI
Definition: Lvl1ItemsAndRoIs.h:44
HLT::JetEtRoI
@ JetEtRoI
Definition: Lvl1ItemsAndRoIs.h:44
HLT::EMTauRoI
Definition: Lvl1ItemsAndRoIs.h:98
HLT::Lvl1ResultAccessTool
Definition: Lvl1ResultAccessTool.h:40
ROIB::EMTauRoI
Definition: EMTauRoI.h:20
HLT::HLTRoI::thresholdMask
unsigned int thresholdMask() const
Definition: Lvl1ItemsAndRoIs.h:72
a
TList * a
Definition: liststreamerinfos.cxx:10
HLT::JetEnergyRoI::m_word1
uint32_t m_word1
additional member: extra RoI word 1
Definition: Lvl1ItemsAndRoIs.h:146
HLT::ConfigThreshold::ConfigThreshold
ConfigThreshold(const std::string &n="", unsigned int h=0, bool a=false, uint32_t m=0)
Definition: Lvl1ItemsAndRoIs.h:42
h
HLT::JetEnergyRoI::setExtraWords
bool setExtraWords(uint32_t word0, uint32_t word1, uint32_t word2)
Definition: Lvl1ItemsAndRoIs.h:140
ROIB::EMTauRoI::roIType
unsigned int roIType() const
Return RoI type.
Definition: EMTauRoI.cxx:38
HLT::METSignificanceRoI
@ METSignificanceRoI
Definition: Lvl1ItemsAndRoIs.h:44
HLT::HLTRoI::lvl1RoI
const R & lvl1RoI() const
const reference getter for underlying LVL1 RoI object
Definition: Lvl1ItemsAndRoIs.h:67
HLT::HLTRoI::m_thresholdMask
unsigned int m_thresholdMask
Definition: Lvl1ItemsAndRoIs.h:80
HLT::ConfigJetEThreshold::type
JetRoIType type
JetEnergy type, see JetRoIType enumeration.
Definition: Lvl1ItemsAndRoIs.h:56
HLT::ForwardJetRoI
@ ForwardJetRoI
Definition: Lvl1ItemsAndRoIs.h:44
HLT::JetRoI
@ JetRoI
Definition: Lvl1ItemsAndRoIs.h:44
HLT::HLTRoI::HLTRoI
HLTRoI(R lvl1RoI)
constructor from templated LVL1 RoI object
Definition: Lvl1ItemsAndRoIs.h:65
HLT::JetEnergyRoI::word2
uint32_t word2() const
extra getter: extra RoI word 2
Definition: Lvl1ItemsAndRoIs.h:125
HLT::HLTRoI::thresholds
const std::vector< const ConfigThreshold * > & thresholds() const
const reference getter for configured thresholds
Definition: Lvl1ItemsAndRoIs.h:68
HLT::JetEnergyRoI::type
JetRoIType type() const
extra getter: JetRoI type, see JetRoIType enumeratio
Definition: Lvl1ItemsAndRoIs.h:122
HLT::JetEnergyRoI::word1
uint32_t word1() const
extra getter: extra RoI word 1
Definition: Lvl1ItemsAndRoIs.h:124