]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDcreateDigits.C
New classes added
[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 (for TRF ~200ns)
21   digitizer->SetGasGain(1600.);
22   digitizer->SetChipGain(8.0);
23   digitizer->SetNoise(1000.);
24   digitizer->SetADCinRange(1000.);
25   digitizer->SetADCoutRange(1023.);
26   digitizer->SetADCthreshold(0);
27   digitizer->SetVerbose(1);
28
29   // Create the digits
30   if (!(digitizer->MakeDigits())) {
31     rc = 2;
32     return rc;
33   }
34
35   // Write the digits into the input file
36   if (!(digitizer->MakeBranch())) {
37     rc = 3;
38     return rc;
39   }
40
41   // Write the digits into the input file
42   if (!(digitizer->WriteDigits())) {
43     rc = 4;
44     return rc;
45   }
46
47   // Save the digitizer class in the AliROOT file
48   if (!(digitizer->Write())) {
49     rc = 4;
50     return rc;
51   }
52
53   return rc;
54
55 }