ATLAS Offline Software
RoIBResult.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #ifndef TRIGT1RESULT_ROIBRESULT_H
7 #define TRIGT1RESULT_ROIBRESULT_H
8 
9 // STL include(s):
10 #include <vector>
11 
12 // Local include(s):
14 #include "TrigT1Result/CTPResult.h"
18 
19 // Forward declaration(s):
20 class MsgStream;
21 
22 namespace ROIB {
23 
47  class RoIBResult {
48 
49  public:
51  RoIBResult() = default;
52 
55  CTPResult&&,
56  std::vector< JetEnergyResult >&&,
57  std::vector< EMTauResult >&& );
60  std::vector< EMTauResult >&&,
61  std::vector< JetEnergyResult >&& );
63  RoIBResult( CTPResult&&, std::vector< EMTauResult >&& );
65  RoIBResult( CTPResult&& );
66 
68  const MuCTPIResult& muCTPIResult() const;
70  const CTPResult& cTPResult() const;
72  const std::vector< JetEnergyResult >& jetEnergyResult() const;
74  const std::vector< EMTauResult >& eMTauResult() const;
76  const std::vector< L1TopoResult >& l1TopoResult() const;
78  void l1TopoResult(std::vector< L1TopoResult >&&) noexcept;
79 
81 
82  const std::string dump() const;
83 
85  const std::string print(const bool longFormat = false) const;
86 
88  void dumpData() const;
90  void dumpData(MsgStream&) const;
91 
92  /* definitions used for overflow checking */
93  enum {EM1_DOFL=1, EM2_DOFL=2, EM3_DOFL=4, EM4_DOFL=8,
94  J1_DOFL=16, J2_DOFL=32,
95  MU_DOFL=64, MU_SUP1=128, MU_SUP2=256, MU_SOFL=512};
96 
97  constexpr static unsigned int DOFL_bitMask = 16;
98  constexpr static unsigned int SUP1_bitMask = 1 << 16;
99  constexpr static unsigned int SUP2_bitMask = 1 << 17;
100 
101  constexpr static unsigned int emOverflow = EM1_DOFL | EM2_DOFL | EM3_DOFL | EM4_DOFL;
102  constexpr static unsigned int jOverflow = J1_DOFL | J2_DOFL;
103  constexpr static unsigned int anyOverflow = emOverflow | jOverflow | MU_DOFL;
104  constexpr static unsigned int emLink[4] = {EM1_DOFL, EM2_DOFL, EM3_DOFL, EM4_DOFL};
105  constexpr static unsigned int jLink[2] = {J1_DOFL, J2_DOFL};
106 
107 
108  /* true if overlfow on any link (note that the SUP1, SUP2 and SOFL bits are not checked) */
109  bool CheckOverflow() const { return (GetOverflowMask(true,true,true) & anyOverflow) != 0;}
110 
111  /* true if overlfow on any of the EMTau links */
112  bool CheckEMOverflow() const { return (GetOverflowMask(false,true,false) & emOverflow) != 0;}
113 
114  /* true if overlfow on either of the JetEnergy links */
115  bool CheckJOverflow() const { return (GetOverflowMask(false,false,true) & jOverflow) != 0;}
116 
117  /* true if overlfow on either of the MuCTPI link */
118  bool CheckMuOverflow() const { return (GetOverflowMask(true,false,false) & MU_DOFL) != 0;}
119 
120  /* true if a low threshhold muon from any sector was suppressed */
121  bool CheckMu1Suppression() const {return (GetOverflowMask(true,false,false) & MU_SUP1) != 0;}
122 
123  /* true if a high threshhold muon from any sector was suppressed */
124  bool CheckMu2Suppression() const {return (GetOverflowMask(true,false,false) & MU_SUP2) != 0;}
125 
126  /* true for sorter overflow (> 10 candidates on same threshold) */
127  bool CheckMuSorterOverflow() const {return (GetOverflowMask(true,false,false) & MU_DOFL) != 0;}
128 
129  /* Check for a specific EMTau link -- there are 4 EMTau links, numbered from 0 through 3 */
130  bool CheckEMLinkOverflow(unsigned int link) const
131  { if(link > 3) return false; return (GetOverflowMask(false,true,false) & emLink[link]) != 0;}
132 
133  /* Check for a specific JetEnergy link -- there are two JetEnergy links (0, 1) */
134  bool CheckJLinkOverflow(unsigned int link) const
135  { if(link > 1) return false; return (GetOverflowMask(false,false,true) & jLink[link]) != 0;}
136 
137  private:
138  /* The members - namely the muctpi, ctp, jetenegry
139  and egamma parts of the L1 RDO */
142  std::vector< JetEnergyResult > m_RoIBResultJetEnergy;
143  std::vector< EMTauResult > m_RoIBResultEMTau;
144  std::vector< L1TopoResult> m_RoIBResultL1Topo;
145 
146  unsigned int GetOverflowMask(bool setMu, bool setEM, bool setJE) const;
147 
148  }; // class RoIBResult
149 
150 } // namespace ROIB
151 
152 
153 /* The RoIBResult class_def part, defining a CLID of 6000 */
154 #include "AthenaKernel/CLASS_DEF.h"
155 CLASS_DEF( ROIB::RoIBResult , 6000 , 0 )
156 
157 #endif // TRIGT1RESULT_ROIBRESULT_H
ROIB::RoIBResult::jLink
constexpr static unsigned int jLink[2]
Definition: RoIBResult.h:105
ROIB::RoIBResult::m_RoIBResultL1Topo
std::vector< L1TopoResult > m_RoIBResultL1Topo
result from L1Topo
Definition: RoIBResult.h:144
ROIB::RoIBResult::EM2_DOFL
@ EM2_DOFL
Definition: RoIBResult.h:93
ROIB::RoIBResult::CheckMuSorterOverflow
bool CheckMuSorterOverflow() const
Definition: RoIBResult.h:127
ROIB::RoIBResult::jOverflow
constexpr static unsigned int jOverflow
Definition: RoIBResult.h:102
ROIB::RoIBResult
Class holding the LVL1 RoIB result build by the RoIBuilder.
Definition: RoIBResult.h:47
ROIB::RoIBResult::dumpData
void dumpData() const
print object content to default message stream
Definition: RoIBResult.cxx:126
ROIB::RoIBResult::emOverflow
constexpr static unsigned int emOverflow
Definition: RoIBResult.h:101
ROIB::RoIBResult::jetEnergyResult
const std::vector< JetEnergyResult > & jetEnergyResult() const
Gets the jet/energy part of the L1 RDO.
Definition: RoIBResult.cxx:64
JetEnergyResult.h
ROIB::RoIBResult::CheckJOverflow
bool CheckJOverflow() const
Definition: RoIBResult.h:115
ROIB::RoIBResult::eMTauResult
const std::vector< EMTauResult > & eMTauResult() const
Gets the egamma part of the L1 RDO.
Definition: RoIBResult.cxx:68
ROIB::CTPResult
Class holding the LVL1 CTP result used by the RoIBuilder.
Definition: CTPResult.h:52
ROIB::RoIBResult::EM4_DOFL
@ EM4_DOFL
Definition: RoIBResult.h:93
ROIB::RoIBResult::m_RoIBResultJetEnergy
std::vector< JetEnergyResult > m_RoIBResultJetEnergy
result from calo system: JetEnergy
Definition: RoIBResult.h:142
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
ROIB::RoIBResult::CheckEMLinkOverflow
bool CheckEMLinkOverflow(unsigned int link) const
Definition: RoIBResult.h:130
ROIB
Namespace of the LVL1 RoIB simulation.
Definition: ILvl1ResultAccessTool.h:19
ROIB::RoIBResult::dump
const std::string dump() const
dump raw object content to string
Definition: RoIBResult.cxx:80
ROIB::RoIBResult::CheckMu2Suppression
bool CheckMu2Suppression() const
Definition: RoIBResult.h:124
ROIB::RoIBResult::CheckOverflow
bool CheckOverflow() const
Definition: RoIBResult.h:109
CTPResult.h
ROIB::RoIBResult::MU_SOFL
@ MU_SOFL
Definition: RoIBResult.h:95
ROIB::RoIBResult::RoIBResult
RoIBResult()=default
default constructor: empty object
ROIB::RoIBResult::MU_SUP2
@ MU_SUP2
Definition: RoIBResult.h:95
ROIB::RoIBResult::m_RoIBResultMuCTPI
MuCTPIResult m_RoIBResultMuCTPI
result from muon system
Definition: RoIBResult.h:140
ROIB::RoIBResult::l1TopoResult
const std::vector< L1TopoResult > & l1TopoResult() const
Gets the L1Topo part of the L1 RDO.
Definition: RoIBResult.cxx:72
ROIB::RoIBResult::print
const std::string print(const bool longFormat=false) const
print object content in a human readable format to string
Definition: RoIBResult.cxx:98
ROIB::RoIBResult::J2_DOFL
@ J2_DOFL
Definition: RoIBResult.h:94
ROIB::RoIBResult::CheckEMOverflow
bool CheckEMOverflow() const
Definition: RoIBResult.h:112
ROIB::RoIBResult::GetOverflowMask
unsigned int GetOverflowMask(bool setMu, bool setEM, bool setJE) const
Definition: RoIBResult.cxx:147
ROIB::RoIBResult::CheckMu1Suppression
bool CheckMu1Suppression() const
Definition: RoIBResult.h:121
ROIB::RoIBResult::anyOverflow
constexpr static unsigned int anyOverflow
Definition: RoIBResult.h:103
ROIB::MuCTPIResult
Class holding the RoIs from the MuCTPI collected by the RoIB.
Definition: MuCTPIResult.h:44
ROIB::RoIBResult::cTPResult
const CTPResult & cTPResult() const
Gets the CTP part of the L1 RDO.
Definition: RoIBResult.cxx:60
ROIB::RoIBResult::m_RoIBResultEMTau
std::vector< EMTauResult > m_RoIBResultEMTau
result from calo system: EmTauResult
Definition: RoIBResult.h:143
ROIB::RoIBResult::emLink
constexpr static unsigned int emLink[4]
Definition: RoIBResult.h:104
L1TopoResult.h
ROIB::RoIBResult::SUP1_bitMask
constexpr static unsigned int SUP1_bitMask
Definition: RoIBResult.h:98
ROIB::RoIBResult::SUP2_bitMask
constexpr static unsigned int SUP2_bitMask
Definition: RoIBResult.h:99
ROIB::RoIBResult::J1_DOFL
@ J1_DOFL
Definition: RoIBResult.h:94
ROIB::RoIBResult::EM3_DOFL
@ EM3_DOFL
Definition: RoIBResult.h:93
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
MuCTPIResult.h
ROIB::RoIBResult::DOFL_bitMask
constexpr static unsigned int DOFL_bitMask
Definition: RoIBResult.h:97
ROIB::RoIBResult::EM1_DOFL
@ EM1_DOFL
Definition: RoIBResult.h:93
ROIB::RoIBResult::muCTPIResult
const MuCTPIResult & muCTPIResult() const
Gets the MuCTPI part of the L1 RDO.
Definition: RoIBResult.cxx:56
ROIB::RoIBResult::m_RoIBResultCTP
CTPResult m_RoIBResultCTP
result from CTP
Definition: RoIBResult.h:141
EMTauResult.h
ROIB::RoIBResult::MU_SUP1
@ MU_SUP1
Definition: RoIBResult.h:95
CLASS_DEF.h
macros to associate a CLID to a type
ROIB::RoIBResult::MU_DOFL
@ MU_DOFL
Definition: RoIBResult.h:95
ROIB::RoIBResult::CheckMuOverflow
bool CheckMuOverflow() const
Definition: RoIBResult.h:118
ROIB::RoIBResult::CheckJLinkOverflow
bool CheckJLinkOverflow(unsigned int link) const
Definition: RoIBResult.h:134