ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
BTaggingSelectionTool Class Reference

#include <BTaggingSelectionTool.h>

Inheritance diagram for BTaggingSelectionTool:
Collaboration diagram for BTaggingSelectionTool:

Classes

struct  taggerproperties
 

Public Member Functions

 BTaggingSelectionTool (const std::string &name)
 Create a proper constructor for Athena. More...
 
StatusCode initialize () override
 Dummy implementation of the initialisation function. More...
 
virtual asg::AcceptData accept (const xAOD::IParticle *p) const override
 Get the decision using a generic IParticle pointer. More...
 
virtual asg::AcceptData accept (const xAOD::Jet &jet) const override
 
virtual asg::AcceptData accept (double, double, double) const override
 Get the decision using thet jet's pt and tag weight values. More...
 
virtual asg::AcceptData accept (double, double, double, double) const override
 
virtual asg::AcceptData accept (double, double, double, double, double) const override
 
virtual asg::AcceptData accept (double, double, double, double, double, double) const override
 
virtual int getQuantile (const xAOD::IParticle *) const override
 Decide in which quantile of the tag weight distribution the jet belongs (continuous tagging) The return value represents the bin index of the quantile distribution. More...
 
virtual int getQuantile (const xAOD::Jet &) const override
 
virtual int getQuantile (double, double, double) const override
 
virtual int getQuantile (double, double, double, double) const override
 
virtual CP::CorrectionCode getCutValue (double, double &cutval) const override
 
virtual CP::CorrectionCode getTaggerWeight (const xAOD::Jet &jet, double &tagweight) const override
 
virtual CP::CorrectionCode getTaggerWeight (double pb, double pc, double pu, double &tagweight) const override
 
virtual CP::CorrectionCode getTaggerWeight (double pb, double pc, double pu, double &tagweight, double ptau) const override
 
virtual CP::CorrectionCode getTaggerWeight (const xAOD::Jet &jet, double &weight, bool getCTagW) const override
 
virtual CP::CorrectionCode getTaggerWeight (double, double, double, double &weight, bool getCTagW, double=0.) const override
 
const asg::AcceptInfogetAcceptInfo () const override
 Declare the interface ID for this pure-virtual interface class to the Athena framework. More...
 
virtual void print () const
 Print the state of the tool. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

enum  Tagger {
  UNKNOWN, DL1, GN1, GN2,
  MV2c10
}
 
typedef double(xAOD::BTagging::* tagWeight_member_t) () const
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

virtual bool checkRange (double, double, asg::AcceptData &) const
 Helper function that decides whether a jet belongs to the correct jet selection for b-tagging. More...
 
void InitializeTaggerVariables (std::string taggerName, std::string OP, TSpline3 *spline, TVector *constcut, double &fraction)
 
Tagger SetTaggerEnum (const std::string &taggerName)
 
StatusCode ExtractTaggerProperties (taggerproperties &tagger, const std::string &taggerName, const std::string &OP)
 
std::vector< std::string > split (const std::string &input, const char &delimiter)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

bool m_initialised = false
 
bool m_ErrorOnTagWeightFailure = true
 
bool m_StoreNConstituents = false
 
bool m_continuous = false
 
bool m_continuous2D = false
 
bool m_useCTag = false
 
bool m_readFromBTaggingObject = true
 
asg::AcceptInfo m_acceptinfo
 Object used to store the last decision. More...
 
double m_maxEta {}
 
double m_minPt {}
 
double m_maxRangePt {}
 
std::string m_CutFileName
 
std::string m_taggerName
 
std::string m_OP
 
std::string m_jetAuthor
 
std::string m_ContinuousBenchmarks
 
std::string m_wps_raw
 
TFile * m_inf {}
 
std::vector< double > m_continuouscuts
 
SG::AuxElement::ConstAccessor< float > m_accessor_pb
 
SG::AuxElement::ConstAccessor< float > m_accessor_pc
 
SG::AuxElement::ConstAccessor< float > m_accessor_pu
 
SG::AuxElement::ConstAccessor< float > m_accessor_ptau
 
taggerproperties m_tagger
 
Tagger m_taggerEnum {UNKNOWN}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 24 of file BTaggingSelectionTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ tagWeight_member_t

typedef double(xAOD::BTagging::* BTaggingSelectionTool::tagWeight_member_t) () const
private

Definition at line 27 of file BTaggingSelectionTool.h.

Member Enumeration Documentation

◆ Tagger

Enumerator
UNKNOWN 
DL1 
GN1 
GN2 
MV2c10 

Definition at line 120 of file BTaggingSelectionTool.h.

120 {UNKNOWN, DL1, GN1, GN2, MV2c10};

Constructor & Destructor Documentation

◆ BTaggingSelectionTool()

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

Create a proper constructor for Athena.

Create a constructor for standalone usage

Definition at line 43 of file BTaggingSelectionTool.cxx.

44  : asg::AsgTool( name ), m_acceptinfo( "JetSelection" ), m_accessor_pb( "pb" ), m_accessor_pc( "pc" ), m_accessor_pu( "pu" ), m_accessor_ptau( "ptau" )
45 {
46  namespace def = ftag::defaults;
47  m_initialised = false;
48  declareProperty( "MaxEta", m_maxEta = 2.5 );
49  declareProperty( "MinPt", m_minPt = 0 /*MeV*/);
50  declareProperty( "MaxRangePt", m_maxRangePt = 3000000 /*MeV*/);
51  declareProperty( "FlvTagCutDefinitionsFileName", m_CutFileName=def::cdi_path, "name of the files containing official cut definitions (uses PathResolver)");
52  declareProperty( "TaggerName", m_taggerName=def::tagger, "tagging algorithm name");
53  declareProperty( "OperatingPoint", m_OP="", "operating point");
54  declareProperty( "JetAuthor", m_jetAuthor=def::jet_collection, "jet collection");
55  declareProperty( "WorkingPointDefinitions", m_wps_raw="FixedCutBEff_85,FixedCutBEff_77,FixedCutBEff_70,FixedCutBEff_60", "Comma-separated list of tagger working points (in decreasing order of efficiency!) - required for 1D tagging purposes");
56  declareProperty( "ErrorOnTagWeightFailure", m_ErrorOnTagWeightFailure=true, "optionally ignore cases where the tagweight cannot be retrived. default behaviour is to give an error, switching to false will turn it into a warning");
57  declareProperty( "CutBenchmarksContinuousWP", m_ContinuousBenchmarks="", "comma separated list of tag bins that will be accepted as tagged: 1,2,3 etc.. ");
58  declareProperty( "useCTagging", m_useCTag=false, "Enabled only for FixedCut or Continuous WPs: define wether the cuts refer to b-tagging or c-tagging");
59  declareProperty( "readFromBTaggingObject", m_readFromBTaggingObject=true, "Enabled to access btagging scores from xAOD::BTagging object; Can be disabled for GN2v01 to access the scores from the jet itself.");
60 }

Member Function Documentation

◆ accept() [1/6]

asg::AcceptData BTaggingSelectionTool::accept ( const xAOD::IParticle p) const
overridevirtual

Get the decision using a generic IParticle pointer.

Implements IAsgSelectionTool.

Definition at line 440 of file BTaggingSelectionTool.cxx.

