X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCHits2Digits.C;h=4ac823f3cfccab3eb63bd66d077b041f4d1efc2d;hb=c630aafd1da7fec82908f28924c025969497227d;hp=529900a3ea8616ebf12978ccce9be972c71d2861;hpb=88cb7938ca21d4a80991d4e7aa564008c29340f7;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCHits2Digits.C b/TPC/AliTPCHits2Digits.C index 529900a3ea8..4ac823f3cfc 100644 --- a/TPC/AliTPCHits2Digits.C +++ b/TPC/AliTPCHits2Digits.C @@ -1,22 +1,29 @@ -Int_t AliTPCHits2Digits(Int_t nevent=1) -{ +#if !defined(__CINT__) || defined(__MAKECINT__) + #include - // new version by J.Belikov + #include "AliRun.h" + #include "AliRunLoader.h" + #include "AliLoader.h" + #include "AliTPC.h" + #include "TStopwatch.h" +#endif + +extern AliRun *gAlice; + +Int_t AliTPCHits2Digits(Int_t nev=5) { // Connect the Root Galice file containing Geometry, Kine and Hits - if (gAlice) - { + if (gAlice) { delete gAlice->GetRunLoader(); delete gAlice;//if everything was OK here it is already NULL gAlice = 0x0; - } + } AliRunLoader *rl = AliRunLoader::Open("galice.root","Event","update"); - if (!rl) - { - cerr<<"Can't load RunLoader from "<GetEvent(0); AliTPC *TPC = (AliTPC*)gAlice->GetDetector("TPC"); AliLoader * tpcl = rl->GetLoader("TPCLoader"); - if ((TPC == 0x0) || (tpcl == 0x0)) - { + if ((TPC == 0x0) || (tpcl == 0x0)) { cerr<<"AliTPCHits2Digits.C : Can not find TPC or TPCLoader\n"; -// delete rl; + delete rl; return 3; - } + } tpcl->LoadHits("READ"); tpcl->LoadDigits("recreate"); TStopwatch timer; timer.Start(); - // uncomment below lines to set sectors active + // uncomment below lines to set sectors active // Int_t sec[10]={0,1,2,3,4,5,6,7,8,9}; // TPC->SetActiveSectors(sec,10); - for(Int_t eventn =0;eventnGetEvent(eventn); + for (Int_t i=0; iGetEvent(i); TPC->SetActiveSectors(); // all sectors set active - for (Int_t i=0;i<72;i++) if (TPC->IsSectorActive(i)) printf("%d\t",i); - TPC->Hits2Digits(eventn); + TPC->Hits2Digits(i); } delete rl; @@ -63,5 +65,5 @@ Int_t AliTPCHits2Digits(Int_t nevent=1) timer.Print(); return 0; -}; +}