1 #ifndef VariableNtupler_NTupler_H 2 #define VariableNtupler_NTupler_H 27 for (;
v != v_end; ++
v) {
31 std::vector<std::string> leaves = variablePSet.
getParameter<std::vector<std::string> >(
"leaves");
32 for (
uint i = 0;
i != leaves.size(); ++
i) {
36 if (variablePSet.
exists(
"useTFileService"))
42 if (variablePSet.
exists(
"treeName"))
63 TObject*
object =
fs->file().Get(
treeName_.c_str());
76 uint iInDataHolder = 0;
77 for (;
i != i_end; ++
i, ++iInDataHolder) {
78 tree_->Branch(
i->first.c_str(), &(
dataHolder_[iInDataHolder]), (
i->first +
"/D").c_str());
84 for (;
i != i_end; ++
i) {
88 producesCollector.
produces<
double>(
lName).setBranchAlias(
i->first);
99 uint iInDataHolder = 0;
100 for (;
i != i_end; ++
i, ++iInDataHolder) {
111 for (;
i != i_end; ++
i) {
112 auto leafValue = std::make_unique<double>((*
i->second)(
iEvent));
122 typedef std::map<std::string, const CachingVariable*>::iterator
iterator;
123 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