Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/ROOT/RDF/RJittedFilter.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Author: Enrico Guiraud, Danilo Piparo CERN  09/2018
0002 
0003 /*************************************************************************
0004  * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers.               *
0005  * All rights reserved.                                                  *
0006  *                                                                       *
0007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0009  *************************************************************************/
0010 
0011 #ifndef ROOT_RJITTEDFILTER
0012 #define ROOT_RJITTEDFILTER
0013 
0014 #include "ROOT/RDF/GraphNode.hxx"
0015 #include "ROOT/RDF/RFilterBase.hxx"
0016 #include "ROOT/RDF/RLoopManager.hxx"
0017 #include <string_view>
0018 #include "RtypesCore.h"
0019 
0020 #include <memory>
0021 #include <string>
0022 #include <vector>
0023 
0024 class TTreeReader;
0025 
0026 namespace ROOT {
0027 namespace RDF {
0028 class RCutFlowReport;
0029 }
0030 
0031 namespace Detail {
0032 namespace RDF {
0033 
0034 namespace RDFGraphDrawing = ROOT::Internal::RDF::GraphDrawing;
0035 
0036 /// A wrapper around a concrete RFilter, which forwards all calls to it
0037 /// RJittedFilter is the type of the node returned by jitted Filter calls: the concrete filter can be created and set
0038 /// at a later time, from jitted code.
0039 class RJittedFilter final : public RFilterBase {
0040    std::unique_ptr<RFilterBase> fConcreteFilter = nullptr;
0041 
0042 public:
0043    RJittedFilter(RLoopManager *lm, std::string_view name, const std::vector<std::string> &variations);
0044 
0045    // Rule of five
0046 
0047    RJittedFilter(const RJittedFilter &) = delete;
0048    RJittedFilter &operator=(const RJittedFilter &) = delete;
0049    RJittedFilter(RJittedFilter &&) = delete;
0050    RJittedFilter &operator=(RJittedFilter &&) = delete;
0051    ~RJittedFilter() final;
0052 
0053    void SetFilter(std::unique_ptr<RFilterBase> f);
0054 
0055    void InitSlot(TTreeReader *r, unsigned int slot) final;
0056    bool CheckFilters(unsigned int slot, Long64_t entry) final;
0057    void Report(ROOT::RDF::RCutFlowReport &) const final;
0058    void PartialReport(ROOT::RDF::RCutFlowReport &) const final;
0059    void FillReport(ROOT::RDF::RCutFlowReport &) const final;
0060    void IncrChildrenCount() final;
0061    void StopProcessing() final;
0062    void ResetChildrenCount() final;
0063    void TriggerChildrenCount() final;
0064    void ResetReportCount() final;
0065    void InitNode() final;
0066    void AddFilterName(std::vector<std::string> &filters) final;
0067    void FinalizeSlot(unsigned int slot) final;
0068    std::shared_ptr<RDFGraphDrawing::GraphNode>
0069    GetGraph(std::unordered_map<void *, std::shared_ptr<RDFGraphDrawing::GraphNode>> &visitedMap) final;
0070    std::shared_ptr<RNodeBase> GetVariedFilter(const std::string &variationName) final;
0071 };
0072 
0073 } // ns RDF
0074 } // ns Detail
0075 } // ns ROOT
0076 
0077 #endif // ROOT_RJITTEDFILTER