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

#include <JetForwardJvtToolBDT.h>

Inheritance diagram for JetForwardJvtToolBDT:

Public Member Functions

 JetForwardJvtToolBDT (const std::string &name)
 Constructor with parameters:
virtual ~JetForwardJvtToolBDT ()
 Destructor:
virtual StatusCode initialize () override
 Dummy implementation of the initialisation function.
virtual StatusCode decorate (const xAOD::JetContainer &jetCont) const override
 Decorate a jet collection without otherwise modifying it.
StatusCode getInputs (const xAOD::Jet *jet) const
float getMVfJVT (const xAOD::Jet *jet, int pvind, const std::vector< TVector2 > &pileupMomenta) const
float getFJVT (const xAOD::Jet *jet, int pvind, const std::vector< TVector2 > &pileupMomenta) const
bool forwardJet (const xAOD::Jet *jet) const
bool centralJet (const xAOD::Jet *jet) const
float getDrpt (const xAOD::Jet *jet) const
int getJetVertex (const xAOD::Jet *jet) const
bool passMVfJVT (float mvfjvt, float pt, float eta) const
StatusCode tagTruth (const xAOD::JetContainer *jets, const xAOD::JetContainer *truthJets)
std::vector< TVector2 > calculateVertexMomenta (const xAOD::JetContainer *jets, int pvind) const
int getPV () const
virtual void print () const
 Print the state of the tool.
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
virtual StatusCode modify (xAOD::JetContainer &jets) const override final
 Concrete implementation of the function inherited from IJetModifier.
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

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

Gaudi::Property< std::string > m_configDir {this, "configDir", "JetPileupTag/MVfJVT/", "Configuration directory"}
Gaudi::Property< std::vector< std::string > > m_MVconfig
Gaudi::Property< std::string > m_wpFile {this, "WPfile", "MVfJVT_WPs.Nov2019.root", "WP file"}
std::unique_ptr< TFile > m_wpFileIn
std::unique_ptr< TMVA::Reader > m_MVreader
std::unique_ptr< TH3D > m_mvfjvtThresh
Gaudi::Property< double > m_etaThresh {this, "EtaThresh", 2.5, "Eta threshold"}
Gaudi::Property< double > m_forwardMinPt {this, "ForwardMinPt", 20e3, "Forward minimum pt"}
Gaudi::Property< double > m_forwardMaxPt {this, "ForwardMaxPt", 120e3, "Forward maximum pt"}
Gaudi::Property< double > m_centerMinPt {this, "CentralMinPt", 20e3, "Central minimum pt"}
Gaudi::Property< double > m_centerMaxPt {this, "CentralMaxPt", -1, "Central maximum pt (set to -1 for no limit)"}
Gaudi::Property< double > m_centerJvtThresh {this, "CentralJvtThresh", 0.11, "Central JVT threshold"}
Gaudi::Property< std::string > m_jvtMomentName {this, "JvtMomentName", "Jvt", "SG key for JVT moment"}
Gaudi::Property< double > m_centerDrptThresh {this, "CentralDrptThresh", 0.2, "Central drpt threshold"}
Gaudi::Property< double > m_maxStochPt {this, "CentralMaxStochPt", 35e3, "Central maximum stochpt"}
Gaudi::Property< double > m_jetScaleFactor {this, "JetScaleFactor", 0.4, "Jet scale factor"}
Gaudi::Property< std::string > m_OP {this, "OperatingPoint", "DEFAULT", "Selected operating point, can be 'LOOSE', 'TIGHT' or 'TIGHTER'"}
Gaudi::Property< bool > m_getTagger {this, "retrieveTagger", false, "Whether to retrieve the tagger"}
Gaudi::Property< bool > m_isAna {this, "AnaToolMode", false, "True if running in AnaTool mode"}
Gaudi::Property< int > m_pvind {this, "PVIndexHS", -1, ""}
Gaudi::Property< std::string > m_jetContainerName {this, "JetContainer", "", "SG key of input jet container"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_outMVKey {this, "OutputDecMV", "passMVFJVT", "SG key for the output MV decoration"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_mvfjvtKey {this, "MVFJVTName", "MVfJVT", "SG key for the output MVfJVT decoration"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_cllambda2Key {this, "cllambda2Name", "LeadclSecondLambda", "SG key for the LeadclSecondLambda decoration"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_clwidthKey {this, "cletawidthName", "LeadclWidth", "SG key for the cluster eta width decoration"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_clisoKey {this, "clisoName", "SumclIso", "SG key for the cluster isolation decoration"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_clemprobKey {this, "clemprobName", "SumclEMprob", "SG key for the cluster EMprob decoration"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_cleKey {this, "cleName", "Sumcle", "SG key for the cluster energy decoration"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_lcllambda2NTKey {this, "lcllambda2NTName", "LeadingClusterSecondLambda", "Leading cluster second lambda to use if getTagger is false"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_lcllambda2Key {this, "lcllambda2Name", "DFCommonJets_MVfJVT_LeadclSecondLambda", "Leading cluster second lambda to use if getTagger is true"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_lclwidthKey {this, "lclwidthName", "DFCommonJets_MVfJVT_LeadclWidth", "Leading cluster width to use if getTagger is true"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_lclisoKey {this, "lclisoName", "DFCommonJets_MVfJVT_SumclIso", "Leading cluster isolation to use if getTagger is true"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_lclemprobKey {this, "lclemprobName", "DFCommonJets_MVfJVT_SumclEMprob", "Leading cluster EMprob to use if getTagger is true"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_lcleKey {this, "lcleName", "DFCommonJets_MVfJVT_Sumcle", "Leading cluster energy to use if getTagger is true"}
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey {this, "EventInfoName", "EventInfo", "SG key for input EventInfo"}
SG::ReadHandleKey< xAOD::VertexContainerm_vertexContainerKey {this, "VertexContainerName", "PrimaryVertices", "SG key for input vertex container"}
SG::ReadHandleKey< xAOD::CaloClusterContainerm_caloClusterContainerKey {this, "CaloClusterContainerName" "CaloCalTopoClusters", "SG key for input calo cluster container"}
SG::ReadHandleKey< xAOD::MissingETContainerm_trkMetKey {this, "TrackMetName", "MET_Track", "SG key for input track MET container"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_isHSKey {this, "isHSName", "isJvtHS", "SG key for output isHS decoration"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_isPUKey {this, "isPUName", "isJvtPU", "SG key for output isPU decoration"}
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 45 of file JetForwardJvtToolBDT.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

◆ JetForwardJvtToolBDT()

JetForwardJvtToolBDT::JetForwardJvtToolBDT ( const std::string & name)

Constructor with parameters:

Definition at line 27 of file JetForwardJvtToolBDT.cxx.

27 :
28 asg::AsgTool(name)
29{
30}

◆ ~JetForwardJvtToolBDT()

JetForwardJvtToolBDT::~JetForwardJvtToolBDT ( )
virtualdefault

Destructor:

Member Function Documentation

◆ calculateVertexMomenta()

std::vector< TVector2 > JetForwardJvtToolBDT::calculateVertexMomenta ( const xAOD::JetContainer * jets,
int pvind ) const

Definition at line 359 of file JetForwardJvtToolBDT.cxx.

359 {
360
361 std::vector<TVector2> pileupMomenta;
362
363 SG::ReadHandle<xAOD::MissingETContainer> trkMetHandle(m_trkMetKey);
364 if( !trkMetHandle.isValid() ) {
365 ATH_MSG_WARNING(" xAOD::MissingETContainer " << m_trkMetKey.key() << "is invalid");
366 return pileupMomenta;
367 }
368 SG::ReadHandle<xAOD::VertexContainer> vxContHandle(m_vertexContainerKey);
369 if( !vxContHandle.isValid() ) {
370 ATH_MSG_WARNING(" xAOD::VertexContainer " << m_vertexContainerKey.key() << "is invalid");
371 return pileupMomenta;
372 }
373 ATH_MSG_DEBUG("In JetForwardJvtToolBDT::calculateVertexMomenta : Starting vertex loop ");
374 for(const xAOD::Vertex *vx : *vxContHandle) {
375 ATH_MSG_DEBUG(" --> VertexType="<<vx->vertexType());
376 if(vx->vertexType()!=xAOD::VxType::PriVtx && vx->vertexType()!=xAOD::VxType::PileUp) continue;
377 TString vname = "PVTrack_vx";
378 vname += vx->index();
379 pileupMomenta.push_back((vx->index()==(size_t)pvind?0:-(1./m_jetScaleFactor))*TVector2(0.5*(*trkMetHandle)[vname.Data()]->mpx(),0.5*(*trkMetHandle)[vname.Data()]->mpy()));
380 }
381 for (const xAOD::Jet *jet : *jets) {
382 if (!centralJet(jet)) continue;
383 int jetvert = getJetVertex(jet);
384 if (jetvert>=0) pileupMomenta[jetvert] += TVector2(0.5*jet->pt()*cos(jet->phi()),0.5*jet->pt()*sin(jet->phi()));
385 }
386
387 return pileupMomenta;
388}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
Gaudi::Property< double > m_jetScaleFactor
bool centralJet(const xAOD::Jet *jet) const
int getJetVertex(const xAOD::Jet *jet) const
SG::ReadHandleKey< xAOD::MissingETContainer > m_trkMetKey
@ PileUp
Pile-up vertex.
@ PriVtx
Primary vertex.
Jet_v1 Jet
Definition of the current "jet version".
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ centralJet()

bool JetForwardJvtToolBDT::centralJet ( const xAOD::Jet * jet) const

Definition at line 397 of file JetForwardJvtToolBDT.cxx.

397 {
398
399 if (fabs(jet->eta())>m_etaThresh) return false;
400 if (jet->pt()<m_centerMinPt || (m_centerMaxPt>0 && jet->pt()>m_centerMaxPt)) return false;
401 float jvt = 0;
402 jet->getAttribute<float>(m_jvtMomentName,jvt);
403 if (jvt>m_centerJvtThresh) return false;
404 if (jet->pt()<m_maxStochPt && getDrpt(jet)<m_centerDrptThresh) return false;
405 return true;
406}
Gaudi::Property< std::string > m_jvtMomentName
Gaudi::Property< double > m_centerMinPt
Gaudi::Property< double > m_centerJvtThresh
float getDrpt(const xAOD::Jet *jet) const
Gaudi::Property< double > m_etaThresh
Gaudi::Property< double > m_centerMaxPt
Gaudi::Property< double > m_maxStochPt
Gaudi::Property< double > m_centerDrptThresh
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition Jet_v1.cxx:44
bool getAttribute(AttributeID type, T &value) const
Retrieve attribute moment by enum.
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition Jet_v1.cxx:49

◆ 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>

◆ decorate()

StatusCode JetForwardJvtToolBDT::decorate ( const xAOD::JetContainer & jets) const
overridevirtual

Decorate a jet collection without otherwise modifying it.

Implements IJetDecorator.

Definition at line 136 of file JetForwardJvtToolBDT.cxx.

136 {
137
138 // -- Retrieve PV index if not provided by user
139 //pvind = (m_pvind.value()==-1) ? getPV() : m_pvind;
140 int pvind = m_pvind.value();
141 if(pvind == -1) pvind = getPV();
142
143 ATH_MSG_DEBUG("In JetForwardJvtToolBDT::modify: PV index = " << pvind);
144 if( pvind == -1 ){
145 ATH_MSG_WARNING( "Something went wrong with the HS primary vertex identification." );
146 return StatusCode::FAILURE;
147 }
148
149 SG::WriteDecorHandle<xAOD::JetContainer, char> outMVHandle(m_outMVKey);
150 SG::WriteDecorHandle<xAOD::JetContainer, float> mvfjvtHandle(m_mvfjvtKey);
151
152 SG::WriteDecorHandle<xAOD::JetContainer, float> cllambda2Handle(m_cllambda2Key);
153 SG::WriteDecorHandle<xAOD::JetContainer, float> clwidthHandle(m_clwidthKey);
154 SG::WriteDecorHandle<xAOD::JetContainer, float> clisoHandle(m_clisoKey);
155 SG::WriteDecorHandle<xAOD::JetContainer, float> clemprobHandle(m_clemprobKey);
156 SG::WriteDecorHandle<xAOD::JetContainer, float> cleHandle(m_cleKey);
157 std::vector<TVector2> pileupMomenta;
158 for(const xAOD::Jet *jetF : jetCont) {
159
160 float mvfjvt = -2;
161 outMVHandle(*jetF) = 1;
162 cllambda2Handle(*jetF) = 0;
163 clwidthHandle(*jetF) = 0;
164 cleHandle(*jetF) = 0;
165 clisoHandle(*jetF) = 0;
166 clemprobHandle(*jetF) = 0;
167
168 // -- Get PU vertices momenta sums, then compute tagger value for forward jets
169 if ( forwardJet(jetF) ){
170 if( pileupMomenta.empty() ) {
171 pileupMomenta = calculateVertexMomenta(&jetCont, pvind);
172 if( pileupMomenta.empty() ) {
173 ATH_MSG_DEBUG( "pileupMomenta is empty, this can happen for events with no PU vertices. fJVT won't be computed for this event and will be set to 0 instead." );
174 mvfjvtHandle(*jetF) = 0;
175 continue;
176 }
177 }
178 mvfjvt = getMVfJVT(jetF, pvind, pileupMomenta);
179 if(m_isAna) outMVHandle(*jetF) = passMVfJVT( mvfjvt, jetF->pt()/(GeV), fabs(jetF->eta()) );
180 mvfjvtHandle(*jetF) = mvfjvt;
181 }
182 }
183 return StatusCode::SUCCESS;
184
185}
std::vector< TVector2 > calculateVertexMomenta(const xAOD::JetContainer *jets, int pvind) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_cllambda2Key
SG::WriteDecorHandleKey< xAOD::JetContainer > m_clisoKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_clwidthKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_outMVKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_clemprobKey
Gaudi::Property< bool > m_isAna
float getMVfJVT(const xAOD::Jet *jet, int pvind, const std::vector< TVector2 > &pileupMomenta) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_cleKey
Gaudi::Property< int > m_pvind
bool forwardJet(const xAOD::Jet *jet) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_mvfjvtKey
bool passMVfJVT(float mvfjvt, float pt, float eta) const

◆ 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

◆ forwardJet()

bool JetForwardJvtToolBDT::forwardJet ( const xAOD::Jet * jet) const

Definition at line 390 of file JetForwardJvtToolBDT.cxx.

390 {
391
392 if (fabs(jet->eta())<m_etaThresh) return false;
393 if (jet->pt()<m_forwardMinPt || jet->pt()>m_forwardMaxPt) return false;
394 return true;
395}
Gaudi::Property< double > m_forwardMaxPt
Gaudi::Property< double > m_forwardMinPt

◆ getDrpt()

float JetForwardJvtToolBDT::getDrpt ( const xAOD::Jet * jet) const

Definition at line 423 of file JetForwardJvtToolBDT.cxx.

423 {
424
425 std::vector<float> sumpts;
426 jet->getAttribute<std::vector<float> >("SumPtTrkPt500",sumpts);
427 if (sumpts.size()<2) return 0;
428
429 std::nth_element(sumpts.begin(),sumpts.begin()+sumpts.size()/2,sumpts.end(),std::greater<int>());
430 double median = sumpts[sumpts.size()/2];
431 std::nth_element(sumpts.begin(),sumpts.begin(),sumpts.end(),std::greater<int>());
432 double max = sumpts[0];
433 return (max-median)/jet->pt();
434}
#define max(a, b)
Definition cfImp.cxx:41
float median(std::vector< float > &Vec)

◆ getFJVT()

float JetForwardJvtToolBDT::getFJVT ( const xAOD::Jet * jet,
int pvind,
const std::vector< TVector2 > & pileupMomenta ) const

Definition at line 188 of file JetForwardJvtToolBDT.cxx.

188 {
189
190 TVector2 fjet(-jet->pt()*cos(jet->phi()),-jet->pt()*sin(jet->phi()));
191 double fjvt = 0;
192 ATH_MSG_DEBUG("In JetForwardJvtToolBDT::getFJVT -----> Starting looping on vertices (pileupMomenta.size() = "<<pileupMomenta.size());
193 for (size_t pui = 0; pui < pileupMomenta.size(); pui++) {
194 if (pui!=(size_t)pvind){
195 double projection = pileupMomenta[pui]*fjet/fjet.Mod();
196 if (projection>fjvt) fjvt = projection;
197 }
198 }
199 return fjvt;
200}
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition Jet_v1.cxx:54

◆ getInputs()

StatusCode JetForwardJvtToolBDT::getInputs ( const xAOD::Jet * jet) const

Definition at line 290 of file JetForwardJvtToolBDT.cxx.

290 {
291 SG::WriteDecorHandle<xAOD::JetContainer, float> cllambda2Handle(m_cllambda2Key);
292 SG::WriteDecorHandle<xAOD::JetContainer, float> clwidthHandle(m_clwidthKey);
293 SG::WriteDecorHandle<xAOD::JetContainer, float> clisoHandle(m_clisoKey);
294 SG::WriteDecorHandle<xAOD::JetContainer, float> clemprobHandle(m_clemprobKey);
295 SG::WriteDecorHandle<xAOD::JetContainer, float> cleHandle(m_cleKey);
296
297 if(!m_getTagger){
298 SG::ReadDecorHandle<xAOD::JetContainer, float> lcllambda2NTHandle(m_lcllambda2NTKey);
299 cllambda2Handle(*jet) = lcllambda2NTHandle(*jet);
300
301 // -- Additional variables computed from cluster information
302 SG::ReadHandle<xAOD::CaloClusterContainer> clustersHandle(m_caloClusterContainerKey);
303 if( !clustersHandle.isValid() ) {
304 ATH_MSG_ERROR(" xAOD::CaloClusterContainer " << m_caloClusterContainerKey.key() << "is invalid");
305 return StatusCode::FAILURE;
306 }
307
308 int ind = 0;
309 float maxpt = 0;
310 float cle1 = 0;
311 float cliso1 = 0;
312 float clemprob1 = 0;
313 float cle2 = 0;
314
315 // Loop over clusters within DeltaR<0.6 of the jet axis to compute the (energy-weighted) moment sums used in the BDT definitions
316 static const SG::ConstAccessor<float> ISOLATIONAcc ("ISOLATION");
317 static const SG::ConstAccessor<float> EM_PROBABILITYAcc ("EM_PROBABILITY");
318 for (const xAOD::CaloCluster *cl: *clustersHandle) {
319 if(cl->p4().DeltaR(jet->p4())>0.6) continue;
320 cle1 += cl->e();
321 cle2 += cl->e()*cl->e();
322 cliso1 += ISOLATIONAcc(*cl)*cl->e()*cl->e();
323 clemprob1 += EM_PROBABILITYAcc(*cl)*cl->e()*cl->e();
324 if(cl->rawE()/cosh(cl->rawEta()) > maxpt){
325 maxpt = cl->rawE()/cosh(cl->rawEta());
326 ind = cl->index();
327 }
328 }
329 const xAOD::CaloCluster *cl = clustersHandle->at(ind);
330 static const SG::ConstAccessor<float> SECOND_RAcc ("SECOND_R");
331 static const SG::ConstAccessor<float> CENTER_MAGAcc ("CENTER_MAG");
332 clwidthHandle(*jet) = TMath::CosH(cl->rawEta()) * TMath::ATan2( TMath::Sqrt(SECOND_RAcc(*cl)),
333 CENTER_MAGAcc(*cl));
334
335 cleHandle(*jet) = cle1;
336 if (cle2 == 0.f)[[unlikely]]{
337 ATH_MSG_ERROR("JetForwardJvtToolBDT::getMVfJVT: divide by zero.");
338 return StatusCode::FAILURE;
339 }
340 clisoHandle(*jet)= cliso1/cle2;
341 clemprobHandle(*jet) =clemprob1/cle2;
342
343 } else {
344 SG::ReadDecorHandle<xAOD::JetContainer, float> lcllambda2Handle(m_lcllambda2Key);
345 SG::ReadDecorHandle<xAOD::JetContainer, float> lclwidthHandle(m_lclwidthKey);
346 SG::ReadDecorHandle<xAOD::JetContainer, float> lclisoHandle(m_lclisoKey);
347 SG::ReadDecorHandle<xAOD::JetContainer, float> lclemprobHandle(m_lclemprobKey);
348 SG::ReadDecorHandle<xAOD::JetContainer, float> lcleHandle(m_lcleKey);
349
350 cllambda2Handle(*jet) = lcllambda2Handle(*jet);
351 clwidthHandle(*jet) = lclwidthHandle(*jet);
352 clisoHandle(*jet) = lclisoHandle(*jet);
353 clemprobHandle(*jet) = lclemprobHandle(*jet);
354 cleHandle(*jet) = lcleHandle(*jet);
355 }
356 return StatusCode::SUCCESS;
357}
#define ATH_MSG_ERROR(x)
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClusterContainerKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_lclwidthKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_lcllambda2NTKey
Gaudi::Property< bool > m_getTagger
SG::ReadDecorHandleKey< xAOD::JetContainer > m_lclisoKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_lcleKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_lcllambda2Key
SG::ReadDecorHandleKey< xAOD::JetContainer > m_lclemprobKey
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition Jet_v1.cxx:71
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
#define unlikely(x)

◆ getJetVertex()

int JetForwardJvtToolBDT::getJetVertex ( const xAOD::Jet * jet) const

Definition at line 408 of file JetForwardJvtToolBDT.cxx.

408 {
409
410 std::vector<float> sumpts;
411 jet->getAttribute<std::vector<float> >("SumPtTrkPt500",sumpts);
412 double firstVal = 0;
413 int bestMatch = -1;
414 for (size_t i = 0; i < sumpts.size(); i++) {
415 if (sumpts[i]>firstVal) {
416 bestMatch = i;
417 firstVal = sumpts[i];
418 }
419 }
420 return bestMatch;
421}

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::Event, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getMVfJVT()

float JetForwardJvtToolBDT::getMVfJVT ( const xAOD::Jet * jet,
int pvind,
const std::vector< TVector2 > & pileupMomenta ) const

Definition at line 203 of file JetForwardJvtToolBDT.cxx.

203 {
204
205 static const SG::ConstAccessor<float> MVfJVTAcc ("MVfJVT");
206 if(m_isAna && !m_getTagger) return MVfJVTAcc(*jet);
207
208 StatusCode sc = getInputs(jet);
209 if( sc.isFailure() ) {
210 ATH_MSG_WARNING(" Could not calculate BDT inputs");
211 return -2;
212 }
213
214 SG::ReadHandle<xAOD::EventInfo> eventInfoHandle(m_eventInfoKey);
215 if ( !eventInfoHandle.isValid() ) {
216 ATH_MSG_WARNING(" xAOD::EventInfo " << m_eventInfoKey.key() << "is invalid");
217 return -2;
218 }
219 float mu = eventInfoHandle->actualInteractionsPerCrossing();
220
221 if (!forwardJet(jet)) return -2;
222
223 SG::WriteDecorHandle<xAOD::JetContainer, float> cllambda2Handle(m_cllambda2Key);
224 SG::WriteDecorHandle<xAOD::JetContainer, float> clwidthHandle(m_clwidthKey);
225 SG::WriteDecorHandle<xAOD::JetContainer, float> clisoHandle(m_clisoKey);
226 SG::WriteDecorHandle<xAOD::JetContainer, float> clemprobHandle(m_clemprobKey);
227 SG::WriteDecorHandle<xAOD::JetContainer, float> cleHandle(m_cleKey);
228
229 std::vector<float> MVinputs;
230 MVinputs.push_back( getFJVT(jet, pvind, pileupMomenta)/jet->pt() );
231 MVinputs.push_back( jet->getAttribute<float>("Width") );
232 MVinputs.push_back( jet->getAttribute<float>("Timing") );
233 MVinputs.push_back( cllambda2Handle(*jet) );
234 MVinputs.push_back( clwidthHandle(*jet) );
235 MVinputs.push_back( cleHandle(*jet) );
236 MVinputs.push_back( clisoHandle(*jet) );
237 MVinputs.push_back( clemprobHandle(*jet) );
238
239 float pt = jet->pt()/(GeV);
240 float eta = fabs(jet->eta());
241
242 float score = -2.;
243 // TMVA::Reader::EvaluateMVA isn't thread-safe.
244 TMVA::Reader& reader ATLAS_THREAD_SAFE = *m_MVreader;
245 static std::mutex mutex;
246 std::lock_guard lock (mutex);
247 if ( pt < 30. && pt >= 20. && eta >= 3.2 && mu>=50. ) score = reader.EvaluateMVA( MVinputs, "BDT_1" ,1.);
248 else if ( pt < 30. && pt >= 20. && eta < 3.2 && mu>=50. ) score = reader.EvaluateMVA( MVinputs, "BDT_2" ,1.);
249 else if ( pt < 40. && pt >= 30. && eta >= 3.2 && mu>=50. ) score = reader.EvaluateMVA( MVinputs, "BDT_3" ,1.);
250 else if ( pt < 40. && pt >= 30. && eta < 3.2 && mu>=50. ) score = reader.EvaluateMVA( MVinputs, "BDT_4" ,1.);
251 else if ( pt < 50. && pt >= 40. && eta >= 3.2 && mu>=50. ) score = reader.EvaluateMVA( MVinputs, "BDT_5" ,1.);
252 else if ( pt < 50. && pt >= 40. && eta < 3.2 && mu>=50. ) score = reader.EvaluateMVA( MVinputs, "BDT_6" ,1.);
253 else if ( pt < 120. && pt >= 50. && eta >= 3.2 && mu>=50. ) score = reader.EvaluateMVA( MVinputs, "BDT_7" ,1.);
254 else if ( pt < 120. && pt >= 50. && eta < 3.2 && mu>=50. ) score = reader.EvaluateMVA( MVinputs, "BDT_8" ,1.);
255 else if ( pt < 30. && pt >= 20. && eta >= 3.2 && mu<50. ) score = reader.EvaluateMVA( MVinputs, "BDT_9" ,1.);
256 else if ( pt < 30. && pt >= 20. && eta < 3.2 && mu<50. ) score = reader.EvaluateMVA( MVinputs, "BDT_10" ,1.);
257 else if ( pt < 40. && pt >= 30. && eta >= 3.2 && mu<50. ) score = reader.EvaluateMVA( MVinputs, "BDT_11" ,1.);
258 else if ( pt < 40. && pt >= 30. && eta < 3.2 && mu<50. ) score = reader.EvaluateMVA( MVinputs, "BDT_12" ,1.);
259 else if ( pt < 50. && pt >= 40. && eta >= 3.2 && mu<50. ) score = reader.EvaluateMVA( MVinputs, "BDT_13" ,1.);
260 else if ( pt < 50. && pt >= 40. && eta < 3.2 && mu<50. ) score = reader.EvaluateMVA( MVinputs, "BDT_14" ,1.);
261 else if ( pt < 120. && pt >= 50. && eta >= 3.2 && mu<50. ) score = reader.EvaluateMVA( MVinputs, "BDT_15" ,1.);
262 else if ( pt < 120. && pt >= 50. && eta < 3.2 && mu<50. ) score = reader.EvaluateMVA( MVinputs, "BDT_16" ,1.);
263
264 ATH_MSG_DEBUG("pt = " << pt << " | eta = " << eta << " | mu = " << mu << " || MVfJVT = " << score );
265
266 return score;
267}
Scalar eta() const
pseudorapidity method
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
static Double_t sc
#define ATLAS_THREAD_SAFE
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
std::unique_ptr< TMVA::Reader > m_MVreader
StatusCode getInputs(const xAOD::Jet *jet) const
float getFJVT(const xAOD::Jet *jet, int pvind, const std::vector< TVector2 > &pileupMomenta) const
::StatusCode StatusCode
StatusCode definition for legacy code.
reader
read the goodrunslist xml file(s)
Definition collisions.py:22

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::Event, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ getPV()

int JetForwardJvtToolBDT::getPV ( ) const

Definition at line 436 of file JetForwardJvtToolBDT.cxx.

436 {
437
438 SG::ReadHandle<xAOD::VertexContainer> vxContHandle(m_vertexContainerKey);
439 if( !vxContHandle.isValid() ) {
440 ATH_MSG_WARNING(" xAOD::VertexContainer " << m_vertexContainerKey.key() << "is invalid");
441 return 0;
442 } else {
443 ATH_MSG_DEBUG("Successfully retrieved primary vertex container");
444 for(const xAOD::Vertex *vx : *vxContHandle) {
445 if(vx->vertexType()==xAOD::VxType::PriVtx) return vx->index();
446 }
447 }
448 ATH_MSG_DEBUG("Couldn't identify the hard-scatter primary vertex (no vertex with \"vx->vertexType()==xAOD::VxType::PriVtx\" in the container)!");
449 return 0;
450}

◆ initialize()

StatusCode JetForwardJvtToolBDT::initialize ( void )
overridevirtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Definition at line 38 of file JetForwardJvtToolBDT.cxx.

39{
40 ATH_MSG_INFO ("Initializing " << name() << "...");
41
42 if(m_isAna){
43 // -- Retrieve MVfJVT WP configFile ONLY if tool used in 'Analysis mode'
44 std::string filename = PathResolverFindCalibFile(std::string(m_configDir)+m_wpFile);
45 if (filename.empty()){
46 ATH_MSG_ERROR ( "Could NOT resolve file name " << m_wpFile);
47 return StatusCode::FAILURE;
48 } else{
49 ATH_MSG_INFO(" Config Files Path found = "<<filename);
50 }
51
52 // -- Retrieve WP histograms
53 m_wpFileIn = std::make_unique<TFile> (filename.c_str(),"read");
54
55 if ( m_OP=="TIGHTER") {
56 m_mvfjvtThresh = std::unique_ptr< TH3D >( dynamic_cast<TH3D*>( m_wpFileIn->Get( "MVfJVT_tighter" ) ) );
57 } else if ( m_OP=="TIGHT" ) {
58 m_mvfjvtThresh = std::unique_ptr< TH3D >( dynamic_cast<TH3D*>( m_wpFileIn->Get( "MVfJVT_tight" ) ) );
59 } else if ( m_OP=="DEFAULT" || m_OP=="LOOSE" ) {
60 m_mvfjvtThresh = std::unique_ptr< TH3D >( dynamic_cast<TH3D*>( m_wpFileIn->Get( "MVfJVT_loose" ) ) );
61 } else {
62 ATH_MSG_ERROR(m_OP << " working point doesn't exist." );
63 return StatusCode::FAILURE;
64 }
65 if (!m_mvfjvtThresh)[[unlikely]]{
66 ATH_MSG_ERROR("'m_mvfjvtThresh' is nullptr" );
67 return StatusCode::FAILURE;
68 }
69 m_mvfjvtThresh->SetDirectory(nullptr);
70 m_wpFileIn->Close();
71 }
72
73 // -- Setup the tagger
74 m_MVreader = std::make_unique< TMVA::Reader > ( "Silent" );
75 float fjvt,width,time,cllambda2,cletawidth,cle,cliso,clemprob;
76 m_MVreader->AddVariable( "fjvtdist", &fjvt );
77 m_MVreader->AddVariable( "Width_jet", &width );
78 m_MVreader->AddVariable( "timedist", &time );
79 m_MVreader->AddVariable( "jet_LeadingClusterSecondLambda", &cllambda2 );
80 m_MVreader->AddVariable( "cl_etaWidthLead", &cletawidth );
81 m_MVreader->AddVariable( "clsum_e", &cle );
82 m_MVreader->AddVariable( "cl_ISOLATIONsumE", &cliso );
83 m_MVreader->AddVariable( "cl_EM_PROBABILITYsumE", &clemprob );
84 for(unsigned int i = 0; i<m_MVconfig.size(); ++i) m_MVreader->BookMVA(TString::Format("BDT_%i",i+1),PathResolverFindCalibFile(m_configDir+m_MVconfig.value().at(i)));
85
86 // "passMVfJVT" flag
88 ATH_CHECK(m_outMVKey.initialize());
89
90 // Moments values
92 ATH_CHECK(m_mvfjvtKey.initialize());
93
98 m_cleKey = m_jetContainerName + "." + m_cleKey.key();
99
100 ATH_CHECK(m_cllambda2Key.initialize());
101 ATH_CHECK(m_clwidthKey.initialize());
102 ATH_CHECK(m_clisoKey.initialize());
103 ATH_CHECK(m_clemprobKey.initialize());
104 ATH_CHECK(m_cleKey.initialize());
105
111 m_lcleKey = m_jetContainerName + "." + m_lcleKey.key();
112
113 ATH_CHECK(m_lcllambda2Key.initialize());
114 ATH_CHECK(m_lcllambda2NTKey.initialize());
115 ATH_CHECK(m_lclwidthKey.initialize());
116 ATH_CHECK(m_lclisoKey.initialize());
117 ATH_CHECK(m_lclemprobKey.initialize());
118 ATH_CHECK(m_lcleKey.initialize());
119
120 ATH_CHECK(m_eventInfoKey.initialize());
121 ATH_CHECK(m_vertexContainerKey.initialize());
123 ATH_CHECK(m_trkMetKey.initialize());
124
125 // Truth information
126 m_isHSKey = m_jetContainerName + "." + m_isHSKey.key();
127 m_isPUKey = m_jetContainerName + "." + m_isPUKey.key();
128
129 ATH_CHECK(m_isHSKey.initialize());
130 ATH_CHECK(m_isPUKey.initialize());
131
132 return StatusCode::SUCCESS;
133}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
const double width
Gaudi::Property< std::vector< std::string > > m_MVconfig
std::unique_ptr< TH3D > m_mvfjvtThresh
Gaudi::Property< std::string > m_OP
SG::WriteDecorHandleKey< xAOD::JetContainer > m_isPUKey
Gaudi::Property< std::string > m_jetContainerName
SG::WriteDecorHandleKey< xAOD::JetContainer > m_isHSKey
Gaudi::Property< std::string > m_wpFile
std::unique_ptr< TFile > m_wpFileIn
Gaudi::Property< std::string > m_configDir
time(flags, cells_name, *args, **kw)

◆ 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.

◆ modify()

virtual StatusCode IJetDecorator::modify ( xAOD::JetContainer & jets) const
inlinefinaloverridevirtualinherited

Concrete implementation of the function inherited from IJetModifier.

Implements IJetModifier.

Definition at line 32 of file IJetDecorator.h.

32{return decorate(jets);};
virtual StatusCode decorate(const xAOD::JetContainer &jets) const =0
Decorate a jet collection without otherwise modifying it.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ 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.

◆ passMVfJVT()

bool JetForwardJvtToolBDT::passMVfJVT ( float mvfjvt,
float pt,
float eta ) const

Definition at line 269 of file JetForwardJvtToolBDT.cxx.

269 {
270
271 double mvfjvtThresh = -999.;
272
273 SG::ReadHandle<xAOD::EventInfo> eventInfoHandle(m_eventInfoKey);
274 if ( !eventInfoHandle.isValid() ) {
275 ATH_MSG_WARNING(" xAOD::EventInfo " << m_eventInfoKey.key() << "is invalid");
276 return true;
277 }
278
279 float mu = eventInfoHandle->actualInteractionsPerCrossing();
280
281 // -- Grab WP from histogram
282 mvfjvtThresh = m_mvfjvtThresh->GetBinContent(m_mvfjvtThresh->GetXaxis()->FindBin(pt),
283 m_mvfjvtThresh->GetYaxis()->FindBin(eta),
284 m_mvfjvtThresh->GetZaxis()->FindBin(mu));
285
286 return mvfjvt==-2 || mvfjvt>mvfjvtThresh;
287
288}

◆ print()

void asg::AsgTool::print ( ) const
virtualinherited

◆ 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 >, and AthCheckedComponent<::AthAlgTool >.

◆ 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.

◆ tagTruth()

StatusCode JetForwardJvtToolBDT::tagTruth ( const xAOD::JetContainer * jets,
const xAOD::JetContainer * truthJets )

Definition at line 452 of file JetForwardJvtToolBDT.cxx.

452 {
453 SG::WriteDecorHandle<xAOD::JetContainer, char> isHSHandle(m_isHSKey);
454 SG::WriteDecorHandle<xAOD::JetContainer, char> isPUHandle(m_isPUKey);
455
456 for(const xAOD::Jet *jet : *jets) {
457 bool ishs = false;
458 bool ispu = true;
459 for(const xAOD::Jet *tjet : *truthJets) {
460 if (tjet->p4().DeltaR(jet->p4())<0.3 && tjet->pt()>10e3) ishs = true;
461 if (tjet->p4().DeltaR(jet->p4())<0.6) ispu = false;
462 }
463 isHSHandle(*jet)=ishs;
464 isPUHandle(*jet)=ispu;
465 }
466 return StatusCode::SUCCESS;
467}

◆ 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_caloClusterContainerKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> JetForwardJvtToolBDT::m_caloClusterContainerKey {this, "CaloClusterContainerName" "CaloCalTopoClusters", "SG key for input calo cluster container"}
private

Definition at line 143 of file JetForwardJvtToolBDT.h.

143{this, "CaloClusterContainerName" "CaloCalTopoClusters", "SG key for input calo cluster container"};

◆ m_centerDrptThresh

Gaudi::Property<double> JetForwardJvtToolBDT::m_centerDrptThresh {this, "CentralDrptThresh", 0.2, "Central drpt threshold"}
private

Definition at line 115 of file JetForwardJvtToolBDT.h.

115{this, "CentralDrptThresh", 0.2, "Central drpt threshold"};

◆ m_centerJvtThresh

Gaudi::Property<double> JetForwardJvtToolBDT::m_centerJvtThresh {this, "CentralJvtThresh", 0.11, "Central JVT threshold"}
private

Definition at line 113 of file JetForwardJvtToolBDT.h.

113{this, "CentralJvtThresh", 0.11, "Central JVT threshold"};

◆ m_centerMaxPt

Gaudi::Property<double> JetForwardJvtToolBDT::m_centerMaxPt {this, "CentralMaxPt", -1, "Central maximum pt (set to -1 for no limit)"}
private

Definition at line 112 of file JetForwardJvtToolBDT.h.

112{this, "CentralMaxPt", -1, "Central maximum pt (set to -1 for no limit)"};

◆ m_centerMinPt

Gaudi::Property<double> JetForwardJvtToolBDT::m_centerMinPt {this, "CentralMinPt", 20e3, "Central minimum pt"}
private

Definition at line 111 of file JetForwardJvtToolBDT.h.

111{this, "CentralMinPt", 20e3, "Central minimum pt"};

◆ m_cleKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_cleKey {this, "cleName", "Sumcle", "SG key for the cluster energy decoration"}
private

Definition at line 132 of file JetForwardJvtToolBDT.h.

132{this, "cleName", "Sumcle", "SG key for the cluster energy decoration"};

◆ m_clemprobKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_clemprobKey {this, "clemprobName", "SumclEMprob", "SG key for the cluster EMprob decoration"}
private

Definition at line 131 of file JetForwardJvtToolBDT.h.

131{this, "clemprobName", "SumclEMprob", "SG key for the cluster EMprob decoration"};

◆ m_clisoKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_clisoKey {this, "clisoName", "SumclIso", "SG key for the cluster isolation decoration"}
private

Definition at line 130 of file JetForwardJvtToolBDT.h.

130{this, "clisoName", "SumclIso", "SG key for the cluster isolation decoration"};

◆ m_cllambda2Key

SG::WriteDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_cllambda2Key {this, "cllambda2Name", "LeadclSecondLambda", "SG key for the LeadclSecondLambda decoration"}
private

Definition at line 128 of file JetForwardJvtToolBDT.h.

128{this, "cllambda2Name", "LeadclSecondLambda", "SG key for the LeadclSecondLambda decoration"};

◆ m_clwidthKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_clwidthKey {this, "cletawidthName", "LeadclWidth", "SG key for the cluster eta width decoration"}
private

Definition at line 129 of file JetForwardJvtToolBDT.h.

129{this, "cletawidthName", "LeadclWidth", "SG key for the cluster eta width decoration"};

◆ m_configDir

Gaudi::Property<std::string> JetForwardJvtToolBDT::m_configDir {this, "configDir", "JetPileupTag/MVfJVT/", "Configuration directory"}
private

Definition at line 83 of file JetForwardJvtToolBDT.h.

83{this, "configDir", "JetPileupTag/MVfJVT/", "Configuration directory"};

◆ 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_etaThresh

Gaudi::Property<double> JetForwardJvtToolBDT::m_etaThresh {this, "EtaThresh", 2.5, "Eta threshold"}
private

Definition at line 108 of file JetForwardJvtToolBDT.h.

108{this, "EtaThresh", 2.5, "Eta threshold"};

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> JetForwardJvtToolBDT::m_eventInfoKey {this, "EventInfoName", "EventInfo", "SG key for input EventInfo"}
private

Definition at line 141 of file JetForwardJvtToolBDT.h.

141{this, "EventInfoName", "EventInfo", "SG key for input EventInfo"};

◆ 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_forwardMaxPt

Gaudi::Property<double> JetForwardJvtToolBDT::m_forwardMaxPt {this, "ForwardMaxPt", 120e3, "Forward maximum pt"}
private

Definition at line 110 of file JetForwardJvtToolBDT.h.

110{this, "ForwardMaxPt", 120e3, "Forward maximum pt"};

◆ m_forwardMinPt

Gaudi::Property<double> JetForwardJvtToolBDT::m_forwardMinPt {this, "ForwardMinPt", 20e3, "Forward minimum pt"}
private

Definition at line 109 of file JetForwardJvtToolBDT.h.

109{this, "ForwardMinPt", 20e3, "Forward minimum pt"};

◆ m_getTagger

Gaudi::Property<bool> JetForwardJvtToolBDT::m_getTagger {this, "retrieveTagger", false, "Whether to retrieve the tagger"}
private

Definition at line 119 of file JetForwardJvtToolBDT.h.

119{this, "retrieveTagger", false, "Whether to retrieve the tagger"};

◆ m_isAna

Gaudi::Property<bool> JetForwardJvtToolBDT::m_isAna {this, "AnaToolMode", false, "True if running in AnaTool mode"}
private

Definition at line 120 of file JetForwardJvtToolBDT.h.

120{this, "AnaToolMode", false, "True if running in AnaTool mode"};

◆ m_isHSKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_isHSKey {this, "isHSName", "isJvtHS", "SG key for output isHS decoration"}
private

Definition at line 146 of file JetForwardJvtToolBDT.h.

146{this, "isHSName", "isJvtHS", "SG key for output isHS decoration"};

◆ m_isPUKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_isPUKey {this, "isPUName", "isJvtPU", "SG key for output isPU decoration"}
private

Definition at line 147 of file JetForwardJvtToolBDT.h.

147{this, "isPUName", "isJvtPU", "SG key for output isPU decoration"};

◆ m_jetContainerName

Gaudi::Property<std::string> JetForwardJvtToolBDT::m_jetContainerName {this, "JetContainer", "", "SG key of input jet container"}
private

Definition at line 123 of file JetForwardJvtToolBDT.h.

123{this, "JetContainer", "", "SG key of input jet container"};

◆ m_jetScaleFactor

Gaudi::Property<double> JetForwardJvtToolBDT::m_jetScaleFactor {this, "JetScaleFactor", 0.4, "Jet scale factor"}
private

Definition at line 117 of file JetForwardJvtToolBDT.h.

117{this, "JetScaleFactor", 0.4, "Jet scale factor"};

◆ m_jvtMomentName

Gaudi::Property<std::string> JetForwardJvtToolBDT::m_jvtMomentName {this, "JvtMomentName", "Jvt", "SG key for JVT moment"}
private

Definition at line 114 of file JetForwardJvtToolBDT.h.

114{this, "JvtMomentName", "Jvt", "SG key for JVT moment"};

◆ m_lcleKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_lcleKey {this, "lcleName", "DFCommonJets_MVfJVT_Sumcle", "Leading cluster energy to use if getTagger is true"}
private

Definition at line 139 of file JetForwardJvtToolBDT.h.

139{this, "lcleName", "DFCommonJets_MVfJVT_Sumcle", "Leading cluster energy to use if getTagger is true"};

◆ m_lclemprobKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_lclemprobKey {this, "lclemprobName", "DFCommonJets_MVfJVT_SumclEMprob", "Leading cluster EMprob to use if getTagger is true"}
private

Definition at line 138 of file JetForwardJvtToolBDT.h.

138{this, "lclemprobName", "DFCommonJets_MVfJVT_SumclEMprob", "Leading cluster EMprob to use if getTagger is true"};

◆ m_lclisoKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_lclisoKey {this, "lclisoName", "DFCommonJets_MVfJVT_SumclIso", "Leading cluster isolation to use if getTagger is true"}
private

Definition at line 137 of file JetForwardJvtToolBDT.h.

137{this, "lclisoName", "DFCommonJets_MVfJVT_SumclIso", "Leading cluster isolation to use if getTagger is true"};

◆ m_lcllambda2Key

SG::ReadDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_lcllambda2Key {this, "lcllambda2Name", "DFCommonJets_MVfJVT_LeadclSecondLambda", "Leading cluster second lambda to use if getTagger is true"}
private

Definition at line 135 of file JetForwardJvtToolBDT.h.

135{this, "lcllambda2Name", "DFCommonJets_MVfJVT_LeadclSecondLambda", "Leading cluster second lambda to use if getTagger is true"};

◆ m_lcllambda2NTKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_lcllambda2NTKey {this, "lcllambda2NTName", "LeadingClusterSecondLambda", "Leading cluster second lambda to use if getTagger is false"}
private

Definition at line 134 of file JetForwardJvtToolBDT.h.

134{this, "lcllambda2NTName", "LeadingClusterSecondLambda", "Leading cluster second lambda to use if getTagger is false"};

◆ m_lclwidthKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_lclwidthKey {this, "lclwidthName", "DFCommonJets_MVfJVT_LeadclWidth", "Leading cluster width to use if getTagger is true"}
private

Definition at line 136 of file JetForwardJvtToolBDT.h.

136{this, "lclwidthName", "DFCommonJets_MVfJVT_LeadclWidth", "Leading cluster width to use if getTagger is true"};

◆ m_maxStochPt

Gaudi::Property<double> JetForwardJvtToolBDT::m_maxStochPt {this, "CentralMaxStochPt", 35e3, "Central maximum stochpt"}
private

Definition at line 116 of file JetForwardJvtToolBDT.h.

116{this, "CentralMaxStochPt", 35e3, "Central maximum stochpt"};

◆ m_MVconfig

Gaudi::Property<std::vector<std::string> > JetForwardJvtToolBDT::m_MVconfig
private
Initial value:
{this, "ConfigFiles", {
"weights/MVfJVT_pt2030_etaHigh_muHigh.May2019.weights.xml",
"weights/MVfJVT_pt2030_etaLow_muHigh.May2019.weights.xml",
"weights/MVfJVT_pt3040_etaHigh_muHigh.May2019.weights.xml",
"weights/MVfJVT_pt3040_etaLow_muHigh.May2019.weights.xml",
"weights/MVfJVT_pt4050_etaHigh_muHigh.May2019.weights.xml",
"weights/MVfJVT_pt4050_etaLow_muHigh.May2019.weights.xml",
"weights/MVfJVT_pt50plus_etaHigh_muHigh.May2019.weights.xml",
"weights/MVfJVT_pt50plus_etaLow_muHigh.May2019.weights.xml",
"weights/MVfJVT_pt2030_etaHigh_muLow.May2019.weights.xml",
"weights/MVfJVT_pt2030_etaLow_muLow.May2019.weights.xml",
"weights/MVfJVT_pt3040_etaHigh_muLow.May2019.weights.xml",
"weights/MVfJVT_pt3040_etaLow_muLow.May2019.weights.xml",
"weights/MVfJVT_pt4050_etaHigh_muLow.May2019.weights.xml",
"weights/MVfJVT_pt4050_etaLow_muLow.May2019.weights.xml",
"weights/MVfJVT_pt50plus_etaHigh_muLow.May2019.weights.xml",
"weights/MVfJVT_pt50plus_etaLow_muLow.May2019.weights.xml"
}, "List of config file names"}

Definition at line 84 of file JetForwardJvtToolBDT.h.

84 {this, "ConfigFiles", {
85 "weights/MVfJVT_pt2030_etaHigh_muHigh.May2019.weights.xml",
86 "weights/MVfJVT_pt2030_etaLow_muHigh.May2019.weights.xml",
87 "weights/MVfJVT_pt3040_etaHigh_muHigh.May2019.weights.xml",
88 "weights/MVfJVT_pt3040_etaLow_muHigh.May2019.weights.xml",
89 "weights/MVfJVT_pt4050_etaHigh_muHigh.May2019.weights.xml",
90 "weights/MVfJVT_pt4050_etaLow_muHigh.May2019.weights.xml",
91 "weights/MVfJVT_pt50plus_etaHigh_muHigh.May2019.weights.xml",
92 "weights/MVfJVT_pt50plus_etaLow_muHigh.May2019.weights.xml",
93 "weights/MVfJVT_pt2030_etaHigh_muLow.May2019.weights.xml",
94 "weights/MVfJVT_pt2030_etaLow_muLow.May2019.weights.xml",
95 "weights/MVfJVT_pt3040_etaHigh_muLow.May2019.weights.xml",
96 "weights/MVfJVT_pt3040_etaLow_muLow.May2019.weights.xml",
97 "weights/MVfJVT_pt4050_etaHigh_muLow.May2019.weights.xml",
98 "weights/MVfJVT_pt4050_etaLow_muLow.May2019.weights.xml",
99 "weights/MVfJVT_pt50plus_etaHigh_muLow.May2019.weights.xml",
100 "weights/MVfJVT_pt50plus_etaLow_muLow.May2019.weights.xml"
101 }, "List of config file names"}; // pt [20,30,40,50,120] || |eta| [2.5,3.2,4.5] || mu [0,50,inf.];

◆ m_mvfjvtKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_mvfjvtKey {this, "MVFJVTName", "MVfJVT", "SG key for the output MVfJVT decoration"}
private

Definition at line 127 of file JetForwardJvtToolBDT.h.

127{this, "MVFJVTName", "MVfJVT", "SG key for the output MVfJVT decoration"};

◆ m_mvfjvtThresh

std::unique_ptr< TH3D > JetForwardJvtToolBDT::m_mvfjvtThresh
private

Definition at line 106 of file JetForwardJvtToolBDT.h.

◆ m_MVreader

std::unique_ptr< TMVA::Reader > JetForwardJvtToolBDT::m_MVreader
private

Definition at line 105 of file JetForwardJvtToolBDT.h.

◆ m_OP

Gaudi::Property<std::string> JetForwardJvtToolBDT::m_OP {this, "OperatingPoint", "DEFAULT", "Selected operating point, can be 'LOOSE', 'TIGHT' or 'TIGHTER'"}
private

Definition at line 118 of file JetForwardJvtToolBDT.h.

118{this, "OperatingPoint", "DEFAULT", "Selected operating point, can be 'LOOSE', 'TIGHT' or 'TIGHTER'"};

◆ m_outMVKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetForwardJvtToolBDT::m_outMVKey {this, "OutputDecMV", "passMVFJVT", "SG key for the output MV decoration"}
private

Definition at line 125 of file JetForwardJvtToolBDT.h.

125{this, "OutputDecMV", "passMVFJVT", "SG key for the output MV decoration"};

◆ m_pvind

Gaudi::Property<int> JetForwardJvtToolBDT::m_pvind {this, "PVIndexHS", -1, ""}
private

Definition at line 121 of file JetForwardJvtToolBDT.h.

121{this, "PVIndexHS", -1, ""};

◆ m_trkMetKey

SG::ReadHandleKey<xAOD::MissingETContainer> JetForwardJvtToolBDT::m_trkMetKey {this, "TrackMetName", "MET_Track", "SG key for input track MET container"}
private

Definition at line 144 of file JetForwardJvtToolBDT.h.

144{this, "TrackMetName", "MET_Track", "SG key for input track MET container"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexContainerKey

SG::ReadHandleKey<xAOD::VertexContainer> JetForwardJvtToolBDT::m_vertexContainerKey {this, "VertexContainerName", "PrimaryVertices", "SG key for input vertex container"}
private

Definition at line 142 of file JetForwardJvtToolBDT.h.

142{this, "VertexContainerName", "PrimaryVertices", "SG key for input vertex container"};

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_wpFile

Gaudi::Property<std::string> JetForwardJvtToolBDT::m_wpFile {this, "WPfile", "MVfJVT_WPs.Nov2019.root", "WP file"}
private

Definition at line 102 of file JetForwardJvtToolBDT.h.

102{this, "WPfile", "MVfJVT_WPs.Nov2019.root", "WP file"};

◆ m_wpFileIn

std::unique_ptr< TFile > JetForwardJvtToolBDT::m_wpFileIn
private

Definition at line 104 of file JetForwardJvtToolBDT.h.


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