Using getter instead of global constant
[u/mrichter/AliRoot.git] / TRD / AliTRDsdigits2digits.C
CommitLineData
fa148e6c 1void AliTRDsdigits2digits()
2{
3
4 /////////////////////////////////////////////////////////////////////////
5 //
6 // Converts s-digits to normal digits
7 //
8 /////////////////////////////////////////////////////////////////////////
9
10 // Dynamically link some shared libs
11 if (gClassTable->GetID("AliRun") < 0) {
12 gROOT->LoadMacro("loadlibs.C");
13 loadlibs();
14 cout << "Loaded shared libraries" << endl;
15 }
16
17 Char_t *fileName = "galice.root";
18
19 // Create the TRD digits merger
20 AliTRDdigitizer *digitizer = new AliTRDdigitizer("TRDdigitizer"
21 ,"TRD digitizer class");
22
23 // Set the parameter
24 digitizer->SetDebug(1);
25
26 // Initialize the geometry
27 digitizer->Open(fileName);
28
f5a857b2 29 AliRunLoader* rl = AliRunLoader::GetRunLoader(AliConfig::GetDefaultEventFolderName());
88cb7938 30 AliLoader* loader = rl->GetLoader("TRDLoader");
fa148e6c 31 // Define the parameter object
32 // If no external parameter object is defined,
33 // default parameter will be used
88cb7938 34 AliTRDparameter *parameter = new AliTRDparameter("TRDparameter","TRD parameter class");
fa148e6c 35 digitizer->SetParameter(parameter);
36
37 // Create the digits manager for the input s-digits
38 AliTRDdigitsManager *sdigitsManager = new AliTRDdigitsManager();
39 sdigitsManager->SetDebug(1);
40 sdigitsManager->SetSDigits(kTRUE);
88cb7938 41 if (loader->TreeS() == 0x0) loader->LoadSDigits();
42
43 sdigitsManager->ReadDigits(loader->TreeS());
fa148e6c 44 // Add the s-digits to the input list
45 digitizer->AddSDigitsManager(sdigitsManager);
46
47 // Convert the s-digits to normal digits
48 digitizer->SDigits2Digits();
49
50 // Store the digits
51 digitizer->WriteDigits();
52
53 // Save the parameter object in the AliROOT file
88cb7938 54
55 rl->CdGAFile();
fa148e6c 56 parameter->Write();
57
58}