1 Int_t AliITSHits2DigitsDefault(const char *inFile = "galice.root"){
2 ////////////////////////////////////////////////////////////////////
3 // This macro will take hits from a galice.root file and
4 // produce digits for the ITS using the standard detector
5 // simulations. It will measure the time required to do so and the
6 // increase in the galice.root file. There is only one input, that
7 // of the name of the root file containing the hits and to which the
8 // digits will be written to. This macro will process all of the
9 // events on the root file.
10 ////////////////////////////////////////////////////////////////////
12 // Dynamically link some shared libs
13 if (gClassTable->GetID("AliRun") < 0) {
14 gROOT->LoadMacro("loadlibs.C");
18 // Connect the Root Galice file containing Geometry, Kine and Hits
20 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject(inFile);
21 if (file) {file->Close(); delete file;}
22 cout << "AliITSHits2DigitsDefault" << endl;
23 file = new TFile(inFile,"UPDATE");
24 if (!file->IsOpen()) {
25 cerr<<"Can't open "<<inFile<<" !" << endl;
30 // Get AliRun object from file or return if not on file
31 if (gAlice) delete gAlice;
32 gAlice = (AliRun*)file->Get("gAlice");
34 cerr << "AliITSITSHits2Digits.C : AliRun object not found on file"
39 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
41 cerr<<"ITSHits2Digits.C : AliITS object not found on file" << endl;
44 if(!(ITS->GetITSgeom())){
45 cerr << " AliITSgeom not found. Can't digitize with out it." << endl;
48 cout << "Digitizing ITS..." << endl;
51 Long_t size0 = file->GetSize();
53 gAlice->Hits2Digits("ITS");
54 timer.Stop(); timer.Print();
57 Long_t size1 = file->GetSize();
58 cout << "File size before = " << size0 << " file size after = " << size1;
59 cout << "Increase in file size is " << size1-size0 << " Bytes" << endl;