ATLAS Offline Software
Loading...
Searching...
No Matches
DisplacedJetDispHypoTool Class Reference

#include <DisplacedJetDispHypoTool.h>

Inheritance diagram for DisplacedJetDispHypoTool:
Collaboration diagram for DisplacedJetDispHypoTool:

Classes

struct  Info

Public Member Functions

 DisplacedJetDispHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~DisplacedJetDispHypoTool ()=default
virtual StatusCode initialize () override
StatusCode decide (Info &info) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

HLT::Identifier m_decisionId
Gaudi::Property< float > m_min_trk_pt {this, "min_trk_pt",{0}, "Minimum pt for a track [GeV]"}
Gaudi::Property< float > m_d0cut {this, "trk_d0cut",{4}, "D0 cut applied to split prompt/displaced"}
Gaudi::Property< float > m_z0stcut {this, "max_z0st",{3.0}, "Maximum value for z0*sin(theta) [mm]"}
Gaudi::Property< float > m_d0sigcut {this, "d0sigcut",{25.0}, "Maximum value for z0*sin(theta) [mm]"}
Gaudi::Property< int > m_maxprompt {this, "max_prompt_trk",{2}, "Max number of prompt tracks in a jet"}
Gaudi::Property< int > m_mindisp {this, "min_disp_trk",{3}, "Min number of disp tracks in a jet"}
Gaudi::Property< float > m_nother_frac {this, "nother_frac",{0.75}, "nother frac"}
Gaudi::Property< std::string > m_cutname {this, "cut_name",{""}, "Name of cuts, used for decoration names"}
Gaudi::Property< bool > m_usebeamspot {this, "use_beamspot",{true}, "Use beamspot info"}
ToolHandle< GenericMonitoringToolm_monTool {this,"MonTool","","Monitoring tool"}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 18 of file DisplacedJetDispHypoTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ DisplacedJetDispHypoTool()

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

Definition at line 13 of file DisplacedJetDispHypoTool.cxx.

14: AthAlgTool( type, name, parent ),
AthAlgTool()
Default constructor:
static HLT::Identifier fromToolName(const std::string &tname)

◆ ~DisplacedJetDispHypoTool()

virtual DisplacedJetDispHypoTool::~DisplacedJetDispHypoTool ( )
virtualdefault

Member Function Documentation

◆ decide()

StatusCode DisplacedJetDispHypoTool::decide ( Info & info) const

Definition at line 22 of file DisplacedJetDispHypoTool.cxx.

