1 #ifndef ConfigurableAnalysis_Plotter_H
2 #define ConfigurableAnalysis_Plotter_H
36 std::vector<std::string> th1Names;
38 for (
unsigned int iH = 0; iH != th1Names.size(); ++iH) {
52 std::vector<std::string> tprofNames;
54 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) {
88 if (!insertedDirectory.
dir) {
106 SubDirectories::iterator subDirectoryFindIterator = currentSetOfSubDirectories.find(subDir);
109 if (subDirectoryFindIterator == currentSetOfSubDirectories.end()) {
111 SubDirectory& insertedDir = currentSetOfSubDirectories[subDir];
112 subDirectoryToUse = &insertedDir;
113 if (!insertedDir.
dir) {
119 DirectoryHistos::iterator masterHistogramIterator =
master_.begin();
120 DirectoryHistos::iterator masterHistogramIterator_end =
master_.end();
121 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) {
130 clonedHistogramIterator->second->book(insertedDir.
dir);
133 subDirectoryToUse = &subDirectoryFindIterator->second;
137 DirectoryHistos::iterator histogramIterator = subDirectoryToUse->
histos.begin();
138 DirectoryHistos::iterator histogramIterator_end = subDirectoryToUse->
histos.end();
139 for (; histogramIterator != histogramIterator_end; ++histogramIterator) {
140 histogramIterator->second->fill(iEvent);
174 for (; dir_It != dir_It_end; ++dir_It) {
175 Directory& currentDirectory = dir_It->second;
177 SubDirectories::iterator subDir_It = currentSetOfSubDirectories.begin();
178 SubDirectories::iterator subDir_It_end = currentSetOfSubDirectories.end();
180 for (; subDir_It != subDir_It_end; ++subDir_It) {
181 DirectoryHistos::iterator histogramIterator = subDir_It->second.histos.begin();
182 DirectoryHistos::iterator histogramIterator_end = subDir_It->second.histos.end();
184 for (; histogramIterator != histogramIterator_end; ++histogramIterator) {
185 histogramIterator->second->complete();
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::map< std::string, Directory > Directories
std::map< std::string, ConfigurableHisto * > DirectoryHistos
VariablePlotter(const edm::ParameterSet &iConfig)
edmplugin::PluginFactory< Plotter *(const edm::ParameterSet &)> PlotterFactory
void setDir(std::string dir) override
~VariablePlotter() override
Log< level::Info, false > LogInfo
void fill(std::string subDir, const edm::Event &iEvent) override
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
T getParameter(std::string const &) const
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