ATLAS Offline Software
PMGHFProductionFractionTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PMGTOOLS_PMGHFPRODUCTIONFRACTIONTOOL_H
6 #define PMGTOOLS_PMGHFPRODUCTIONFRACTIONTOOL_H
7 
8 // EDM include(s):
11 
12 // Interface include(s):
14 
15 #include <map>
16 
17 namespace PMGTools
18 {
26 {
29 
30 public:
32  PMGHFProductionFractionTool(const std::string &name);
33 
36 
38  virtual StatusCode initialize() override;
39 
41 
44 
46  virtual float getSysWeight(const xAOD::TruthParticleContainer *truthParticles, const CP::SystematicSet &sys) const override;
47 
49  virtual CP::SystematicSet affectingSystematics() const override;
50 
52  virtual CP::SystematicSet recommendedSystematics() const override { return affectingSystematics(); };
53 
55 
56 private:
58  struct ParameterSet {
59  std::map<unsigned int, float> charmWeights;
60  std::map<unsigned int, float> bottomWeights;
61  };
62 
65 
67  StatusCode readProductionFractionsFile(const std::string&, std::map<CP::SystematicVariation, std::map<unsigned int, float>> &);
68 
70  bool fromBdecay(const xAOD::TruthParticle *particle) const;
71 
74 
76  void printCurrentProdFractions() const;
77 
78  float getWeight(const xAOD::TruthParticleContainer *truthParticles, const ParameterSet &prod_fracs) const;
79 
81  std::string m_calibrationAreaPath;
82 
84  std::map<std::string, std::string> m_showerGeneratorMap;
85 
88 
90  std::string m_showerGenerator;
91 
93  std::string m_charmFilename;
94 
96  std::string m_bottomFilename;
97 
100 
103 
105  std::map<CP::SystematicVariation, std::map<unsigned int, float>> m_charmProdFractionWeights;
106 
108  std::map<CP::SystematicVariation, std::map<unsigned int, float>> m_bottomProdFractionWeights;
109 
111  StatusCode setSystematicVariation(const CP::SystematicSet& systConfig, ParameterSet& param) const;
112 
115 };
116 } // namespace PMGTools
117 
118 #endif // PMGTOOLS_PMGHFProductionFractionTool_H
ISysTruthWeightTool.h
PMGTools::PMGHFProductionFractionTool::ParameterSet
Struct for the production fractions.
Definition: PMGHFProductionFractionTool.h:58
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:79
PMGTools::PMGHFProductionFractionTool::m_showerGenerator
std::string m_showerGenerator
MC Shower generator software (valid options: Pythia8)
Definition: PMGHFProductionFractionTool.h:90
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition: AsgToolMacros.h:77
PMGTools::PMGHFProductionFractionTool::ParameterSet::charmWeights
std::map< unsigned int, float > charmWeights
Definition: PMGHFProductionFractionTool.h:59
PMGTools::PMGHFProductionFractionTool::m_Parameters
CP::SystematicsCache< ParameterSet > m_Parameters
The SystematicsCache object.
Definition: PMGHFProductionFractionTool.h:114
PMGTools::ISysTruthWeightTool
Interface for xAOD Truth Weight Tool which returns an event weight based on truth particle container.
Definition: ISysTruthWeightTool.h:24
PMGTools::PMGHFProductionFractionTool::m_bottomProdFractionWeights
std::map< CP::SystematicVariation, std::map< unsigned int, float > > m_bottomProdFractionWeights
Bottom production fraction weights.
Definition: PMGHFProductionFractionTool.h:108
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
ParticleTest.tp
tp
Definition: ParticleTest.py:25
PMGTools::PMGHFProductionFractionTool::getSysWeight
virtual float getSysWeight(const xAOD::TruthParticleContainer *truthParticles, const CP::SystematicSet &sys) const override
Implements interface from ISysTruthWeightTool.
Definition: PMGHFProductionFractionTool.cxx:379
CP::SystematicVariation
Definition: SystematicVariation.h:47
PMGTools::PMGHFProductionFractionTool::PMGHFProductionFractionTool
PMGHFProductionFractionTool(const std::string &name)
Create a proper constructor for Athena.
Definition: PMGHFProductionFractionTool.cxx:25
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
PMGTools::PMGHFProductionFractionTool::m_showerGeneratorMapFile
std::string m_showerGeneratorMapFile
MC Shower generator map file name.
Definition: PMGHFProductionFractionTool.h:87
PMGTools::PMGHFProductionFractionTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
Definition: PMGHFProductionFractionTool.cxx:57
PMGTools::PMGHFProductionFractionTool::m_showerGeneratorMap
std::map< std::string, std::string > m_showerGeneratorMap
MC Shower generator map.
Definition: PMGHFProductionFractionTool.h:84
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PMGTools::PMGHFProductionFractionTool::m_calibrationAreaPath
std::string m_calibrationAreaPath
Path to calibration area.
Definition: PMGHFProductionFractionTool.h:81
PMGTools::PMGHFProductionFractionTool::readProductionFractionsFile
StatusCode readProductionFractionsFile(const std::string &, std::map< CP::SystematicVariation, std::map< unsigned int, float >> &)
Read production fractions from input file.
Definition: PMGHFProductionFractionTool.cxx:98
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
PMGTools
Tool providing sample cross-sections and k-factors etc.
Definition: AnalysisCommon/PMGTools/PMGTools/IPMGSherpaVjetsSysTool.h:16
PMGTools::PMGHFProductionFractionTool::affectingSystematics
virtual CP::SystematicSet affectingSystematics() const override
Which systematics have an effect on the tool's behaviour?
Definition: PMGHFProductionFractionTool.cxx:448
PMGTools::PMGHFProductionFractionTool::setSystematicVariation
StatusCode setSystematicVariation(const CP::SystematicSet &systConfig, ParameterSet &param) const
calculate the parameter set for the given systematic
Definition: PMGHFProductionFractionTool.cxx:409
PMGTools::PMGHFProductionFractionTool::fromBdecay
bool fromBdecay(const xAOD::TruthParticle *particle) const
Checks if a particle originates from a bottom decay.
Definition: PMGHFProductionFractionTool.cxx:283
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
PMGTools::PMGHFProductionFractionTool::m_fiducialPtCut
float m_fiducialPtCut
The fiducial charm/bottom pT cut (in GeV)
Definition: PMGHFProductionFractionTool.h:99
PMGTools::PMGHFProductionFractionTool::getInitialParticle
const xAOD::TruthParticle * getInitialParticle(const xAOD::TruthParticle *tp) const
Loops back the decay chain through particles with the same pdgId (e.g. photon emission)
Definition: PMGHFProductionFractionTool.cxx:296
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
PMGTools::PMGHFProductionFractionTool::m_fiducialEtaCut
float m_fiducialEtaCut
The fiducial charm/bottom eta cut.
Definition: PMGHFProductionFractionTool.h:102
PMGTools::PMGHFProductionFractionTool::printCurrentProdFractions
void printCurrentProdFractions() const
Print the current production fractions.
Definition: PMGHFProductionFractionTool.cxx:386
PMGTools::PMGHFProductionFractionTool::ParameterSet::bottomWeights
std::map< unsigned int, float > bottomWeights
Definition: PMGHFProductionFractionTool.h:60
PMGTools::PMGHFProductionFractionTool::recommendedSystematics
virtual CP::SystematicSet recommendedSystematics() const override
Copied from SystematicsTool.cxx.
Definition: PMGHFProductionFractionTool.h:52
PMGTools::PMGHFProductionFractionTool::getWeight
float getWeight(const xAOD::TruthParticleContainer *truthParticles, const ParameterSet &prod_fracs) const
Definition: PMGHFProductionFractionTool.cxx:319
asg::AsgMetadataTool
Base class for dual-use tools that provide file metadata access.
Definition: AsgMetadataTool.h:48
PMGTools::PMGHFProductionFractionTool::m_charmFilename
std::string m_charmFilename
Input file with charm production fractions.
Definition: PMGHFProductionFractionTool.h:93
AsgMetadataTool.h
CP::SystematicsCache
helper class to cache systematics varied calibration constants inside a ISystematicsTool or IRentrant...
Definition: SystematicsCache.h:85
PMGTools::PMGHFProductionFractionTool::setupProductionFractions
StatusCode setupProductionFractions()
Setup weights.
Definition: PMGHFProductionFractionTool.cxx:141
PMGTools::PMGHFProductionFractionTool::m_charmProdFractionWeights
std::map< CP::SystematicVariation, std::map< unsigned int, float > > m_charmProdFractionWeights
Charm production fraction weights.
Definition: PMGHFProductionFractionTool.h:105
SystematicsCache.h
PMGTools::PMGHFProductionFractionTool
Implementation for xAOD Truth Weight Tool which retrieves the charm / bottom hadron content of an eve...
Definition: PMGHFProductionFractionTool.h:26
PMGTools::PMGHFProductionFractionTool::m_bottomFilename
std::string m_bottomFilename
Input file with bottom production fractions.
Definition: PMGHFProductionFractionTool.h:96