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

#include <TrigEgammaFastElectronHypoTool.h>

Inheritance diagram for TrigEgammaFastElectronHypoTool:
Collaboration diagram for TrigEgammaFastElectronHypoTool:

Public Member Functions

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

Private Member Functions

bool decide_cb (const ITrigEgammaFastElectronHypoTool::ElectronInfo &i) const
 
bool decide_ringer (const ITrigEgammaFastElectronHypoTool::ElectronInfo &i) const
 

Private Attributes

HLT::Identifier m_decisionId
 
Gaudi::Property< bool > m_acceptAll { this, "AcceptAll", false, "Ignore selection" }
 
Gaudi::Property< bool > m_doLRT { this, "DoLRT", false, "apply d0 cut for LRT triggers" }
 
Gaudi::Property< bool > m_doRinger { this, "DoRinger", false, "apply NN ringer selection" }
 
Gaudi::Property< float > m_trackPt { this, "TrackPt", 5.0*Gaudi::Units::GeV, "Track pT requirement ( separate threshold for each electron )" }
 
Gaudi::Property< float > m_caloTrackDEta { this, "CaloTrackdETA", 0, "Delta Eta between the track and cluster" }
 
Gaudi::Property< float > m_caloTrackDPhi { this, "CaloTrackdPHI", 0, "Delta Phi between track and cluster" }
 
Gaudi::Property< float > m_caloTrackdEoverPLow { this, "CaloTrackdEoverPLow", 0, "Min E over Pt cut "}
 
Gaudi::Property< float > m_caloTrackdEoverPHigh { this, "CaloTrackdEoverPHigh", 0, "Max E over pT cut" }
 
Gaudi::Property< float > m_trtRatio { this, "TRTRatio", 0, "TRT HT ratio" }
 
Gaudi::Property< float > m_d0 { this, "d0Cut", 0, "d0 cut" }
 
Gaudi::Property< std::string > m_pidName {this,"PidName", "", "Pid name"}
 
ToolHandle< GenericMonitoringToolm_monTool { this, "MonTool", "", "Monitoring tool" }
 

Detailed Description

Definition at line 23 of file TrigEgammaFastElectronHypoTool.h.

Constructor & Destructor Documentation

◆ TrigEgammaFastElectronHypoTool()

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

Definition at line 14 of file TrigEgammaFastElectronHypoTool.cxx.

17  : base_class( type, name, parent ),
19 {}

Member Function Documentation

◆ decide() [1/2]

bool TrigEgammaFastElectronHypoTool::decide ( const ITrigEgammaFastElectronHypoTool::ElectronInfo i) const
overridevirtual

Definition at line 61 of file TrigEgammaFastElectronHypoTool.cxx.

62 {
64 }

◆ decide() [2/2]

StatusCode TrigEgammaFastElectronHypoTool::decide ( std::vector< ITrigEgammaFastElectronHypoTool::ElectronInfo > &  input) const
overridevirtual

Definition at line 48 of file TrigEgammaFastElectronHypoTool.cxx.

48  {
49  for ( auto& i: input ) {
50  if ( TCU::passed ( m_decisionId.numeric(), i.previousDecisionIDs ) ) {
51  if ( decide( i ) ) {
52  TCU::addDecisionID( m_decisionId, i.decision );
53  }
54  }
55  }
56  return StatusCode::SUCCESS;
57 }

◆ decide_cb()

bool TrigEgammaFastElectronHypoTool::decide_cb ( const ITrigEgammaFastElectronHypoTool::ElectronInfo i) const
private

Definition at line 68 of file TrigEgammaFastElectronHypoTool.cxx.

