1 #ifndef VariableNtupler_NTupler_H 2 #define VariableNtupler_NTupler_H 33 leaves_[v->second->name()]=v->second;
37 std::vector<std::string> leaves=variablePSet.
getParameter<std::vector<std::string> >(
"leaves");
38 for (uint
i=0;
i!=leaves.size();++
i){
42 if (variablePSet.
exists(
"useTFileService"))
48 if (variablePSet.
exists(
"treeName"))
84 for(;i!=i_end;++
i,++iInDataHolder){
85 tree_->Branch(i->first.c_str(), &(
dataHolder_[iInDataHolder]), (i->first+
"/D").c_str());
95 producer->
produces<
double>(lName.c_str()).setBranchAlias(i->first);
106 uint iInDataHolder=0;
107 for(;i!=i_end;++
i,++iInDataHolder){
119 auto leafValue = std::make_unique<double>((*i->second)(iEvent));
129 typedef std::map<std::string, const CachingVariable *>::iterator
iterator;
130 std::map<std::string, const CachingVariable *>
leaves_;
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void fill(edm::Event &iEvent)
VariableNTupler(const edm::ParameterSet &iConfig)
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
std::map< std::string, const CachingVariable * >::iterator iterator
TypeLabelItem const & produces()
declare what type of product will make and with which optional label
uint registerleaves(edm::ProducerBase *producer)
TFile & file() const
return opened TFile
std::map< std::string, const CachingVariable * > leaves_
std::map< std::string, const CachingVariable * >::const_iterator iterator