1 #if !defined(__CINT__) || defined(__MAKECINT__)
5 #include "TClassTable.h"
7 #include "AliRunDigitizer.h"
8 #include "AliITSDigitizer.h"
10 #include "AliITSDetType.h"
11 #include "AliITSLoader.h"
12 #include "AliITSresponseSDD.h"
13 #include "TStopwatch.h"
17 Int_t AliITSHits2SDigits(TString filename = "galice.root")
19 // Standard ITS Hits to SDigits.
21 // Dynamically link some shared libs
22 if (gClassTable->GetID("AliRun") < 0) {
23 gROOT->ProcessLine(".x $(ALICE_ROOT)/macros/loadlibs.C");
25 delete AliRunLoader::Instance();
30 // Connect the Root Galice file containing Geometry, Kine and Hits
32 AliRunLoader* rl = AliRunLoader::Open(filename);
35 cerr<<"AliITSHits2SDigits.C : Can not open session RL=NULL"
40 Int_t retval = rl->LoadgAlice();
43 cerr<<"AliITSHits2SDigits.C : LoadgAlice returned error"
47 gAlice=rl->GetAliRun();
48 AliITSLoader* gime = (AliITSLoader*) rl->GetLoader("ITSLoader");
51 cerr<<"AliITSHits2SDigits.C : can not get ITS loader"
54 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
56 cerr<<"AliITSHits2SDigits.C : AliITS object not found on file"
60 if(!(ITS->GetITSgeom())){
61 cerr << " AliITSgeom not found. Can't digitize without it." << endl;
67 Int_t evNumber2 = AliRunLoader::GetNumberOfEvents();
69 retval = gime->LoadHits();
72 cerr<<"AliITSHits2SDigits.C : ITSLoader::LoadHits returned error"
76 retval = gime->LoadSDigits("recreate");
79 cerr<<"AliITSHits2SDigits.C : ITSLoader::LoadSDigits returned error"
83 for(Int_t event = evNumber1; event < evNumber2; event++){
86 cout << "Having to create the SDigits Tree." << endl;
91 ITS->SetTreeAddress();
92 cout<<"Making ITS SDigits for event "<<event<<endl;
98 delete rl; // sdigfile is closed by deleting gAlice if != hitfile.