70 {
71 
72  if ( m_acceptAll ) {
73  ATH_MSG_DEBUG( "AcceptAll property is set: taking all events" );
74  return true;
75  } else {
76  ATH_MSG_DEBUG( "AcceptAll property not set: applying selection" );
77  }
78 
79  auto cutCounter = Monitored::Scalar<int>( "CutCounter", -1 );
80  auto mon_ptCalo = Monitored::Scalar( "PtCalo", -999. );
81  auto mon_ptTrack = Monitored::Scalar( "PtTrack", -999. );
82  auto mon_dEtaCalo = Monitored::Scalar( "CaloTrackdEta", -1. );
83  auto mon_dPhiCalo = Monitored::Scalar( "CaloTrackdPhi", -1. );
84  auto mon_eToverPt = Monitored::Scalar( "CaloTrackEoverP", -1. );
85  auto mon_caloEta = Monitored::Scalar( "CaloEta", -100. );
86  auto mon_caloPhi = Monitored::Scalar( "CaloPhi", -100. );
87  auto mon_trk_d0 = Monitored::Scalar( "d0Value", -1. );
88  auto monitorIt = Monitored::Group( m_monTool,
89  cutCounter,
90  mon_ptCalo, mon_ptTrack,
91  mon_dEtaCalo, mon_dPhiCalo,
92  mon_eToverPt,
93  mon_caloEta, mon_caloPhi, mon_trk_d0);
94 
95  auto electron = input.electron;
96 
97  if(!electron){
98  ATH_MSG_DEBUG("disconsider candidates without electron");
99  return false;
100  }
101 
102  float ptCalo(0), dEtaCalo(0), dPhiCalo(0), eToverPt(0), caloEta(0), caloPhi(0), trk_d0(0);
103 
104  const xAOD::TrackParticle* trkIter = electron->trackParticle();
105 
106  if ( !trkIter ){ // disconsider candidates without track
107  ATH_MSG_DEBUG("disconsider candidates without track");
108  return false;
109  }
110  cutCounter++;
111 
112  // Retrieve all quantities
113  dPhiCalo = electron->trkClusDphi();
114  dEtaCalo = electron->trkClusDeta();
115  ptCalo = electron->pt();
116  eToverPt = electron->etOverPt();
117  caloEta = electron->caloEta();
118  caloPhi = electron->caloPhi();
119  trk_d0 = std::abs(trkIter->d0());
120 
121  float NTRHits = static_cast<float>( electron->nTRTHits() );
122  float NStrawHits = static_cast<float>( electron->nTRTHiThresholdHits() );
123  float TRTHitRatio = NStrawHits == 0 ? 1e10 : NTRHits/NStrawHits;
124 
125  if ( ptCalo < m_trackPt ){
126  ATH_MSG_DEBUG( "Fails pt cut" << ptCalo << " < " << m_trackPt );
127  return false;
128  }
129  mon_ptCalo = ptCalo;
130  mon_ptTrack = m_trackPt;
131  cutCounter++;
132 
133  if ( dEtaCalo > m_caloTrackDEta ) {
134  ATH_MSG_DEBUG( "Fails dEta cut " << dEtaCalo << " < " << m_caloTrackDEta );
135  return false;
136  }
137  mon_dEtaCalo = dEtaCalo;
138  mon_caloEta = caloEta;
139 
140  cutCounter++;
141  if ( dPhiCalo > m_caloTrackDPhi ) {
142  ATH_MSG_DEBUG( "Fails dPhi cut " << dPhiCalo << " < " << m_caloTrackDPhi );
143  return false;
144  }
145 
146  mon_dPhiCalo = dPhiCalo;
147  mon_caloPhi = caloPhi;
148  cutCounter++;
149  if( eToverPt < m_caloTrackdEoverPLow ) {
150  ATH_MSG_DEBUG( "Fails eoverp low cut " << eToverPt << " < " << m_caloTrackdEoverPLow );
151  return false;
152  }
153 
154 
155  cutCounter++;
156  if ( eToverPt > m_caloTrackdEoverPHigh ) {
157  ATH_MSG_DEBUG( "Fails eoverp high cut " << eToverPt << " < " << m_caloTrackdEoverPHigh );
158  return false;
159  }
160  mon_eToverPt = eToverPt;
161 
162  cutCounter++;
163  if ( TRTHitRatio < m_trtRatio ){
164  ATH_MSG_DEBUG( "Fails TRT cut " << TRTHitRatio << " < " << m_trtRatio );
165  return false;
166  }
167 
168 
169  cutCounter++;
170  if(m_doLRT){
171  ATH_MSG_DEBUG( "doLRT: " <<m_doLRT);
172  ATH_MSG_DEBUG( "Track d0: " <<trk_d0);
173 
174  if(trk_d0 < m_d0){
175  ATH_MSG_DEBUG( "Fails d0 cut " <<trk_d0<< " < " <<m_d0 );
176  return false;
177  }
178  }
179  mon_trk_d0 = trk_d0;
180 
181  ATH_MSG_DEBUG( "Passed selection" );
182  return true;
183 
184 }

