ATLAS Offline Software
EMTauRoI.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
10 
11 using namespace LVL1;
12 using namespace std;
13 
14 namespace ROIB {
15 
16  EMTauRoI::EMTauRoI( uint32_t RoIWord )
17  : m_roIWord( RoIWord )
18  {
19  }
20 
22  : m_roIWord( 0 )
23  {
24  }
25 
27  // Obsolete a long time ago.
28  m_roIWord = RoIFormatUpdater::UpdateEMTauRoI(m_roIWord) ;
29  return;
30  }
31 
33  return m_roIWord;
34  }
35 
38  unsigned int EMTauRoI::roIType() const {
39  if ( m_roIWord != 0 ) {
40  unsigned int type = BitOp::getValue( &m_roIWord, 0xc0000000 );
41  if (type == TrigT1CaloDefs::EMTauRoIWord) {
42  return TrigT1CaloDefs::CpRoIWordType;
43  }
44  else {
45  unsigned int temp2 = BitOp::getValue( &m_roIWord, 0xf0000000 );
46  if (temp2 == TrigT1CaloDefs::EMRoIWord) {
47  return TrigT1CaloDefs::EMRoIWordType;
48  }
49  else if (temp2 == TrigT1CaloDefs::TauRoIWord) {
50  return TrigT1CaloDefs::TauRoIWordType;
51  }
52  }
53  }
54  return TrigT1CaloDefs::RoIWordTypeError;
55  }
56 
58  unsigned int EMTauRoI::electronicsID() const {
59  if ( roIType() == TrigT1CaloDefs::CpRoIWordType )
60  return BitOp::getValue( &m_roIWord, 0x3ffc0000 );
61  else if ( roIType() == TrigT1CaloDefs::EMRoIWordType || roIType() == TrigT1CaloDefs::TauRoIWordType )
62  return BitOp::getValue( &m_roIWord, 0x0fff0000 );
63  else
64  return 9999;
65  }
66 
68  vector< unsigned int > EMTauRoI::thresholds() const {
69 
70  std::vector<unsigned int> returnVec;
71  if ( roIType() != TrigT1CaloDefs::CpRoIWordType )
72  returnVec.push_back( 9999 );
73  else {
74  for ( unsigned int i = 0;i < TrigT1CaloDefs::numOfCPThresholds;i++ )
75  returnVec.push_back( static_cast< unsigned int >( BitOp::isSet( &m_roIWord, i ) ) );
76  }
77  return returnVec;
78  }
79 
81  unsigned int EMTauRoI::et() const {
82 
83  if ( roIType() == TrigT1CaloDefs::EMRoIWordType || roIType() == TrigT1CaloDefs::TauRoIWordType )
84  return BitOp::getValue( &m_roIWord, 0x000000ff );
85 
86  return 0;
87  }
88 
90  unsigned int EMTauRoI::isolation() const {
91 
92  if ( roIType() == TrigT1CaloDefs::EMRoIWordType || roIType() == TrigT1CaloDefs::TauRoIWordType )
93  return BitOp::getValue( &m_roIWord, 0x00001f00 );
94 
95  return 0;
96  }
97 
98 } // namespace ROIB
RoIFormatUpdater.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ROIB::EMTauRoI::electronicsID
unsigned int electronicsID() const
Return bitmask containing coordinate information (crate, module, chip, ocation)
Definition: EMTauRoI.cxx:58
ROIB::EMTauRoI::thresholds
std::vector< unsigned int > thresholds() const
Return vector of thresholds passed for Run 1 RoI.
Definition: EMTauRoI.cxx:68
ROIB::EMTauRoI::et
unsigned int et() const
Return cluster ET for Run 2 RoI.
Definition: EMTauRoI.cxx:81
ROIB
Namespace of the LVL1 RoIB simulation.
Definition: ILvl1ResultAccessTool.h:19
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
lumiFormat.i
int i
Definition: lumiFormat.py:92
BitOp.h
ROIB::EMTauRoI::roIWord
uint32_t roIWord() const
Definition: EMTauRoI.cxx:32
EMTauRoI.h
ROIB::EMTauRoI::m_roIWord
uint32_t m_roIWord
Definition: EMTauRoI.h:48
BitOp::isSet
static bool isSet(const unsigned int *uintValue, int bit)
Check if a the given bit in the given unsigned int or int value is set.
Definition: BitOp.h:47
ROIB::EMTauRoI::isolation
unsigned int isolation() const
Return isolation flags for Run 2 RoI.
Definition: EMTauRoI.cxx:90
TrigT1CaloDefs.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ROIB::EMTauRoI::roIType
unsigned int roIType() const
Return RoI type.
Definition: EMTauRoI.cxx:38
ROIB::EMTauRoI::update
void update()
Definition: EMTauRoI.cxx:26
ROIB::EMTauRoI::EMTauRoI
EMTauRoI()
Definition: EMTauRoI.cxx:21
BitOp::getValue
static unsigned int getValue(const unsigned int *uintValue, const unsigned int mask)
get the value in the input word represented by a bit pattern given as a bitmask
Definition: BitOp.cxx:47