ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TrigEgammaForwardPrecisionCaloHypoTool Class Reference

#include <TrigEgammaForwardPrecisionCaloHypoTool.h>

Inheritance diagram for TrigEgammaForwardPrecisionCaloHypoTool:
Collaboration diagram for TrigEgammaForwardPrecisionCaloHypoTool:

Public Member Functions

 TrigEgammaForwardPrecisionCaloHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
virtual StatusCode decide (std::vector< ITrigEgammaForwardPrecisionCaloHypoTool::ClusterInfo > &input) const override
 
virtual bool decide (const ITrigEgammaForwardPrecisionCaloHypoTool::ClusterInfo &i) const override
 

Private Member Functions

int findCutIndex (float eta) const
 

Private Attributes

HLT::Identifier m_decisionId
 
Gaudi::Property< std::vector< float > > m_etabin { this, "EtaBins", {} , "Bins of eta" }
 selection variable for PRECISION calo selection:eta bins More...
 
Gaudi::Property< std::vector< float > > m_eTthr { this, "ETthr", {}, "ET Threshold" }
 
Gaudi::Property< std::vector< float > > m_eT2thr { this, "ET2thr", {}, "Second layer ET threshold" }
 
Gaudi::Property< float > m_detacluster { this, "dETACLUSTERthr", 0. , "" }
 
Gaudi::Property< float > m_dphicluster { this, "dPHICLUSTERthr", 0. , "" }
 
ToolHandle< GenericMonitoringToolm_monTool { this, "MonTool", "", "Monitoring tool" }
 

Detailed Description

Definition at line 18 of file TrigEgammaForwardPrecisionCaloHypoTool.h.

Constructor & Destructor Documentation

◆ TrigEgammaForwardPrecisionCaloHypoTool()

TrigEgammaForwardPrecisionCaloHypoTool::TrigEgammaForwardPrecisionCaloHypoTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 16 of file TrigEgammaForwardPrecisionCaloHypoTool.cxx.

19  : base_class( type, name, parent ),

Member Function Documentation

◆ decide() [1/2]

bool TrigEgammaForwardPrecisionCaloHypoTool::decide ( const ITrigEgammaForwardPrecisionCaloHypoTool::ClusterInfo i) const
overridevirtual

Definition at line 55 of file TrigEgammaForwardPrecisionCaloHypoTool.cxx.