◆ decide_ringer()

bool TrigEgammaFastElectronHypoTool::decide_ringer ( const ITrigEgammaFastElectronHypoTool::ElectronInfo i) const
private

Definition at line 190 of file TrigEgammaFastElectronHypoTool.cxx.

191 {
192 
193  if ( m_acceptAll ) {
194  ATH_MSG_DEBUG( "AcceptAll property is set: taking all events" );
195  return true;
196  } else {
197  ATH_MSG_DEBUG( "AcceptAll property not set: applying selection" );
198  }
199  auto cutCounter = Monitored::Scalar<int>( "CutCounter", -1 );
200  auto mon_ptCalo = Monitored::Scalar( "PtCalo", -999. );
201  auto mon_ptTrack = Monitored::Scalar( "PtTrack", -999. );
202  auto mon_dEtaCalo = Monitored::Scalar( "CaloTrackdEta", -1. );
203  auto mon_dPhiCalo = Monitored::Scalar( "CaloTrackdPhi", -1. );
204  auto mon_eToverPt = Monitored::Scalar( "CaloTrackEoverP", -1. );
205  auto mon_caloEta = Monitored::Scalar( "CaloEta", -100. );
206  auto mon_caloPhi = Monitored::Scalar( "CaloPhi", -100. );
207  auto mon_trk_d0 = Monitored::Scalar( "d0Value", -1. );
208  auto mon_nnOutput = Monitored::Scalar("NNOutput",-100);
209 
210  auto mon = Monitored::Group( m_monTool,
211  cutCounter,
212  mon_ptCalo,
213  mon_ptTrack,
214  mon_dEtaCalo,
215  mon_dPhiCalo,
216  mon_eToverPt,
217  mon_caloEta,
218  mon_caloPhi,
219  mon_trk_d0,
220  mon_nnOutput);
221 
222  auto el = input.electron;
223 
224  if(!el){
225  return false;
226  }
227 
228  float ptCalo(0), dEtaCalo(0), dPhiCalo(0), eToverPt(0), caloEta(0), caloPhi(0), trk_d0(0), nnOutput(0);
229 
230  cutCounter++;
231 
232  const xAOD::TrackParticle* trk = el->trackParticle();
233  if ( !trk ){
234  ATH_MSG_DEBUG("disconsider candidates without track");
235  return false;
236  }
237  cutCounter++;
238 
239  // Retrieve all quantities
240  dPhiCalo = el->trkClusDphi();
241  dEtaCalo = el->trkClusDeta();
242  ptCalo = el->pt();
243  eToverPt = el->etOverPt();
244  caloEta = el->caloEta();
245  caloPhi = el->caloPhi();
246  trk_d0 = std::abs(trk->d0());
247 
248 
249  if ( ptCalo < m_trackPt ){
250  ATH_MSG_DEBUG( "Fails pt cut" << ptCalo << " < " << m_trackPt );
251  return false;
252  }
253  mon_ptCalo = ptCalo;
254  cutCounter++;
255 
256  auto rings = input.rings;
257  if(!rings){
258  ATH_MSG_DEBUG("disconsider candidates without rings");
259  return false;
260  }
261  cutCounter++;
262 
263  auto clus = input.cluster;
264  if(!clus){
265  ATH_MSG_DEBUG("disconsider candidates without cluster");
266  return false;
267  }
268  cutCounter++;
269 
270 
271  bool pass = false;
272  if( input.pidDecorator.count(m_pidName)){
273  nnOutput = input.valueDecorator.at(m_pidName+"NNOutput");
274  pass = input.pidDecorator.at(m_pidName);
275  ATH_MSG_DEBUG( "Get the decision for " << m_pidName << ": " << (pass?"Yes":"No") );
276  }
277 
278 
279  mon_ptTrack = m_trackPt;
280  mon_dEtaCalo = dEtaCalo;
281  mon_dPhiCalo = dPhiCalo;
282  mon_eToverPt = eToverPt;
283  mon_caloEta = caloEta;
284  mon_caloPhi = caloPhi;
285  mon_trk_d0 = trk_d0;
286  mon_nnOutput = nnOutput;
287 
288 
289  return pass;
290 }

