8 #include <TDirectory.h>
26 int nbins,
float xmin,
float xmax) {
29 edm::LogInfo(
"Benchmark") <<
" Benchmark::book1D " <<
"booking "<<histname;
30 return DQM_->book1D(histname,title,nbins,xmin, xmax)->getTH1F();
33 TDirectory *oldpwd = gDirectory;
35 TH1F *
hist =
new TH1F(histname, title, nbins, xmin, xmax);
36 cout<<
"booking (ROOT mode) "<<histname<<
" in "<<
dir_->GetName()<<endl;
44 int nbinsx,
float xmin,
float xmax,
45 int nbinsy,
float ymin,
float ymax ) {
48 edm::LogInfo(
"Benchmark") <<
" Benchmark::book2D "<<
"booked "<<histname;
49 return DQM_->book2D(histname,title,nbinsx,xmin, xmax, nbinsy, ymin, ymax)->getTH2F();
52 TDirectory *oldpwd = gDirectory;
54 TH2F *
hist =
new TH2F(histname, title, nbinsx, xmin, xmax, nbinsy, ymin, ymax);
55 cout<<
"booked (ROOT mode) "<<histname<<
" in "<<
dir_->GetName()<<endl;
63 int nbinsx,
float*
xbins,
64 int nbinsy,
float ymin,
float ymax ) {
66 edm::LogInfo(
"Benchmark") <<
" Benchmark::book2D " <<
" booked "<<histname;
70 vector<float> ybins( nbinsy+1 );
71 double binsize = (ymax - ymin) / nbinsy;
72 for(
int i=0;
i<=nbinsy; ++
i) {
73 ybins[
i] = ymin +
i*binsize;
76 return DQM_->book2D(histname,title,nbinsx, xbins, nbinsy, &ybins[0])->getTH2F();
79 TDirectory *oldpwd = gDirectory;
85 vector<double> xbinsd(nbinsx+1);
86 for(
int i=0;
i<=nbinsx; ++
i) {
90 TH2F *
hist =
new TH2F(histname, title, nbinsx, &xbinsd[0], nbinsy, ymin, ymax);
91 cout<<
"booked (ROOT mode) "<<histname<<
" in "<<
dir_->GetName()<<endl;
virtual void setDirectory(TDirectory *dir)
void write()
write to the TFile, in plain ROOT mode. No need to call this function in DQM mode ...
TH2F * book2D(const char *histname, const char *title, int nbinsx, float xmin, float xmax, int nbinsy, float ymin, float ymax)
book a 2D histogram, either with DQM or plain root.
TH1F * book1D(const char *histname, const char *title, int nbins, float xmin, float xmax)
book a 1D histogram, either with DQM or plain root.