ATLAS Offline Software
EmTauRoI_v2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 // System include(s):
7 #include <stdexcept>
8 
9 // xAOD include(s):
11 
12 // Local include(s):
14 
15 namespace xAOD {
16 
18  : SG::AuxElement() {
19 
20  }
21 
22  void EmTauRoI_v2::initialize( uint32_t roiword, float eta, float phi ) {
23 
24  setRoIWord( roiword );
25  setEta( eta );
26  setPhi( phi );
27 
28  return;
29  }
30 
38 
39  const uint32_t roi = roiWord();
40  if( ( roi & 0xc0000000 ) == 0 ) {
41  return CPRoIWord;
42  } else if( ( roi & 0xf0000000 ) == 0xa0000000 ) {
43  return EMRoIWord;
44  } else if( ( roi & 0xf0000000 ) == 0xb0000000 ) {
45  return TauRoIWord;
46  }
47 
48  throw std::runtime_error( "xAOD::EmTauRoI_v2::roiType() "
49  "Unknown RoI word type found" );
50  return static_cast< RoIType >( -1 );
51  }
52 
56  setRoIWord )
57  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( EmTauRoI_v2, float, etScale, setEtScale )
58 
61  setThrPattern )
62 
63  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( EmTauRoI_v2, float, core, setCore )
64  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( EmTauRoI_v2, float, emClus, setEmClus )
66  setTauClus )
67  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( EmTauRoI_v2, float, emIsol, setEmIsol )
69  setHadIsol )
71  setHadCore )
72 
74  float EmTauRoI_v2::eT() const {
75  if ( roiType() == EMRoIWord || roiType() == TauRoIWord ) {
76  if (etScale() == 0) return ( roiWord() & 0xff );
77  return ( (roiWord() & 0xff)*etScale() );
78  }
79  return 0;
80  }
81 
83  uint8_t EmTauRoI_v2::isol() const {
84  if ( roiType() == EMRoIWord || roiType() == TauRoIWord )
85  return ( (roiWord()>>8) & 0x1f );
86  return 0;
87  }
88 
91  names( "thrNames" );
94  values( "thrValues" );
95 
99  void EmTauRoI_v2::addThreshold( const std::string& name, float value ) {
100 
101  names( *this ).push_back( name );
102  values( *this ).push_back( value );
103 
104  return;
105  }
106 
111 
112  names( *this ).clear();
113  values( *this ).clear();
114 
115  return;
116  }
117 
118  AUXSTORE_OBJECT_GETTER( EmTauRoI_v2, std::vector< std::string >, thrNames )
119  AUXSTORE_OBJECT_GETTER( EmTauRoI_v2, std::vector< float >, thrValues )
120 
121 } // namespace xAOD
xAOD::AUXSTORE_PRIMITIVE_SETTER_AND_GETTER
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
xAOD::EmTauRoI_v2::setEta
void setEta(float v)
Set the pseudorapidity of the em/tau candidate.
xAOD::name
name
Definition: TriggerMenuJson_v1.cxx:29
xAOD::hadIsol
setThrPattern hadIsol
Definition: EmTauRoI_v2.cxx:68
xAOD::EmTauRoI_v2::phi
float phi() const
The azimuthal angle ( ) of the em/tau candidate.
xAOD::EmTauRoI_v2::RoIType
RoIType
RoI word types.
Definition: EmTauRoI_v2.h:45
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
AuxStoreAccessorMacros.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
EmTauRoI_v2.h
xAOD::EmTauRoI_v2::clearThresholds
void clearThresholds()
Remove all the passed thresholds from the RoI.
Definition: EmTauRoI_v2.cxx:110
athena.value
value
Definition: athena.py:122
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::EmTauRoI_v2::initialize
void initialize(uint32_t roiword, float eta, float phi)
Initialise the object with its most important properties.
Definition: EmTauRoI_v2.cxx:22
xAOD::EmTauRoI_v2::addThreshold
void addThreshold(const std::string &name, float value)
Add a new threshold that was passed by the RoI.
Definition: EmTauRoI_v2.cxx:99
xAOD::EmTauRoI_v2::setRoIWord
void setRoIWord(uint32_t value)
Set the "raw" RoI word, describing the em/tau candidate.
Amg::setPhi
Amg::RotationMatrix3D setPhi(Amg::RotationMatrix3D mat, double angle, int convention=0)
Definition: EulerAnglesHelpers.h:102
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:797
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
xAOD::roiWord
roiWord
Definition: TrigMissingET_v1.cxx:36
IDTPM::eT
float eT(const U &p)
Accessor utility function for getting the value of Tranverse energy.
Definition: TrackParametersHelper.h:78
xAOD::EmTauRoI_v2
Class describing a LVL1 em/tau region of interest.
Definition: EmTauRoI_v2.h:35
python.subdetectors.mmg.names
names
Definition: mmg.py:8
xAOD::EmTauRoI_v2::TauRoIWord
@ TauRoIWord
This is a Run 2 Tau RoI word.
Definition: EmTauRoI_v2.h:48
xAOD::EmTauRoI_v2::EmTauRoI_v2
EmTauRoI_v2()
Default constructor.
Definition: EmTauRoI_v2.cxx:17
xAOD::EmTauRoI_v2::isol
uint8_t isol() const
The isolation result mask (from RoI word)
xAOD::EmTauRoI_v2::CPRoIWord
@ CPRoIWord
This is a Run 1 EM/Tau RoI word.
Definition: EmTauRoI_v2.h:46
xAOD::thrPattern
thrPattern
Definition: EmTauRoI_v2.cxx:60
xAOD::EmTauRoI_v2::eta
float eta() const
The pseudorapidity ( ) of the em/tau candidate.
xAOD::EmTauRoI_v2::EMRoIWord
@ EMRoIWord
This is a Run 2 EM RoI word.
Definition: EmTauRoI_v2.h:47
xAOD::AUXSTORE_OBJECT_GETTER
AUXSTORE_OBJECT_GETTER(TrigComposite_v1, std::vector< std::string >, linkColNames) AUXSTORE_OBJECT_GETTER(TrigComposite_v1
xAOD::EmTauRoI_v2::setPhi
void setPhi(float v)
Set the azimuthal angle of the em/tau candidate.
xAOD::EmTauRoI_v2::roiWord
uint32_t roiWord() const
The "raw" RoI word describing the em/tau candidate.
xAOD::EmTauRoI_v2::roiType
RoIType roiType() const
Get the type of the RoI word.
Definition: EmTauRoI_v2.cxx:37