◆ initialize()

StatusCode TrigEgammaFastElectronHypoTool::initialize ( )
overridevirtual

Definition at line 24 of file TrigEgammaFastElectronHypoTool.cxx.

24  {
25 
26  if ( !m_monTool.empty() ) ATH_CHECK( m_monTool.retrieve() );
27 
28 
29  ATH_MSG_DEBUG( "AcceptAll = " << ( m_acceptAll? "True" : "False" ) );
30  ATH_MSG_DEBUG( "Do_Ringer = " << ( m_doRinger ? "True" : "False" ) );
31  ATH_MSG_DEBUG( "TrackPt = " << m_trackPt );
32  ATH_MSG_DEBUG( "CaloTrackdETA = " << m_caloTrackDEta );
33  ATH_MSG_DEBUG( "CaloTrackdPHI = " << m_caloTrackDPhi );
34  ATH_MSG_DEBUG( "CaloTrackdEoverPLow = " << m_caloTrackdEoverPLow );
35  ATH_MSG_DEBUG( "CaloTrackdEoverPHigh = " << m_caloTrackdEoverPHigh );
36  ATH_MSG_DEBUG( "TRTRatio = " << m_trtRatio );
37  ATH_MSG_DEBUG( "Do_LRT = " << m_doLRT );
38  ATH_MSG_DEBUG( "d0Cut = " << m_d0 );
39 
40  ATH_MSG_DEBUG( "Tool configured for chain/id: " << m_decisionId );
41 
42  ATH_MSG_DEBUG( "Initialization completed successfully:" );
43  return StatusCode::SUCCESS;
44 }

Member Data Documentation

◆ m_acceptAll

Gaudi::Property<bool> TrigEgammaFastElectronHypoTool::m_acceptAll { this, "AcceptAll", false, "Ignore selection" }
private

Definition at line 43 of file TrigEgammaFastElectronHypoTool.h.

◆ m_caloTrackdEoverPHigh

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_caloTrackdEoverPHigh { this, "CaloTrackdEoverPHigh", 0, "Max E over pT cut" }
private

Definition at line 50 of file TrigEgammaFastElectronHypoTool.h.

◆ m_caloTrackdEoverPLow

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_caloTrackdEoverPLow { this, "CaloTrackdEoverPLow", 0, "Min E over Pt cut "}
private

Definition at line 49 of file TrigEgammaFastElectronHypoTool.h.

◆ m_caloTrackDEta

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_caloTrackDEta { this, "CaloTrackdETA", 0, "Delta Eta between the track and cluster" }
private

Definition at line 47 of file TrigEgammaFastElectronHypoTool.h.

◆ m_caloTrackDPhi

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_caloTrackDPhi { this, "CaloTrackdPHI", 0, "Delta Phi between track and cluster" }
private

Definition at line 48 of file TrigEgammaFastElectronHypoTool.h.

◆ m_d0

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_d0 { this, "d0Cut", 0, "d0 cut" }
private

Definition at line 52 of file TrigEgammaFastElectronHypoTool.h.

◆ m_decisionId

HLT::Identifier TrigEgammaFastElectronHypoTool::m_decisionId
private

Definition at line 41 of file TrigEgammaFastElectronHypoTool.h.

◆ m_doLRT

Gaudi::Property<bool> TrigEgammaFastElectronHypoTool::m_doLRT { this, "DoLRT", false, "apply d0 cut for LRT triggers" }
private

Definition at line 44 of file TrigEgammaFastElectronHypoTool.h.

◆ m_doRinger

Gaudi::Property<bool> TrigEgammaFastElectronHypoTool::m_doRinger { this, "DoRinger", false, "apply NN ringer selection" }
private

Definition at line 45 of file TrigEgammaFastElectronHypoTool.h.

◆ m_monTool

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

Definition at line 54 of file TrigEgammaFastElectronHypoTool.h.

◆ m_pidName

Gaudi::Property<std::string> TrigEgammaFastElectronHypoTool::m_pidName {this,"PidName", "", "Pid name"}
private

Definition at line 53 of file TrigEgammaFastElectronHypoTool.h.

