|
ATLAS Offline Software
|
Go to the documentation of this file.
27 std::shared_ptr<top::TopConfig>
config,
29 m_nominalHashValue(0),
35 m_PMGTruthWeights(nullptr) {
41 static const std::string truthWeightToolName =
"PMGTruthWeightTool";
42 if (asg::ToolStore::contains<PMGTools::IPMGTruthWeightTool>(truthWeightToolName))
m_PMGTruthWeights =
43 asg::ToolStore::get<PMGTools::IPMGTruthWeightTool>(truthWeightToolName);
45 std::unique_ptr<PMGTools::PMGTruthWeightTool> pmgtruthtool = std::make_unique<PMGTools::PMGTruthWeightTool>(truthWeightToolName);
53 if (
s.substr(0,7) ==
"deltaR:") {
54 m_deltaR = std::stof(
s.substr(7,
s.size() - 7));
56 }
else if (
s.substr(0,5) ==
"bins:") {
57 m_bins = std::stoi(
s.substr(5,
s.size() - 5));
58 }
else if (
s.substr(0,4) ==
"min:") {
59 m_min = std::stof(
s.substr(4,
s.size() - 4));
60 }
else if (
s.substr(0,4) ==
"max:") {
61 m_max = std::stof(
s.substr(4,
s.size() - 4));
62 }
else if (
s.substr(0,10) ==
"ptBinning:") {
63 const std::string
tmp =
s.substr(10,
s.size() - 4);
65 std::vector<std::string>
split;
67 for (
const std::string& istring :
split) {
71 throw std::runtime_error{
"ERROR: Can't understand argument " +
s +
"For JETRESPONSEPLOTS"};
76 throw std::invalid_argument{
"pT binning (x axis) size is smaller than 2"};
98 if (
event.m_isLoose && !
m_config->doLooseEvents())
return true;
100 if (!
event.m_isLoose && !
m_config->doTightEvents())
return true;
102 const double nominalWeight =
event.m_info->auxdata<
float>(
"AnalysisTop_eventWeight");
112 for (
const auto*
const jetPtr :
event.m_jets) {
113 int jet_flavor = -99;
114 bool status = jetPtr->getAttribute<
int>(
"HadronConeExclExtendedTruthLabelID", jet_flavor);
117 float matchedPt = -9999;
118 status = jetPtr->getAttribute<
float>(
"AnalysisTop_MatchedTruthJetPt", matchedPt);
122 if (matchedPt < 1
e-6)
continue;
124 const float response = jetPtr->pt() / matchedPt;
127 if (jet_flavor == 55) {
129 }
else if (jet_flavor == 5 || jet_flavor == 54) {
131 }
else if (jet_flavor == 4 || jet_flavor == 44) {
133 }
else if (jet_flavor == 15) {
136 status = jetPtr->getAttribute<
int>(
"PartonTruthLabelID", jet_flavor);
138 if (jet_flavor >= 1 && jet_flavor <= 3) {
140 }
else if (jet_flavor == 21) {
150 return "JETRESPONSEPLOTS";
ToolHandle< PMGTools::IPMGTruthWeightTool > m_PMGTruthWeights
TopConfig A simple configuration that is NOT a singleton.
std::shared_ptr< PlotManager > m_hists
void FillHistograms(const double w_event, const top::Event &event) const
Helper function to fill the histograms.
void tokenize(const std::string &input, Container &output, const std::string &delimiters=" ", bool trim_empty=false)
Tokenize an input string using a set of delimiters.
Class to wrap a set of SystematicVariations.
std::shared_ptr< top::TopConfig > m_config
std::string name() const override
Return the name for the cutflow table.
POOL::TEvent event(POOL::TEvent::kClassAccess)
bool apply(const top::Event &event) const override
Fill the histograms.
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
std::vector< double > m_ptBinning
bool isSimulation(const top::Event &event)
Is this event MC simulation (True) or data (False)?
JetResponsePlots(const std::string &name, TFile *outputFile, const std::string ¶ms, std::shared_ptr< top::TopConfig > config, EL::Worker *wk=nullptr)
Setup some example plots.
std::size_t m_nominalHashValue
Very simple class to hold event data after reading from a file.