8 #include <TDirectory.h>
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;
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;
69 vector<float> ybins( nbinsy+1 );
70 double binsize = (ymax -
ymin) / nbinsy;
71 for(
int i=0;
i<=nbinsy; ++
i) {
72 ybins[
i] = ymin +
i*binsize;
75 return DQM_->book2D(histname,title,nbinsx, xbins, nbinsy, &ybins[0])->getTH2F();
78 TDirectory *oldpwd = gDirectory;
82 vector<double> xbinsd(nbinsx+1);
83 for(
int i=0;
i<=nbinsx; ++
i) {
87 TH2F *
hist =
new TH2F(histname, title, nbinsx, &xbinsd[0], nbinsy, ymin, ymax);
88 cout<<
"booked (ROOT mode) "<<histname<<
" in "<<
dir_->GetName()<<endl;
97 float ymin,
float ymax,
const char* option ) {
100 edm::LogInfo(
"Benchmark") <<
" Benchmark::bookProfile "<<
"booked "<<histname;
101 return DQM_->bookProfile(histname, title, nbinsx, xmin, xmax, 0.0, 0.0, option )->getTProfile();
104 TDirectory *oldpwd = gDirectory;
106 TProfile *
hist =
new TProfile(histname, title, nbinsx, xmin, xmax, ymin, ymax, option);
107 cout<<
"booked (ROOT mode) "<<histname<<
" in "<<
dir_->GetName()<<endl;
115 int nbinsx,
float*
xbins,
116 float ymin,
float ymax,
const char* option ) {
119 vector<double> xbinsd(nbinsx+1);
120 for(
int i=0;
i<=nbinsx; ++
i) {
121 xbinsd[
i] = xbins[
i];
126 edm::LogInfo(
"Benchmark") <<
" Benchmark::bookProfile "<<
"booked "<<histname;
127 return DQM_->bookProfile(histname, title, nbinsx, &xbinsd[0], ymin, ymax, option)->getTProfile();
130 TDirectory *oldpwd = gDirectory;
132 TProfile *
hist =
new TProfile(histname, title, nbinsx, &xbinsd[0], ymin, ymax, option);
133 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.
TProfile * bookProfile(const char *histname, const char *title, int nbinsx, float xmin, float xmax, float ymin, float ymax, const char *option)
book a TProfile 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.