Minor updates
[u/mrichter/AliRoot.git] / HLT / comp / run.C
CommitLineData
1f5a3cb8 1void run()
2{
3
4 a = new AliL3Modeller();
5 //a->Init(1,0,"/prog/alice/data/Rawdata/6_patch/1track_s1/");
6 a->Init(1,0,"/prog/alice/data/Rawdata/1_patch/hg_1000_s1-3/");
7 a->Process();
8
9 a->WriteRemaining("test.raw");
10 return;
11
12 tracks = a->GetTracks();
13
14 //plot(tracks);
15
16 for(int i=0; i<tracks->GetNTracks(); i++)
17 {
18 track = (AliL3ModelTrack*)tracks->GetCheckedTrack(i);
19 if(!track) continue;
20 track->FillModel();
21 }
22
23 c = new AliL3Compress();
24 c->Write2File(tracks,"mtracks.raw");
25
26 //c->ReadFile("mtracks.raw");
27 c->CompressFile("mtracks.raw","ctracks.raw");
28 //c->ExpandFile();
29 delete c;
30
31 //delete a;
32}
33
34void plot(AliL3TrackArray *tracks)
35{
36 hist = new TH1F("hist","",256,0,255);
37
38 for(int i=0; i<tracks->GetNTracks(); i++)
39 {
40 track = (AliL3ModelTrack*)tracks->GetCheckedTrack(i);
41 if(!track) continue;
42 if(track->GetNHits()<150) break;
43
44 track->Print();
45
46 for(int j=0; j<30; j++)
47 {
48 Float_t res;
49 if(track->GetPadResidual(j,res))
50 hist->Fill(res);
51 }
52
53
54 }
55 return;
56 c1 = new TCanvas("c1","",2);
57 hist->Draw();
58}
59
60void getcharge()
61{
62
63 TNtuple *ntuppel = new TNtuple("ntuppel","","charge");
64
65 int patch=0;
66 file = new AliL3MemHandler();
67 for(int event=0; event<25; event++)
68 {
69 for(int slice=0; slice<35; slice++)
70 {
71 char fname[100];
72 sprintf(fname,"/prog/alice/data/Rawdata/1_patch/pp/recon_%d/points_%d_%d.raw",event,slice,patch);
73 file->SetBinaryInput(fname);
74
75 UInt_t npoints;
76 AliL3SpacePointData *points = (AliL3SpacePointData *) file->Allocate();
77 file->Binary2Memory(npoints,points);
78 file->CloseBinaryInput();
79
80 for(int i=0; i<npoints; i++)
81 {
82 //cout<<""<<points[i].fX<<" "<<points[i].fY<<" "<<points[i].fZ<<endl;
83 //cout<<"Charge "<<points[i].fCharge<<endl;
84 Float_t charge[1] = {(float)points[i].fCharge};
85 ntuppel->Fill(charge);
86 }
87 file->Free();
88 }
89 }
90 delete file;
91 rootfile = TFile::Open("average_charge.root","RECREATE");
92 ntuppel->Write();
93 rootfile->Close();
94
95}
96
97void plotcharge()
98{
99 gStyle->SetOptFit(1);
100 file = TFile::Open("average_charge.root");
101
102 hist = new TH1F("hist","",100,0,2000);
103 ntuppel->Draw("charge>>hist","","goff");
104
105 f1 = new TF1("f1","landau",0,2000);
106 hist->Draw();
107 hist->Fit(f1,"R");
108}