Changes in digits IO. Add merging of summable digits
[u/mrichter/AliRoot.git] / TRD / AliTRDcreateDigits.C
CommitLineData
793ff80c 1Int_t AliTRDcreateDigits()
2{
3 //
4 // Creates the digits from the hits of the slow simulator
5 //
6
7 Int_t rc = 0;
8
793ff80c 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
abaf1f1d 17 AliTRDdigitizer *digitizer = new AliTRDdigitizer("digitizer","Digitizer class");
18 digitizer->InitDetector();
793ff80c 19
f9428ca8 20 // Set the parameter (for TRF ~200ns)
abaf1f1d 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);
793ff80c 28
29 // Create the digits
abaf1f1d 30 if (!(digitizer->MakeDigits())) {
6244debe 31 rc = 2;
793ff80c 32 return rc;
33 }
34
e2c86a4a 35 // Write the digits into the input file
abaf1f1d 36 if (!(digitizer->MakeBranch())) {
6244debe 37 rc = 3;
e2c86a4a 38 return rc;
39 }
40
abaf1f1d 41 // Write the digits into the input file
42 if (!(digitizer->WriteDigits())) {
43 rc = 4;
44 return rc;
45 }
46
e2c86a4a 47 // Save the digitizer class in the AliROOT file
abaf1f1d 48 if (!(digitizer->Write())) {
6244debe 49 rc = 4;
e2c86a4a 50 return rc;
51 }
52
793ff80c 53 return rc;
54
55}