ATLAS Offline Software
Loading...
Searching...
No Matches
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
17namespace PMGTools
18{
26{
29
30public:
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
56private:
58 struct ParameterSet {
59 std::map<unsigned int, float> charmWeights;
60 std::map<unsigned int, float> bottomWeights;
61 };
62
64 StatusCode setupProductionFractions();
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
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
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Class to wrap a set of SystematicVariations.
helper class to cache systematics varied calibration constants inside a ISystematicsTool or IRentrant...
Interface for xAOD Truth Weight Tool which returns an event weight based on truth particle container.
std::string m_calibrationAreaPath
Path to calibration area.
StatusCode readProductionFractionsFile(const std::string &, std::map< CP::SystematicVariation, std::map< unsigned int, float > > &)
Read production fractions from input file.
PMGHFProductionFractionTool(const std::string &name)
Create a proper constructor for Athena.
virtual StatusCode initialize() override
Function initialising the tool.
const xAOD::TruthParticle * getInitialParticle(const xAOD::TruthParticle *tp) const
Loops back the decay chain through particles with the same pdgId (e.g. photon emission)
std::map< CP::SystematicVariation, std::map< unsigned int, float > > m_charmProdFractionWeights
Charm production fraction weights.
std::string m_showerGenerator
MC Shower generator software (valid options: Pythia8)
float m_fiducialPtCut
The fiducial charm/bottom pT cut (in GeV)
std::map< std::string, std::string > m_showerGeneratorMap
MC Shower generator map.
std::string m_charmFilename
Input file with charm production fractions.
bool fromBdecay(const xAOD::TruthParticle *particle) const
Checks if a particle originates from a bottom decay.
CP::SystematicsCache< ParameterSet > m_Parameters
The SystematicsCache object.
virtual float getSysWeight(const xAOD::TruthParticleContainer *truthParticles, const CP::SystematicSet &sys) const override
Implements interface from ISysTruthWeightTool.
StatusCode setSystematicVariation(const CP::SystematicSet &systConfig, ParameterSet &param) const
calculate the parameter set for the given systematic
std::string m_showerGeneratorMapFile
MC Shower generator map file name.
float getWeight(const xAOD::TruthParticleContainer *truthParticles, const ParameterSet &prod_fracs) const
virtual CP::SystematicSet affectingSystematics() const override
Which systematics have an effect on the tool's behaviour?
std::string m_bottomFilename
Input file with bottom production fractions.
void printCurrentProdFractions() const
Print the current production fractions.
float m_fiducialEtaCut
The fiducial charm/bottom eta cut.
virtual CP::SystematicSet recommendedSystematics() const override
Copied from SystematicsTool.cxx.
std::map< CP::SystematicVariation, std::map< unsigned int, float > > m_bottomProdFractionWeights
Bottom production fraction weights.
Base class for dual-use tools that provide file metadata access.
Tool providing sample cross-sections and k-factors etc.
TruthParticle_v1 TruthParticle
Typedef to implementation.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.