Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TrigEgammaPrecisionCaloHypoTool Class Reference

#include <TrigEgammaPrecisionCaloHypoTool.h>

Inheritance diagram for TrigEgammaPrecisionCaloHypoTool:
Collaboration diagram for TrigEgammaPrecisionCaloHypoTool:

Public Member Functions

 TrigEgammaPrecisionCaloHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
virtual StatusCode decide (std::vector< ITrigEgammaPrecisionCaloHypoTool::ClusterInfo > &input) const override
 
virtual bool decide (const ITrigEgammaPrecisionCaloHypoTool::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 TrigEgammaPrecisionCaloHypoTool.h.

Constructor & Destructor Documentation

◆ TrigEgammaPrecisionCaloHypoTool()

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

Definition at line 17 of file TrigEgammaPrecisionCaloHypoTool.cxx.

20  : base_class( type, name, parent ),

Member Function Documentation

◆ decide() [1/2]

bool TrigEgammaPrecisionCaloHypoTool::decide ( const ITrigEgammaPrecisionCaloHypoTool::ClusterInfo i) const
overridevirtual

Definition at line 54 of file TrigEgammaPrecisionCaloHypoTool.cxx.

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

◆ decide() [2/2]

virtual StatusCode TrigEgammaPrecisionCaloHypoTool::decide ( std::vector< ITrigEgammaPrecisionCaloHypoTool::ClusterInfo > &  input) const
overridevirtual

◆ findCutIndex()

int TrigEgammaPrecisionCaloHypoTool::findCutIndex ( float  eta) const
private

Definition at line 158 of file TrigEgammaPrecisionCaloHypoTool.cxx.

158  {
159  const float absEta = std::abs(eta);
160 
161  auto binIterator = std::adjacent_find( m_etabin.begin(), m_etabin.end(), [=](float left, float right){ return left < absEta and absEta < right; } );
162  if ( binIterator == m_etabin.end() ) {
163  return -1;
164  }
165  return binIterator - m_etabin.begin();
166 }

◆ initialize()

StatusCode TrigEgammaPrecisionCaloHypoTool::initialize ( )
overridevirtual

Definition at line 23 of file TrigEgammaPrecisionCaloHypoTool.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 #define CHECK_SIZE( __n) if ( m_##__n.size() != (nEtaBin - 1) ) \
37  { ATH_MSG_DEBUG(" __n size is " << m_##__n.size() << " but needs to be " << (nEtaBin - 1) ); return StatusCode::FAILURE; }
38 
39  CHECK_SIZE( eTthr );
40  CHECK_SIZE( eT2thr );
41 #undef CHECK_SIZE
42 
43 
44 
45  ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId );
46 
47  if ( not m_monTool.name().empty() )
48  CHECK( m_monTool.retrieve() );
49 
50  return StatusCode::SUCCESS;
51 }

Member Data Documentation

◆ m_decisionId

HLT::Identifier TrigEgammaPrecisionCaloHypoTool::m_decisionId
private

Definition at line 31 of file TrigEgammaPrecisionCaloHypoTool.h.

◆ m_detacluster

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

Definition at line 37 of file TrigEgammaPrecisionCaloHypoTool.h.

◆ m_dphicluster

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

Definition at line 38 of file TrigEgammaPrecisionCaloHypoTool.h.

◆ m_eT2thr

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

Definition at line 36 of file TrigEgammaPrecisionCaloHypoTool.h.

◆ m_etabin

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

selection variable for PRECISION calo selection:eta bins

Definition at line 34 of file TrigEgammaPrecisionCaloHypoTool.h.

◆ m_eTthr

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

Definition at line 35 of file TrigEgammaPrecisionCaloHypoTool.h.

◆ m_monTool

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

Definition at line 40 of file TrigEgammaPrecisionCaloHypoTool.h.


The documentation for this class was generated from the following files:
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
TrigEgammaPrecisionCaloHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigEgammaPrecisionCaloHypoTool.h:31
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
TrigEgammaPrecisionCaloHypoTool::m_eTthr
Gaudi::Property< std::vector< float > > m_eTthr
Definition: TrigEgammaPrecisionCaloHypoTool.h:35
CHECK_SIZE
#define CHECK_SIZE(__n)
M_PI
#define M_PI
Definition: ActiveFraction.h:11
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
TrigEgammaPrecisionCaloHypoTool::findCutIndex
int findCutIndex(float eta) const
Definition: TrigEgammaPrecisionCaloHypoTool.cxx:158
TrigEgammaPrecisionCaloHypoTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigEgammaPrecisionCaloHypoTool.h:40
HLT::Identifier::fromToolName
static HLT::Identifier fromToolName(const std::string &tname)
Definition: HLTIdentifier.cxx:31
TrigEgammaPrecisionCaloHypoTool::m_etabin
Gaudi::Property< std::vector< float > > m_etabin
selection variable for PRECISION calo selection:eta bins
Definition: TrigEgammaPrecisionCaloHypoTool.h:34
TrigEgammaPrecisionCaloHypoTool::m_dphicluster
Gaudi::Property< float > m_dphicluster
Definition: TrigEgammaPrecisionCaloHypoTool.h:38
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
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:548
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:240
TrigEgammaPrecisionCaloHypoTool::m_detacluster
Gaudi::Property< float > m_detacluster
Definition: TrigEgammaPrecisionCaloHypoTool.h:37
TrigEgammaPrecisionCaloHypoTool::m_eT2thr
Gaudi::Property< std::vector< float > > m_eT2thr
Definition: TrigEgammaPrecisionCaloHypoTool.h:36
TauGNNUtils::Variables::absEta
bool absEta(const xAOD::TauJet &tau, double &out)
Definition: TauGNNUtils.cxx:244
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TauGNNUtils::Variables::Track::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:537