1 Int_t AliTPCHits2SDigits(Int_t nevent=1)
4 // new version by J.Belikov
6 // Connect the Root Galice file containing Geometry, Kine and Hits
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";
18 // Get AliRun object from file or create it if not on file
19 if (gAlice) delete gAlice;
20 gAlice = (AliRun*)file->Get("gAlice");
22 cerr<<"AliTPCHits2Digits.C : AliRun object not found on file\n";
28 // gAlice->GetEvent(0);
29 AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC");
34 // uncomment lines below to set active sectors
35 //Int_t sec[10]={4,5,6,7,8,4+36,5+36,6+36,7+36,8+36};
36 //TPC->SetActiveSectors(sec,10);
38 for(Int_t eventn =0;eventn<nevent;eventn++){
39 printf("Processing event %d \n",eventn);
40 gAlice->GetEvent(eventn);
41 TPC->SetActiveSectors(); // all sectors set active
42 printf("\nActive sectors\n");
43 for (Int_t i=0;i<72;i++) if (TPC->IsSectorActive(i)) printf("%d\t",i);
44 TPC->Hits2SDigits2(eventn);
47 delete gAlice; gAlice=0;
48 file->Close(); delete file;