◆ m_trackPt

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_trackPt { this, "TrackPt", 5.0*Gaudi::Units::GeV, "Track pT requirement ( separate threshold for each electron )" }
private

Definition at line 46 of file TrigEgammaFastElectronHypoTool.h.

◆ m_trtRatio

Gaudi::Property<float> TrigEgammaFastElectronHypoTool::m_trtRatio { this, "TRTRatio", 0, "TRT HT ratio" }
private

Definition at line 51 of file TrigEgammaFastElectronHypoTool.h.


The documentation for this class was generated from the following files:
TrigEgammaFastElectronHypoTool::m_pidName
Gaudi::Property< std::string > m_pidName
Definition: TrigEgammaFastElectronHypoTool.h:53
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
HLT::Identifier::numeric
TrigCompositeUtils::DecisionID numeric() const
numeric ID
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:47
TrigEgammaFastElectronHypoTool::m_acceptAll
Gaudi::Property< bool > m_acceptAll
Definition: TrigEgammaFastElectronHypoTool.h:43
TrigCompositeUtils::addDecisionID
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Definition: TrigCompositeUtilsRoot.cxx:61
TrigEgammaFastElectronHypoTool::decide_ringer
bool decide_ringer(const ITrigEgammaFastElectronHypoTool::ElectronInfo &i) const
Definition: TrigEgammaFastElectronHypoTool.cxx:190
xAOD::TrackParticle_v1::d0
float d0() const
Returns the parameter.
HLT::Identifier::fromToolName
static HLT::Identifier fromToolName(const std::string &tname)
Definition: HLTIdentifier.cxx:31
TrigEgammaFastElectronHypoTool::m_doLRT
Gaudi::Property< bool > m_doLRT
Definition: TrigEgammaFastElectronHypoTool.h:44
TrigEgammaFastElectronHypoTool::m_trtRatio
Gaudi::Property< float > m_trtRatio
Definition: TrigEgammaFastElectronHypoTool.h:51
lumiFormat.i
int i
Definition: lumiFormat.py:92
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
test_pyathena.parent
parent
Definition: test_pyathena.py:15
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::caloPhi
setRcore setEtHad setFside setPt caloPhi
Definition: TrigPhoton_v1.cxx:111
TrigEgammaFastElectronHypoTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigEgammaFastElectronHypoTool.h:54
TrigEgammaFastElectronHypoTool::decide_cb
bool decide_cb(const ITrigEgammaFastElectronHypoTool::ElectronInfo &i) const
Definition: TrigEgammaFastElectronHypoTool.cxx:68
TrigEgammaFastElectronHypoTool::decide
virtual StatusCode decide(std::vector< ITrigEgammaFastElectronHypoTool::ElectronInfo > &input) const override
Definition: TrigEgammaFastElectronHypoTool.cxx:48
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TrigEgammaFastElectronHypoTool::m_doRinger
Gaudi::Property< bool > m_doRinger
Definition: TrigEgammaFastElectronHypoTool.h:45
TrigEgammaFastElectronHypoTool::m_caloTrackdEoverPHigh
Gaudi::Property< float > m_caloTrackdEoverPHigh
Definition: TrigEgammaFastElectronHypoTool.h:50
TrigEgammaFastElectronHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigEgammaFastElectronHypoTool.h:41
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
plotBeamSpotMon.mon
mon
Definition: plotBeamSpotMon.py:67
TrigEgammaFastElectronHypoTool::m_d0
Gaudi::Property< float > m_d0
Definition: TrigEgammaFastElectronHypoTool.h:52
TrigEgammaFastElectronHypoTool::m_caloTrackDEta
Gaudi::Property< float > m_caloTrackDEta
Definition: TrigEgammaFastElectronHypoTool.h:47
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
TrigEgammaFastElectronHypoTool::m_caloTrackDPhi
Gaudi::Property< float > m_caloTrackDPhi
Definition: TrigEgammaFastElectronHypoTool.h:48
TrigEgammaFastElectronHypoTool::m_caloTrackdEoverPLow
Gaudi::Property< float > m_caloTrackdEoverPLow
Definition: TrigEgammaFastElectronHypoTool.h:49
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TrigEgammaFastElectronHypoTool::m_trackPt
Gaudi::Property< float > m_trackPt
Definition: TrigEgammaFastElectronHypoTool.h:46