1 #ifndef VariableNtupler_NTupler_H 2 #define VariableNtupler_NTupler_H 29 for (;
v != v_end; ++
v) {
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"))
65 TObject*
object =
fs->file().Get(
treeName_.c_str());
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
T getParameter(std::string const &) const
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)
uint registerleaves(edm::ProducesCollector producesCollector) override
std::map< std::string, const CachingVariable * >::const_iterator iterator
void fill(edm::Event &iEvent) override