1 Int_t AliITSHitsToSDigitsDefault(const char *inFile="galice.root"){
2 /////////////////////////////////////////////////////////////////////////
3 // This macro is a small example of a ROOT macro
4 // illustrating how to read the output of GALICE
5 // and do some analysis.
7 /////////////////////////////////////////////////////////////////////////
9 // Dynamically link some shared libs
10 if (gClassTable->GetID("AliRun") < 0) {
11 gROOT->LoadMacro("loadlibs.C");
15 // Connect the Root Galice file containing Geometry, Kine and Hits
17 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile);
18 if (file) {file->Close(); delete file;}
19 cout << "AliITSHits2SDigitsDefault" << endl;
20 file = new TFile(inFile,"UPDATE");
21 if (!file->IsOpen()) {
22 cerr<<"Can't open "<<inFile<<" !" << endl;
27 // Get AliRun object from file or create it if not on file
28 if (gAlice) delete gAlice;
29 gAlice = (AliRun*)file->Get("gAlice");
31 cerr << "AliITSITSHits2Digits.C : AliRun object not found on file"
37 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
39 cerr<<"AliITSHits2DigitsDefault.C : AliITS object not found on file"
43 if(!(ITS->GetITSgeom())){
44 cerr << " AliITSgeom not found. Can't digitize with out it." << endl;
49 cout << "Having to create the SDigits Tree." << endl;
50 gAlice->MakeTree("S");
51 } // end if !gAlice->TreeS()
54 ITS->SetTreeAddress();
56 cout<<"SDigitizing ITS..." << endl;
59 Long_t size0 = file->GetSize();
61 for (Int_t nev=evNumber1; nev<= evNumber2; nev++) {
62 cout << "nev " <<nev<<endl;
64 gAlice->SetEvent(nev);
65 if(!gAlice->TreeD()) gAlice->MakeTree("D");
68 if (nev < evNumber1) continue;
70 ITS->HitsToDigits(nev,0,-1," ","All"," ");
71 timer.Stop(); timer.Print();
74 delete gAlice; gAlice=0;
76 Long_t size1 = file->GetSize();
77 cout << "File size before = " << size0 << " file size after = " << size1;
78 cout << "Increase in file size is " << size1-size0 << " Bytes" << endl;