]>
Commit | Line | Data |
---|---|---|
5df06ecf | 1 | void eval(char *inFile) |
2 | { | |
dc4dbb7a | 3 | |
dc4dbb7a | 4 | |
5df06ecf | 5 | // Connect the Root Galice file containing Geometry, Kine and Hits |
dc4dbb7a | 6 | |
5df06ecf | 7 | file = new TFile(inFile); |
8 | ||
9 | gAlice = (AliRun*)file->Get("gAlice"); | |
10 | if (gAlice) printf("AliRun object found on file\n"); | |
11 | if (!gAlice) gAlice = new AliRun("gAlice","Alice test program"); | |
12 | ||
13 | gAlice->GetEvent(0); | |
14 | AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC"); | |
15 | ||
16 | AliTPCParam *param = (AliTPCParam*)file->Get("75x40_100x60"); | |
17 | ||
18 | TFile *nfile = new TFile("/prog/alice/data/exact_clusters.root","RECREATE"); | |
19 | nfile->cd(); | |
20 | ||
21 | //setup AliTPCClustersArray | |
22 | AliTPCClustersArray * arr=new AliTPCClustersArray; | |
23 | arr->SetClusterType("AliComplexCluster"); | |
24 | arr->Setup(param); | |
25 | TPC->SetParam(param); | |
26 | arr->MakeTree(); | |
dc4dbb7a | 27 | |
5df06ecf | 28 | TPC->SetClustersArray(arr); |
29 | TPC->Hits2ExactClustersSector(1); | |
30 | TPC->Hits2ExactClustersSector(37); | |
31 | ||
dc4dbb7a | 32 | |
5df06ecf | 33 | //write results |
34 | char treeName[100]; | |
35 | sprintf(treeName,"TreeCExact_%s",param->GetTitle()); | |
36 | TPC->GetClustersArray()->GetTree()->Write(treeName); | |
37 | param->Write(param->GetTitle()); | |
38 | file->Close(); | |
39 | nfile->Close(); | |
dc4dbb7a | 40 | |
5df06ecf | 41 | return; |
42 | } | |
43 | ||
44 | void calc(char *rootfile,char *digitsfile,char *cfile) | |
45 | { | |
46 | ||
47 | int slice[2] = {1,1}; | |
48 | a = new AliL3Evaluate(rootfile,digitsfile,slice); | |
49 | a->SetupSlow("tracks.raw","./"); | |
50 | ntuppel = (TNtuple*)a->EvaluatePoints(cfile); | |
51 | ||
52 | f = new TFile("results.root","RECREATE"); | |
53 | f->cd(); | |
54 | ntuppel->Write(); | |
55 | f->Close(); | |
56 | ||
57 | } | |
58 | ||
59 | void plot(char *file) | |
60 | { | |
61 | gStyle->SetOptFit(0110); | |
62 | f = new TFile(file); | |
63 | ||
64 | TCanvas *c1 = new TCanvas("c1","",2); | |
65 | TH1F *hist = new TH1F("hist","",100,-2,2); | |
66 | ||
67 | ntuppel->Draw("resy>>hist","pt>1"); | |
68 | ||
69 | float rms = hist->GetRMS(); | |
70 | hist->SetXTitle("#delta_{T} [cm]"); | |
71 | ||
72 | TF1 *f1 = new TF1("f1","gaus",-rms,rms); | |
73 | hist->Fit("f1","R"); | |
74 | ||
dc4dbb7a | 75 | } |