ATLAS Offline Software
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 PassedCuts = Monitored::Scalar<int>( "CutCounter", -1 );
64  auto monitorIt = Monitored::Group( m_monTool, mon_dEta, mon_dPhi, mon_eta, mon_phi, mon_eT_Cluster,PassedCuts );
65 
66  // when leaving scope it will ship data to monTool
67  PassedCuts = PassedCuts + 1; //got called (data in place)
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  ATH_MSG_DEBUG( "; 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 
88  // correct phi the to right range ( probably not needed anymore )
89  if ( fabs( phiRef ) > M_PI ) phiRef -= 2*M_PI; // correct phi if outside range
90 
91 
92  auto pClus = input.cluster;
93  eta = pClus->eta();
94  phi = pClus->phi();
95 
96  float absEta = fabs( pClus->eta() );
97  const int cutIndex = findCutIndex( absEta );
98 
99  dEta = pClus->eta() - etaRef;
100  // Deal with angle diferences greater than Pi
101  dPhi = fabs( pClus->phi() - phiRef );
102  dPhi = ( dPhi < M_PI ? dPhi : 2*M_PI - dPhi ); // TB why only <
103  eT_Cluster = pClus->et();
104  // apply cuts: DeltaEta( clus-ROI )
105  ATH_MSG_DEBUG( "CaloCluster: eta=" << pClus->eta()
106  << " roi eta=" << etaRef << " DeltaEta=" << dEta
107  << " cut: <" << m_detacluster );
108 
109  if ( fabs(dEta) > m_detacluster ) {
110  ATH_MSG_DEBUG("REJECT Cluster dEta cut failed");
111  return pass;
112  }
113  mon_eta = eta;
114  mon_dEta = dEta;
115  PassedCuts = PassedCuts + 1; //Deta
116 
117  // DeltaPhi( clus-ROI )
118  ATH_MSG_DEBUG( ": phi=" << pClus->phi()
119  << " roi phi="<< phiRef << " DeltaPhi="<< dPhi
120  << " cut: <" << m_dphicluster );
121 
122  if( dPhi > m_dphicluster ) {
123  ATH_MSG_DEBUG("REJECT Clsuter dPhi cut failed");
124  return pass;
125  }
126  mon_dPhi = dPhi;
127  mon_phi = phi;
128  PassedCuts = PassedCuts + 1; //DPhi
129 
130  // eta range
131  if ( cutIndex == -1 ) { // VD
132  ATH_MSG_DEBUG( "Cluster eta: " << absEta << " outside eta range " << m_etabin[m_etabin.size()-1] );
133  return pass;
134  } else {
135  ATH_MSG_DEBUG( "eta bin used for cuts " << cutIndex );
136  }
137  PassedCuts = PassedCuts + 1; // passed eta cut
138 
139  // ET_em
140  ATH_MSG_DEBUG( "PrecisionCaloCluster: ET_em=" << eT_Cluster << " cut: >" << m_eTthr[cutIndex] );
141  if ( eT_Cluster < m_eTthr[cutIndex] ) {
142  ATH_MSG_DEBUG("REJECT et cut failed");
143  return pass;
144  }
145  mon_eT_Cluster = eT_Cluster;
146 
147  // got this far => passed!
148  pass = true;
149 
150  // Reach this point successfully
151  ATH_MSG_DEBUG( "pass = " << pass );
152 
153  return pass;
154 
155 }

◆ 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 157 of file TrigEgammaPrecisionCaloHypoTool.cxx.

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

◆ 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:64
TrigEgammaPrecisionCaloHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigEgammaPrecisionCaloHypoTool.h:31
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
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
TrigEgammaPrecisionCaloHypoTool::findCutIndex
int findCutIndex(float eta) const
Definition: TrigEgammaPrecisionCaloHypoTool.cxx:157
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:530
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:195
TrigEgammaPrecisionCaloHypoTool::m_detacluster
Gaudi::Property< float > m_detacluster
Definition: TrigEgammaPrecisionCaloHypoTool.h:37
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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:232
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:525