22 {
23 if ( info.previousDecisionIDs.count( m_decisionId.numeric() ) == 0 ) {
24 ATH_MSG_DEBUG("Already rejected");
25 return StatusCode::SUCCESS;
26 }
27
28 auto mon_ndisp = Monitored::Scalar<int>("ndisp", -1);
29 auto mon_nprompt = Monitored::Scalar<int>("nprompt", -1);
30 auto mon_frac_other = Monitored::Scalar<float>("frac_other", -1.0);
31
32 std::vector<float> monvec_trk_d0sig;
33 std::vector<float> monvec_trk_z0st;
34 std::vector<float> monvec_trk_d0;
35
36 auto mon_trk_d0sig = Monitored::Collection("trk_d0sig", monvec_trk_d0sig);
37 auto mon_trk_z0st = Monitored::Collection("trk_z0st", monvec_trk_z0st);
38 auto mon_trk_d0 = Monitored::Collection("trk_d0", monvec_trk_d0);
39
40 Monitored::Group mon_group(m_monTool, mon_ndisp, mon_nprompt, mon_frac_other, mon_trk_d0sig, mon_trk_z0st, mon_trk_d0);
41
42 //apply the track counting for the displaced tracks
43 int ndisp = info.counts->getDetail<int>("ndisp_"+m_cutname);
44 int nother = info.counts->getDetail<int>("nother_"+m_cutname);
45 int nprompt = info.counts->getDetail<int>("nprompt_"+m_cutname);
46
47
48 for(auto trk: *(info.lrt_tracks)){
49 if(trk->pt()/Gaudi::Units::GeV < m_min_trk_pt) continue;
50 unsigned int track_class = 0;
51
52 monvec_trk_d0.push_back(std::abs(trk->d0()));
53
54 if(std::abs(trk->d0()) < m_d0cut){
55 double dz0 = trk->z0() + trk->vz() - info.primary_vertex->z();
56 double dz0st = std::abs(std::sin(trk->theta()) * dz0);
57
58 monvec_trk_z0st.push_back(dz0st);
59
60 if(dz0st <= m_z0stcut){
61 track_class = 1; //prompt
62 }
63 }else{
64 double d0sig = 0.0;
65
66 if(m_usebeamspot){
67 d0sig = std::abs(xAOD::TrackingHelpers::d0significance(trk, info.beamspot.sigmaX(), info.beamspot.sigmaY(), info.beamspot.sigmaXY()));
68 }else{
69 d0sig = std::abs(xAOD::TrackingHelpers::d0significance(trk));
70 }
71
72 monvec_trk_d0sig.push_back(d0sig);
73
74 //candidate displaced
75 if(d0sig >= m_d0sigcut){
76 track_class = 2; //displaced
77 ATH_MSG_DEBUG("disp_trk in jet "<<info.jet->pt()/Gaudi::Units::GeV<<" accepted pT: "<<trk->pt()/Gaudi::Units::GeV<<" d0: "<<std::abs(trk->d0())<< " d0sig: "<<d0sig);
78 }else{
79 ATH_MSG_DEBUG("disp_trk in jet "<<info.jet->pt()/Gaudi::Units::GeV<<" dropped for d0sig pT: "<<trk->pt()/Gaudi::Units::GeV<<" d0: "<<std::abs(trk->d0())<< " d0sig: "<<d0sig);
80 }
81 }
82
83 if(track_class == 1){
84 nprompt += 1;
85 }else if(track_class == 2){
86 ndisp += 1;
87 }else if(track_class == 0){
88 nother += 1;
89 }
90 }
91 double nother_frac = 0.0;
92 //ensure divide by zero does not occur
93 if((nother + ndisp + nprompt) > 0){
94 nother_frac = nother*1.0/(nother + ndisp + nprompt);
95 }
96
97 ANA_MSG_DEBUG("jet pT = "<<info.jet->pt()/Gaudi::Units::GeV<<" nPrompt = "<<nprompt<<" nDisp = "<<ndisp<<" nother = "<<nother);
98
99 mon_ndisp = ndisp;
100 mon_nprompt = nprompt;
101 mon_frac_other = nother_frac;
102
103 if(ndisp >= m_mindisp && nprompt <= m_maxprompt && nother_frac <= m_nother_frac){
104 //monitor passing jet pt and eta
105 auto mon_jetpt = Monitored::Scalar<float>("pass_jet_pt", 0.0);
106 auto mon_jeteta = Monitored::Scalar<float>("pass_jet_eta", -100);
107 Monitored::Group mg_passing(m_monTool, mon_jetpt, mon_jeteta);
108 mon_jetpt = info.jet->pt()/Gaudi::Units::GeV;
109 mon_jeteta = info.jet->eta();
110
111 addDecisionID( m_decisionId.numeric(), info.decision );
112 }
113
114 return StatusCode::SUCCESS;
115}
#define ATH_MSG_DEBUG(x)
#define ANA_MSG_DEBUG(xmsg)
Macro printing debug messages.
Gaudi::Property< float > m_min_trk_pt
ToolHandle< GenericMonitoringTool > m_monTool
Gaudi::Property< float > m_d0cut
Gaudi::Property< bool > m_usebeamspot
Gaudi::Property< float > m_z0stcut
Gaudi::Property< float > m_nother_frac
Gaudi::Property< std::string > m_cutname
Gaudi::Property< int > m_maxprompt
Gaudi::Property< int > m_mindisp
Gaudi::Property< float > m_d0sigcut
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
double d0significance(const xAOD::TrackParticle *tp, double d0_uncert_beam_spot_2)

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ initialize()

