]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDcreateDigits.C
Latest version
[u/mrichter/AliRoot.git] / TRD / AliTRDcreateDigits.C
1 Int_t AliTRDcreateDigits()
2 {
3   //
4   // Creates the digits from the hits of the slow simulator
5   //
6
7   Int_t rc = 0;
8
9   if (!gAlice) {
10     cout << "<AliTRDcreateDigits> No AliRun object found" << endl;
11     rc = 1;
12     return rc;
13   }
14   gAlice->GetEvent(0);
15
16   // Create the TRD digitzer 
17   AliTRDdigitizer *digitizer = new AliTRDdigitizer("TRDdigitizer","Digitizer class");
18   digitizer->InitDetector();
19
20   // Set the parameter
21   digitizer->SetTailCancelation(0);
22   digitizer->SetADCthreshold(0);
23   digitizer->SetDebug(1);
24
25   // Create the digits
26   if (!(digitizer->MakeDigits())) {
27     rc = 2;
28     return rc;
29   }
30
31   // Write the digits into the input file
32   if (!(digitizer->MakeBranch())) {
33     rc = 3;
34     return rc;
35   }
36
37   // Write the digits into the input file
38   if (!(digitizer->WriteDigits())) {
39     rc = 4;
40     return rc;
41   }
42
43   // Save the digitizer class in the AliROOT file
44   if (!(digitizer->Write())) {
45     rc = 4;
46     return rc;
47   }
48
49   return rc;
50
51 }