440  {
441 
442  // Check if this is a jet:
443  if( p->type() != xAOD::Type::Jet ) {
444  ATH_MSG_ERROR( "accept(...) Function received a non-jet" );
445  return asg::AcceptData (&m_acceptinfo);
446  }
447 
448  // Cast it to a jet:
449  const xAOD::Jet* jet = dynamic_cast< const xAOD::Jet* >( p );
450  if( ! jet ) {
451  ATH_MSG_FATAL( "accept(...) Failed to cast particle to jet" );
452  return asg::AcceptData (&m_acceptinfo);
453  }
454 
455  // Let the specific function do the work:
456  return accept( *jet );
457 }

◆ accept() [2/6]

asg::AcceptData BTaggingSelectionTool::accept ( const xAOD::Jet jet) const
overridevirtual

Implements IBTaggingSelectionTool.

Definition at line 459 of file BTaggingSelectionTool.cxx.

459  {
460  asg::AcceptData acceptData (&m_acceptinfo);
461 
462  if (! m_initialised) {
463  ATH_MSG_ERROR("BTaggingSelectionTool has not been initialised");
464  return acceptData;
465  }
466 
468  // We want at least 2 tracks in a track jet
469  acceptData.setCutResult( "NConstituents", jet.numConstituents() >= 2 );
470  }
471 
472  double pT = jet.pt();
473  double eta = jet.eta();
474 
475  if(m_continuous2D){
476  double taggerweight_b(-100);
477  double taggerweight_c(-100);
478  if( (getTaggerWeight( jet, taggerweight_b, false)!=CorrectionCode::Ok) ||
479  (getTaggerWeight( jet, taggerweight_c, true )!=CorrectionCode::Ok) )
480  return acceptData;
481 
482  return accept(pT, eta, taggerweight_b,taggerweight_c);
483  }
484  else{ //if here, we are in 1D mode
485  double taggerweight(-100);
486  if( getTaggerWeight( jet ,taggerweight, m_useCTag)!=CorrectionCode::Ok)
487  return acceptData;
488 
489  return accept(pT, eta, taggerweight);
490  }
491 }

◆ accept() [3/6]

asg::AcceptData BTaggingSelectionTool::accept ( double  pT,
double  eta,
double  tag_weight 
) const
overridevirtual

Get the decision using thet jet's pt and tag weight values.

Implements IBTaggingSelectionTool.

Definition at line 493 of file BTaggingSelectionTool.cxx.

494 {
495 
496  asg::AcceptData acceptData (&m_acceptinfo);
497 
498  if (! m_initialised) {
499  ATH_MSG_ERROR("BTaggingSelectionTool has not been initialised");
500  return acceptData;
501  }
502 
503  eta = std::abs(eta);
504  if (! checkRange(pT, eta, acceptData))
505  return acceptData;
506 
507  // After initialization, either m_tagger.spline or m_tagger.constcut should be non-zero
508  // Else, the initialization was incorrect and should be revisited
509  if(m_continuous){
510  for(size_t bin : m_tagger.benchmarks){
511  if(bin == 0){
512  throw std::logic_error("bin == 0 in the list of tagged bins. you should not be here. Wrong convention");
513  } else if ( bin == 1 ) {
514  if ( tag_weight < m_continuouscuts.at(bin-1) ) {
515  acceptData.setCutResult( "WorkingPoint", true );
516  }
517  } else if (bin > 1 && bin <= m_continuouscuts.size()){
518  if ( tag_weight > m_continuouscuts.at(bin-2) && tag_weight < m_continuouscuts.at(bin-1) ) {
519  acceptData.setCutResult( "WorkingPoint", true );
520  }
521  } else {
522  if ( tag_weight > m_continuouscuts.at(bin-2) ) {
523  acceptData.setCutResult( "WorkingPoint", true );
524  }
525  }
526  }
527  }
528  else{ //FixedCut
529  double cutvalue(DBL_MAX);
530  if( getCutValue(pT, cutvalue )!=CorrectionCode::Ok ){
531  return acceptData;
532  }
533 
534  if ( tag_weight < cutvalue ){
535  return acceptData;
536  }
537 
538  acceptData.setCutResult( "WorkingPoint", true );
539  }
540 
541  // Return the result:
542  return acceptData;
543 }

◆ accept() [4/6]

asg::AcceptData BTaggingSelectionTool::accept ( double  pT,
double  eta,
double  taggerWeight_b,
double  taggerWeight_c 
) const
overridevirtual

Implements IBTaggingSelectionTool.

Definition at line 545 of file BTaggingSelectionTool.cxx.

546 {
547  asg::AcceptData acceptData (&m_acceptinfo);
548 
549  if (! m_initialised) {
550  ATH_MSG_ERROR("BTaggingSelectionTool has not been initialised");
551  return acceptData;
552  }
553 
554  eta = std::abs(eta);
555 
556  if (! checkRange(pT, eta, acceptData))
557  return acceptData;
558 
559  for(auto bin : m_tagger.benchmarks){
560 
561  ATH_MSG_DEBUG("bin" <<bin <<" taggerWeight_c "
562  <<taggerWeight_c <<" taggerWeight_b "
563  <<taggerWeight_b);
564 
565  ATH_MSG_DEBUG(" c-cuts : " <<m_tagger.get2DCutValue(bin,0) <<" "
566  <<m_tagger.get2DCutValue(bin,1) <<" b-cuts : "
567  <<m_tagger.get2DCutValue(bin,2) <<" "
568  <<m_tagger.get2DCutValue(bin,3));
569 
570  if (taggerWeight_c > m_tagger.get2DCutValue(bin,0) && //ctag low
571  taggerWeight_c <= m_tagger.get2DCutValue(bin,1) && //ctag max
572  taggerWeight_b > m_tagger.get2DCutValue(bin,2) && //btag low
573  taggerWeight_b <= m_tagger.get2DCutValue(bin,3) ) //btag max
574  {
575  acceptData.setCutResult( "WorkingPoint", true ); // IF we arrived here, the jet is tagged
576  break;
577  }
578  } //for loop
579 
580  // Return the result:
581  return acceptData;
582 }

◆ accept() [5/6]

asg::AcceptData BTaggingSelectionTool::accept ( double  pT,
double  eta,
double  pb,
double  pc,
double  pu 
) const
overridevirtual

Implements IBTaggingSelectionTool.

Definition at line 584 of file BTaggingSelectionTool.cxx.

585 {
586  if (m_tagger.name == "GN2v01"){
587  asg::AcceptData acceptData (&m_acceptinfo);
588  ATH_MSG_ERROR("For GN2v01 tagger, there is a new tau claass in the NN output. Please update the accept() to accept(double pT, double eta, double pb, double pc, double pu, double ptau)");
589  return acceptData;
590  } else {
591  return accept(pT, eta, pb, pc, pu, 0.);
592  }
593 }

◆ accept() [6/6]

asg::AcceptData BTaggingSelectionTool::accept ( double  pT,
double  eta,
double  pb,
double  pc,
double  pu,
double  ptau 
) const
overridevirtual

Implements IBTaggingSelectionTool.

Definition at line 595 of file BTaggingSelectionTool.cxx.

596  {
597  asg::AcceptData acceptData (&m_acceptinfo);
598 
599  if (! m_initialised) {
600  ATH_MSG_ERROR("BTaggingSelectionTool has not been initialised");
601  return acceptData;
602  }
603 
604  eta = std::abs(eta);
605  if (! checkRange(pT, eta, acceptData))
606  return acceptData;
607 
608  // After initialization, either m_tagger.spline or m_tagger.constcut should be non-zero
609  // Else, the initialization was incorrect and should be revisited
610  double cutvalue(DBL_MAX);
611 
612  if( getCutValue(pT, cutvalue)!=CorrectionCode::Ok){
613  return acceptData;
614  };
615 
616  if(m_continuous2D){
617  double tagger_weight_b(-100);
618  double tagger_weight_c(-100);
619  if( ( getTaggerWeight(pb, pc, pu, tagger_weight_b, false, ptau)!=CorrectionCode::Ok) ||
620  ( getTaggerWeight(pb, pc, pu, tagger_weight_c, true, ptau)!=CorrectionCode::Ok) )
621  return acceptData;
622  return accept(pT, eta, tagger_weight_b, tagger_weight_c);
623  }
624  else{
625  double tagger_weight(-100);
626  if( getTaggerWeight(pb, pc, pu, tagger_weight, m_useCTag, ptau)!=CorrectionCode::Ok)
627  return acceptData;
628  if ( tagger_weight < cutvalue )
629  return acceptData;
630  }
631  //if you made it here, the jet is tagged
632  acceptData.setCutResult( "WorkingPoint", true );
633  return acceptData;
634  }

◆ checkRange()

bool BTaggingSelectionTool::checkRange ( double  pT,
double  eta,
asg::AcceptData acceptData 
) const
privatevirtual

Helper function that decides whether a jet belongs to the correct jet selection for b-tagging.

Definition at line 770 of file BTaggingSelectionTool.cxx.

771 {
772  // Do the |eta| cut:
773  if( std::abs(eta) > m_maxEta ) {
774  return false;
775  }
776  acceptData.setCutResult( "Eta", true );
777 
778  // Do the pT cut:
779  ATH_MSG_VERBOSE( "Jet pT: " << pT );
780  if( pT < m_minPt ) {
781  return false;
782  }
783  acceptData.setCutResult( "Pt", true );
784 
785  return true;
786 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

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

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ ExtractTaggerProperties()

StatusCode BTaggingSelectionTool::ExtractTaggerProperties ( taggerproperties tagger,
const std::string &  taggerName,
const std::string &  OP 
)
private

Definition at line 232 of file BTaggingSelectionTool.cxx.

232  {
233 
234  TString cutname = OP;
235 
236  //set the name
237  tagger.name = taggerName;
238 
239  if ("FlatBEff"==cutname(0,8) || "HybBEff"==cutname(0,7) ){
240  cutname = taggerName+"/"+m_jetAuthor+"/"+OP+"/cutprofile";
241  tagger.spline = dynamic_cast<TSpline3*> (m_inf->Get(cutname));
242  if (tagger.spline == nullptr){
243  ATH_MSG_ERROR( "Invalid operating point" );
244  return StatusCode::FAILURE;
245  }
246  tagger.constcut = nullptr;
247  }
248  else {
249  cutname = taggerName+"/"+m_jetAuthor+"/"+OP+"/cutvalue";
250  tagger.constcut = dynamic_cast<TVector*> (m_inf->Get(cutname));
251  if (tagger.constcut == nullptr){
252  ATH_MSG_ERROR( "Invalid operating point" );
253  return StatusCode::FAILURE;
254  }
255  tagger.spline = nullptr;
256  }
257 
258  //retrive the "fraction" used in the DL1 log likelihood from the CDI, if its not there, use the hard coded values
259  // (backwards compatibility)
260  if( (m_taggerEnum == Tagger::DL1) || (m_taggerEnum == Tagger::GN1) || (m_taggerEnum == Tagger::GN2)){
261 
262  TString fraction_data_name = taggerName+"/"+m_jetAuthor+"/"+OP+"/fraction";
263  TVector *fraction_data = dynamic_cast<TVector*> (m_inf->Get(fraction_data_name));
264 
265  double fraction = -1;
266  if(fraction_data!=nullptr){
267  fraction = fraction_data[0](0);
268  }else{
269  if("DL1" ==taggerName){ fraction = 0.08; }
270  if("DL1mu" ==taggerName){ fraction = 0.08; }
271  if("DL1rnn" ==taggerName){ fraction = 0.03; }
272  }
273  tagger.fraction_c = fraction;
274  tagger.fraction_b = fraction;
275 
276  double fraction_tau = 0.;
277  double fraction_tau_cTag = 0.;
278  TString fraction_tau_name = taggerName+"/"+m_jetAuthor+"/"+OP+"/fraction_tau";
279  TVector *fraction_tau_data = dynamic_cast<TVector*> (m_inf->Get(fraction_tau_name));
280  if (m_taggerEnum == Tagger::GN2 && !(taggerName.find("GN2v00") != std::string::npos)){
281  if( fraction_tau_data != nullptr ) {
282  if (m_useCTag){
283  // tau fraction for c-tagging
284  fraction_tau_cTag = fraction_tau_data[0](0);
285  }
286  else{
287  // tau fraction for b-tagging
288  fraction_tau = fraction_tau_data[0](0);
289  }
290  }
291  else {
292  // For GN2v01 taggers and onwards the fraction_tau should be in the CDI file
293  ATH_MSG_ERROR("Tagger fraction_tau is not available");
294  return StatusCode::FAILURE;
295  }
296  }
297  tagger.fraction_tau = fraction_tau;
298  tagger.fraction_tau_cTag = fraction_tau_cTag;
299 
300  delete fraction_data;
301  delete fraction_tau_data;
302  }
303  return StatusCode::SUCCESS;
304 }

◆ 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

◆ getAcceptInfo()

const asg::AcceptInfo& BTaggingSelectionTool::getAcceptInfo ( ) const
inlineoverridevirtual

Declare the interface ID for this pure-virtual interface class to the Athena framework.

Method to get the AcceptInfo to query what cuts are defined.

Implements IAsgSelectionTool.

Definition at line 63 of file BTaggingSelectionTool.h.

63 {return m_acceptinfo;}

◆ getCutValue()

CorrectionCode BTaggingSelectionTool::getCutValue ( double  pT,
double &  cutval 
) const
overridevirtual

Implements IBTaggingSelectionTool.

Definition at line 788 of file BTaggingSelectionTool.cxx.

789 {
790  cutval = DBL_MAX;
791 
792  // flat cut for out of range pTs
793  if (pT>m_maxRangePt)
794  pT = m_maxRangePt;
795 
796  taggerproperties tagger ATLAS_THREAD_SAFE = m_tagger;
797 
798  if (tagger.spline != nullptr && tagger.constcut == nullptr) {
799  pT = pT/1000.0;
800  double maxsplinept = tagger.spline->GetXmax();
801  if (pT>maxsplinept){ pT = maxsplinept; }
802  cutval = tagger.spline->Eval(pT);
803  }
804 
805  else if (tagger.constcut != nullptr && tagger.spline == nullptr) {
806  cutval = tagger.constcut[0](0);
807  }
808  else{
809  ATH_MSG_ERROR( "Bad cut configuration!" );
810  return CorrectionCode::Error;
811  }
812 
813 
814  ATH_MSG_VERBOSE( "Cut value " << cutval );
815 
816  return CorrectionCode::Ok;
817 }

◆ 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::TEvent 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::TEvent, 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  }

◆ 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::TEvent 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::TEvent, 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.

◆ getQuantile() [1/4]

int BTaggingSelectionTool::getQuantile ( const xAOD::IParticle p) const
overridevirtual

Decide in which quantile of the tag weight distribution the jet belongs (continuous tagging) The return value represents the bin index of the quantile distribution.

Implements IBTaggingSelectionTool.

Definition at line 636 of file BTaggingSelectionTool.cxx.

636  {
637  // Check if this is a jet:
638 
639 
640  if( p->type() != xAOD::Type::Jet ) {
641  ATH_MSG_ERROR( "accept(...) Function received a non-jet" );
642  return -1;
643  }
644 
645  // Cast it to a jet:
646  const xAOD::Jet* jet = dynamic_cast< const xAOD::Jet* >( p );
647  if( ! jet ) {
648  ATH_MSG_FATAL( "accept(...) Failed to cast particle to jet" );
649  return -1;
650  }
651 
652  // Let the specific function do the work:
653  return getQuantile( *jet );
654 }

◆ getQuantile() [2/4]

int BTaggingSelectionTool::getQuantile ( const xAOD::Jet jet) const
overridevirtual

Implements IBTaggingSelectionTool.

Definition at line 656 of file BTaggingSelectionTool.cxx.

656  {
657  double pT = jet.pt();
658  double eta = std::abs( jet.eta() );
659  int quantile = -1;
660 
661  if (m_continuous2D){
662  double tag_weight_b(-100.);
663  double tag_weight_c(-100.);
664  if ( (getTaggerWeight(jet, tag_weight_b, false) == CP::CorrectionCode::Error) ||
665  (getTaggerWeight(jet, tag_weight_c, true ) == CP::CorrectionCode::Error) ){
666  ATH_MSG_WARNING("getQuantile: Failed to retrieve tag weight for Continuous2D!");
667  return -1;
668  }
669  quantile = getQuantile(pT, eta, tag_weight_b, tag_weight_c );
670  }
671  else{
672  // Retrieve the tagger weight which was assigned to the jet
673  double tag_weight(-100.);
675  ATH_MSG_WARNING("getQuantile: Failed to retrieve "+m_taggerName+" weight!");
676  return -1;
677  }
678  ATH_MSG_VERBOSE( m_taggerName << " " << tag_weight);
679  quantile = getQuantile(pT, eta, tag_weight);
680  }
681  return quantile;
682 }

◆ getQuantile() [3/4]

int BTaggingSelectionTool::getQuantile ( double  pT,
double  eta,
double  tag_weight 
) const
overridevirtual

Implements IBTaggingSelectionTool.

Definition at line 685 of file BTaggingSelectionTool.cxx.

686 {
687  if (! m_initialised) {
688  ATH_MSG_ERROR("BTaggingSelectionTool has not been initialised");
689  }
691  // Cheatsheet:
692  // With n WPs, (from highest to lowest) A1 , A2, A3, ..., An
693  // return -1 if not in b-tagging acceptance
694  // return 1 if between 100% and A1 (untagged)
695  // return 2 if between A1 and A2 (tagged at the A1 WP)
696  // return 3 if between A2 and A3 (tagged at the A2 WP)
697  // ...
698  // return n if between An-1 and An (tagged at the An-1 WP)
699  // return n+1 if between An and 0% (tagged at the An WP)
701 
702  int bin_index = -1;
703 
704  // First, check if the jet is in acceptance
705  asg::AcceptData acceptData (&m_acceptinfo);
706  if (! checkRange(pT, eta,acceptData)) {
707  return bin_index;
708  }
709 
710  // Now we need to check each threshold in the PCBT vector
711  // and return the maximum WP bin index (1,2,...,n).
712  // Instead of checking low<tag_weight<high for each bin,
713  // we simply check tag_weight<high and therefore range
714  // from vector indices 1 to vector.size()
715  bin_index = 1; // setting the ones that pass selection you have default as 1
716  for (std::size_t i=0; i<m_continuouscuts.size(); i++) {
717  if ( tag_weight > m_continuouscuts.at(i) ) {
718  bin_index++;
719  } else {
720  break;
721  }
722  }
723  return bin_index;
724 }

◆ getQuantile() [4/4]

int BTaggingSelectionTool::getQuantile ( double  pT,
double  eta,
double  tag_weight_b,
double  tag_weight_c 
) const
overridevirtual

Cheatsheet: returns 4 if pass B_tight (?) returns 3 if pass B_loose returns 2 if pass C_tight + fail B_loose returns 1 if pass C_loose + fail C_tight + fail B_loose returns 0 if fail C_loose + fail B_loose return -1 not in b-tagging acceptance

Implements IBTaggingSelectionTool.

Definition at line 726 of file BTaggingSelectionTool.cxx.

727 {
737 
738  //More details here: https://indico.cern.ch/event/1116952/#4-mr49953-implements-the-conti
739 
740  ATH_MSG_DEBUG("inside getQuantile 2D " <<pT <<" " <<eta <<" " <<tag_weight_b <<" " <<tag_weight_c);
741  int bin_index(-1);
742 
743  asg::AcceptData acceptData (&m_acceptinfo);
744  if (! checkRange(pT, eta, acceptData)) return bin_index;
745 
746  int ncuts = m_tagger.cuts2D->GetNrows();
747  ATH_MSG_VERBOSE("ncuts: " <<ncuts);
748 
749  //loop over all the cuts
750  for(int i = 0; i < ncuts ; i++){
751  double c_cut_low = m_tagger.get2DCutValue(i,0);
752  double c_cut_hig = m_tagger.get2DCutValue(i,1);
753  double b_cut_low = m_tagger.get2DCutValue(i,2);
754  double b_cut_hig = m_tagger.get2DCutValue(i,3);
755 
756  ATH_MSG_DEBUG("bin " <<i <<" c_cut low " <<c_cut_low <<" c_cut hig " <<c_cut_hig <<" c_cut low " <<b_cut_low <<" b_ct hig" <<b_cut_hig);
757  if (tag_weight_c > c_cut_low &&
758  tag_weight_c <= c_cut_hig &&
759  tag_weight_b > b_cut_low &&
760  tag_weight_b <= b_cut_hig){
761  bin_index = i;
762  break;
763  }
764  }
765 
766  ATH_MSG_VERBOSE("bin_index " <<bin_index);
767  return bin_index;
768 }

◆ getTaggerWeight() [1/5]

CorrectionCode BTaggingSelectionTool::getTaggerWeight ( const xAOD::Jet jet,
double &  tagweight 
) const
overridevirtual

Implements IBTaggingSelectionTool.

Definition at line 306 of file BTaggingSelectionTool.cxx.

306  {
307  return getTaggerWeight(jet, tagweight, m_useCTag);
308 }

◆ getTaggerWeight() [2/5]

CorrectionCode BTaggingSelectionTool::getTaggerWeight ( const xAOD::Jet jet,
double &  weight,
bool  getCTagW 
) const
overridevirtual

Implements IBTaggingSelectionTool.

Definition at line 310 of file BTaggingSelectionTool.cxx.

310  {
311 
312  std::string taggerName = m_tagger.name;
313  // following taggerName change is needed given different name is used for GN2v00 in derivation and in CDI
314  if (taggerName == "GN2v00LegacyWP" || taggerName == "GN2v00NewAliasWP"){
315  taggerName = "GN2v00";
316  }
317 
318  tagweight = -100.;
319 
320  if(!m_continuous2D && (getCTagW != m_useCTag) ){
321  ATH_MSG_ERROR("Difference between initialisation and getTaggerWeight request! useCTagging property set to " <<m_useCTag <<" while getTaggerWeight use c-tag is set to " <<getCTagW <<".");
322  return CorrectionCode::Error;
323  }
324 
325  if ( m_taggerEnum == Tagger::MV2c10 ){
326 
328 
329  if ((!btag) || (!btag->MVx_discriminant(taggerName, tagweight))){
331  ATH_MSG_ERROR("Failed to retrieve "+taggerName+" weight!");
332  return CorrectionCode::Error;
333  }else{
334  ATH_MSG_WARNING("Failed to retrieve "+taggerName+" weight!");
335  return CorrectionCode::Ok;
336  }
337  }
338  ATH_MSG_VERBOSE( taggerName << " " << tagweight );
339  return CorrectionCode::Ok;
340  } //MV2
341  else{
342  //DL1r or DL1 or GN2v01
343  double tagger_pb(-10.);
344  double tagger_pc(-10.);
345  double tagger_pu(-10.);
346  double tagger_ptau(0.);
347 
348  const SG::AuxElement* btagInfo = &jet;
351 
352  if(!btagInfo){
354  ATH_MSG_ERROR("Failed to retrieve "+taggerName+" weight!");
355  return CorrectionCode::Error;
356  }else{
357  ATH_MSG_WARNING("Failed to retrieve "+taggerName+" weight!");
358  return CorrectionCode::Ok;
359  }
360  }
361 
362  tagger_pb = m_accessor_pb(*btagInfo);
363  tagger_pc = m_accessor_pc(*btagInfo);
364  tagger_pu = m_accessor_pu(*btagInfo);
365  if(m_taggerName == "GN2v01")
366  tagger_ptau = m_accessor_ptau(*btagInfo);
367 
368 
369  return getTaggerWeight(tagger_pb, tagger_pc, tagger_pu, tagweight, getCTagW, tagger_ptau);
370 
371  }
372 
373  //if we got here the tagger name is not configured properly
374  ATH_MSG_ERROR("BTaggingSelectionTool doesn't support tagger: "+m_taggerName);
375  return CorrectionCode::Error;
376 
377 }

◆ getTaggerWeight() [3/5]

CorrectionCode BTaggingSelectionTool::getTaggerWeight ( double  pb,
double  pc,
double  pu,
double &  tagweight 
) const
overridevirtual

Implements IBTaggingSelectionTool.

Definition at line 379 of file BTaggingSelectionTool.cxx.

379  {
380  if (m_tagger.name == "GN2v01"){
381  ATH_MSG_ERROR("For GN2v01 tagger, there is a new tau claass in the NN output. Please update your getTaggerWeight() to getTaggerWeight( double pb, double pc, double pu, double & tagweight, double ptau)");
382  return CorrectionCode::Error;
383  } else {
384  return getTaggerWeight(pb, pc, pu, tagweight, m_useCTag, 0.);
385  }
386 }

◆ getTaggerWeight() [4/5]

CorrectionCode BTaggingSelectionTool::getTaggerWeight ( double  pb,
double  pc,
double  pu,
double &  tagweight,
double  ptau 
) const
overridevirtual

Implements IBTaggingSelectionTool.

Definition at line 388 of file BTaggingSelectionTool.cxx.

388  {
389  return getTaggerWeight(pb, pc, pu, tagweight, m_useCTag, ptau);
390 }

◆ getTaggerWeight() [5/5]

CorrectionCode BTaggingSelectionTool::getTaggerWeight ( double  pb,
double  pc,
double  pu,
double &  weight,
bool  getCTagW,
double  ptau = 0. 
) const
overridevirtual

Implements IBTaggingSelectionTool.

Definition at line 392 of file BTaggingSelectionTool.cxx.

392  {
393 
394  std::string taggerName = m_tagger.name;
395 
396  if(!m_continuous2D && (getCTagW != m_useCTag) ){
397  ATH_MSG_ERROR("Difference between initialisation and getTaggerWeight request! useCTagging property set to " <<m_useCTag <<" while getTaggerWeight use c-tag is set to " <<getCTagW <<".");
398  return CorrectionCode::Error;
399  }
400 
401  tagweight = -100.;
402  if( (m_taggerEnum == Tagger::DL1) || (m_taggerEnum == Tagger::GN1) || (m_taggerEnum == Tagger::GN2)){
403 
404  bool valid_input = (!std::isnan(pu) && pb>=0 && pc>=0 && pu>=0 && ptau>=0);
405 
406  if (!valid_input){
408  ATH_MSG_ERROR("Invalid inputs for "+taggerName+" pb " << pb << " pc " << pc << " pu " << pu << " ptau " << ptau << " ");
409  return CorrectionCode::Error;
410  }else{
411  ATH_MSG_WARNING("Invalid inputs for "+taggerName+" pb " << pb << " pc " << pc << " pu " << pu << " ptau " << ptau << " ");
412  return CorrectionCode::Ok;
413  }
414  }
415 
416  if(getCTagW){
418  }
419  else{
420  tagweight = log(pb / (m_tagger.fraction_c * pc + (1. - m_tagger.fraction_c - m_tagger.fraction_tau) * pu + m_tagger.fraction_tau * ptau) );
421  }
422 
423  ATH_MSG_VERBOSE( "pb " << pb );
424  ATH_MSG_VERBOSE( "pc " << pc );
425  ATH_MSG_VERBOSE( "pu " << pu );
426  ATH_MSG_VERBOSE( "ptau" << ptau );
427  ATH_MSG_VERBOSE( "tagweight " << tagweight );
428 
429  return CorrectionCode::Ok;
430  }
431 
432  //if we got here the tagger name is not configured properly
433  ATH_MSG_ERROR("this call to getTaggerWeight only works for DL1/GNx taggers");
434  return CorrectionCode::Error;
435 
436 }

◆ initialize()

StatusCode BTaggingSelectionTool::initialize ( )
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 62 of file BTaggingSelectionTool.cxx.

62  {
63  m_initialised = true;
64 
65  if (""==m_OP){
66  ATH_MSG_ERROR( "BTaggingSelectionTool wasn't given a working point name" );
67  return StatusCode::FAILURE;
68  }
69 
70  TString pathtofile = PathResolverFindCalibFile(m_CutFileName);
71  m_inf = TFile::Open(pathtofile, "read");
72  if (0==m_inf) {
73 
74  ATH_MSG_ERROR( "BTaggingSelectionTool couldn't access tagging cut definitions" );
75  return StatusCode::FAILURE;
76  }
77 
78  // check the CDI file for the selected tagger and jet collection
79  TString check_CDI = m_taggerName;
80  if(!m_inf->Get(check_CDI)){
81  ATH_MSG_ERROR( "Tagger: "+m_taggerName+" not found in this CDI file: "+m_CutFileName);
82  return StatusCode::FAILURE;
83  }
84  check_CDI = m_taggerName+"/"+m_jetAuthor;
85  if(!m_inf->Get(check_CDI)){
86  ATH_MSG_ERROR( "Tagger: "+m_taggerName+" and Jet Collection : "+m_jetAuthor+" not found in this CDI file: "+m_CutFileName);
87  return StatusCode::FAILURE;
88  }
89 
90  //set taggerEnum to avid string comparison:
92 
93  //special requirement for VR TrackJets:
94  if((m_jetAuthor.find("AntiKt2PV0TrackJets") != std::string::npos) ||
95  (m_jetAuthor.find("AntiKt4PV0TrackJets") != std::string::npos) ||
96  (m_jetAuthor.find("AntiKtVR30Rmax4Rmin02TrackJets") != std::string::npos)) {
97  m_StoreNConstituents = true;
98  }
99 
100  // Change the minPt cut if the user didn't touch it
101  if (m_minPt < 0){
102  ATH_MSG_ERROR( "Tagger: "+m_taggerName+" and Jet Collection : "+m_jetAuthor+" do not have a minimum jet pT cut set.");
103  return StatusCode::FAILURE;
104  }
105 
106 
107  // Operating point reading
108  TString cutname = m_OP;
109  m_continuous = false;
110  m_continuous2D = false;
111 
112  if(cutname.Contains("Continuous2D")){
113  ATH_MSG_INFO("Working with Continuous2D WP.");
114  m_continuous = true;
115  m_continuous2D = true;
116  m_useCTag = false; //important for backward compatibility in getTaggerWeight methods.
117  cutname = m_taggerName+"/"+m_jetAuthor+"/Continuous2D/cutvalue";
119  TMatrixD* matrix = dynamic_cast<TMatrixD*> (m_inf->Get(cutname));
121 
122  for (int bin = 0; bin < m_tagger.cuts2D->GetNrows(); bin++)
123  ATH_MSG_DEBUG("INITIALIZATION c-cuts : " <<m_tagger.get2DCutValue(bin,0) <<" "
124  <<m_tagger.get2DCutValue(bin,1) <<" b-cuts : "
125  <<m_tagger.get2DCutValue(bin,2) <<" "
126  <<m_tagger.get2DCutValue(bin,3));
127 
128  if (m_tagger.cuts2D == nullptr){
129  ATH_MSG_ERROR( "Invalid operating point" );
130  return StatusCode::FAILURE;
131  }
132 
133  m_tagger.spline = nullptr;
134 
135  TString fraction_data_name = m_taggerName+"/"+m_jetAuthor+"/Continuous2D/fraction_b";
136  TVector *fraction_data = dynamic_cast<TVector*> (m_inf->Get(fraction_data_name));
137  if(fraction_data!=nullptr){
138  m_tagger.fraction_b = fraction_data[0](0);
139  }
140  else{
141  ATH_MSG_ERROR("Tagger fraction_b in Continuous2D WP not available");
142  return StatusCode::FAILURE;
143  }
144 
145  //now the c-fraction:
146  fraction_data_name = m_taggerName+"/"+m_jetAuthor+"/Continuous2D/fraction_c";
147  fraction_data = dynamic_cast<TVector*> (m_inf->Get(fraction_data_name));
148  if(fraction_data!=nullptr){
149  m_tagger.fraction_c = fraction_data[0](0);}
150  else{
151  ATH_MSG_ERROR("Tagger fraction_c in Continuous2D WP not available");
152  return StatusCode::FAILURE;
153  }
154  //now the tau-fraction if the tagger is GN2*:
155  if ( m_taggerName == "GN2v01" ){
156  fraction_data_name = m_taggerName+"/"+m_jetAuthor+"/Continuous2D/fraction_tau";
157  TString fraction_data_name_cTag = m_taggerName+"/"+m_jetAuthor+"/Continuous2D/fraction_tau_cTag";
158  fraction_data = dynamic_cast<TVector*> (m_inf->Get(fraction_data_name));
159  TVector *fraction_data_cTag = dynamic_cast<TVector*> (m_inf->Get(fraction_data_name_cTag));
160  if(fraction_data!=nullptr){
161  m_tagger.fraction_tau = fraction_data[0](0);
162  }else{
163  ATH_MSG_ERROR("Tagger fraction_tau in Continuous2D WP not available");
164  return StatusCode::FAILURE;
165  }
166  if(fraction_data_cTag!=nullptr){
167  m_tagger.fraction_tau_cTag = fraction_data_cTag[0](0);
168  }else{
169  ATH_MSG_ERROR("Tagger fraction_tau_cTag in Continuous2D WP not available");
170  return StatusCode::FAILURE;
171  }
172  delete fraction_data_cTag;
173  }
174  delete fraction_data;
175  } //Continuous2D
176  else if ("Continuous"==cutname(0,10)){ // For continuous tagging load all flat-cut WPs
177  if(m_useCTag)
178  ATH_MSG_WARNING( "Running in Continuous WP and using 1D c-tagging");
179  m_continuous = true;
180  // For GN2v01, we have different WPs than the default ones.
181  if ( m_taggerName == "GN2v01" )
182  m_wps_raw="FixedCutBEff_90,FixedCutBEff_85,FixedCutBEff_77,FixedCutBEff_70,FixedCutBEff_65";
183  std::vector<std::string> workingpoints = split(m_wps_raw, ',');
184  std::sort(workingpoints.begin(), workingpoints.end());
185  std::reverse(workingpoints.begin(), workingpoints.end()); // put in descending order
186  for(const std::string& wp : workingpoints){
187  cutname = m_taggerName + "/" + m_jetAuthor + "/" + wp + "/cutvalue";
188  m_tagger.constcut = dynamic_cast<TVector*> (m_inf->Get(cutname));
189  if (m_tagger.constcut != nullptr) {
190  m_continuouscuts.push_back(m_tagger.constcut[0](0));
191  } else {
192  ATH_MSG_ERROR( "Continuous tagging is trying to use an invalid operating point: " + wp );
193  return StatusCode::FAILURE;
194  }
195  }
196 
197  //The WP is not important. This is just to retrieve the c-fraction.
198  ANA_CHECK(ExtractTaggerProperties(m_tagger, m_taggerName, workingpoints.at(0)));
199 
200  } else { // FixedCut Working Point: load only one WP
201  if(m_useCTag){
202  ATH_MSG_WARNING( "Running in FixedCut WP and using c-tagging");
203  }
205  }
206 
207  //set the accept working points, jets in these pseudo-continuous bins will be accepted
208  if(m_continuous){
209  std::vector<std::string> tag_benchmarks_names = split(m_ContinuousBenchmarks, ',');
210  std::vector<int> tag_benchmarks;
211  for (const std::string& tagbin : tag_benchmarks_names){
212  tag_benchmarks.push_back(std::atoi(tagbin.c_str()));
213  ATH_MSG_INFO("adding " <<tag_benchmarks.back() <<" as tagged bin ");
214  }
215  m_tagger.benchmarks = tag_benchmarks;
216  }
217 
218  m_inf->Close();
219 
220  m_acceptinfo.addCut( "Eta", "Selection of jets according to their pseudorapidity" );
221  m_acceptinfo.addCut( "Pt", "Selection of jets according to their transverse momentum" );
222  m_acceptinfo.addCut( "WorkingPoint", "Working point for flavour-tagging of jets according to their b-tagging weight" );
223 
228 
229  return StatusCode::SUCCESS;
230 }

◆ InitializeTaggerVariables()

void BTaggingSelectionTool::InitializeTaggerVariables ( std::string  taggerName,
std::string  OP,
TSpline3 *  spline,
TVector *  constcut,
double &  fraction 
)
private

◆ 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() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

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

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

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
366  }

◆ SetTaggerEnum()

Tagger BTaggingSelectionTool::SetTaggerEnum ( const std::string &  taggerName)
inlineprivate

Definition at line 123 of file BTaggingSelectionTool.h.

123  {
124  if(taggerName.find("DL1") != std::string::npos) return Tagger::DL1;
125  else if(taggerName.find("GN1") != std::string::npos) return Tagger::GN1;
126  else if(taggerName.find("GN2") != std::string::npos) return Tagger::GN2;
127  else if(taggerName == "MV2c10") return Tagger::MV2c10;
128  else
129  ATH_MSG_ERROR("Tagger Name NOT supported.");
130  return Tagger::UNKNOWN;
131  };

◆ split()

std::vector< std::string > BTaggingSelectionTool::split ( const std::string &  input,
const char &  delimiter 
)
private

Definition at line 819 of file BTaggingSelectionTool.cxx.

819  {
820  std::vector<std::string> v;
821  std::istringstream buf(input);
822  for(std::string token; std::getline(buf, token, delimiter); )
823  v.push_back(token);
824  return v;
825 }

◆ 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 DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_acceptinfo

asg::AcceptInfo BTaggingSelectionTool::m_acceptinfo
private

Object used to store the last decision.

Definition at line 78 of file BTaggingSelectionTool.h.

◆ m_accessor_pb

SG::AuxElement::ConstAccessor<float> BTaggingSelectionTool::m_accessor_pb
private

Definition at line 94 of file BTaggingSelectionTool.h.

◆ m_accessor_pc

SG::AuxElement::ConstAccessor<float> BTaggingSelectionTool::m_accessor_pc
private

Definition at line 95 of file BTaggingSelectionTool.h.

◆ m_accessor_ptau

SG::AuxElement::ConstAccessor<float> BTaggingSelectionTool::m_accessor_ptau
private

Definition at line 97 of file BTaggingSelectionTool.h.

◆ m_accessor_pu

SG::AuxElement::ConstAccessor<float> BTaggingSelectionTool::m_accessor_pu
private

Definition at line 96 of file BTaggingSelectionTool.h.

◆ m_continuous

bool BTaggingSelectionTool::m_continuous = false
private

Definition at line 73 of file BTaggingSelectionTool.h.

◆ m_continuous2D

bool BTaggingSelectionTool::m_continuous2D = false
private

Definition at line 74 of file BTaggingSelectionTool.h.

◆ m_ContinuousBenchmarks

std::string BTaggingSelectionTool::m_ContinuousBenchmarks
private

Definition at line 88 of file BTaggingSelectionTool.h.

◆ m_continuouscuts

std::vector<double> BTaggingSelectionTool::m_continuouscuts
private

Definition at line 92 of file BTaggingSelectionTool.h.

◆ m_CutFileName

std::string BTaggingSelectionTool::m_CutFileName
private

Definition at line 84 of file BTaggingSelectionTool.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_ErrorOnTagWeightFailure

bool BTaggingSelectionTool::m_ErrorOnTagWeightFailure = true
private

Definition at line 71 of file BTaggingSelectionTool.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_inf

TFile* BTaggingSelectionTool::m_inf {}
private

Definition at line 91 of file BTaggingSelectionTool.h.

◆ m_initialised

bool BTaggingSelectionTool::m_initialised = false
private

Definition at line 70 of file BTaggingSelectionTool.h.

◆ m_jetAuthor

std::string BTaggingSelectionTool::m_jetAuthor
private

Definition at line 87 of file BTaggingSelectionTool.h.

◆ m_maxEta

double BTaggingSelectionTool::m_maxEta {}
private

Definition at line 80 of file BTaggingSelectionTool.h.

◆ m_maxRangePt

double BTaggingSelectionTool::m_maxRangePt {}
private

Definition at line 82 of file BTaggingSelectionTool.h.

◆ m_minPt

double BTaggingSelectionTool::m_minPt {}
private

Definition at line 81 of file BTaggingSelectionTool.h.

◆ m_OP

std::string BTaggingSelectionTool::m_OP
private

Definition at line 86 of file BTaggingSelectionTool.h.

◆ m_readFromBTaggingObject

bool BTaggingSelectionTool::m_readFromBTaggingObject = true
private

Definition at line 76 of file BTaggingSelectionTool.h.

◆ m_StoreNConstituents

bool BTaggingSelectionTool::m_StoreNConstituents = false
private

Definition at line 72 of file BTaggingSelectionTool.h.

◆ m_tagger

taggerproperties BTaggingSelectionTool::m_tagger
private

Definition at line 118 of file BTaggingSelectionTool.h.

◆ m_taggerEnum

Tagger BTaggingSelectionTool::m_taggerEnum {UNKNOWN}
private

Definition at line 121 of file BTaggingSelectionTool.h.

◆ m_taggerName

std::string BTaggingSelectionTool::m_taggerName
private

Definition at line 85 of file BTaggingSelectionTool.h.

◆ m_useCTag

bool BTaggingSelectionTool::m_useCTag = false
private

Definition at line 75 of file BTaggingSelectionTool.h.

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

std::string BTaggingSelectionTool::m_wps_raw
private

Definition at line 89 of file BTaggingSelectionTool.h.


The documentation for this class was generated from the following files:
BTaggingSelectionTool::m_StoreNConstituents
bool m_StoreNConstituents
Definition: BTaggingSelectionTool.h:72
python.StoreID.UNKNOWN
int UNKNOWN
Definition: StoreID.py:16
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
BTaggingSelectionTool::taggerproperties::fraction_b
double fraction_b
Definition: BTaggingSelectionTool.h:101
BTaggingSelectionTool::m_wps_raw
std::string m_wps_raw
Definition: BTaggingSelectionTool.h:89
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
BTaggingSelectionTool::UNKNOWN
@ UNKNOWN
Definition: BTaggingSelectionTool.h:120
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
BTaggingSelectionTool::m_continuous
bool m_continuous
Definition: BTaggingSelectionTool.h:73
BTaggingSelectionTool::m_maxRangePt
double m_maxRangePt
Definition: BTaggingSelectionTool.h:82
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
BTaggingSelectionTool::m_initialised
bool m_initialised
Definition: BTaggingSelectionTool.h:70
keylayer_zslicemap.pb
pb
Definition: keylayer_zslicemap.py:188
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
BTaggingSelectionTool::MV2c10
@ MV2c10
Definition: BTaggingSelectionTool.h:120
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:483
BTaggingSelectionTool::m_continuous2D
bool m_continuous2D
Definition: BTaggingSelectionTool.h:74
BTaggingSelectionTool::m_continuouscuts
std::vector< double > m_continuouscuts
Definition: BTaggingSelectionTool.h:92
BTaggingSelectionTool::accept
virtual asg::AcceptData accept(const xAOD::IParticle *p) const override
Get the decision using a generic IParticle pointer.
Definition: BTaggingSelectionTool.cxx:440
bin
Definition: BinsDiffFromStripMedian.h:43
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
BTaggingSelectionTool::m_taggerEnum
Tagger m_taggerEnum
Definition: BTaggingSelectionTool.h:121
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
BTaggingSelectionTool::m_jetAuthor
std::string m_jetAuthor
Definition: BTaggingSelectionTool.h:87
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
BTaggingSelectionTool::m_ErrorOnTagWeightFailure
bool m_ErrorOnTagWeightFailure
Definition: BTaggingSelectionTool.h:71
BTaggingSelectionTool::m_acceptinfo
asg::AcceptInfo m_acceptinfo
Object used to store the last decision.
Definition: BTaggingSelectionTool.h:78
BTaggingSelectionTool::taggerproperties::benchmarks
std::vector< int > benchmarks
Definition: BTaggingSelectionTool.h:108
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
DeMoUpdate.reverse
reverse
Definition: DeMoUpdate.py:563
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
BTaggingSelectionTool::m_minPt
double m_minPt
Definition: BTaggingSelectionTool.h:81
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
BTaggingSelectionTool::m_accessor_pb
SG::AuxElement::ConstAccessor< float > m_accessor_pb
Definition: BTaggingSelectionTool.h:94
BTaggingSelectionTool::m_accessor_ptau
SG::AuxElement::ConstAccessor< float > m_accessor_ptau
Definition: BTaggingSelectionTool.h:97
BTaggingSelectionTool::m_maxEta
double m_maxEta
Definition: BTaggingSelectionTool.h:80
BTaggingSelectionTool::m_useCTag
bool m_useCTag
Definition: BTaggingSelectionTool.h:75
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
BTaggingSelectionTool::split
std::vector< std::string > split(const std::string &input, const char &delimiter)
Definition: BTaggingSelectionTool.cxx:819
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
BTaggingSelectionTool::taggerproperties::name
std::string name
Definition: BTaggingSelectionTool.h:100
BTaggingSelectionTool::m_accessor_pu
SG::AuxElement::ConstAccessor< float > m_accessor_pu
Definition: BTaggingSelectionTool.h:96
python.AthDsoLogger.delimiter
delimiter
Definition: AthDsoLogger.py:71
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
BTaggingSelectionTool::getTaggerWeight
virtual CP::CorrectionCode getTaggerWeight(const xAOD::Jet &jet, double &tagweight) const override
Definition: BTaggingSelectionTool.cxx:306
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
BTaggingSelectionTool::taggerproperties::fraction_tau_cTag
double fraction_tau_cTag
Definition: BTaggingSelectionTool.h:104
BTaggingSelectionTool::m_readFromBTaggingObject
bool m_readFromBTaggingObject
Definition: BTaggingSelectionTool.h:76
lumiFormat.i
int i
Definition: lumiFormat.py:85
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:27
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
BTaggingSelectionTool::m_tagger
taggerproperties m_tagger
Definition: BTaggingSelectionTool.h:118
BTaggingSelectionTool::taggerproperties::get2DCutValue
double get2DCutValue(int row, int column) const
Definition: BTaggingSelectionTool.h:110
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
BTaggingSelectionTool::m_taggerName
std::string m_taggerName
Definition: BTaggingSelectionTool.h:85
ftag::defaults::tagger
const std::string tagger
Definition: ToolDefaults.h:11
python.xAODType.dummy
dummy
Definition: xAODType.py:4
BTaggingSelectionTool::m_ContinuousBenchmarks
std::string m_ContinuousBenchmarks
Definition: BTaggingSelectionTool.h:88
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
ftag::defaults::jet_collection
const std::string jet_collection
Definition: ToolDefaults.h:12
PlotSFuncertainty.wp
wp
Definition: PlotSFuncertainty.py:112
xAOD::BTagging_v1
Definition: BTagging_v1.h:39
BTaggingSelectionTool::m_accessor_pc
SG::AuxElement::ConstAccessor< float > m_accessor_pc
Definition: BTaggingSelectionTool.h:95
BTaggingSelectionTool::m_CutFileName
std::string m_CutFileName
Definition: BTaggingSelectionTool.h:84
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
BTaggingSelectionTool::ExtractTaggerProperties
StatusCode ExtractTaggerProperties(taggerproperties &tagger, const std::string &taggerName, const std::string &OP)
Definition: BTaggingSelectionTool.cxx:232
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Base_Fragment.defaults
dictionary defaults
This includes now the top quark, the leptons and the bosons.
Definition: GeneratorFilters/share/common/Base_Fragment.py:79
BTaggingSelectionTool::GN2
@ GN2
Definition: BTaggingSelectionTool.h:120
BTaggingSelectionTool::taggerproperties::fraction_c
double fraction_c
Definition: BTaggingSelectionTool.h:102
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
xAOD::BTaggingUtilities::getBTagging
const BTagging * getBTagging(const SG::AuxElement &part)
Access the default xAOD::BTagging object associated to an object.
Definition: BTaggingUtilities.cxx:37
BTaggingSelectionTool::GN1
@ GN1
Definition: BTaggingSelectionTool.h:120
CheckAppliedSFs.pu
pu
Definition: CheckAppliedSFs.py:311
python.PyAthena.v
v
Definition: PyAthena.py:154
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
BTaggingSelectionTool::SetTaggerEnum
Tagger SetTaggerEnum(const std::string &taggerName)
Definition: BTaggingSelectionTool.h:123
ftag::defaults::cdi_path
const std::string cdi_path
Definition: ToolDefaults.h:13
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:66
a
TList * a
Definition: liststreamerinfos.cxx:10
asg::AcceptData::setCutResult
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer)
Definition: AcceptData.h:134
h
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
BTaggingSelectionTool::getQuantile
virtual int getQuantile(const xAOD::IParticle *) const override
Decide in which quantile of the tag weight distribution the jet belongs (continuous tagging) The retu...
Definition: BTaggingSelectionTool.cxx:636
BTaggingSelectionTool::taggerproperties::spline
TSpline3 * spline
Definition: BTaggingSelectionTool.h:105
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
BTaggingSelectionTool::taggerproperties::cuts2D
TMatrixD * cuts2D
Definition: BTaggingSelectionTool.h:107
BTaggingSelectionTool::taggerproperties::constcut
TVector * constcut
Definition: BTaggingSelectionTool.h:106
BTaggingSelectionTool::m_inf
TFile * m_inf
Definition: BTaggingSelectionTool.h:91
BTaggingSelectionTool::getCutValue
virtual CP::CorrectionCode getCutValue(double, double &cutval) const override
Definition: BTaggingSelectionTool.cxx:788
asg::AcceptData
Definition: AcceptData.h:30
BTaggingSelectionTool::checkRange
virtual bool checkRange(double, double, asg::AcceptData &) const
Helper function that decides whether a jet belongs to the correct jet selection for b-tagging.
Definition: BTaggingSelectionTool.cxx:770
SG::DataProxy
Definition: DataProxy.h:45
BTaggingSelectionTool::m_OP
std::string m_OP
Definition: BTaggingSelectionTool.h:86
BTaggingSelectionTool::DL1
@ DL1
Definition: BTaggingSelectionTool.h:120
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition: Event/xAOD/xAODJet/xAODJet/Jet.h:17
python.SystemOfUnits.pc
float pc
Definition: SystemOfUnits.py:99
BTaggingSelectionTool::taggerproperties::fraction_tau
double fraction_tau
Definition: BTaggingSelectionTool.h:103
fitman.k
k
Definition: fitman.py:528
asg::AcceptInfo::addCut
int addCut(const std::string &cutName, const std::string &cutDescription)
Add a cut; returning the cut position.
Definition: AcceptInfo.h:53
xAOD::BTagging_v1::MVx_discriminant
bool MVx_discriminant(const std::string &taggername, double &value) const
Definition: BTagging_v1.cxx:381