RDFAnalysis  0.1.1
Physics analysis with ROOT::RDataFrame
ScheduleNamer.h
Go to the documentation of this file.
1 #ifndef RDFAnalysis_ScheduleNamer_H
2 #define RDFAnalysis_ScheduleNamer_H
3 
5 
11 namespace RDFAnalysis {
20  class ScheduleNamer : public IBranchNamer {
21  public:
22 
29  ScheduleNamer(const IBranchNamer& other) :
30  m_branches(other.branches() ),
31  m_nominal("") {}
32 
34 
42  std::string nameBranch(
43  const std::string& branch,
44  const std::string& = "") const override { return branch; }
45 
50  std::string createBranch(
51  const std::string& branch,
52  const std::string& = "") override
53  {
54  m_branches.push_back(branch);
55  return branch;
56  }
57 
62  bool exists(
63  const std::string& branch,
64  const std::string& = "") const override
65  { return std::count(m_branches.begin(), m_branches.end(), branch) > 0; }
66 
67  const std::string& nominalName() const override { return m_nominal;}
68 
72  std::vector<std::string> systematics() const override
73  { return std::vector<std::string>{}; }
74 
78  std::set<std::string> systematicsAffecting(
79  const std::string& = "") const override
80  { return std::set<std::string>{}; }
81 
85  std::vector<std::string> branches() const override
86  { return m_branches; }
87 
92  const std::map<std::string, ROOT::RDF::RNode>&) override {}
93 
95  std::unique_ptr<IBranchNamer> copy() const override
96  { return std::make_unique<ScheduleNamer>(*this); }
97 
98  private:
100  std::vector<std::string> m_branches;
102  std::string m_nominal;
103 
104  }; //> end class ScheduleNamer
105 } //> end namespace RDFAnalysis
106 
107 #endif //> !RDFAnalysis_ScheduleNamer_H
Abstract base class that describes how a Node should name its branches internally.
Definition: IBranchNamer.h:33
Namer class to be used by the scheduler.
Definition: ScheduleNamer.h:20
std::string nameBranch(const std::string &branch, const std::string &="") const override
Get the full name of a branch.
Definition: ScheduleNamer.h:42
void readBranchList(const std::map< std::string, ROOT::RDF::RNode > &) override
Read branch lists from a set of rnodes.
Definition: ScheduleNamer.h:91
std::set< std::string > systematicsAffecting(const std::string &="") const override
Get all systematics affecting a base branch name.
Definition: ScheduleNamer.h:78
bool exists(const std::string &branch, const std::string &="") const override
Test if a specific variation of a specific branch exists.
Definition: ScheduleNamer.h:62
std::vector< std::string > systematics() const override
Get all systematics.
Definition: ScheduleNamer.h:72
std::string createBranch(const std::string &branch, const std::string &="") override
Create a new branch.
Definition: ScheduleNamer.h:50
Definition: CutflowDetail.h:11
The branch naming interface.
std::vector< std::string > branches() const override
Get all branch base names.
Definition: ScheduleNamer.h:85
std::unique_ptr< IBranchNamer > copy() const override
Make a copy of this class.
Definition: ScheduleNamer.h:95
const std::string & nominalName() const override
Get the name of the nominal variation.
Definition: ScheduleNamer.h:67
~ScheduleNamer()
Definition: ScheduleNamer.h:33
ScheduleNamer(const IBranchNamer &other)
Create the namer by copying the list of branches from another namer.
Definition: ScheduleNamer.h:29