1 #if !defined(__CINT__) || defined(__MAKECINT__)
5 #include "STEER/AliRun.h"
6 #include "STEER/AliRunDigitizer.h"
7 #include "ITS/AliITSDigitizer.h"
8 #include "ITS/AliITS.h"
9 #include "ITS/AliITSDetType.h"
10 #include "ITS/AliITSresponseSDD.h"
11 #include "TStopwatch.h"
15 Int_t AliITSHits2SDigits(TString filename = "galice.root")
17 // Standeard ITS Hits to SDigits.
19 // Dynamically link some shared libs
20 if (gClassTable->GetID("AliRun") < 0) {
21 gROOT->LoadMacro("loadlibs.C");
24 delete gAlice->GetRunLoader();
29 // Connect the Root Galice file containing Geometry, Kine and Hits
31 AliRunLoader* rl = AliRunLoader::Open(filename);
34 cerr<<"AliITSHits2DigitsDefault.C : Can not open session RL=NULL"
39 Int_t retval = rl->LoadgAlice();
42 cerr<<"AliITSHits2DigitsDefault.C : LoadgAlice returned error"
46 gAlice=rl->GetAliRun();
47 AliLoader* gime = rl->GetLoader("ITSLoader");
50 cerr<<"AliITSHits2DigitsDefault.C : can not get ITS loader"
53 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
55 cerr<<"AliITSHits2DigitsDefault.C : AliITS object not found on file"
59 if(!(ITS->GetITSgeom())){
60 cerr << " AliITSgeom not found. Can't digitize with out it." << endl;
66 Int_t evNumber2 = gAlice->GetEventsPerRun();
68 retval = gime->LoadHits();
71 cerr<<"AliITSHits2DigitsDefault.C : ITSLoader::LoadHits returned error"
75 retval = gime->LoadSDigits("recreate");
78 cerr<<"AliITSHits2DigitsDefault.C : ITSLoader::LoadSDigits returned error"
82 for(Int_t event = evNumber1; event < evNumber2; event++){
85 cout << "Having to create the SDigits Tree." << endl;
90 ITS->SetTreeAddress();
91 cout<<"Making ITS SDigits for event "<<event<<endl;
97 delete rl; // sdigfile is closed by deleting gAlice if != hitfile.