31 edm::LogInfo(
"EmDQMPostProcessor") <<
"Cannot create DQMStore instance\n";
47 std::vector<std::string> subdirectories = dqm->
getSubdirs();
48 for(std::vector<std::string>::iterator
dir = subdirectories.begin() ;
dir!= subdirectories.end();
dir++ ){
57 std::vector<std::string> postfixes;
58 std::string tmpstring=
"";
59 postfixes.push_back(tmpstring);
60 tmpstring=
"_MC_matched";
61 postfixes.push_back(tmpstring);
63 for(std::vector<std::string>::iterator postfix=postfixes.begin(); postfix!=postfixes.end();postfix++){
69 std::string histoName=
"efficiency_by_step"+ *postfix;
70 std::string baseName =
"total_eff"+ *postfix;
116 value = dqm->
get(dqm->
pwd() +
"/" + baseName)->getBinContent(total->
getNbinsX()-2)/dqm->
get(dqm->
pwd() +
"/" + baseName)->getBinContent(1) ;
117 error =
sqrt(value*(1-value)/dqm->
get(dqm->
pwd() +
"/" + baseName)->getBinContent(1));
125 total->
getTH1F()->SetMaximum(1.2);
126 total->
getTH1F()->SetMinimum(0);
133 varNames.push_back(
"eta");
134 varNames.push_back(
"phi");
135 varNames.push_back(
"et");
138 std::string filterName2;
139 std::string denomName;
146 filterName2= total->
getTH1F()->GetXaxis()->GetBinLabel(1);
149 for(std::vector<std::string>::iterator var = varNames.begin(); var != varNames.end() ; var++){
150 numName = dqm->
pwd() +
"/" + filterName2 + *var + *postfix;
151 genName = dqm->
pwd() +
"/gen_" + *var ;
152 num = dqm->
get(numName);
153 genPlot = dqm->
get(genName);
154 effL1VsGen = dqm->
book1D(
"efficiency_"+filterName2+
"_vs_"+*var +*postfix, dqm->
get(numName)->
getTH1F());
157 if(!num || !genPlot)
break;
163 effL1VsGen->
setTitle(
"efficiency_"+filterName2+
"_vs_"+*var + *postfix);
164 effL1VsGen->
getTH1F()->SetMaximum(1.2);
165 effL1VsGen->
getTH1F()->SetMinimum(0);
166 effL1VsGen->
getTH1F()->GetXaxis()->SetTitle(var->c_str());
172 filterName = total->
getTH1F()->GetXaxis()->GetBinLabel(
filter);
173 filterName2= total->
getTH1F()->GetXaxis()->GetBinLabel(
filter+1);
176 for(std::vector<std::string>::iterator var = varNames.begin(); var != varNames.end() ; var++){
177 numName = dqm->
pwd() +
"/" + filterName2 + *var + *postfix;
178 denomName = dqm->
pwd() +
"/" + filterName + *var + *postfix;
179 num = dqm->
get(numName);
180 denom = dqm->
get(denomName);
183 if(!num || !denom)
break;
189 std::string
temp = *postfix;
190 if (
filter==total->
getNbinsX()-3 && temp.find(
"matched")!=std::string::npos) {
191 genName = dqm->
pwd() +
"/gen_" + *var;
192 genPlot = dqm->
get(genName);
196 effVsGen->
setTitle(
"Efficiency Compared to Gen vs "+*var);
197 effVsGen->
getTH1F()->SetMaximum(1.2); effVsGen->
getTH1F()->SetMinimum(0.0);
198 effVsGen->
getTH1F()->GetXaxis()->SetTitle(var->c_str());
202 eff = dqm->
book1D(
"efficiency_"+filterName2+
"_vs_"+*var +*postfix, dqm->
get(numName)->
getTH1F());
212 eff->
setTitle(
"efficiency_"+filterName2+
"_vs_"+*var + *postfix);
213 eff->
getTH1F()->SetMaximum(1.2);
215 eff->
getTH1F()->GetXaxis()->SetTitle(var->c_str());
T getUntrackedParameter(std::string const &, T const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< std::string > getSubdirs(void) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void cd(void)
go to top directory (ie. root)
#define DEFINE_FWK_MODULE(type)
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void endRun(edm::Run const &, edm::EventSetup const &)
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
EmDQMPostProcessor(const edm::ParameterSet &pset)
void setTitle(const std::string &title)
set (ie. change) histogram/profile title
bool dirExists(const std::string &path) const
true if directory exists
tuple filter
USE THIS FOR SKIMMED TRACKS process.p = cms.Path(process.hltLevel1GTSeed*process.skimming*process.offlineBeamSpot*process.TrackRefitter2) OTHERWISE USE THIS.
TH1F * getTH1F(void) const
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
void goUp(void)
equivalent to "cd .."
const std::string & pwd(void) const