1 Int_t AliITSHitsToDigitsDefault(Int_t evNumber1=0,Int_t evNumber2=0,
2 const char *inFile="galice.root"){
3 /////////////////////////////////////////////////////////////////////////
4 // This macro is a small example of a ROOT macro
5 // illustrating how to read the output of GALICE
6 // and do some analysis.
8 /////////////////////////////////////////////////////////////////////////
10 // Dynamically link some shared libs
11 if (gClassTable->GetID("AliRun") < 0) {
12 gROOT->LoadMacro("loadlibs.C");
16 // Connect the Root Galice file containing Geometry, Kine and Hits
18 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile);
19 if (file) {file->Close(); delete file;}
20 cout << "AliITSHitsToDigitsDefault" << endl;
21 file = new TFile(inFile,"UPDATE");
22 if (!file->IsOpen()) {
23 cerr<<"Can't open "<<inFile<<" !" << endl;
28 // Get AliRun object from file or return if not on file
29 if (gAlice) delete gAlice;
30 gAlice = (AliRun*)file->Get("gAlice");
32 cerr << "AliITSITSHits2Digits.C : AliRun object not found on file"
38 AliITS *ITS = (AliITS*) gAlice->GetDetector("ITS");
40 cerr << "ITS not found in gAlice. Exiting." << endl;
43 if(!(ITS->GetITSgeom())){
44 cerr << " AliITSgeom not found. Can't digitize with out it." << endl;
49 cout << "Having to create the Digits Tree." << endl;
50 gAlice->MakeTree("D");
51 } // end if !gAlice->TreeD()
54 ITS->SetTreeAddress();
56 cout<<"Digitizing ITS..." << endl;
58 Long_t size0 = file->GetSize();
60 for (Int_t nev=evNumber1; nev<= evNumber2; nev++) {
61 cout << "nev " <<nev<<endl;
63 gAlice->SetEvent(nev);
64 if(!gAlice->TreeD()) gAlice->MakeTree("D");
67 if (nev < evNumber1) continue;
69 ITS->HitsToDigits(nev,0,-1," ","All"," ");
70 timer.Stop(); timer.Print();
73 delete gAlice; gAlice=0;
75 Long_t size1 = file->GetSize();
76 cout << "File size before = " << size0 << " file size after = " << size1;
77 cout << "Increase in file size is " << size1-size0 << " Bytes" << endl;