]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDdigits2cluster.C
Coding conventions
[u/mrichter/AliRoot.git] / TRD / AliTRDdigits2cluster.C
CommitLineData
fa148e6c 1void AliTRDdigits2cluster()
2{
3
4/////////////////////////////////////////////////////////////////////////
5//
6// Creates cluster from the digit information.
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 // Input and output file names
18 Char_t *infile = "galice.root";
687fbf4a 19 Char_t *outfile = "AliTRDclusters.root";
fa148e6c 20
21 // Create the clusterizer
22 AliTRDclusterizerV1 *clusterizer =
23 new AliTRDclusterizerV1("clusterizer","Clusterizer class");
24
fd621f36 25 // Read the parameter
26 TFile *parfile = TFile::Open(infile);
27 AliTRDparameter *par = (AliTRDparameter *) parfile->Get("TRDparameter");
28 par->ReInit();
29 clusterizer->SetParameter(par);
30
31 // Set the parameter
32 clusterizer->SetVerbose(1);
fa148e6c 33
890031ed 34 //Number of events
35 TTree * te = (TTree*)parfile->Get("TE");
36 Int_t nev = (Int_t)te->GetEntries();
fa148e6c 37
890031ed 38 for(Int_t iev=0;iev<nev;iev++) {
fd621f36 39
890031ed 40 // Open the AliRoot file
41 clusterizer->Open(infile,iev);
42 //clusterizer->Open(infile,outfile,0);
43
44
45 // Load the digits
46 clusterizer->ReadDigits();
47 clusterizer->Dump();
fa148e6c 48
890031ed 49 // Find the cluster
50 clusterizer->MakeClusters();
fa148e6c 51
890031ed 52 // Write the cluster tree into file AliTRDclusters.root
53 clusterizer->WriteClusters(-1);
fa148e6c 54
890031ed 55 }
fa148e6c 56 // Save the clusterizer class in the AliROOT file
57 // clusterizer->Write();
58
59}