StatusCode DisplacedJetDispHypoTool::initialize ( )
overridevirtual

Definition at line 17 of file DisplacedJetDispHypoTool.cxx.

17 {
18 if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
19 return StatusCode::SUCCESS;
20}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_cutname

Gaudi::Property<std::string> DisplacedJetDispHypoTool::m_cutname {this, "cut_name",{""}, "Name of cuts, used for decoration names"}
private

Definition at line 55 of file DisplacedJetDispHypoTool.h.

55{this, "cut_name",{""}, "Name of cuts, used for decoration names"};

◆ m_d0cut

Gaudi::Property<float> DisplacedJetDispHypoTool::m_d0cut {this, "trk_d0cut",{4}, "D0 cut applied to split prompt/displaced"}
private

Definition at line 45 of file DisplacedJetDispHypoTool.h.

45{this, "trk_d0cut",{4}, "D0 cut applied to split prompt/displaced"};

◆ m_d0sigcut

Gaudi::Property<float> DisplacedJetDispHypoTool::m_d0sigcut {this, "d0sigcut",{25.0}, "Maximum value for z0*sin(theta) [mm]"}
private

Definition at line 48 of file DisplacedJetDispHypoTool.h.

48{this, "d0sigcut",{25.0}, "Maximum value for z0*sin(theta) [mm]"};

◆ m_decisionId

HLT::Identifier DisplacedJetDispHypoTool::m_decisionId
private

Definition at line 43 of file DisplacedJetDispHypoTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_maxprompt

Gaudi::Property<int> DisplacedJetDispHypoTool::m_maxprompt {this, "max_prompt_trk",{2}, "Max number of prompt tracks in a jet"}
private

Definition at line 51 of file DisplacedJetDispHypoTool.h.

51{this, "max_prompt_trk",{2}, "Max number of prompt tracks in a jet"};

◆ m_min_trk_pt

Gaudi::Property<float> DisplacedJetDispHypoTool::m_min_trk_pt {this, "min_trk_pt",{0}, "Minimum pt for a track [GeV]"}
private

Definition at line 44 of file DisplacedJetDispHypoTool.h.

44{this, "min_trk_pt",{0}, "Minimum pt for a track [GeV]"};

◆ m_mindisp

Gaudi::Property<int> DisplacedJetDispHypoTool::m_mindisp {this, "min_disp_trk",{3}, "Min number of disp tracks in a jet"}
private

Definition at line 52 of file DisplacedJetDispHypoTool.h.

52{this, "min_disp_trk",{3}, "Min number of disp tracks in a jet"};

◆ m_monTool

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

Definition at line 59 of file DisplacedJetDispHypoTool.h.

59{this,"MonTool","","Monitoring tool"};

◆ m_nother_frac

Gaudi::Property<float> DisplacedJetDispHypoTool::m_nother_frac {this, "nother_frac",{0.75}, "nother frac"}
private

Definition at line 53 of file DisplacedJetDispHypoTool.h.

53{this, "nother_frac",{0.75}, "nother frac"};

◆ m_usebeamspot

Gaudi::Property<bool> DisplacedJetDispHypoTool::m_usebeamspot {this, "use_beamspot",{true}, "Use beamspot info"}
private

Definition at line 57 of file DisplacedJetDispHypoTool.h.

57{this, "use_beamspot",{true}, "Use beamspot info"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_z0stcut

Gaudi::Property<float> DisplacedJetDispHypoTool::m_z0stcut {this, "max_z0st",{3.0}, "Maximum value for z0*sin(theta) [mm]"}
private

Definition at line 47 of file DisplacedJetDispHypoTool.h.

47{this, "max_z0st",{3.0}, "Maximum value for z0*sin(theta) [mm]"};

The documentation for this class was generated from the following files: