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, V, H > &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, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &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_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 119 of file BTaggingSelectionTool.h.

119 {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 retrieved. 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=false, "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 433 of file BTaggingSelectionTool.cxx.

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

◆ accept() [2/6]

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

Implements IBTaggingSelectionTool.

Definition at line 452 of file BTaggingSelectionTool.cxx.

452  {
453  asg::AcceptData acceptData (&m_acceptinfo);
454 
455  if (! m_initialised) {
456  ATH_MSG_ERROR("BTaggingSelectionTool has not been initialised");
457  return acceptData;
458  }
459 
460  double pT = jet.pt();
461  double eta = jet.eta();
462 
463  if(m_continuous2D){
464  double taggerweight_b(-100);
465  double taggerweight_c(-100);
466  if( (getTaggerWeight( jet, taggerweight_b, false)!=CorrectionCode::Ok) ||
467  (getTaggerWeight( jet, taggerweight_c, true )!=CorrectionCode::Ok) )
468  return acceptData;
469 
470  return accept(pT, eta, taggerweight_b,taggerweight_c);
471  }
472  else{ //if here, we are in 1D mode
473  double taggerweight(-100);
474  if( getTaggerWeight( jet ,taggerweight, m_useCTag)!=CorrectionCode::Ok)
475  return acceptData;
476 
477  return accept(pT, eta, taggerweight);
478  }
479 }

◆ 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 481 of file BTaggingSelectionTool.cxx.

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

◆ accept() [4/6]

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

Implements IBTaggingSelectionTool.

Definition at line 533 of file BTaggingSelectionTool.cxx.

534 {
535  asg::AcceptData acceptData (&m_acceptinfo);
536 
537  if (! m_initialised) {
538  ATH_MSG_ERROR("BTaggingSelectionTool has not been initialised");
539  return acceptData;
540  }
541 
542  eta = std::abs(eta);
543 
544  if (! checkRange(pT, eta, acceptData))
545  return acceptData;
546 
547  for(auto bin : m_tagger.benchmarks){
548 
549  ATH_MSG_DEBUG("bin" <<bin <<" taggerWeight_c "
550  <<taggerWeight_c <<" taggerWeight_b "
551  <<taggerWeight_b);
552 
553  ATH_MSG_DEBUG(" c-cuts : " <<m_tagger.get2DCutValue(bin,0) <<" "
554  <<m_tagger.get2DCutValue(bin,1) <<" b-cuts : "
555  <<m_tagger.get2DCutValue(bin,2) <<" "
556  <<m_tagger.get2DCutValue(bin,3));
557 
558  if (taggerWeight_c > m_tagger.get2DCutValue(bin,0) && //ctag low
559  taggerWeight_c <= m_tagger.get2DCutValue(bin,1) && //ctag max
560  taggerWeight_b > m_tagger.get2DCutValue(bin,2) && //btag low
561  taggerWeight_b <= m_tagger.get2DCutValue(bin,3) ) //btag max
562  {
563  acceptData.setCutResult( "WorkingPoint", true ); // IF we arrived here, the jet is tagged
564  break;
565  }
566  } //for loop
567 
568  // Return the result:
569  return acceptData;
570 }

◆ accept() [5/6]

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

Implements IBTaggingSelectionTool.

Definition at line 572 of file BTaggingSelectionTool.cxx.

573 {
574  if (m_tagger.name == "GN2v01"){
575  asg::AcceptData acceptData (&m_acceptinfo);
576  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)");
577  return acceptData;
578  } else {
579  return accept(pT, eta, pb, pc, pu, 0.);
580  }
581 }

◆ 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 583 of file BTaggingSelectionTool.cxx.

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

◆ 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 758 of file BTaggingSelectionTool.cxx.

759 {
760  // Do the |eta| cut:
761  if( std::abs(eta) > m_maxEta ) {
762  return false;
763  }
764  acceptData.setCutResult( "Eta", true );
765 
766  // Do the pT cut:
767  ATH_MSG_VERBOSE( "Jet pT: " << pT );
768  if( pT < m_minPt ) {
769  return false;
770  }
771  acceptData.setCutResult( "Pt", true );
772 
773  return true;
774 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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 225 of file BTaggingSelectionTool.cxx.

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

◆ 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 776 of file BTaggingSelectionTool.cxx.

777 {
778  cutval = DBL_MAX;
779 
780  // flat cut for out of range pTs
781  if (pT>m_maxRangePt)
782  pT = m_maxRangePt;
783 
784  taggerproperties tagger ATLAS_THREAD_SAFE = m_tagger;
785 
786  if (tagger.spline != nullptr && tagger.constcut == nullptr) {
787  pT = pT/1000.0;
788  double maxsplinept = tagger.spline->GetXmax();
789  if (pT>maxsplinept){ pT = maxsplinept; }
790  cutval = tagger.spline->Eval(pT);
791  }
792 
793  else if (tagger.constcut != nullptr && tagger.spline == nullptr) {
794  cutval = tagger.constcut[0](0);
795  }
796  else{
797  ATH_MSG_ERROR( "Bad cut configuration!" );
798  return CorrectionCode::Error;
799  }
800 
801 
802  ATH_MSG_VERBOSE( "Cut value " << cutval );
803 
804  return CorrectionCode::Ok;
805 }

◆ 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 624 of file BTaggingSelectionTool.cxx.

624  {
625  // Check if this is a jet:
626 
627 
628  if( p->type() != xAOD::Type::Jet ) {
629  ATH_MSG_ERROR( "accept(...) Function received a non-jet" );
630  return -1;
631  }
632 
633  // Cast it to a jet:
634  const xAOD::Jet* jet = dynamic_cast< const xAOD::Jet* >( p );
635  if( ! jet ) {
636  ATH_MSG_FATAL( "accept(...) Failed to cast particle to jet" );
637  return -1;
638  }
639 
640  // Let the specific function do the work:
641  return getQuantile( *jet );
642 }

◆ getQuantile() [2/4]

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

Implements IBTaggingSelectionTool.

Definition at line 644 of file BTaggingSelectionTool.cxx.

644  {
645  double pT = jet.pt();
646  double eta = std::abs( jet.eta() );
647  int quantile = -1;
648 
649  if (m_continuous2D){
650  double tag_weight_b(-100.);
651  double tag_weight_c(-100.);
652  if ( (getTaggerWeight(jet, tag_weight_b, false) == CP::CorrectionCode::Error) ||
653  (getTaggerWeight(jet, tag_weight_c, true ) == CP::CorrectionCode::Error) ){
654  ATH_MSG_WARNING("getQuantile: Failed to retrieve tag weight for Continuous2D!");
655  return -1;
656  }
657  quantile = getQuantile(pT, eta, tag_weight_b, tag_weight_c );
658  }
659  else{
660  // Retrieve the tagger weight which was assigned to the jet
661  double tag_weight(-100.);
663  ATH_MSG_WARNING("getQuantile: Failed to retrieve "+m_taggerName+" weight!");
664  return -1;
665  }
666  ATH_MSG_VERBOSE( m_taggerName << " " << tag_weight);
667  quantile = getQuantile(pT, eta, tag_weight);
668  }
669  return quantile;
670 }

◆ getQuantile() [3/4]

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

Implements IBTaggingSelectionTool.

Definition at line 673 of file BTaggingSelectionTool.cxx.

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

◆ 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 714 of file BTaggingSelectionTool.cxx.

715 {
725 
726  //More details here: https://indico.cern.ch/event/1116952/#4-mr49953-implements-the-conti
727 
728  ATH_MSG_DEBUG("inside getQuantile 2D " <<pT <<" " <<eta <<" " <<tag_weight_b <<" " <<tag_weight_c);
729  int bin_index(-1);
730 
731  asg::AcceptData acceptData (&m_acceptinfo);
732  if (! checkRange(pT, eta, acceptData)) return bin_index;
733 
734  int ncuts = m_tagger.cuts2D->GetNrows();
735  ATH_MSG_VERBOSE("ncuts: " <<ncuts);
736 
737  //loop over all the cuts
738  for(int i = 0; i < ncuts ; i++){
739  double c_cut_low = m_tagger.get2DCutValue(i,0);
740  double c_cut_hig = m_tagger.get2DCutValue(i,1);
741  double b_cut_low = m_tagger.get2DCutValue(i,2);
742  double b_cut_hig = m_tagger.get2DCutValue(i,3);
743 
744  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);
745  if (tag_weight_c > c_cut_low &&
746  tag_weight_c <= c_cut_hig &&
747  tag_weight_b > b_cut_low &&
748  tag_weight_b <= b_cut_hig){
749  bin_index = i;
750  break;
751  }
752  }
753 
754  ATH_MSG_VERBOSE("bin_index " <<bin_index);
755  return bin_index;
756 }

◆ getTaggerWeight() [1/5]

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

Implements IBTaggingSelectionTool.

Definition at line 299 of file BTaggingSelectionTool.cxx.

299  {
300  return getTaggerWeight(jet, tagweight, m_useCTag);
301 }

◆ getTaggerWeight() [2/5]

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

Implements IBTaggingSelectionTool.

Definition at line 303 of file BTaggingSelectionTool.cxx.

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

◆ getTaggerWeight() [3/5]

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

Implements IBTaggingSelectionTool.

Definition at line 372 of file BTaggingSelectionTool.cxx.

372  {
373  if (m_tagger.name == "GN2v01"){
374  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)");
375  return CorrectionCode::Error;
376  } else {
377  return getTaggerWeight(pb, pc, pu, tagweight, m_useCTag, 0.);
378  }
379 }

◆ getTaggerWeight() [4/5]

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

Implements IBTaggingSelectionTool.

Definition at line 381 of file BTaggingSelectionTool.cxx.

381  {
382  return getTaggerWeight(pb, pc, pu, tagweight, m_useCTag, ptau);
383 }

◆ 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 385 of file BTaggingSelectionTool.cxx.

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

◆ 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  // Change the minPt cut if the user didn't touch it
94  if (m_minPt < 0){
95  ATH_MSG_ERROR( "Tagger: "+m_taggerName+" and Jet Collection : "+m_jetAuthor+" do not have a minimum jet pT cut set.");
96  return StatusCode::FAILURE;
97  }
98 
99 
100  // Operating point reading
101  TString cutname = m_OP;
102  m_continuous = false;
103  m_continuous2D = false;
104 
105  if(cutname.Contains("Continuous2D")){
106  ATH_MSG_INFO("Working with Continuous2D WP.");
107  m_continuous = true;
108  m_continuous2D = true;
109  m_useCTag = false; //important for backward compatibility in getTaggerWeight methods.
110  cutname = m_taggerName+"/"+m_jetAuthor+"/Continuous2D/cutvalue";
112  TMatrixD* matrix = dynamic_cast<TMatrixD*> (m_inf->Get(cutname));
114 
115  for (int bin = 0; bin < m_tagger.cuts2D->GetNrows(); bin++)
116  ATH_MSG_DEBUG("INITIALIZATION c-cuts : " <<m_tagger.get2DCutValue(bin,0) <<" "
117  <<m_tagger.get2DCutValue(bin,1) <<" b-cuts : "
118  <<m_tagger.get2DCutValue(bin,2) <<" "
119  <<m_tagger.get2DCutValue(bin,3));
120 
121  if (m_tagger.cuts2D == nullptr){
122  ATH_MSG_ERROR( "Invalid operating point" );
123  return StatusCode::FAILURE;
124  }
125 
126  m_tagger.spline = nullptr;
127 
128  TString fraction_data_name = m_taggerName+"/"+m_jetAuthor+"/Continuous2D/fraction_b";
129  TVector *fraction_data = dynamic_cast<TVector*> (m_inf->Get(fraction_data_name));
130  if(fraction_data!=nullptr){
131  m_tagger.fraction_b = fraction_data[0](0);
132  }
133  else{
134  ATH_MSG_ERROR("Tagger fraction_b in Continuous2D WP not available");
135  return StatusCode::FAILURE;
136  }
137 
138  //now the c-fraction:
139  fraction_data_name = m_taggerName+"/"+m_jetAuthor+"/Continuous2D/fraction_c";
140  fraction_data = dynamic_cast<TVector*> (m_inf->Get(fraction_data_name));
141  if(fraction_data!=nullptr){
142  m_tagger.fraction_c = fraction_data[0](0);}
143  else{
144  ATH_MSG_ERROR("Tagger fraction_c in Continuous2D WP not available");
145  return StatusCode::FAILURE;
146  }
147  //now the tau-fraction if the tagger is GN2*:
148  if ( m_taggerName == "GN2v01" ){
149  fraction_data_name = m_taggerName+"/"+m_jetAuthor+"/Continuous2D/fraction_tau";
150  TString fraction_data_name_cTag = m_taggerName+"/"+m_jetAuthor+"/Continuous2D/fraction_tau_cTag";
151  fraction_data = dynamic_cast<TVector*> (m_inf->Get(fraction_data_name));
152  TVector *fraction_data_cTag = dynamic_cast<TVector*> (m_inf->Get(fraction_data_name_cTag));
153  if(fraction_data!=nullptr){
154  m_tagger.fraction_tau = fraction_data[0](0);
155  }else{
156  ATH_MSG_ERROR("Tagger fraction_tau in Continuous2D WP not available");
157  return StatusCode::FAILURE;
158  }
159  if(fraction_data_cTag!=nullptr){
160  m_tagger.fraction_tau_cTag = fraction_data_cTag[0](0);
161  }else{
162  ATH_MSG_ERROR("Tagger fraction_tau_cTag in Continuous2D WP not available");
163  return StatusCode::FAILURE;
164  }
165  delete fraction_data_cTag;
166  }
167  delete fraction_data;
168  } //Continuous2D
169  else if ("Continuous"==cutname(0,10)){ // For continuous tagging load all flat-cut WPs
170  if(m_useCTag)
171  ATH_MSG_WARNING( "Running in Continuous WP and using 1D c-tagging");
172  m_continuous = true;
173  // For GN2v01, we have different WPs than the default ones.
174  if ( m_taggerName == "GN2v01" )
175  m_wps_raw="FixedCutBEff_90,FixedCutBEff_85,FixedCutBEff_77,FixedCutBEff_70,FixedCutBEff_65";
176  std::vector<std::string> workingpoints = split(m_wps_raw, ',');
177  std::sort(workingpoints.begin(), workingpoints.end());
178  std::reverse(workingpoints.begin(), workingpoints.end()); // put in descending order
179  for(const std::string& wp : workingpoints){
180  cutname = m_taggerName + "/" + m_jetAuthor + "/" + wp + "/cutvalue";
181  m_tagger.constcut = dynamic_cast<TVector*> (m_inf->Get(cutname));
182  if (m_tagger.constcut != nullptr) {
183  m_continuouscuts.push_back(m_tagger.constcut[0](0));
184  } else {
185  ATH_MSG_ERROR( "Continuous tagging is trying to use an invalid operating point: " + wp );
186  return StatusCode::FAILURE;
187  }
188  }
189 
190  //The WP is not important. This is just to retrieve the c-fraction.
191  ANA_CHECK(ExtractTaggerProperties(m_tagger, m_taggerName, workingpoints.at(0)));
192 
193  } else { // FixedCut Working Point: load only one WP
194  if(m_useCTag){
195  ATH_MSG_WARNING( "Running in FixedCut WP and using c-tagging");
196  }
198  }
199 
200  //set the accept working points, jets in these pseudo-continuous bins will be accepted
201  if(m_continuous){
202  std::vector<std::string> tag_benchmarks_names = split(m_ContinuousBenchmarks, ',');
203  std::vector<int> tag_benchmarks;
204  for (const std::string& tagbin : tag_benchmarks_names){
205  tag_benchmarks.push_back(std::atoi(tagbin.c_str()));
206  ATH_MSG_INFO("adding " <<tag_benchmarks.back() <<" as tagged bin ");
207  }
208  m_tagger.benchmarks = tag_benchmarks;
209  }
210 
211  m_inf->Close();
212 
213  m_acceptinfo.addCut( "Eta", "Selection of jets according to their pseudorapidity" );
214  m_acceptinfo.addCut( "Pt", "Selection of jets according to their transverse momentum" );
215  m_acceptinfo.addCut( "WorkingPoint", "Working point for flavour-tagging of jets according to their b-tagging weight" );
216 
221 
222  return StatusCode::SUCCESS;
223 }

