9 #include "boost/foreach.hpp"
32 : ml( desc->moduleLabel() ),
33 pin( desc->productInstanceName() )
45 std::map<std::string, LEAFTYPE> leafmap;
46 leafmap[
"bool"] =
BOOL; leafmap[
"bools"] =
BOOL_V;
47 leafmap[
"short int"] =
SHORT; leafmap[
"shorts"] =
SHORT_V;
49 leafmap[
"int"] =
INT; leafmap[
"ints"] =
INT_V;
53 leafmap[
"lint"] =
LONG; leafmap[
"longs"] =
LONG_V;
55 leafmap[
"char"] =
CHAR; leafmap[
"chars"] =
CHAR_V;
63 groupSelector_.
initialize(groupSelectorRules_, allBranches);
65 std::set<std::string> branchnames;
68 if(groupSelector_.
selected(*selection)) {
71 if (branchnames.find( selection->productInstanceName()) != branchnames.end() ) {
73 <<
"More than one branch named: "
74 << selection->productInstanceName() << std::endl
75 <<
"Exception thrown from ShallowTree::beginJob" << std::endl;
78 branchnames.insert( selection->productInstanceName() );
82 switch(leafmap.find( selection->friendlyClassName() )->
second) {
107 std::string leafstring =
"";
108 typedef std::pair<std::string, LEAFTYPE> pair_t;
109 BOOST_FOREACH(
const pair_t&
leaf, leafmap)
110 leafstring+=
"\t" + leaf.first +
"\n";
113 <<
"class ShallowTree does not handle leaves of type " << selection->className() <<
" like\n"
114 << selection->friendlyClassName() <<
"_"
115 << selection->moduleLabel() <<
"_"
116 << selection->productInstanceName() <<
"_"
117 << selection->processName() << std::endl
118 <<
"Valid leaf types are (friendlyClassName):\n"
120 <<
"Exception thrown from ShallowTree::beginJob\n";
std::vector< BranchDescription const * > Selections
virtual void analyze(const edm::Event &, const edm::EventSetup &)
virtual void connect(const edm::Event &)=0
TypedBranchConnector(edm::BranchDescription const *, std::string, TTree *)
U second(std::pair< T, U > const &p)
Container::value_type value_type
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void connect(const edm::Event &)
edm::Service< TFileService > fs
std::vector< BranchConnector * > connectors
bool selected(BranchDescription const &desc) const
T * make() const
make new ROOT object
std::vector< BranchDescription const * > allBranchDescriptions() const
void initialize(GroupSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)