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

#include <DisplacedJetPromptHypoTool.h>

Inheritance diagram for DisplacedJetPromptHypoTool:
Collaboration diagram for DisplacedJetPromptHypoTool:

Classes

struct  Info

Public Member Functions

 DisplacedJetPromptHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~DisplacedJetPromptHypoTool ()=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_jet_pt {this, "min_jet_pt",{0}, "Minimum jet pt [GeV]"}
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",{4}, "Max number of prompt tracks in a jet"}
Gaudi::Property< unsigned int > m_rankcut {this, "max_jet_rank",{4}, "Maximum jet rank which will be processed"}
Gaudi::Property< int > m_minnjets {this, "min_njets",{2}, "Minimum number of jets left for it to be worth processing the event"}
Gaudi::Property< std::string > m_cutname {this, "cut_name",{""}, "Name of cuts, used for decoration names"}
Gaudi::Property< int > m_maxjets {this, "max_jets",{0}, "Max jets allowed in an event after ranking"}
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 17 of file DisplacedJetPromptHypoTool.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

◆ DisplacedJetPromptHypoTool()

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

Definition at line 15 of file DisplacedJetPromptHypoTool.cxx.

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

◆ ~DisplacedJetPromptHypoTool()

virtual DisplacedJetPromptHypoTool::~DisplacedJetPromptHypoTool ( )
virtualdefault

Member Function Documentation

◆ decide()

StatusCode DisplacedJetPromptHypoTool::decide ( Info & info) const

Definition at line 24 of file DisplacedJetPromptHypoTool.cxx.

24 {
25 //setup monitoring
26 auto mon_nprompt = Monitored::Scalar<int>("nprompt", -1);
27
28 std::vector<float> monvec_trk_d0sig;
29 std::vector<float> monvec_trk_z0st;
30 std::vector<float> monvec_trk_d0;
31
32 auto mon_trk_d0sig = Monitored::Collection("trk_d0sig", monvec_trk_d0sig);
33 auto mon_trk_z0st = Monitored::Collection("trk_z0st", monvec_trk_z0st);
34 auto mon_trk_d0 = Monitored::Collection("trk_d0", monvec_trk_d0);
35 Monitored::Group mon_group(m_monTool, mon_nprompt, mon_trk_z0st, mon_trk_d0sig, mon_trk_d0);
36
37
38 if ( info.previousDecisionIDs.count( m_decisionId.numeric() ) == 0 ) {
39 ATH_MSG_DEBUG("Already rejected");
40 return StatusCode::SUCCESS;
41 }
42
43 //apply jet cuts
44 //jet pt cut
45 if(info.jet->pt()/Gaudi::Units::GeV < m_min_jet_pt){
46 return StatusCode::SUCCESS;
47 }
48
49 //reject jets outside the barrel region
50 if(std::abs(info.jet->eta()) > 2.4){
51 return StatusCode::SUCCESS;
52 }
53
54 //apply track counts
55 int nprompt = 0;
56 int nother = 0;
57 int ndisp = 0;
58
59 for(auto trk: info.tracks){
60 if(trk->pt()/Gaudi::Units::GeV < m_min_trk_pt) continue;
61 unsigned int track_class = 0;
62
63 monvec_trk_d0.push_back(std::abs(trk->d0()));
64
65 if(std::abs(trk->d0()) < m_d0cut){
66 double dz0 = trk->z0() + trk->vz() - info.primary_vertex->z();
67 double dz0st = std::abs(std::sin(trk->theta()) * dz0);
68
69 monvec_trk_z0st.push_back(dz0st);
70
71 if(dz0st <= m_z0stcut){
72 track_class = 1; //prompt
73 }
74 }else{
75 //candidate displaced
76 double d0sig = 0.0;
77
78 if(m_usebeamspot){
79 d0sig = std::abs(xAOD::TrackingHelpers::d0significance(trk, info.beamspot.sigmaX(), info.beamspot.sigmaY(), info.beamspot.sigmaXY()));
80 }else{
81 d0sig = std::abs(xAOD::TrackingHelpers::d0significance(trk));
82 }
83
84 monvec_trk_d0sig.push_back(d0sig);
85
86 if(d0sig >= m_d0sigcut){
87 track_class = 2; //displaced
88 }
89 }
90
91 if(track_class == 1){
92 nprompt += 1;
93 }else if(track_class == 2){
94 ndisp += 1;
95 }else if(track_class == 0){
96 nother += 1;
97 }
98 }
99
100 mon_nprompt = nprompt;
101
102 if(nprompt > m_maxprompt){
103 //reject the jet
104 return StatusCode::SUCCESS;
105 }
106
107 //store in counts container
108 info.counts->setDetail<int>("nprompt_"+m_cutname, nprompt);
109 info.counts->setDetail<int>("ndisp_"+m_cutname, ndisp);
110 info.counts->setDetail<int>("nother_"+m_cutname, nother);
111
112 ATH_MSG_DEBUG("Passing Jet pT = "<<info.jet->pt()/Gaudi::Units::GeV);
113
114 //record some info about the passed jet
115 auto mon_jetpt = Monitored::Scalar<float>("pass_jet_pt", 0.0);
116 auto mon_jeteta = Monitored::Scalar<float>("pass_jet_eta", -100);
117 Monitored::Group mg_passing(m_monTool, mon_jetpt, mon_jeteta);
118 mon_jetpt = info.jet->pt()/Gaudi::Units::GeV;
119 mon_jeteta = info.jet->eta();
120
121 addDecisionID(m_decisionId.numeric(), info.output_decision);
122
123 return StatusCode::SUCCESS;
124}
#define ATH_MSG_DEBUG(x)
Gaudi::Property< float > m_min_trk_pt
Gaudi::Property< float > m_d0sigcut
ToolHandle< GenericMonitoringTool > m_monTool
Gaudi::Property< float > m_min_jet_pt
Gaudi::Property< std::string > m_cutname
Gaudi::Property< bool > m_usebeamspot
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 DisplacedJetPromptHypoTool::initialize ( )
overridevirtual

Definition at line 19 of file DisplacedJetPromptHypoTool.cxx.

19 {
20 if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
21 return StatusCode::SUCCESS;
22}
#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> DisplacedJetPromptHypoTool::m_cutname {this, "cut_name",{""}, "Name of cuts, used for decoration names"}
private

Definition at line 52 of file DisplacedJetPromptHypoTool.h.

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

◆ m_d0cut

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

Definition at line 46 of file DisplacedJetPromptHypoTool.h.

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

◆ m_d0sigcut

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

Definition at line 48 of file DisplacedJetPromptHypoTool.h.

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

◆ m_decisionId

HLT::Identifier DisplacedJetPromptHypoTool::m_decisionId
private

Definition at line 43 of file DisplacedJetPromptHypoTool.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_maxjets

Gaudi::Property<int> DisplacedJetPromptHypoTool::m_maxjets {this, "max_jets",{0}, "Max jets allowed in an event after ranking"}
private

Definition at line 53 of file DisplacedJetPromptHypoTool.h.

53{this, "max_jets",{0}, "Max jets allowed in an event after ranking"};

◆ m_maxprompt

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

Definition at line 49 of file DisplacedJetPromptHypoTool.h.

49{this, "max_prompt_trk",{4}, "Max number of prompt tracks in a jet"};

◆ m_min_jet_pt

Gaudi::Property<float> DisplacedJetPromptHypoTool::m_min_jet_pt {this, "min_jet_pt",{0}, "Minimum jet pt [GeV]"}
private

Definition at line 44 of file DisplacedJetPromptHypoTool.h.

44{this, "min_jet_pt",{0}, "Minimum jet pt [GeV]"};

◆ m_min_trk_pt

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

Definition at line 45 of file DisplacedJetPromptHypoTool.h.

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

◆ m_minnjets

Gaudi::Property<int> DisplacedJetPromptHypoTool::m_minnjets {this, "min_njets",{2}, "Minimum number of jets left for it to be worth processing the event"}
private

Definition at line 51 of file DisplacedJetPromptHypoTool.h.

51{this, "min_njets",{2}, "Minimum number of jets left for it to be worth processing the event"};

◆ m_monTool

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

Definition at line 58 of file DisplacedJetPromptHypoTool.h.

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

◆ m_rankcut

Gaudi::Property<unsigned int> DisplacedJetPromptHypoTool::m_rankcut {this, "max_jet_rank",{4}, "Maximum jet rank which will be processed"}
private

Definition at line 50 of file DisplacedJetPromptHypoTool.h.

50{this, "max_jet_rank",{4}, "Maximum jet rank which will be processed"};

◆ m_usebeamspot

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

Definition at line 55 of file DisplacedJetPromptHypoTool.h.

55{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> DisplacedJetPromptHypoTool::m_z0stcut {this, "max_z0st",{3.0}, "Maximum value for z0*sin(theta) [mm]"}
private

Definition at line 47 of file DisplacedJetPromptHypoTool.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: