3 /////////////////////////////////////////////////////////////////////////
5 // Creates the digits from the hit information. An additional hit-tree
6 // is added to the input file.
8 /////////////////////////////////////////////////////////////////////////
10 // Dynamically link some shared libs
11 if (gClassTable->GetID("AliRun") < 0) {
12 gROOT->LoadMacro("loadlibs.C");
16 // Input (and output) file name
17 Char_t *alifile = "galice_v1.root";
22 // Connect the AliRoot file containing Geometry, Kine, and Hits
23 TFile *gafl = (TFile*) gROOT->GetListOfFiles()->FindObject(alifile);
25 cout << "Open the ALIROOT-file " << alifile << endl;
26 gafl = new TFile(alifile,"UPDATE");
29 cout << alifile << " is already open" << endl;
32 // Get AliRun object from file or create it if not on file
34 gAlice = (AliRun*) gafl->Get("gAlice");
36 cout << "AliRun object found on file" << endl;
38 gAlice = new AliRun("gAlice","Alice test program");
41 // Import the Trees for the event nEvent in the file
42 Int_t nparticles = gAlice->GetEvent(nEvent);
43 if (nparticles <= 0) break;
45 // Get the pointer to the detector class
46 AliTRDv2 *TRD = (AliTRDv2*) gAlice->GetDetector("TRD");
48 // Create the digitd and fill the digits-tree
51 // Write the new tree into the input file
52 cout << "Entries in hit tree = " << gAlice->TreeD()->GetEntries()) << endl;
54 sprintf(treeName,"TreeD%d",nEvent);
55 gAlice->TreeD()->Write(treeName);