13 std::map<std::string, LEAFTYPE> leafmap;
14 leafmap[
"bool"] =
BOOL; leafmap[
"bools"] =
BOOL_V;
15 leafmap[
"short int"] =
SHORT; leafmap[
"shorts"] =
SHORT_V;
17 leafmap[
"int"] =
INT; leafmap[
"ints"] =
INT_V;
21 leafmap[
"lint"] =
LONG; leafmap[
"longs"] =
LONG_V;
23 leafmap[
"char"] =
CHAR; leafmap[
"chars"] =
CHAR_V;
31 productSelector_.
initialize(productSelectorRules_, allBranches);
33 std::set<std::string> branchnames;
35 for(
auto const&
selection : allBranches) {
39 if (branchnames.find(
selection->productInstanceName()) != branchnames.end() ) {
41 <<
"More than one branch named: "
42 <<
selection->productInstanceName() << std::endl
43 <<
"Exception thrown from ShallowTree::ShallowTree" << std::endl;
46 branchnames.insert(
selection->productInstanceName() );
76 typedef std::pair<std::string, LEAFTYPE> pair_t;
77 for(
const pair_t& leaf: leafmap) {
78 leafstring+=
"\t" + leaf.first +
"\n";
82 <<
"class ShallowTree does not handle leaves of type " <<
selection->className() <<
" like\n"
85 <<
selection->productInstanceName() <<
"_"
87 <<
"Valid leaf types are (friendlyClassName):\n"
89 <<
"Exception thrown from ShallowTree::ShallowTree\n";
100 connector->connect(iEvent);
118 : ml( desc->moduleLabel() ),
119 pin( desc->productInstanceName() )
bool selected(BranchDescription const &desc) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
TypedBranchConnector(edm::BranchDescription const *, std::string, TTree *)
T * make(const Args &...args) const
make new ROOT object
U second(std::pair< T, U > const &p)
edm::Service< TFileService > fs_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void connect(const edm::Event &)
ShallowTree(const edm::ParameterSet &iConfig)
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
std::vector< BranchDescription const * > allBranchDescriptions() const
std::vector< BranchConnector * > connectors_