Go to the documentation of this file. 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"))
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_;
void fill(edm::Event &iEvent) override
TFile & file() const
return opened TFile
uint registerleaves(edm::ProducesCollector producesCollector) override
std::map< std::string, const CachingVariable * >::const_iterator iterator
bool exists(std::string const ¶meterName) const
checks if a parameter exists
ProductRegistryHelper::BranchAliasSetterT< ProductType > produces()
std::map< std::string, const CachingVariable * >::iterator iterator
std::map< std::string, const CachingVariable * > leaves_
T getParameter(std::string const &) const
VariableNTupler(const edm::ParameterSet &iConfig)
T * make(const Args &... args) const
make new ROOT object
def replace(string, replacements)