1 Int_t AliITSHits2SDigitsDefault(const char *inFile = "galice.root"){
3 // Dynamically link some shared libs
4 if (gClassTable->GetID("AliRun") < 0) {
5 gROOT->LoadMacro("loadlibs.C");
9 // Connect the Root Galice file containing Geometry, Kine and Hits
11 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile);
12 if (file) {file->Close(); delete file;}
13 cout << "AliITSHits2SDigitsDefault" << endl;
14 file = new TFile(inFile,"UPDATE");
15 if (!file->IsOpen()) {
16 cerr<<"Can't open "<<inFile<<" !" << endl;
21 // Get AliRun object from file or return if not on file
22 if (gAlice) delete gAlice;
23 gAlice = (AliRun*)file->Get("gAlice");
25 cerr << "AliITSITSHits2Digits.C : AliRun object not found on file"
31 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
33 cerr<<"AliITSHits2DigitsDefault.C : AliITS object not found on file"
37 if(!(ITS->GetITSgeom())){
38 cerr << " AliITSgeom not found. Can't digitize with out it." << endl;
43 cout << "Having to create the SDigits Tree." << endl;
44 gAlice->MakeTree("S");
45 } // end if !gAlice->TreeS()
48 ITS->SetTreeAddress();
49 cout << "Digitizing ITS..." << endl;
52 Long_t size0 = file->GetSize();
55 timer.Stop(); timer.Print();
57 delete gAlice; gAlice=0;
59 Long_t size1 = file->GetSize();
60 cout << "File size before = " << size0 << " file size after = " << size1;
61 cout << "Increase in file size is " << size1-size0 << " Bytes" << endl;