ATLAS Offline Software
JetFlavorPlots.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef TOPEVENTSELECTIONTOOLS_JETFLAVORPLOTS_H_
6 #define TOPEVENTSELECTIONTOOLS_JETFLAVORPLOTS_H_
7 
8 #include <string>
9 
13 
14 class TFile;
15 
16 namespace EL {
17  class Worker;
18 }
19 
20 namespace top {
21  class TopConfig;
22 
28  public:
42  JetFlavorPlots(const std::string& name, TFile* outputFile, const std::string& params,
43  std::shared_ptr<top::TopConfig> config,
44  EL::Worker* wk = nullptr);
45 
51  bool apply(const top::Event& event) const override;
52 
58  std::string name() const override;
59  private:
60  // File units are MeV and normally people like plots in GeV.
61  static const double toGeV;
62 
63  // Easy access to histograms.
64  std::shared_ptr<PlotManager> m_hists = nullptr;
65  std::shared_ptr<PlotManager> m_hists_Loose = nullptr;
66  std::shared_ptr<PlotManager> m_hists_RadHigh = nullptr;
67  std::shared_ptr<PlotManager> m_hists_RadHigh_Loose = nullptr;
68  std::shared_ptr<PlotManager> m_hists_RadLow = nullptr;
69  std::shared_ptr<PlotManager> m_hists_RadLow_Loose = nullptr;
70  std::shared_ptr<PlotManager> m_hists_RadHighNoVar3c = nullptr;
71  std::shared_ptr<PlotManager> m_hists_RadHighNoVar3c_Loose = nullptr;
72  std::shared_ptr<PlotManager> m_hists_RadLowNoVar3c = nullptr;
73  std::shared_ptr<PlotManager> m_hists_RadLowNoVar3c_Loose = nullptr;
74 
75  // Nominal hash value
76  std::size_t m_nominalHashValue;
77 
78  // for detailed plots (e.g. vs. Njets)
79  bool m_detailed;
80 
81  // to choose between radiation varied and nominal plots
84  bool m_doRadLow;
85  bool m_doRadHighNoVar3c; // doRadHigh but don't take Var3c into account
86  bool m_doRadLowNoVar3c; // doRadLow but don't take Var3c into account
87 
88  // pT and eta bin edges, separated by colons
89  std::string m_ptBins;
90  std::string m_etaBins;
91 
92  // max value for nJets, when doing the plots vs. nJets
94 
95  // name of the jet collection - this is needed for the names of the histograms
96  std::string m_jetCollection;
97 
98  // shared pointed to instance of TopConfig
99  std::shared_ptr<top::TopConfig> m_config;
100 
101  //PMGTruthWeights
103 
104  // function to translate the binnings into vector of bin edges
105  void formatBinning(const std::string& str, std::vector<double>& binEdges);
106  //helper function to book histograms
107  void BookHistograms(std::shared_ptr<PlotManager> h_ptr, std::vector<double> ptBins, std::vector<double> etaBins);
108  //helper function to fill histograms
109  void FillHistograms(std::shared_ptr<PlotManager> h_ptr, double w_event, const top::Event& event) const;
110  //This is to suppress excessive printout
111  mutable std::atomic<bool> m_throwwarningPMG;
112  };
113 } // namespace top
114 
115 #endif // TOPEVENTSELECTIONTOOLS_JETFLAVORPLOTS_H_
PlotManager.h
top::JetFlavorPlots::m_hists_Loose
std::shared_ptr< PlotManager > m_hists_Loose
Definition: JetFlavorPlots.h:65
top::JetFlavorPlots::m_doRadHigh
bool m_doRadHigh
Definition: JetFlavorPlots.h:83
top::JetFlavorPlots::BookHistograms
void BookHistograms(std::shared_ptr< PlotManager > h_ptr, std::vector< double > ptBins, std::vector< double > etaBins)
Definition: JetFlavorPlots.cxx:136
top::JetFlavorPlots::m_etaBins
std::string m_etaBins
Definition: JetFlavorPlots.h:90
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::JetFlavorPlots::name
std::string name() const override
Return the name for the cutflow table.
Definition: JetFlavorPlots.cxx:317
top::JetFlavorPlots::formatBinning
void formatBinning(const std::string &str, std::vector< double > &binEdges)
Definition: JetFlavorPlots.cxx:308
ConvertOldUJHistosToNewHistos.etaBins
list etaBins
Definition: ConvertOldUJHistosToNewHistos.py:145
top::JetFlavorPlots::m_hists_RadLowNoVar3c_Loose
std::shared_ptr< PlotManager > m_hists_RadLowNoVar3c_Loose
Definition: JetFlavorPlots.h:73
top::JetFlavorPlots::apply
bool apply(const top::Event &event) const override
Fill the histograms.
Definition: JetFlavorPlots.cxx:162
PMGTruthWeightTool.h
top::JetFlavorPlots::JetFlavorPlots
JetFlavorPlots(const std::string &name, TFile *outputFile, const std::string &params, std::shared_ptr< top::TopConfig > config, EL::Worker *wk=nullptr)
Setup some example plots.
Definition: JetFlavorPlots.cxx:31
top::JetFlavorPlots::m_jetCollection
std::string m_jetCollection
Definition: JetFlavorPlots.h:96
top::JetFlavorPlots::m_throwwarningPMG
std::atomic< bool > m_throwwarningPMG
Definition: JetFlavorPlots.h:111
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
top::JetFlavorPlots::toGeV
static const double toGeV
Definition: JetFlavorPlots.h:61
top::JetFlavorPlots
An example of how to quickly make some plots at a certain point in the cutflow.
Definition: JetFlavorPlots.h:27
compareGeometries.outputFile
string outputFile
Definition: compareGeometries.py:25
EL::Worker
Definition: Worker.h:25
top::JetFlavorPlots::m_nominalHashValue
std::size_t m_nominalHashValue
Definition: JetFlavorPlots.h:76
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
top::JetFlavorPlots::m_hists
std::shared_ptr< PlotManager > m_hists
Definition: JetFlavorPlots.h:64
top::JetFlavorPlots::m_detailed
bool m_detailed
Definition: JetFlavorPlots.h:79
top::JetFlavorPlots::m_config
std::shared_ptr< top::TopConfig > m_config
Definition: JetFlavorPlots.h:99
top::JetFlavorPlots::m_hists_RadLow
std::shared_ptr< PlotManager > m_hists_RadLow
Definition: JetFlavorPlots.h:68
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
top::JetFlavorPlots::m_doRadHighNoVar3c
bool m_doRadHighNoVar3c
Definition: JetFlavorPlots.h:85
top::JetFlavorPlots::m_hists_RadHighNoVar3c
std::shared_ptr< PlotManager > m_hists_RadHighNoVar3c
Definition: JetFlavorPlots.h:70
top::JetFlavorPlots::m_hists_RadHighNoVar3c_Loose
std::shared_ptr< PlotManager > m_hists_RadHighNoVar3c_Loose
Definition: JetFlavorPlots.h:71
top::JetFlavorPlots::m_doRadLowNoVar3c
bool m_doRadLowNoVar3c
Definition: JetFlavorPlots.h:86
top::JetFlavorPlots::m_PMGTruthWeights
PMGTools::PMGTruthWeightTool * m_PMGTruthWeights
Definition: JetFlavorPlots.h:102
top::EventSelectorBase
This should apply event-level cuts and perform simple plotting on top::Event objects.
Definition: EventSelectorBase.h:20
top::JetFlavorPlots::m_doNominal
bool m_doNominal
Definition: JetFlavorPlots.h:82
top::JetFlavorPlots::m_nJetsMax
int m_nJetsMax
Definition: JetFlavorPlots.h:93
top::JetFlavorPlots::FillHistograms
void FillHistograms(std::shared_ptr< PlotManager > h_ptr, double w_event, const top::Event &event) const
Definition: JetFlavorPlots.cxx:234
PMGTools::PMGTruthWeightTool
Implementation for the xAOD truth meta data weight tool.
Definition: PMGTruthWeightTool.h:26
top::JetFlavorPlots::m_doRadLow
bool m_doRadLow
Definition: JetFlavorPlots.h:84
top::JetFlavorPlots::m_hists_RadLowNoVar3c
std::shared_ptr< PlotManager > m_hists_RadLowNoVar3c
Definition: JetFlavorPlots.h:72
EventSelectorBase.h
str
Definition: BTagTrackIpAccessor.cxx:11
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49
top::JetFlavorPlots::m_hists_RadHigh_Loose
std::shared_ptr< PlotManager > m_hists_RadHigh_Loose
Definition: JetFlavorPlots.h:67
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
top::JetFlavorPlots::m_ptBins
std::string m_ptBins
Definition: JetFlavorPlots.h:89
top::JetFlavorPlots::m_hists_RadLow_Loose
std::shared_ptr< PlotManager > m_hists_RadLow_Loose
Definition: JetFlavorPlots.h:69
top::JetFlavorPlots::m_hists_RadHigh
std::shared_ptr< PlotManager > m_hists_RadHigh
Definition: JetFlavorPlots.h:66