1 #ifndef VariableNtupler_NTupler_H 2 #define VariableNtupler_NTupler_H 31 for (; v != v_end; ++
v) {
32 leaves_[v->second->name()] = v->second;
35 std::vector<std::string> leaves = variablePSet.
getParameter<std::vector<std::string> >(
"leaves");
36 for (
uint i = 0;
i != leaves.size(); ++
i) {
40 if (variablePSet.
exists(
"useTFileService"))
46 if (variablePSet.
exists(
"treeName"))
80 uint iInDataHolder = 0;
81 for (; i != i_end; ++
i, ++iInDataHolder) {
82 tree_->Branch(i->first.c_str(), &(
dataHolder_[iInDataHolder]), (i->first +
"/D").c_str());
88 for (; i != i_end; ++
i) {
92 producesCollector.
produces<
double>(
lName).setBranchAlias(i->first);
103 uint iInDataHolder = 0;
104 for (; i != i_end; ++
i, ++iInDataHolder) {
115 for (; i != i_end; ++
i) {
116 auto leafValue = std::make_unique<double>((*i->second)(iEvent));
126 typedef std::map<std::string, const CachingVariable*>::iterator
iterator;
127 std::map<std::string, const CachingVariable*>
leaves_;
std::map< std::string, const CachingVariable * >::iterator iterator
T getParameter(std::string const &) const
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
def replace(string, replacements)
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
void fill(edm::Event &iEvent) override