X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TRD%2FAliTRDanaDigits.C;h=266d6cb946a7a617a21e80db6ae81288aa97d6e2;hb=88cb7938ca21d4a80991d4e7aa564008c29340f7;hp=81c055cd05994737f31916916c67093d5d8d892c;hpb=7dac99f120274a79fe58e2f0732b77fa8669f0c8;p=u%2Fmrichter%2FAliRoot.git diff --git a/TRD/AliTRDanaDigits.C b/TRD/AliTRDanaDigits.C index 81c055cd059..266d6cb946a 100644 --- a/TRD/AliTRDanaDigits.C +++ b/TRD/AliTRDanaDigits.C @@ -28,26 +28,12 @@ void AliTRDanaDigits() Int_t track; - // Connect the AliRoot file containing Geometry, Kine, Hits, and digits - TFile *gafl = (TFile*) gROOT->GetListOfFiles()->FindObject(alifile); - if (!gafl) { - cout << "Open the ALIROOT-file " << alifile << endl; - gafl = new TFile(alifile); - } - else { - cout << alifile << " is already open" << endl; - } - - // Get AliRun object from file or create it if not on file - gAlice = (AliRun*) gafl->Get("gAlice"); - if (gAlice) - cout << "AliRun object found on file" << endl; - else - gAlice = new AliRun("gAlice","Alice test program"); - - // Import the Trees for the event nEvent in the file - Int_t nparticles = gAlice->GetEvent(nEvent); - if (nparticles <= 0) break; + AliRunLoader* rl = AliRunLoader::Open(alifile); + AliLoader* loader = rl->GetLoader("TRDLoader"); + rl->LoadDigits(); + + rl->LoadgAlice(); + gAlice = rl->GetAliRun(); // Get the pointer to the detector object trd = (AliTRDv1*) gAlice->GetDetector("TRD"); @@ -69,8 +55,8 @@ void AliTRDanaDigits() digitsManager->SetDebug(1); // Read the digits from the file - digitsManager->Open(alifile); - digitsManager->ReadDigits(); + + digitsManager->ReadDigits(loader->TreeD()); // Get the detector number Int_t iDet = 514; @@ -109,5 +95,5 @@ void AliTRDanaDigits() matrix->ProjRow(); matrix->ProjCol(); matrix->ProjTime(); - + delete rl; }