55  {
56 
57  bool pass = false;
58 
59  auto dEta = Monitored::Scalar( "dEta", -1. );
60  auto dPhi = Monitored::Scalar( "dPhi", -1. );
61  auto eT_Cluster = Monitored::Scalar( "Et_em" , -1.0 );
62  auto etaBin = Monitored::Scalar( "EtaBin", -1. );
63  auto monEta = Monitored::Scalar( "Eta", -99. );
64  auto monPhi = Monitored::Scalar( "Phi", -99. );
65  auto PassedCuts = Monitored::Scalar<int>( "CutCounter", -1 );
66  auto monitorIt = Monitored::Group( m_monTool,dEta, dPhi, eT_Cluster,
67  etaBin, monEta,monPhi,PassedCuts );
68  // when leaving scope it will ship data to monTool
69  PassedCuts = PassedCuts + 1; //got called (data in place)
70 
71  auto roiDescriptor = input.roi;
72 
73 
74  if ( std::abs( roiDescriptor->eta() ) > 2.6 ) {
75  ATH_MSG_DEBUG( "REJECT The cluster had eta coordinates beyond the EM fiducial volume : " << roiDescriptor->eta() << "; stop the chain now" );
76  pass=false; // special case
77  return pass;
78  }
79 
80  ATH_MSG_INFO( "; RoI ID = " << roiDescriptor->roiId()
81  << ": Eta = " << roiDescriptor->eta()
82  << ", Phi = " << roiDescriptor->phi() );
83 
84  // fill local variables for RoI reference position
85  double etaRef = roiDescriptor->eta();
86  double phiRef = roiDescriptor->phi();
87  // correct phi the to right range ( probably not needed anymore )
88  if ( std::abs( phiRef ) > M_PI ) phiRef -= 2*M_PI; // correct phi if outside range
89 
90 
91  auto pClus = input.cluster;
92 
93  float absEta = std::abs( pClus->eta() );
94  const int cutIndex = findCutIndex( absEta );
95 
96 
97 
98  dEta = pClus->eta() - etaRef;
99  // Deal with angle diferences greater than Pi
100  dPhi = std::abs( pClus->phi() - phiRef );
101  dPhi = ( dPhi < M_PI ? dPhi : 2*M_PI - dPhi ); // TB why only <
102  eT_Cluster = pClus->et();
103  // apply cuts: DeltaEta( clus-ROI )
104  ATH_MSG_INFO( "CaloCluster: eta=" << pClus->eta()
105  << " roi eta=" << etaRef << " DeltaEta=" << dEta
106  << " cut: <" << m_detacluster );
107 
108  if ( std::abs( pClus->eta() - etaRef ) > m_detacluster ) {
109  ATH_MSG_DEBUG("REJECT Cluster dEta cut failed");
110  return pass;
111  }
112  PassedCuts = PassedCuts + 1; //Deta
113 
114  // DeltaPhi( clus-ROI )
115  ATH_MSG_DEBUG( ": phi=" << pClus->phi()
116  << " roi phi="<< phiRef << " DeltaPhi="<< dPhi
117  << " cut: <" << m_dphicluster );
118 
119  if( dPhi > m_dphicluster ) {
120  ATH_MSG_DEBUG("REJECT Clsuter dPhi cut failed");
121  return pass;
122  }
123  PassedCuts = PassedCuts + 1; //DPhi
124 
125  // eta range
126  if ( cutIndex == -1 ) { // VD
127  ATH_MSG_DEBUG( "Cluster eta: " << absEta << " outside eta range " << m_etabin[m_etabin.size()-1] );
128  return pass;
129  } else {
130  ATH_MSG_DEBUG( "eta bin used for cuts " << cutIndex );
131  }
132  PassedCuts = PassedCuts + 1; // passed eta cut
133 
134  // ET_em
135  ATH_MSG_DEBUG( "CaloCluster: ET_em=" << eT_Cluster << " cut: >" << m_eTthr[cutIndex] );
136  if ( eT_Cluster < m_eTthr[cutIndex] ) {
137  ATH_MSG_DEBUG("REJECT et cut failed");
138  return pass;
139  }
140  PassedCuts = PassedCuts + 1; // ET_em
141 
142  // got this far => passed!
143  pass = true;
144 
145  // Reach this point successfully
146  ATH_MSG_DEBUG( "pass = " << pass );
147 
148  return pass;
149 
150 }

◆ decide() [2/2]

virtual StatusCode TrigEgammaForwardPrecisionCaloHypoTool::decide ( std::vector< ITrigEgammaForwardPrecisionCaloHypoTool::ClusterInfo > &  input) const
overridevirtual

◆ findCutIndex()

int TrigEgammaForwardPrecisionCaloHypoTool::findCutIndex ( float  eta) const
private

Definition at line 152 of file TrigEgammaForwardPrecisionCaloHypoTool.cxx.

152  {
153  const float absEta = std::abs(eta);
154 
155  auto binIterator = std::adjacent_find( m_etabin.begin(), m_etabin.end(), [=](float left, float right){ return left < absEta and absEta < right; } );
156  if ( binIterator == m_etabin.end() ) {
157  return -1;
158  }
159  return binIterator - m_etabin.begin();
160 }

◆ initialize()

StatusCode TrigEgammaForwardPrecisionCaloHypoTool::initialize ( )
overridevirtual

Definition at line 22 of file TrigEgammaForwardPrecisionCaloHypoTool.cxx.

