1 #ifndef VariableNtupler_NTupler_H
2 #define VariableNtupler_NTupler_H
29 for (; v != v_end; ++
v) {
30 leaves_[v->second->name()] = v->second;
33 std::vector<std::string> leaves = variablePSet.
getParameter<std::vector<std::string> >(
"leaves");
34 for (
uint i = 0;
i != leaves.size(); ++
i) {
38 if (variablePSet.
exists(
"useTFileService"))
44 if (variablePSet.
exists(
"treeName"))
70 tree_ =
dynamic_cast<TTree*
>(object);
78 uint iInDataHolder = 0;
79 for (; i != i_end; ++
i, ++iInDataHolder) {
80 tree_->Branch(i->first.c_str(), &(
dataHolder_[iInDataHolder]), (i->first +
"/D").c_str());
86 for (; i != i_end; ++
i) {
90 producesCollector.
produces<
double>(lName).setBranchAlias(i->first);
101 uint iInDataHolder = 0;
102 for (; i != i_end; ++
i, ++iInDataHolder) {
113 for (; i != i_end; ++
i) {
114 auto leafValue = std::make_unique<double>((*i->second)(iEvent));
124 typedef std::map<std::string, const CachingVariable*>::iterator
iterator;
125 std::map<std::string, const CachingVariable*>
leaves_;
std::map< std::string, const CachingVariable * >::iterator iterator
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::map< std::string, const CachingVariable * > leaves_
VariableNTupler(const edm::ParameterSet &iConfig)
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
bool exists(std::string const ¶meterName) const
checks if a parameter exists
T * make(const Args &...args) const
make new ROOT object
uint registerleaves(edm::ProducesCollector producesCollector) override
std::map< std::string, const CachingVariable * >::const_iterator iterator
TFile & file() const
return opened TFile
T getParameter(std::string const &) const
void fill(edm::Event &iEvent) override