1 /// \file AliTPCHits2Digits.C
3 #if !defined(__CINT__) || defined(__MAKECINT__)
7 #include "AliRunLoader.h"
11 #include "TStopwatch.h"
14 extern AliRun *gAlice;
16 Int_t AliTPCHits2Digits(Int_t nev=5) {
17 /// Connect the Root Galice file containing Geometry, Kine and Hits
20 delete AliRunLoader::Instance();
21 delete gAlice;//if everything was OK here it is already NULL
25 AliRunLoader *rl = AliRunLoader::Open("galice.root","Event","update");
27 cerr<<"Can't load RunLoader from "<<endl;
31 // Get AliRun object from file or create it if not on file
35 gAlice = rl->GetAliRun();
37 cerr<<"AliTPCHits2Digits.C : AliRun object not found on file\n";
41 AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC");
42 AliLoader * tpcl = rl->GetLoader("TPCLoader");
43 if ((TPC == 0x0) || (tpcl == 0x0)) {
44 cerr<<"AliTPCHits2Digits.C : Can not find TPC or TPCLoader\n";
48 tpcl->LoadHits("READ");
49 tpcl->LoadDigits("recreate");
54 // uncomment below lines to set sectors active
55 // Int_t sec[10]={0,1,2,3,4,5,6,7,8,9};
56 // TPC->SetActiveSectors(sec,10);
58 for (Int_t i=0; i<nev; i++){
59 printf("Processing event %d \n",i);
60 if(rl->GetEvent(i)) break;
61 TPC->SetActiveSectors(); // all sectors set active