1 #if !defined(__CINT__) || defined(__MAKECINT__)
5 #include "AliRunLoader.h"
9 #include "TStopwatch.h"
12 extern AliRun *gAlice;
14 Int_t AliTPCHits2Digits(Int_t nev=5) {
15 // Connect the Root Galice file containing Geometry, Kine and Hits
17 delete gAlice->GetRunLoader();
18 delete gAlice;//if everything was OK here it is already NULL
22 AliRunLoader *rl = AliRunLoader::Open("galice.root","Event","update");
24 cerr<<"Can't load RunLoader from "<<endl;
28 // Get AliRun object from file or create it if not on file
32 gAlice = rl->GetAliRun();
34 cerr<<"AliTPCHits2Digits.C : AliRun object not found on file\n";
38 AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC");
39 AliLoader * tpcl = rl->GetLoader("TPCLoader");
40 if ((TPC == 0x0) || (tpcl == 0x0)) {
41 cerr<<"AliTPCHits2Digits.C : Can not find TPC or TPCLoader\n";
45 tpcl->LoadHits("READ");
46 tpcl->LoadDigits("recreate");
51 // uncomment below lines to set sectors active
52 // Int_t sec[10]={0,1,2,3,4,5,6,7,8,9};
53 // TPC->SetActiveSectors(sec,10);
55 for (Int_t i=0; i<nev; i++){
56 printf("Processing event %d \n",i);
57 if(rl->GetEvent(i)) break;
58 TPC->SetActiveSectors(); // all sectors set active