StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
QAH.cxx
1 // $Id: QAH.cxx,v 2.4 2007/03/13 18:44:07 genevb Exp $
2 // $Log: QAH.cxx,v $
3 // Revision 2.4 2007/03/13 18:44:07 genevb
4 // Added StMultiH2F support
5 //
6 // Revision 2.3 2004/12/13 15:52:36 genevb
7 // Numerous updates: PMD, primtrk, FPD, QAShift lists
8 //
9 // Revision 2.2 2001/04/28 22:05:12 genevb
10 // Added EMC histograms
11 //
12 // Revision 2.1 2000/08/25 16:04:09 genevb
13 // Introduction of files
14 //
15 //
17 // //
18 // QAH class for instantiating QA Histograms //
19 // //
21 
22 #include "StMultiH1F.h"
23 #include "StMultiH2F.h"
24 #include "QAH.h"
25 #include "StMaker.h"
26 
27 StMaker* QAH::maker = 0;
28 TString QAH::preString = "";
29 TString QAH::QAHistName = "";
30 TString QAH::QAHistTitle = "";
31 
32 ClassImp(QAH)
33 //_____________________________________________________________________________
34 TH1F* QAH::H1F(const Text_t* name, const Text_t* title,
35  Int_t nbinsx, Axis_t xlow, Axis_t xup) {
36 
37  TH1F* hist = new
38  TH1F(NameIt(name),TitleIt(title),nbinsx,xlow,xup);
39  if (maker) maker->AddHist(hist);
40  return hist;
41 
42 }
43 //_____________________________________________________________________________
44 TH1F* QAH::H1F(const Text_t* name, const Text_t* title,
45  Int_t nbinsx, const Double_t* xbins) {
46 
47  TH1F* hist = new
48  TH1F(NameIt(name),TitleIt(title),nbinsx,xbins);
49  if (maker) maker->AddHist(hist);
50  return hist;
51 
52 }
53 //_____________________________________________________________________________
54 TH2F* QAH::H2F(const Text_t* name, const Text_t* title,
55  Int_t nbinsx, Axis_t xlow, Axis_t xup,
56  Int_t nbinsy, Axis_t ylow, Axis_t yup) {
57 
58  TH2F* hist = new
59  TH2F(NameIt(name),TitleIt(title),nbinsx,xlow,xup,nbinsy,ylow,yup);
60  if (maker) maker->AddHist(hist);
61  return hist;
62 
63 }
64 //_____________________________________________________________________________
65 TH2F* QAH::H2F(const Text_t* name, const Text_t* title,
66  Int_t nbinsx, const Double_t* xbins,
67  Int_t nbinsy, Axis_t ylow, Axis_t yup) {
68 
69  TH2F* hist = new
70  TH2F(NameIt(name),TitleIt(title),nbinsx,xbins,nbinsy,ylow,yup);
71  if (maker) maker->AddHist(hist);
72  return hist;
73 
74 }
75 //_____________________________________________________________________________
76 TH2F* QAH::MH1F(const Text_t* name, const Text_t* title,
77  Int_t nbinsx, Axis_t xlow, Axis_t xup, Int_t nbinsy) {
78 
79  TH2F* hist = (TH2F*) new
80  StMultiH1F(NameIt(name),TitleIt(title),nbinsx,xlow,xup,nbinsy);
81  if (maker) maker->AddHist(hist);
82  return hist;
83 
84 }
85 //_____________________________________________________________________________
86 void QAH::MMH1F(TH2F** histp, Int_t nhist, const Text_t* name, const Text_t* title,
87  Int_t nbinsx, Axis_t xlow, Axis_t xup, Int_t nbinsy, Int_t first) {
88 
89  for (Int_t i=0; i<nhist; i++) {
90  Int_t j = first + (i * nbinsy);
91  Int_t k = j + nbinsy - 1;
92  histp[i] = QAH::MH1F(Form(name,i),Form(title,j,k),nbinsx,xlow,xup,nbinsy);
93  for (Int_t l=0; l<nbinsy; l++) histp[i]->Rebin(l,Form("%d",j+l));
94  histp[i]->SetStats(kFALSE);
95  }
96 
97 }
98 //_____________________________________________________________________________
99 TH3F* QAH::MH2F(const Text_t* name, const Text_t* title,
100  Int_t nbinsx, Axis_t xlow, Axis_t xup, Int_t nbinsy, Axis_t ylow, Axis_t yup,
101  Int_t nbinsz) {
102 
103  TH3F* hist = (TH3F*) new
104  StMultiH2F(NameIt(name),TitleIt(title),nbinsx,xlow,xup,nbinsy,ylow,yup,nbinsz);
105  if (maker) maker->AddHist(hist);
106  return hist;
107 
108 }
109 //_____________________________________________________________________________
110 const char* QAH::NameIt(const char* name) {
111 
112  return ((QAHistName=preString) += name).Data();
113 
114 }
115 //_____________________________________________________________________________
116 const char* QAH::TitleIt(const char* name) {
117 
118  return (((QAHistTitle=preString) += " ") += name).Data();
119 
120 }
121 //_____________________________________________________________________________
Definition: QAH.h:34