ATLAS Offline Software
JetFtagEffPlots.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef TOPEVENTSELECTIONTOOLS_JETFTAGEFFPLOTS_H_
6 #define TOPEVENTSELECTIONTOOLS_JETFTAGEFFPLOTS_H_
7 
8 #include <string>
9 
13 #include <AsgTools/AnaToolHandle.h>
17 
18 
19 class TFile;
20 
21 namespace EL {
22  class Worker;
23 }
24 
25 namespace {
26  enum class WEIGHTTYPE {
27  MURUP, MURDOWN, MUFUP, MUFDOWN, VAR3CUP, VAR3CDOWN, FSRUP, FSRDOWN
28  };
29 }
30 
31 namespace top {
32  class TopConfig;
33 
39  public:
40  JetFtagEffPlots(const std::string& name, TFile* outputFile, const std::string& params,
41  std::shared_ptr<top::TopConfig> config,
42  EL::Worker* wk = nullptr);
43 
44 
45  bool apply(const top::Event& event) const override;
46 
47 
48  std::string name() const override;
49  private:
50  // File units are MeV and normally people like plots in GeV.
51  static const double toGeV;
52 
53  // Easy access to histograms.
54  std::shared_ptr<PlotManager> m_hists = nullptr;
55  std::shared_ptr<PlotManager> m_hists_muRup = nullptr;
56  std::shared_ptr<PlotManager> m_hists_muRdown = nullptr;
57  std::shared_ptr<PlotManager> m_hists_muFup = nullptr;
58  std::shared_ptr<PlotManager> m_hists_muFdown = nullptr;
59  std::shared_ptr<PlotManager> m_hists_Var3cup = nullptr;
60  std::shared_ptr<PlotManager> m_hists_Var3cdown = nullptr;
61  std::shared_ptr<PlotManager> m_hists_FSRup = nullptr;
62  std::shared_ptr<PlotManager> m_hists_FSRdown = nullptr;
63 
64 
65  // Nominal hash value
66  std::size_t m_nominalHashValue;
67 
68  std::string m_CDIfile;
69 
71 
72  //optional suffix you can add to your histogram
73  std::string m_histogram_suffix;
77  bool m_doMuRup;
79  bool m_doMuFup;
83  bool m_doFSRup;
85 
86  // pT and eta bin edges
87  std::string m_ptBins;
88  std::string m_etaBins;
89 
90  float m_max_pT;
91  float m_min_pT;
93 
94  float m_max_Eta;
95  float m_min_Eta;
97 
98  // name of the jet collection - this is needed for the names of the histograms
99  std::string m_jetCollection;
100  std::string m_WP;
101  std::string m_tagger;
102  // shared pointed to instance of TopConfig
103  std::shared_ptr<top::TopConfig> m_config;
104 
105 
107 
109 
111 
112  // function to translate the binnings into vector of bin edges
113  void formatBinning(const std::string& str, std::vector<double>& binEdges);
114 
115  //helper function to fill histograms
116  void FillHistograms(std::shared_ptr<PlotManager> h_ptr, double w_event, const top::Event& event) const;
117 
119  float GetPMGTruthWeight(const xAOD::EventInfo* evtInfo, WEIGHTTYPE type) const;
120  };
121 } // namespace top
122 
123 #endif // TOPEVENTSELECTIONTOOLS_JETFTAGEFFPLOTS_H_
PlotManager.h
top::JetFtagEffPlots::m_hists_Var3cup
std::shared_ptr< PlotManager > m_hists_Var3cup
Definition: JetFtagEffPlots.h:59
top::JetFtagEffPlots::m_hists
std::shared_ptr< PlotManager > m_hists
Definition: JetFtagEffPlots.h:54
asg::AnaToolHandle< IBTaggingSelectionTool >
top::JetFtagEffPlots::m_use_track_jets
bool m_use_track_jets
Definition: JetFtagEffPlots.h:75
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::JetFtagEffPlots::m_N_pT_bins
int m_N_pT_bins
Definition: JetFtagEffPlots.h:92
top::JetFtagEffPlots::m_dont_use_event_weight
bool m_dont_use_event_weight
Definition: JetFtagEffPlots.h:74
top::JetFtagEffPlots::formatBinning
void formatBinning(const std::string &str, std::vector< double > &binEdges)
Definition: JetFtagEffPlots.cxx:351
top::JetFtagEffPlots::m_CDIfile
std::string m_CDIfile
Definition: JetFtagEffPlots.h:68
top::JetFtagEffPlots::GetPMGTruthWeight
float GetPMGTruthWeight(const xAOD::EventInfo *evtInfo, WEIGHTTYPE type) const
A helper function to get the correct truth weight.
Definition: JetFtagEffPlots.cxx:360
top::JetFtagEffPlots::name
std::string name() const override
A human readable name.
Definition: JetFtagEffPlots.cxx:390
top::JetFtagEffPlots::m_hists_FSRdown
std::shared_ptr< PlotManager > m_hists_FSRdown
Definition: JetFtagEffPlots.h:62
top::JetFtagEffPlots::m_hists_FSRup
std::shared_ptr< PlotManager > m_hists_FSRup
Definition: JetFtagEffPlots.h:61
top::JetFtagEffPlots::m_min_Eta
float m_min_Eta
Definition: JetFtagEffPlots.h:95
top::JetFtagEffPlots::m_doMuFup
bool m_doMuFup
Definition: JetFtagEffPlots.h:79
PMGTruthWeightTool.h
top::JetFtagEffPlots::m_hists_muFdown
std::shared_ptr< PlotManager > m_hists_muFdown
Definition: JetFtagEffPlots.h:58
top::JetFtagEffPlots
An example of how to quickly make some plots at a certain point in the cutflow.
Definition: JetFtagEffPlots.h:38
top::JetFtagEffPlots::m_doFSRup
bool m_doFSRup
Definition: JetFtagEffPlots.h:83
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
top::JetFtagEffPlots::m_max_pT
float m_max_pT
Definition: JetFtagEffPlots.h:90
top::JetFtagEffPlots::JetFtagEffPlots
JetFtagEffPlots(const std::string &name, TFile *outputFile, const std::string &params, std::shared_ptr< top::TopConfig > config, EL::Worker *wk=nullptr)
Definition: JetFtagEffPlots.cxx:29
top::JetFtagEffPlots::m_jetCollection
std::string m_jetCollection
Definition: JetFtagEffPlots.h:99
compareGeometries.outputFile
string outputFile
Definition: compareGeometries.py:25
top::JetFtagEffPlots::m_doNominal
bool m_doNominal
Definition: JetFtagEffPlots.h:76
top::JetFtagEffPlots::m_max_Eta
float m_max_Eta
Definition: JetFtagEffPlots.h:94
top::JetFtagEffPlots::m_fill_total_hists
bool m_fill_total_hists
Definition: JetFtagEffPlots.h:70
IBTaggingSelectionTool.h
top::JetFtagEffPlots::m_ptBins
std::string m_ptBins
Definition: JetFtagEffPlots.h:87
EL::Worker
Definition: Worker.h:25
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
top::JetFtagEffPlots::m_WP
std::string m_WP
Definition: JetFtagEffPlots.h:100
top::JetFtagEffPlots::m_doMuRdown
bool m_doMuRdown
Definition: JetFtagEffPlots.h:78
top::JetFtagEffPlots::m_PMGTruthWeights
PMGTools::PMGTruthWeightTool * m_PMGTruthWeights
Definition: JetFtagEffPlots.h:108
top::JetFtagEffPlots::m_hists_muRup
std::shared_ptr< PlotManager > m_hists_muRup
Definition: JetFtagEffPlots.h:55
top::JetFtagEffPlots::m_histogram_suffix
std::string m_histogram_suffix
Definition: JetFtagEffPlots.h:73
top::JetFtagEffPlots::m_hists_Var3cdown
std::shared_ptr< PlotManager > m_hists_Var3cdown
Definition: JetFtagEffPlots.h:60
top::JetFtagEffPlots::m_tagger
std::string m_tagger
Definition: JetFtagEffPlots.h:101
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
top::JetFtagEffPlots::m_hists_muFup
std::shared_ptr< PlotManager > m_hists_muFup
Definition: JetFtagEffPlots.h:57
top::JetFtagEffPlots::m_doVar3cdown
bool m_doVar3cdown
Definition: JetFtagEffPlots.h:82
top::JetFtagEffPlots::m_selection_tool
asg::AnaToolHandle< IBTaggingSelectionTool > m_selection_tool
Definition: JetFtagEffPlots.h:106
AnaToolHandle.h
top::ScaleFactorRetriever
Definition: ScaleFactorRetriever.h:216
top::JetFtagEffPlots::toGeV
static const double toGeV
Definition: JetFtagEffPlots.h:51
top::JetFtagEffPlots::m_min_pT
float m_min_pT
Definition: JetFtagEffPlots.h:91
top::EventSelectorBase
This should apply event-level cuts and perform simple plotting on top::Event objects.
Definition: EventSelectorBase.h:20
top::JetFtagEffPlots::apply
bool apply(const top::Event &event) const override
This does stuff based on the information in an event.
Definition: JetFtagEffPlots.cxx:244
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
PMGTools::PMGTruthWeightTool
Implementation for the xAOD truth meta data weight tool.
Definition: PMGTruthWeightTool.h:26
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
top::JetFtagEffPlots::m_doMuFdown
bool m_doMuFdown
Definition: JetFtagEffPlots.h:80
EventSelectorBase.h
top::JetFtagEffPlots::m_doFSRdown
bool m_doFSRdown
Definition: JetFtagEffPlots.h:84
str
Definition: BTagTrackIpAccessor.cxx:11
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49
top::JetFtagEffPlots::m_etaBins
std::string m_etaBins
Definition: JetFtagEffPlots.h:88
top::JetFtagEffPlots::m_N_Eta_bins
int m_N_Eta_bins
Definition: JetFtagEffPlots.h:96
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
top::JetFtagEffPlots::FillHistograms
void FillHistograms(std::shared_ptr< PlotManager > h_ptr, double w_event, const top::Event &event) const
Definition: JetFtagEffPlots.cxx:310
top::JetFtagEffPlots::m_config
std::shared_ptr< top::TopConfig > m_config
Definition: JetFtagEffPlots.h:103
top::JetFtagEffPlots::m_sfRetriever
top::ScaleFactorRetriever * m_sfRetriever
Definition: JetFtagEffPlots.h:110
ScaleFactorRetriever.h
top::JetFtagEffPlots::m_nominalHashValue
std::size_t m_nominalHashValue
Definition: JetFtagEffPlots.h:66
top::JetFtagEffPlots::m_hists_muRdown
std::shared_ptr< PlotManager > m_hists_muRdown
Definition: JetFtagEffPlots.h:56
top::JetFtagEffPlots::m_doVar3cup
bool m_doVar3cup
Definition: JetFtagEffPlots.h:81
top::JetFtagEffPlots::m_doMuRup
bool m_doMuRup
Definition: JetFtagEffPlots.h:77