StRoot
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
StHighptPool
macros
zdcCent.C
1
#include "commonmacro/common.h"
2
#include "common/Name.cc"
3
#include "commonmacro/histutil.h"
4
5
void
zdcCent(
const
char
* inName=
6
"links/P01hi.minbias.2000.hist/hianalysis_cut111.hist.root"
,
7
const
char
* psDir=
"ps"
,
8
int
cut = 1,
9
const
char
* outDir=
"./"
,
10
const
char
* more =
"west"
,
11
float
extraValue = 0)
12
{
13
gSystem->Clear();
14
15
cout <<
"--------------------------"
<< endl;
16
cout <<
"in name="
<< inName << endl
17
<<
"ps dir="
<< psDir << endl
18
<<
"cut="
<< cut << endl;
19
cout <<
"--------------------------"
<< endl;
20
21
inRoot =
new
TFile(inName);
22
23
gSystem->Load(
"StHiMicroEvent"
);
24
gSystem->Load(
"StHiMicroAnalysis"
);
25
Cut::SetCut(cut);
26
Cut::ShowCuts();
27
28
if
(!inRoot){
29
cout <<
"cannot find the infile"
<< endl;
30
return
;
31
}
32
33
gStyle->SetOptStat(0);
34
35
TCanvas *c1=
new
TCanvas(
"c1"
,
"c1"
,400,500);
36
//-------------------------------------------------------------------
37
TH3* h3=inRoot->Get(
"h3ZdcHMinusVtxZ"
);
38
39
// only -95,95 vtx
40
float
vtxMin=-95,vtxMax=95;
41
42
TH2 *h2,*h2Clone; TProfile* p;
43
h2 = HistSlice(h3,
""
,
""
,0,vtxMin,vtxMax,
"xy"
,
"e"
);
44
45
// function?
46
TF1* f=
new
TF1(
"f"
,
"[0]*exp(-[1])"
);
47
48
Divide(c1,2,2,
"zdc vs h-"
);
49
c1->cd(1);
50
h2->SetMinimum(0);
51
h2->Draw(
"colz"
);
52
53
/*
54
c1->cd(2);
55
gStyle->SetPalette(1,0);
56
h2Clone=(TH2*)h2->Clone();
57
h2Clone->Draw("colz");
58
*/
59
60
c1->cd(3);
61
p=h2->ProfileX();
62
p->Draw(
"e"
);
63
64
// Print(c1,psDir,"zdcVhMinus");
65
66
}
67
68
69
Generated by
1.8.5