]>
Commit | Line | Data |
---|---|---|
1c53abe2 | 1 | /**************************************************************************** |
2 | * Origin: M.Ivanov, CERN, Marian.Ivanov@cern.ch * | |
3 | ****************************************************************************/ | |
4 | ||
9652f61d | 5 | Int_t AliTPCHits2ExactClusters(Int_t nevent=1) |
6 | { | |
1c53abe2 | 7 | // |
8 | // loop over hits and find itersection of the trak with pad rows | |
9 | // so called exact clusters stored in the structure similar to hits | |
10 | // it's used for comparison purpose - to have benchmark of cluster | |
11 | // finder and tracker | |
9652f61d | 12 | |
9652f61d | 13 | |
14 | // Connect the Root Galice file containing Geometry, Kine and Hits | |
15 | ||
16 | const char * inFile_old = "galice.root"; | |
17 | const char * inFile_new = "galice.root"; | |
18 | TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile_old); | |
19 | if (file) {file->Close(); delete file;} | |
20 | file = TFile::Open(inFile_new,"UPDATE"); | |
21 | if (!file->IsOpen()) { | |
22 | cerr<<"Can't open "<<inFile_new<<" !\n"; | |
23 | return 1; | |
24 | } | |
25 | ||
26 | // Get AliRun object from file or create it if not on file | |
27 | if (gAlice) delete gAlice; | |
28 | gAlice = (AliRun*)file->Get("gAlice"); | |
29 | if (!gAlice) { | |
30 | cerr<<"AliTPCHits2Digits.C : AliRun object not found on file\n"; | |
31 | return 2; | |
32 | } | |
33 | ||
34 | ||
35 | ||
36 | // gAlice->GetEvent(0); | |
37 | AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC"); | |
38 | AliTPCParam * param = TPC->GetParam(); | |
39 | TStopwatch timer; | |
40 | timer.Start(); | |
41 | ||
42 | for(Int_t eventn =0;eventn<nevent;eventn++){ | |
43 | printf("Processing event %d\n",eventn); | |
44 | gAlice->GetEvent(eventn); | |
45 | //setup AliTPCClustersArray | |
46 | AliTPCClustersArray * arr=new AliTPCClustersArray; | |
47 | arr->SetClusterType("AliComplexCluster"); | |
48 | arr->Setup(param); | |
49 | arr->MakeTree(); | |
50 | TPC->SetClustersArray(arr); | |
51 | for (Int_t i=0;i<72;i++) | |
52 | TPC->Hits2ExactClustersSector(i); | |
53 | char treeName[100]; | |
54 | sprintf(treeName,"TreeCExact_%d",eventn); | |
55 | TPC->GetClustersArray()->GetTree()->Write(treeName); | |
56 | } | |
57 | ||
58 | delete gAlice; gAlice=0; | |
59 | file->Close(); delete file; | |
60 | timer.Stop(); | |
61 | timer.Print(); | |
62 | ||
63 | return 0; | |
64 | }; | |
65 | ||
66 | ||
67 | ||
68 |