14 fs_->
file().SetCompressionSettings(compSettings);
17 std::map<std::string, LEAFTYPE> leafmap;
18 leafmap[
"bool"] =
BOOL; leafmap[
"bools"] =
BOOL_V;
19 leafmap[
"short int"] =
SHORT; leafmap[
"shorts"] =
SHORT_V;
21 leafmap[
"int"] =
INT; leafmap[
"ints"] =
INT_V;
25 leafmap[
"lint"] =
LONG; leafmap[
"longs"] =
LONG_V;
27 leafmap[
"char"] =
CHAR; leafmap[
"chars"] =
CHAR_V;
35 productSelector_.
initialize(productSelectorRules_, allBranches);
37 std::set<std::string> branchnames;
39 for(
auto const&
selection : allBranches) {
43 if (branchnames.find(
selection->productInstanceName()) != branchnames.end() ) {
45 <<
"More than one branch named: " 46 <<
selection->productInstanceName() << std::endl
47 <<
"Exception thrown from ShallowTree::ShallowTree" << std::endl;
50 branchnames.insert(
selection->productInstanceName() );
80 typedef std::pair<std::string, LEAFTYPE> pair_t;
81 for(
const pair_t& leaf: leafmap) {
82 leafstring+=
"\t" + leaf.first +
"\n";
86 <<
"class ShallowTree does not handle leaves of type " <<
selection->className() <<
" like\n" 89 <<
selection->productInstanceName() <<
"_" 91 <<
"Valid leaf types are (friendlyClassName):\n" 93 <<
"Exception thrown from ShallowTree::ShallowTree\n";
104 connector->connect(iEvent);
122 : ml( desc->moduleLabel() ),
123 pin( desc->productInstanceName() )
127 if(!t.empty()) { tree->Branch(
pin.c_str(),
object_ptr_, s.c_str() );}
T getUntrackedParameter(std::string const &, T const &) const
bool selected(BranchDescription const &desc) const
TypedBranchConnector(edm::BranchDescription const *, std::string, TTree *)
T * make(const Args &...args) const
make new ROOT object
void analyze(const edm::Event &, const edm::EventSetup &) override
U second(std::pair< T, U > const &p)
edm::Service< TFileService > fs_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
ShallowTree(const edm::ParameterSet &iConfig)
TFile & file() const
return opened TFile
void connect(const edm::Event &) override
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
std::vector< BranchDescription const * > allBranchDescriptions() const
std::vector< BranchConnector * > connectors_