1 #ifndef ConfigurableAnalysis_Plotter_H 2 #define ConfigurableAnalysis_Plotter_H 38 std::vector<std::string> th1Names;
40 for (
unsigned int iH=0;iH!=th1Names.size();++iH){
53 std::vector<std::string> tprofNames;
55 for (
unsigned int iH=0;iH!=tprofNames.size();++iH){
68 std::vector<std::string> th2Names;
70 for (
unsigned int iH=0;iH!=th2Names.size();++iH){
87 if (!insertedDirectory.
dir){
98 Directory & currentDirectory= directories_[currentDir_];
105 SubDirectories::iterator subDirectoryFindIterator=currentSetOfSubDirectories.find(subDir);
108 if (subDirectoryFindIterator==currentSetOfSubDirectories.end()){
109 edm::LogInfo(
"VariablePlotter")<<
" gonna clone histograms for :"<<subDir<<
" in "<<currentDir_;
111 subDirectoryToUse = &insertedDir;
112 if (!insertedDir.
dir){
118 DirectoryHistos::iterator masterHistogramIterator=master_.begin();
119 DirectoryHistos::iterator masterHistogramIterator_end=master_.end();
120 for (; masterHistogramIterator!=masterHistogramIterator_end;++masterHistogramIterator)
123 insertedDir.
histos[masterHistogramIterator->first]=masterHistogramIterator->second->clone();
127 DirectoryHistos::iterator clonedHistogramIterator=insertedDir.
histos.begin();
128 DirectoryHistos::iterator clonedHistogramIterator_end=insertedDir.
histos.end();
129 for (; clonedHistogramIterator!=clonedHistogramIterator_end;++clonedHistogramIterator)
131 clonedHistogramIterator->second->book(insertedDir.
dir);
135 subDirectoryToUse=&subDirectoryFindIterator->second;
139 DirectoryHistos::iterator histogramIterator=subDirectoryToUse->
histos.begin();
140 DirectoryHistos::iterator histogramIterator_end=subDirectoryToUse->
histos.end();
141 for(; histogramIterator!=histogramIterator_end;++histogramIterator)
142 { histogramIterator->second->fill(iEvent); }
173 Directories::iterator dir_It = directories_.begin();
174 Directories::iterator dir_It_end = directories_.end();
176 for (;dir_It!=dir_It_end;++dir_It){
177 Directory & currentDirectory=dir_It->second;
179 SubDirectories::iterator subDir_It = currentSetOfSubDirectories.begin();
180 SubDirectories::iterator subDir_It_end = currentSetOfSubDirectories.end();
182 for (;subDir_It!=subDir_It_end;++subDir_It){
183 DirectoryHistos::iterator histogramIterator=subDir_It->second.histos.begin();
184 DirectoryHistos::iterator histogramIterator_end=subDir_It->second.histos.end();
186 for(; histogramIterator!=histogramIterator_end;++histogramIterator)
187 { histogramIterator->second->complete(); }
T getParameter(std::string const &) const
void fill(std::string subDir, const edm::Event &iEvent)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::map< std::string, Directory > Directories
std::map< std::string, ConfigurableHisto * > DirectoryHistos
edmplugin::PluginFactory< Plotter *(const edm::ParameterSet &) > PlotterFactory
VariablePlotter(const edm::ParameterSet &iConfig)
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
void setDir(std::string dir)
Plotter(const edm::ParameterSet &iConfig)
std::map< std::string, SubDirectory > SubDirectories
size_t getParameterSetNames(std::vector< std::string > &output, bool trackiness=true) const
virtual void fill(std::string subDir, const edm::Event &iEvent)=0
virtual void complete()=0
virtual void setDir(std::string dir)=0