CMS 3D CMS Logo

ShallowTree.h
Go to the documentation of this file.
1 #ifndef Shallow_Tree_h
2 #define Shallow_Tree_h
3 
28 
29 #include <string>
30 #include <vector>
31 #include <TTree.h>
32 
33 class ShallowTree : public edm::one::EDAnalyzer<edm::one::SharedResources> {
34 private:
35  void analyze(const edm::Event&, const edm::EventSetup&) override;
36 
37  template <class T>
39  consumes<T>(edm::InputTag(desc->moduleLabel(), desc->productInstanceName()));
40  }
41 
43  public:
44  virtual ~BranchConnector(){};
45  virtual void connect(const edm::Event&) = 0;
46  };
47 
48  template <class T>
50  private:
51  std::string ml; //module label
52  std::string pin; //product instance name
55 
56  public:
58  void connect(const edm::Event&) override;
59  };
60 
62  TTree* tree_;
63  std::vector<BranchConnector*> connectors_;
64 
65 public:
66  explicit ShallowTree(const edm::ParameterSet& iConfig); // : pset(iConfig) {}
67 
68  enum LEAFTYPE {
69  BOOL = 1,
75  INT,
91  };
92 };
93 
94 #endif
virtual void connect(const edm::Event &)=0
TypedBranchConnector(edm::BranchDescription const *, std::string, TTree *)
Definition: ShallowTree.cc:186
void eat(edm::BranchDescription const *desc)
Definition: ShallowTree.h:38
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: ShallowTree.cc:171
edm::Service< TFileService > fs_
Definition: ShallowTree.h:61
ShallowTree(const edm::ParameterSet &iConfig)
Definition: ShallowTree.cc:10
TTree * tree_
Definition: ShallowTree.h:62
void connect(const edm::Event &) override
Definition: ShallowTree.cc:179
long double T
std::vector< BranchConnector * > connectors_
Definition: ShallowTree.h:63