◆ 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 122 of file BTaggingSelectionTool.h.

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

◆ split()

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

Definition at line 807 of file BTaggingSelectionTool.cxx.

807  {
808  std::vector<std::string> v;
809  std::istringstream buf(input);
810  for(std::string token; std::getline(buf, token, delimiter); )
811  v.push_back(token);
812  return v;
813 }

◆ 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 77 of file BTaggingSelectionTool.h.

◆ m_accessor_pb

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

Definition at line 93 of file BTaggingSelectionTool.h.

◆ m_accessor_pc

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

Definition at line 94 of file BTaggingSelectionTool.h.

◆ m_accessor_ptau

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

Definition at line 96 of file BTaggingSelectionTool.h.

◆ m_accessor_pu

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

Definition at line 95 of file BTaggingSelectionTool.h.

◆ m_continuous

bool BTaggingSelectionTool::m_continuous = false
private

Definition at line 72 of file BTaggingSelectionTool.h.

◆ m_continuous2D

bool BTaggingSelectionTool::m_continuous2D = false
private

Definition at line 73 of file BTaggingSelectionTool.h.

◆ m_ContinuousBenchmarks

std::string BTaggingSelectionTool::m_ContinuousBenchmarks
private

Definition at line 87 of file BTaggingSelectionTool.h.

