CalibTracker
SiStripCommon
plugins
ShallowTree.h
Go to the documentation of this file.
1
#ifndef Shallow_Tree_h
2
#define Shallow_Tree_h
3
21
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
22
#include "
FWCore/Framework/interface/one/EDAnalyzer.h
"
23
#include "
FWCore/Framework/interface/Event.h
"
24
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
25
#include "
FWCore/ServiceRegistry/interface/Service.h
"
26
#include "
CommonTools/UtilAlgos/interface/TFileService.h
"
27
#include "
FWCore/Utilities/interface/InputTag.h
"
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>
38
void
eat
(
edm::BranchDescription
const
*
desc
) {
39
consumes<T>(
edm::InputTag
(
desc
->moduleLabel(),
desc
->productInstanceName()));
40
}
41
42
class
BranchConnector
{
43
public
:
44
virtual
~BranchConnector
(){};
45
virtual
void
connect
(
const
edm::Event
&) = 0;
46
};
47
48
template
<
class
T>
49
class
TypedBranchConnector
:
public
BranchConnector
{
50
private
:
51
std::string
ml
;
//module label
52
std::string
pin
;
//product instance name
53
T
object_
;
54
T
*
object_ptr_
;
55
56
public
:
57
TypedBranchConnector
(
edm::BranchDescription
const
*,
std::string
, TTree*);
58
void
connect
(
const
edm::Event
&)
override
;
59
};
60
61
edm::Service<TFileService>
fs_
;
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,
70
BOOL_V
,
71
SHORT
,
72
SHORT_V
,
73
U_SHORT
,
74
U_SHORT_V
,
75
INT
,
76
INT_V
,
77
U_INT
,
78
U_INT_V
,
79
FLOAT
,
80
FLOAT_V
,
81
DOUBLE
,
82
DOUBLE_V
,
83
LONG
,
84
LONG_V
,
85
U_LONG
,
86
U_LONG_V
,
87
CHAR
,
88
CHAR_V
,
89
U_CHAR
,
90
U_CHAR_V
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
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:58
ShallowTree::FLOAT
Definition:
ShallowTree.h:79
ShallowTree::tree_
TTree * tree_
Definition:
ShallowTree.h:62
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
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
Generated for CMSSW Reference Manual by
1.8.16