23 {
24  ATH_MSG_DEBUG( "Initialization completed successfully" );
25  ATH_MSG_DEBUG( "EtaBins = " << m_etabin );
26  ATH_MSG_DEBUG( "ETthr = " << m_eTthr << "( lo )/" << m_eT2thr << "( hi )" );
27  ATH_MSG_DEBUG( "dPHICLUSTERthr = " << m_dphicluster );
28  ATH_MSG_DEBUG( "dETACLUSTERthr = " << m_detacluster );
29 
30  if ( m_etabin.size() == 0 ) {
31  ATH_MSG_ERROR( " There are no cuts set (EtaBins property is an empty list)" );
32  return StatusCode::FAILURE;
33  }
34 
35  unsigned int nEtaBin = m_etabin.size();
36 
37 #define CHECK_SIZE( __n) if ( m_##__n.size() != (nEtaBin - 1) ) \
38  { ATH_MSG_DEBUG(" __n size is " << m_##__n.size() << " but needs to be " << (nEtaBin - 1) ); return StatusCode::FAILURE; }
39 
40  CHECK_SIZE( eTthr );
41  CHECK_SIZE( eT2thr );
42 #undef CHECK_SIZE
43 
44 
45 
46  ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId );
47 
48  if ( not m_monTool.name().empty() )
49  CHECK( m_monTool.retrieve() );
50 
51  return StatusCode::SUCCESS;
52 }

Member Data Documentation

◆ m_decisionId

HLT::Identifier TrigEgammaForwardPrecisionCaloHypoTool::m_decisionId
private

Definition at line 31 of file TrigEgammaForwardPrecisionCaloHypoTool.h.

◆ m_detacluster

Gaudi::Property< float > TrigEgammaForwardPrecisionCaloHypoTool::m_detacluster { this, "dETACLUSTERthr", 0. , "" }
private

Definition at line 37 of file TrigEgammaForwardPrecisionCaloHypoTool.h.

◆ m_dphicluster

Gaudi::Property< float > TrigEgammaForwardPrecisionCaloHypoTool::m_dphicluster { this, "dPHICLUSTERthr", 0. , "" }
private

Definition at line 38 of file TrigEgammaForwardPrecisionCaloHypoTool.h.

◆ m_eT2thr

Gaudi::Property< std::vector<float> > TrigEgammaForwardPrecisionCaloHypoTool::m_eT2thr { this, "ET2thr", {}, "Second layer ET threshold" }
private

Definition at line 36 of file TrigEgammaForwardPrecisionCaloHypoTool.h.

◆ m_etabin

Gaudi::Property< std::vector<float> > TrigEgammaForwardPrecisionCaloHypoTool::m_etabin { this, "EtaBins", {} , "Bins of eta" }
private

selection variable for PRECISION calo selection:eta bins

Definition at line 34 of file TrigEgammaForwardPrecisionCaloHypoTool.h.

◆ m_eTthr

Gaudi::Property< std::vector<float> > TrigEgammaForwardPrecisionCaloHypoTool::m_eTthr { this, "ETthr", {}, "ET Threshold" }
private

Definition at line 35 of file TrigEgammaForwardPrecisionCaloHypoTool.h.

◆ m_monTool

ToolHandle< GenericMonitoringTool > TrigEgammaForwardPrecisionCaloHypoTool::m_monTool { this, "MonTool", "", "Monitoring tool" }
private

Definition at line 40 of file TrigEgammaForwardPrecisionCaloHypoTool.h.


The documentation for this class was generated from the following files:
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
TrigEgammaForwardPrecisionCaloHypoTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigEgammaForwardPrecisionCaloHypoTool.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TrigEgammaForwardPrecisionCaloHypoTool::m_eT2thr
Gaudi::Property< std::vector< float > > m_eT2thr
Definition: TrigEgammaForwardPrecisionCaloHypoTool.h:36
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TrigEgammaForwardPrecisionCaloHypoTool::m_etabin
Gaudi::Property< std::vector< float > > m_etabin
selection variable for PRECISION calo selection:eta bins
Definition: TrigEgammaForwardPrecisionCaloHypoTool.h:34
TrigEgammaForwardPrecisionCaloHypoTool::m_dphicluster
Gaudi::Property< float > m_dphicluster
Definition: TrigEgammaForwardPrecisionCaloHypoTool.h:38
TrigEgammaForwardPrecisionCaloHypoTool::m_eTthr
Gaudi::Property< std::vector< float > > m_eTthr
Definition: TrigEgammaForwardPrecisionCaloHypoTool.h:35
CHECK_SIZE
#define CHECK_SIZE(__n)
HLT::Identifier::fromToolName
static HLT::Identifier fromToolName(const std::string &tname)
Definition: HLTIdentifier.cxx:31
xAOD::etaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
Definition: L2StandAloneMuon_v1.cxx:148
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TrigEgammaForwardPrecisionCaloHypoTool::m_detacluster
Gaudi::Property< float > m_detacluster
Definition: TrigEgammaForwardPrecisionCaloHypoTool.h:37
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:538
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TauGNNUtils::Variables::absEta
bool absEta(const xAOD::TauJet &tau, double &out)
Definition: TauGNNUtils.cxx:234
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TrigEgammaForwardPrecisionCaloHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigEgammaForwardPrecisionCaloHypoTool.h:31
TrigEgammaForwardPrecisionCaloHypoTool::findCutIndex
int findCutIndex(float eta) const
Definition: TrigEgammaForwardPrecisionCaloHypoTool.cxx:152
TauGNNUtils::Variables::Track::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:527