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"))
75 tree_=
dynamic_cast<TTree*
>(object);
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 std::auto_ptr<double> leafValue(
new double((*i->second)(iEvent)));
122 iEvent.
put(leafValue, lName.c_str());
129 typedef std::map<std::string, const CachingVariable *>::iterator
iterator;
130 std::map<std::string, const CachingVariable *>
leaves_;
T getParameter(std::string const &) const
void fill(edm::Event &iEvent)
VariableNTupler(const edm::ParameterSet &iConfig)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
T * make(const Args &...args) const
make new ROOT object
std::map< std::string, const CachingVariable * >::iterator iterator
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
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