1 Int_t AliITSHits2SDigits(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;
20 if(!file) file = new TFile(fileNameSDigitsSig.Data());
21 TDatime *ct0 = new TDatime(2002,04,26,00,00,00), ct = file->GetCreationDate();
23 // Get AliRun object from file or return if not on file
24 if (gAlice) delete gAlice;
25 gAlice = (AliRun*)file->Get("gAlice");
27 cerr << "AliITSITSHits2Digits.C : AliRun object not found on file"
33 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
35 cerr<<"AliITSHits2DigitsDefault.C : AliITS object not found on file"
39 if(!(ITS->GetITSgeom())){
40 cerr << " AliITSgeom not found. Can't digitize with out it." << endl;
44 if(ct0->GetDate()>ct.GetDate()){
45 // For old files, must change SDD noise.
46 AliITS *ITS = (AliITS*) gAlice->GetDetector("ITS");
47 AliITSresponseSDD *resp1 = ITS->DetType(1)->GetResponseModel();
48 resp1->SetNoiseParam();
49 resp1->SetNoiseAfterElectronics();
52 resp1->GetNoiseParam(n,b);
53 n = resp1->GetNoiseAfterElectronics();
56 cPar[2]=(Int_t)(b + 2.*n + 0.5);
57 cPar[3]=(Int_t)(b + 2.*n + 0.5);
62 resp1->SetCompressParam(cPar);
66 cout << "Having to create the SDigits Tree." << endl;
67 gAlice->MakeTree("S");
68 } // end if !gAlice->TreeS()
71 ITS->SetTreeAddress();
72 cout << "Digitizing ITS..." << endl;
75 Long_t size0 = file->GetSize();
78 timer.Stop(); timer.Print();
80 delete gAlice; gAlice=0;
82 Long_t size1 = file->GetSize();
83 cout << "File size before = " << size0 << " file size after = " << size1;
84 cout << "Increase in file size is " << size1-size0 << " Bytes" << endl;