◆ m_continuouscuts

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

Definition at line 91 of file BTaggingSelectionTool.h.

◆ m_CutFileName

std::string BTaggingSelectionTool::m_CutFileName
private

Definition at line 83 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 90 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 86 of file BTaggingSelectionTool.h.

◆ m_maxEta

double BTaggingSelectionTool::m_maxEta {}
private

Definition at line 79 of file BTaggingSelectionTool.h.

◆ m_maxRangePt

double BTaggingSelectionTool::m_maxRangePt {}
private

Definition at line 81 of file BTaggingSelectionTool.h.

◆ m_minPt

double BTaggingSelectionTool::m_minPt {}
private

Definition at line 80 of file BTaggingSelectionTool.h.

◆ m_OP

std::string BTaggingSelectionTool::m_OP
private

Definition at line 85 of file BTaggingSelectionTool.h.

◆ m_readFromBTaggingObject

bool BTaggingSelectionTool::m_readFromBTaggingObject = true
private

Definition at line 75 of file BTaggingSelectionTool.h.

◆ m_tagger

taggerproperties BTaggingSelectionTool::m_tagger
private

Definition at line 117 of file BTaggingSelectionTool.h.

◆ m_taggerEnum

Tagger BTaggingSelectionTool::m_taggerEnum {UNKNOWN}
private

Definition at line 120 of file BTaggingSelectionTool.h.

◆ m_taggerName

std::string BTaggingSelectionTool::m_taggerName
private

Definition at line 84 of file BTaggingSelectionTool.h.

◆ m_useCTag

bool BTaggingSelectionTool::m_useCTag = false
private

Definition at line 74 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 88 of file BTaggingSelectionTool.h.


