ATLAS Offline Software
JetGhostTrackSelection.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3  */
4 
7 
9 #include "xAODTracking/Vertex.h"
10 
11 #include "TopEvent/EventTools.h"
12 
13 #include "AsgTools/AsgTool.h"
14 #include "AsgTools/ToolHandle.h"
15 
17 using namespace TopObjectSelectionTools;
18 
19 namespace top {
20 
21  JetGhostTrackSelection::JetGhostTrackSelection(const double ptcut, const double etamax, const std::string vertexassociation, const double ptcut_jet, const double etacut_jet ) :
22  m_ptcut(ptcut),
23  m_etamax(etamax),
24  m_ptcut_jet(ptcut_jet),
25  m_etamax_jet(etacut_jet),
26  m_vertexassociation(vertexassociation),
27  m_trkseltool("top::GhostTrackCPTools::TrkSelTool")
28  {
29 
30  top::check(m_trkseltool.retrieve(), "Failed to retrieve InDetTrackSelectionTool");
31 
32  // https://twiki.cern.ch/twiki/bin/view/AtlasProtected/TrackingCPRecsRun2Final
33  if (m_vertexassociation == "nominal"){
34  m_d0=2;
35  m_z0sintheta=3;
36  }
37  else if(m_vertexassociation == "tight"){
38  m_d0=0.5;
39  m_z0sintheta=0.5;
40  }
41  else {
42  ATH_MSG_INFO("Not applying any vertex association for GA tracks");
43  m_d0=10000;
44  m_z0sintheta=10000;
45 
46  }
47 
48  }
49 
51  }
52 
53 // bool JetGhostTrackSelection::passSelection(const xAOD::TrackParticle& track, const xAOD::Vertex& primaryVertex) const {
54 
55 // // Track quality requirements
56 // if (track.pt() < m_ptcut) return false;
57 //
58 // if (std::fabs(track.eta()) > m_etamax) return false;
59 //
60 // if ( !m_trkseltool->accept(track, &primaryVertex ) ) return false;
61 //
62 // // Vertex association requirements
63 // float deltaz0 = track.z0() + track.vz() - primaryVertex.z();
64 //
65 // if ((std::fabs(track.d0()) > m_d0) || (std::fabs(sin(track.theta()) * deltaz0) > m_z0sintheta))
66 // return false;
67 
68 // return true;
69 // }
70 
72  if ( (pt > m_ptcut_jet) && (std::abs(eta) < m_etamax_jet) ){
73  return true;
74  }
75  else {
76  return false;
77  }
78 
79  }
80 
81  void JetGhostTrackSelection::print(std::ostream& os) const {
82  os << "Ghost Associated Track \n"
83  << " * pT > " << m_ptcut << "\n"
84  << " * |eta| < " << m_etamax
85  << " * |d0| < " << m_d0
86  << " * |z0sintheta| < " << m_z0sintheta;
87  }
88 
89 
90 }
top::JetGhostTrackSelection::m_etamax
double m_etamax
Definition: JetGhostTrackSelection.h:26
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
test_pyathena.pt
pt
Definition: test_pyathena.py:11
top::JetGhostTrackSelection::m_etamax_jet
double m_etamax_jet
Definition: JetGhostTrackSelection.h:30
top::JetGhostTrackSelection::m_z0sintheta
double m_z0sintheta
Definition: JetGhostTrackSelection.h:35
top::JetGhostTrackSelection::m_ptcut_jet
double m_ptcut_jet
Definition: JetGhostTrackSelection.h:29
Pythia8_A14_NNPDF23LO_forMGHT_EvtGen.ptcut
float ptcut
Definition: Pythia8_A14_NNPDF23LO_forMGHT_EvtGen.py:9
MsgCategory.h
EventTools.h
A few functions for doing operations on particles / events. Currently holds code for dR,...
JetGhostTrackSelection.h
InDetTrackSelectionTool.h
top::check
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
Definition: EventTools.cxx:15
Vertex.h
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
top::JetGhostTrackSelection::print
virtual void print(std::ostream &os) const override
Because everybody likes to know what object definitions they ran with.
Definition: JetGhostTrackSelection.cxx:81
top::JetGhostTrackSelection::~JetGhostTrackSelection
~JetGhostTrackSelection()
Definition: JetGhostTrackSelection.cxx:50
TrackParticle.h
top::JetGhostTrackSelection::m_vertexassociation
std::string m_vertexassociation
Definition: JetGhostTrackSelection.h:33
top::JetGhostTrackSelection::m_ptcut
double m_ptcut
Definition: JetGhostTrackSelection.h:25
top::JetGhostTrackSelection::m_d0
double m_d0
Definition: JetGhostTrackSelection.h:34
ToolHandle.h
AsgTool.h
top::JetGhostTrackSelection::m_trkseltool
ToolHandle< InDet::InDetTrackSelectionTool > m_trkseltool
Definition: JetGhostTrackSelection.h:38
top::JetGhostTrackSelection::JetConsideredForGhostTrackSelection
virtual bool JetConsideredForGhostTrackSelection(double pt, double eta) const override
For the main analysis object selection.
Definition: JetGhostTrackSelection.cxx:71