]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/slowClusterCreate.C
Make also RALICE doc
[u/mrichter/AliRoot.git] / TRD / slowClusterCreate.C
CommitLineData
5c7f4665 1{
2
3/////////////////////////////////////////////////////////////////////////
4//
5// Creates cluster from the digit information. An additional hit-tree
6// is added to the input file.
7//
8/////////////////////////////////////////////////////////////////////////
9
10 // Dynamically link some shared libs
11 if (gClassTable->GetID("AliRun") < 0) {
12 gROOT->LoadMacro("loadlibs.C");
13 loadlibs();
14 }
15
16 // Input (and output) file name
17 Char_t *alifile = "galice_c_v1.root";
18
19 // Event number
20 Int_t nEvent = 0;
21
22 // Connect the AliRoot file containing Geometry, Kine, Hits, and Digits
23 TFile *gafl = (TFile*) gROOT->GetListOfFiles()->FindObject(alifile);
24 if (!gafl) {
25 cout << "Open the ALIROOT-file " << alifile << endl;
26 gafl = new TFile(alifile,"UPDATE");
27 }
28 else {
29 cout << alifile << " is already open" << endl;
30 }
31
32 // Get AliRun object from file or create it if not on file
33 if (!gAlice) {
34 gAlice = (AliRun*) gafl->Get("gAlice");
35 if (gAlice)
36 cout << "AliRun object found on file" << endl;
37 else
38 gAlice = new AliRun("gAlice","Alice test program");
39 }
40
41 // Import the Trees for the event nEvent in the file
42 Int_t nparticles = gAlice->GetEvent(nEvent);
43 if (nparticles <= 0) break;
44
45 // Get the pointer to the detector classes
46 AliTRDv1 *TRD = (AliTRDv1*) gAlice->GetDetector("TRD");
47
48 // Create the clusters
49 TRD->Digits2Clusters();
50
51 // Write the new tree into the input file
52 cout << "Entries in digits tree = " << gAlice->TreeD()->GetEntries() << endl;
53 Char_t treeName[7];
54 sprintf(treeName,"TreeD%d",nEvent);
55 gAlice->TreeD()->Write(treeName);
56
57}