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"
18 Int_t AliITSHits2Digits(TString inFile = "galice.root"){
19 // Standard ITS Hits to Digits, excluding creation of SDigits.
21 // Dynamically link some shared libs
22 if (gClassTable->GetID("AliRun") < 0) {
23 gROOT->ProcessLine(".x $(ALICE_ROOT)/macros/loadlibs.C");
25 delete gAlice->GetRunLoader();
30 AliRunLoader* rl = AliRunLoader::Open(inFile.Data());
33 cerr<<"AliITSHits2Digits.C : Can not open session RL=NULL"
38 Int_t retval = rl->LoadgAlice();
41 cerr<<"AliITSHits2Digits.C : LoadgAlice returned error"
45 gAlice=rl->GetAliRun();
46 AliITSLoader* gime = (AliITSLoader*)rl->GetLoader("ITSLoader");
49 cerr<<"AliITSHits2Digits.C : can not get ITS loader"
52 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
54 cerr<<"AliITSHits2Digit.C : AliITS object not found on file"
59 if(!(ITS->GetITSgeom())){
60 cerr << " AliITSgeom not found. Can't digitize without it." << endl;
68 Int_t evNumber2 = gAlice->GetEventsPerRun();
70 retval = gime->LoadHits();
73 cerr<<"AliITSHits2Digits.C : ITSLoader::LoadHits returned error"
78 retval = gime->LoadDigits("recreate");
81 cerr<<"AliITSHits2Digits.C : ITSLoader::LoadDigits returned error"
85 for(Int_t nevent = evNumber1; nevent < evNumber2; nevent++){
86 // cout<<"Producing Digits for event n."<<nevent<<endl;
90 cout << "Having to create the Digits Tree." << endl;
92 } // end if creating digits tree
94 ITS->SetTreeAddress();