00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00017
00018
00019
00021
00022 #include "StMultiH1F.h"
00023 #include "StMultiH2F.h"
00024 #include "QAH.h"
00025 #include "StMaker.h"
00026
00027 StMaker* QAH::maker = 0;
00028 TString QAH::preString = "";
00029 TString QAH::QAHistName = "";
00030 TString QAH::QAHistTitle = "";
00031
00032 ClassImp(QAH)
00033
00034 TH1F* QAH::H1F(const Text_t* name, const Text_t* title,
00035 Int_t nbinsx, Axis_t xlow, Axis_t xup) {
00036
00037 TH1F* hist = new
00038 TH1F(NameIt(name),TitleIt(title),nbinsx,xlow,xup);
00039 if (maker) maker->AddHist(hist);
00040 return hist;
00041
00042 }
00043
00044 TH1F* QAH::H1F(const Text_t* name, const Text_t* title,
00045 Int_t nbinsx, const Double_t* xbins) {
00046
00047 TH1F* hist = new
00048 TH1F(NameIt(name),TitleIt(title),nbinsx,xbins);
00049 if (maker) maker->AddHist(hist);
00050 return hist;
00051
00052 }
00053
00054 TH2F* QAH::H2F(const Text_t* name, const Text_t* title,
00055 Int_t nbinsx, Axis_t xlow, Axis_t xup,
00056 Int_t nbinsy, Axis_t ylow, Axis_t yup) {
00057
00058 TH2F* hist = new
00059 TH2F(NameIt(name),TitleIt(title),nbinsx,xlow,xup,nbinsy,ylow,yup);
00060 if (maker) maker->AddHist(hist);
00061 return hist;
00062
00063 }
00064
00065 TH2F* QAH::H2F(const Text_t* name, const Text_t* title,
00066 Int_t nbinsx, const Double_t* xbins,
00067 Int_t nbinsy, Axis_t ylow, Axis_t yup) {
00068
00069 TH2F* hist = new
00070 TH2F(NameIt(name),TitleIt(title),nbinsx,xbins,nbinsy,ylow,yup);
00071 if (maker) maker->AddHist(hist);
00072 return hist;
00073
00074 }
00075
00076 TH2F* QAH::MH1F(const Text_t* name, const Text_t* title,
00077 Int_t nbinsx, Axis_t xlow, Axis_t xup, Int_t nbinsy) {
00078
00079 TH2F* hist = (TH2F*) new
00080 StMultiH1F(NameIt(name),TitleIt(title),nbinsx,xlow,xup,nbinsy);
00081 if (maker) maker->AddHist(hist);
00082 return hist;
00083
00084 }
00085
00086 void QAH::MMH1F(TH2F** histp, Int_t nhist, const Text_t* name, const Text_t* title,
00087 Int_t nbinsx, Axis_t xlow, Axis_t xup, Int_t nbinsy, Int_t first) {
00088
00089 for (Int_t i=0; i<nhist; i++) {
00090 Int_t j = first + (i * nbinsy);
00091 Int_t k = j + nbinsy - 1;
00092 histp[i] = QAH::MH1F(Form(name,i),Form(title,j,k),nbinsx,xlow,xup,nbinsy);
00093 for (Int_t l=0; l<nbinsy; l++) histp[i]->Rebin(l,Form("%d",j+l));
00094 histp[i]->SetStats(kFALSE);
00095 }
00096
00097 }
00098
00099 TH3F* QAH::MH2F(const Text_t* name, const Text_t* title,
00100 Int_t nbinsx, Axis_t xlow, Axis_t xup, Int_t nbinsy, Axis_t ylow, Axis_t yup,
00101 Int_t nbinsz) {
00102
00103 TH3F* hist = (TH3F*) new
00104 StMultiH2F(NameIt(name),TitleIt(title),nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz);
00105 if (maker) maker->AddHist(hist);
00106 return hist;
00107
00108 }
00109
00110 const char* QAH::NameIt(const char* name) {
00111
00112 return ((QAHistName=preString) += name).Data();
00113
00114 }
00115
00116 const char* QAH::TitleIt(const char* name) {
00117
00118 return (((QAHistTitle=preString) += " ") += name).Data();
00119
00120 }
00121