1 #ifndef RDFAnalysis_Scheduler_H 2 #define RDFAnalysis_Scheduler_H 24 template <
typename Detail>
54 std::vector<SysResultPtr<TObject>>
objects;
71 const std::map<std::string, Region>&
regions()
const 83 const std::string& name,
84 std::function<
void(
node_t*)> action,
85 const std::set<std::string>& variables = {},
86 const std::set<std::string>& filters = {},
100 const std::string& name,
103 const std::set<std::string>& filters = {},
114 const std::string& name,
115 const std::string& expression,
116 const std::set<std::string>& filters = {},
128 const std::string& name,
129 const std::string& expression,
131 const std::set<std::string>& filters,
144 template <std::
size_t N>
146 const std::array<std::string, N>& names,
147 std::function<
void(
node_t*)> action,
148 const std::set<std::string>& variables = {},
149 const std::set<std::string>& filters = {},
162 template <std::
size_t N,
typename F>
164 const std::array<std::string, N>& names,
167 const std::set<std::string>& filters = {},
183 const std::string& name,
185 const std::set<std::string>& variables = {},
186 const std::set<std::string>& filters = {},
203 template <
typename F>
204 std::enable_if_t<std::is_convertible<typename ROOT::TTraits::CallableTraits<F>::ret_type, std::tuple<bool, float>>::value,
void>
registerFilter(
207 const std::string& name,
208 const std::string& cutflowName =
"",
210 const std::set<std::string>& filters = {},
225 template <
typename F>
226 std::enable_if_t<std::is_convertible<typename ROOT::TTraits::CallableTraits<F>::ret_type,
bool>::value,
void>
registerFilter(
229 const std::string& name,
230 const std::string& cutflowName =
"",
231 const std::string& weight =
"",
233 const std::set<std::string>& filters = {},
247 const std::string& expression,
248 const std::string& name,
249 const std::string& cutflowName =
"",
250 const std::string& weight =
"",
252 const std::set<std::string>& filters = {},
269 template <
typename F,
typename W>
270 std::enable_if_t<!std::is_convertible<F, std::string>::value && !std::is_convertible<W, std::string>::value,
void>
registerFilter(
273 const std::string& name,
274 const std::string& cutflowName,
278 const std::set<std::string>& filters = {},
293 template <
typename W>
295 const std::string& expression,
296 const std::string& name,
297 const std::string& cutflowName,
301 const std::set<std::string>& filters = {},
315 const std::string& name,
317 const std::set<std::string>& variables = {},
318 const std::set<std::string>& filters = {});
332 template <
typename T>
336 const std::string& weight =
"",
338 const std::set<std::string>& filters = {});
342 std::map<std::string, std::function<node_t*(node_t*)>>
m_filters;
346 std::map<std::string, std::function<SysResultPtr<TObject>(
node_t*)>>
m_fills;
357 const std::string& currentRegion =
"");
360 #include "RDFAnalysis/Scheduler.icc" 361 #endif //> !RDFAnalysis_Scheduler_H std::map< std::string, Region > m_regions
After scheduling, pointers to the end nodes for all defined regions will be here. ...
Definition: Scheduler.h:353
std::map< std::string, std::function< node_t *(node_t *)> > m_filters
The defined filters.
Definition: Scheduler.h:342
Namer class to be used by the scheduler.
Definition: ScheduleNamer.h:20
node_t * node
The node that defines the final selection of this region.
Definition: Scheduler.h:51
std::map< std::string, std::function< void(node_t *)> > m_variables
The defined variables.
Definition: Scheduler.h:344
File containing the central analysis class.
Helper struct to define a region.
Definition: Scheduler.h:49
The namer used by the scheduler.
ROOT::RDataFrame::ColumnNames_t ColumnNames_t
Helper typedef.
Definition: NodeBase.h:30
Helper struct used to build and express the schedule.
Definition: SchedulerBase.h:157
std::enable_if_t<!std::is_convertible< F, std::string >{}, T > enable_ifn_string_t
Reduce size of enable_if statements.
Definition: Helpers.h:114
std::enable_if_t< std::is_convertible< typename ROOT::TTraits::CallableTraits< F >::ret_type, std::tuple< bool, float > >::value, void > registerFilter(F f, const ColumnNames_t &columns, const std::string &name, const std::string &cutflowName="", WeightStrategy strategy=WeightStrategy::Default, const std::set< std::string > &filters={}, float cost=0)
Register a new filter.
ScheduleNamer m_namer
The namer.
Definition: Scheduler.h:350
const std::map< std::string, Region > & regions() const
Get the string->region mapping.
Definition: Scheduler.h:71
node_t * m_root
The root node.
Definition: Scheduler.h:348
void registerVariableImpl(const std::string &name, std::function< void(node_t *)> action, const std::set< std::string > &variables={}, const std::set< std::string > &filters={}, float cost=0)
Register a new variable.
Scheduler(node_t *root)
Create the scheduler from a node.
Definition: Scheduler.h:36
void addNode(const ScheduleNode &source, node_t *target, const std::string ¤tRegion="")
Copy information across from the Schedule node to the actual node.
Base class for the scheduler.
Definition: SchedulerBase.h:18
Definition: CutflowDetail.h:11
Class to represent a single step in the analysis process.
Definition: Node.h:32
Job scheduler.
Definition: Scheduler.h:25
WeightStrategy
enum class to describe how weights are applied.
Definition: WeightStrategy.h:33
Detail detail_t
The node detail type.
Definition: Scheduler.h:28
void registerFilterImpl(const std::string &name, std::function< node_t *(node_t *)> action, const std::set< std::string > &variables={}, const std::set< std::string > &filters={}, float cost=0)
Register a new filter.
std::map< std::string, Region > & regions()
Get the string->region mapping.
Definition: Scheduler.h:63
Class to wrap together RResultPtrs for different systematic variations.
Definition: SysResultPtr.h:24
enable_ifn_string_t< F, void > registerVariable(const std::string &name, F f, const ColumnNames_t &columns={}, const std::set< std::string > &filters={}, float cost=0)
Register a new variable definition.
node_t * root()
Get the root node. After schedule has been called this will contain the whole data structure...
Definition: Scheduler.h:40
ScheduleNode & schedule(const std::string &graphFile="")
Schedule the analysis.
std::vector< SysResultPtr< TObject > > objects
The TObject fills associated with this region.
Definition: Scheduler.h:54
void registerVariablesImpl(const std::array< std::string, N > &names, std::function< void(node_t *)> action, const std::set< std::string > &variables={}, const std::set< std::string > &filters={}, float cost=0)
Register a single action that defines multiple new variables.
void registerFillImpl(const std::string &name, std::function< SysResultPtr< TObject >(node_t *)> action, const std::set< std::string > &variables={}, const std::set< std::string > &filters={})
Register a new fill.
void registerFill(const T &model, const ColumnNames_t &columns, const std::string &weight="", WeightStrategy strategy=WeightStrategy::Default, const std::set< std::string > &filters={})
register a new fill
enable_ifn_string_t< F, void > registerVariables(const std::array< std::string, N > &names, F f, const ColumnNames_t &columns, const std::set< std::string > &filters={}, float cost=0)
Register a single action that defines multiple new variables.
std::map< std::string, std::function< SysResultPtr< TObject >node_t *)> > m_fills
The defined fills.
Definition: Scheduler.h:346