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
ShallowTree::BranchConnector
Definition: ShallowTree.h:42
ShallowTree::connectors_
std::vector< BranchConnector * > connectors_
Definition: ShallowTree.h:63
ShallowTree::SHORT_V
Definition: ShallowTree.h:72
EDAnalyzer.h
ShallowTree::DOUBLE
Definition: ShallowTree.h:81
ShallowTree::TypedBranchConnector
Definition: ShallowTree.h:49
ShallowTree::BranchConnector::~BranchConnector
virtual ~BranchConnector()
Definition: ShallowTree.h:44
ShallowTree::U_INT
Definition: ShallowTree.h:77
ShallowTree::BOOL
Definition: ShallowTree.h:69
ShallowTree::TypedBranchConnector::object_ptr_
T * object_ptr_
Definition: ShallowTree.h:54
ShallowTree::U_SHORT
Definition: ShallowTree.h:73
ShallowTree::TypedBranchConnector::ml
std::string ml
Definition: ShallowTree.h:51
ShallowTree::U_SHORT_V
Definition: ShallowTree.h:74
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
ShallowTree::CHAR_V
Definition: ShallowTree.h:88
ShallowTree::eat
void eat(edm::BranchDescription const *desc)
Definition: ShallowTree.h:38
ShallowTree::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: ShallowTree.cc:171
ShallowTree::LEAFTYPE
LEAFTYPE
Definition: ShallowTree.h:68
ShallowTree::INT
Definition: ShallowTree.h:75
ShallowTree::U_CHAR_V
Definition: ShallowTree.h:90
ShallowTree::FLOAT_V
Definition: ShallowTree.h:80
ShallowTree::TypedBranchConnector::TypedBranchConnector
TypedBranchConnector(edm::BranchDescription const *, std::string, TTree *)
Definition: ShallowTree.cc:186
ShallowTree::TypedBranchConnector::pin
std::string pin
Definition: ShallowTree.h:52
Service.h
ShallowTree::U_LONG
Definition: ShallowTree.h:85
ShallowTree::U_LONG_V
Definition: ShallowTree.h:86
ShallowTree::BOOL_V
Definition: ShallowTree.h:70
ShallowTree::BranchConnector::connect
virtual void connect(const edm::Event &)=0
ShallowTree::ShallowTree
ShallowTree(const edm::ParameterSet &iConfig)
Definition: ShallowTree.cc:10
ShallowTree::U_INT_V
Definition: ShallowTree.h:78
ShallowTree::SHORT
Definition: ShallowTree.h:71
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TFileService.h
ShallowTree::INT_V
Definition: ShallowTree.h:76
edm::ParameterSet
Definition: ParameterSet.h:47
ShallowTree::DOUBLE_V
Definition: ShallowTree.h:82
Event.h
ShallowTree::U_CHAR
Definition: ShallowTree.h:89
edm::Service< TFileService >
ShallowTree::fs_
edm::Service< TFileService > fs_
Definition: ShallowTree.h:61
ShallowTree::TypedBranchConnector::connect
void connect(const edm::Event &) override
Definition: ShallowTree.cc:179
edm::EventSetup
Definition: EventSetup.h:57
ShallowTree::FLOAT
Definition: ShallowTree.h:79
ShallowTree::tree_
TTree * tree_
Definition: ShallowTree.h:62
InputTag.h
ShallowTree::LONG
Definition: ShallowTree.h:83
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
ShallowTree
Definition: ShallowTree.h:33
Frameworkfwd.h
T
long double T
Definition: Basic3DVectorLD.h:48
ShallowTree::CHAR
Definition: ShallowTree.h:87
edm::BranchDescription
Definition: BranchDescription.h:32
ParameterSet.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
ShallowTree::TypedBranchConnector::object_
T object_
Definition: ShallowTree.h:53
ShallowTree::LONG_V
Definition: ShallowTree.h:84