New macros for handling Sdigits and merging
[u/mrichter/AliRoot.git] / TPC / AliTPCSDigits2Digits.C
CommitLineData
9be6ad43 1#ifndef __CINT__
2 #include "alles.h"
3 #include "AliTPCtracker.h"
4#endif
5Int_t AliTPCSDigits2Digits(Int_t nevent=1)
6{
7
8 // new version by J.Belikov
9
10 // Connect the Root Galice file containing Geometry, Kine and Hits
11
12 const char * inFile_old = "galice.root";
13 const char * inFile_new = "galice.root";
14 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile_old);
15 if (file) {file->Close(); delete file;}
16 file = TFile::Open(inFile_new,"UPDATE");
17 if (!file->IsOpen()) {
18 cerr<<"Can't open "<<inFile_new<<" !\n";
19 return 1;
20 }
21
22 // Get AliRun object from file or create it if not on file
23 // if (gAlice) delete gAlice;
24 gAlice = (AliRun*)file->Get("gAlice");
25 if (!gAlice) {
26 cerr<<"AliTPCHits2Digits.C : AliRun object not found on file\n";
27 return 2;
28 }
29
30
31
32 // gAlice->GetEvent(0);
33 AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC");
34
35 TStopwatch timer;
36 timer.Start();
37
38 for(Int_t eventn =0;eventn<nevent;eventn++){
39 printf("Processing event %d\n",eventn);
40 gAlice->GetEvent(eventn);
41
42 TPC->SDigits2Digits2(eventn);
43 }
44
45 delete gAlice; gAlice=0;
46 file->Close(); delete file;
47 timer.Stop();
48 timer.Print();
49
50 return 0;
51};
52
53
54
55
56
57
58
59
60
61
62
63