]>
Commit | Line | Data |
---|---|---|
9652f61d | 1 | Int_t AliTPCHits2ExactClusters(Int_t nevent=1) |
2 | { | |
3 | ||
4 | // new version by J.Belikov | |
5 | ||
6 | // Connect the Root Galice file containing Geometry, Kine and Hits | |
7 | ||
8 | const char * inFile_old = "galice.root"; | |
9 | const char * inFile_new = "galice.root"; | |
10 | TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile_old); | |
11 | if (file) {file->Close(); delete file;} | |
12 | file = TFile::Open(inFile_new,"UPDATE"); | |
13 | if (!file->IsOpen()) { | |
14 | cerr<<"Can't open "<<inFile_new<<" !\n"; | |
15 | return 1; | |
16 | } | |
17 | ||
18 | // Get AliRun object from file or create it if not on file | |
19 | if (gAlice) delete gAlice; | |
20 | gAlice = (AliRun*)file->Get("gAlice"); | |
21 | if (!gAlice) { | |
22 | cerr<<"AliTPCHits2Digits.C : AliRun object not found on file\n"; | |
23 | return 2; | |
24 | } | |
25 | ||
26 | ||
27 | ||
28 | // gAlice->GetEvent(0); | |
29 | AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC"); | |
30 | AliTPCParam * param = TPC->GetParam(); | |
31 | TStopwatch timer; | |
32 | timer.Start(); | |
33 | ||
34 | for(Int_t eventn =0;eventn<nevent;eventn++){ | |
35 | printf("Processing event %d\n",eventn); | |
36 | gAlice->GetEvent(eventn); | |
37 | //setup AliTPCClustersArray | |
38 | AliTPCClustersArray * arr=new AliTPCClustersArray; | |
39 | arr->SetClusterType("AliComplexCluster"); | |
40 | arr->Setup(param); | |
41 | arr->MakeTree(); | |
42 | TPC->SetClustersArray(arr); | |
43 | for (Int_t i=0;i<72;i++) | |
44 | TPC->Hits2ExactClustersSector(i); | |
45 | char treeName[100]; | |
46 | sprintf(treeName,"TreeCExact_%d",eventn); | |
47 | TPC->GetClustersArray()->GetTree()->Write(treeName); | |
48 | } | |
49 | ||
50 | delete gAlice; gAlice=0; | |
51 | file->Close(); delete file; | |
52 | timer.Stop(); | |
53 | timer.Print(); | |
54 | ||
55 | return 0; | |
56 | }; | |
57 | ||
58 | ||
59 | ||
60 |