The documentation for this class was generated from the following files:
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:100
BTaggingSelectionTool::m_wps_raw
std::string m_wps_raw
Definition: BTaggingSelectionTool.h:88
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
BTaggingSelectionTool::UNKNOWN
@ UNKNOWN
Definition: BTaggingSelectionTool.h:119
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
BTaggingSelectionTool::m_continuous
bool m_continuous
Definition: BTaggingSelectionTool.h:72
BTaggingSelectionTool::m_maxRangePt
double m_maxRangePt
Definition: BTaggingSelectionTool.h:81
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:407
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:119
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
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:73
BTaggingSelectionTool::m_continuouscuts
std::vector< double > m_continuouscuts
Definition: BTaggingSelectionTool.h:91
BTaggingSelectionTool::accept
virtual asg::AcceptData accept(const xAOD::IParticle *p) const override
Get the decision using a generic IParticle pointer.
Definition: BTaggingSelectionTool.cxx:433
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:120
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:86
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:77
BTaggingSelectionTool::taggerproperties::benchmarks
std::vector< int > benchmarks
Definition: BTaggingSelectionTool.h:107
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:80
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
BTaggingSelectionTool::m_accessor_pb
SG::AuxElement::ConstAccessor< float > m_accessor_pb
Definition: BTaggingSelectionTool.h:93
BTaggingSelectionTool::m_accessor_ptau
SG::AuxElement::ConstAccessor< float > m_accessor_ptau
Definition: BTaggingSelectionTool.h:96
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
BTaggingSelectionTool::m_maxEta
double m_maxEta
Definition: BTaggingSelectionTool.h:79
BTaggingSelectionTool::m_useCTag
bool m_useCTag
Definition: BTaggingSelectionTool.h:74
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:807
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
BTaggingSelectionTool::taggerproperties::name
std::string name
Definition: BTaggingSelectionTool.h:99
BTaggingSelectionTool::m_accessor_pu
SG::AuxElement::ConstAccessor< float > m_accessor_pu
Definition: BTaggingSelectionTool.h:95
python.AthDsoLogger.delimiter
delimiter
Definition: AthDsoLogger.py:70
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
BTaggingSelectionTool::getTaggerWeight
virtual CP::CorrectionCode getTaggerWeight(const xAOD::Jet &jet, double &tagweight) const override
Definition: BTaggingSelectionTool.cxx:299
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:103
BTaggingSelectionTool::m_readFromBTaggingObject
bool m_readFromBTaggingObject
Definition: BTaggingSelectionTool.h:75
lumiFormat.i
int i
Definition: lumiFormat.py:85
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:26
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
BTaggingSelectionTool::m_tagger
taggerproperties m_tagger
Definition: BTaggingSelectionTool.h:117
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
BTaggingSelectionTool::taggerproperties::get2DCutValue
double get2DCutValue(int row, int column) const
Definition: BTaggingSelectionTool.h:109
CalibDbCompareRT.dummy
dummy
Definition: CalibDbCompareRT.py:59
BTaggingSelectionTool::m_taggerName
std::string m_taggerName
Definition: BTaggingSelectionTool.h:84
ftag::defaults::tagger
const std::string tagger
Definition: ToolDefaults.h:11
BTaggingSelectionTool::m_ContinuousBenchmarks
std::string m_ContinuousBenchmarks
Definition: BTaggingSelectionTool.h:87
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:94
BTaggingSelectionTool::m_CutFileName
std::string m_CutFileName
Definition: BTaggingSelectionTool.h:83
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:225
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
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:119
BTaggingSelectionTool::taggerproperties::fraction_c
double fraction_c
Definition: BTaggingSelectionTool.h:101
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:321
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:119
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:122
ftag::defaults::cdi_path
const std::string cdi_path
Definition: ToolDefaults.h:14
python.testIfMatch.matrix
matrix
Definition: testIfMatch.py:63
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
trigbs_mixBSevents.input
input
Definition: trigbs_mixBSevents.py:56
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:624
BTaggingSelectionTool::taggerproperties::spline
TSpline3 * spline
Definition: BTaggingSelectionTool.h:104
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:629
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:801
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
BTaggingSelectionTool::taggerproperties::cuts2D
TMatrixD * cuts2D
Definition: BTaggingSelectionTool.h:106
BTaggingSelectionTool::taggerproperties::constcut
TVector * constcut
Definition: BTaggingSelectionTool.h:105
BTaggingSelectionTool::m_inf
TFile * m_inf
Definition: BTaggingSelectionTool.h:90
BTaggingSelectionTool::getCutValue
virtual CP::CorrectionCode getCutValue(double, double &cutval) const override
Definition: BTaggingSelectionTool.cxx:776
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:758
SG::DataProxy
Definition: DataProxy.h:45
BTaggingSelectionTool::m_OP
std::string m_OP
Definition: BTaggingSelectionTool.h:85
BTaggingSelectionTool::DL1
@ DL1
Definition: BTaggingSelectionTool.h:119
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:114
BTaggingSelectionTool::taggerproperties::fraction_tau
double fraction_tau
Definition: BTaggingSelectionTool.h:102
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