Adaption to new fluka common blocks (E. Futo)
[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);
7a09f434 33 AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC");
34
35 AliTPCParamSR *dig=(AliTPCParamSR *)file->Get("75x40_100x60");
36 if(dig){
37 cerr<<"2 pad-length geom hits with 3 pad-lengths geom digits\n";
38 delete dig;
39 dig = new AliTPCParamSR();
40 }
41 else
42 {
43 dig=(AliTPCParamSR *)gDirectory->Get("75x40_100x60_150x60");
44 }
45 if (!dig) {cerr<<"TPC parameters have not been found !\n"; return 4;}
46 TPC->SetParam(dig);
47
9be6ad43 48
49 TStopwatch timer;
50 timer.Start();
51
52 for(Int_t eventn =0;eventn<nevent;eventn++){
53 printf("Processing event %d\n",eventn);
54 gAlice->GetEvent(eventn);
55
56 TPC->SDigits2Digits2(eventn);
57 }
58
59 delete gAlice; gAlice=0;
60 file->Close(); delete file;
61 timer.Stop();
62 timer.Print();
63
64 return 0;
65};
66
67
68
69
70
71
72
73
74
75
76
77