Transition to newIO
[u/mrichter/AliRoot.git] / ITS / AliITSstandard.C
CommitLineData
d2e7afa1 1// Functions used to access input files - shared by several macros
2
8d8f0259 3//______________________________________________________________________
4Bool_t GaliceITSok(){
5 // Checks gAlice to see that ITS and the ITS geometry are properly
6 // defined. If not return kFALSE and deletes gAlice and set it to zero.
7
8 if(!gAlice){
9 return kFALSE;
10 } // end if !gAlice
11 // gAlice defined check to see if ITS is properly defined.
12 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
13 if(!ITS){ // ITS not defined, delete and reload gAlice
14 delete gAlice;
15 gAlice = 0;
16 return kFALSE;
17 } // end if !ITS
18 // ITS defined
19 if(!(ITS->GetITSgeom())){
20 delete gAlice;
21 gAlice = 0;
22 return kFALSE;
23 } // end if !(ITS->GetITSgeom())
24 // ITS and ITS geometry properly defined defined.
25 return kTRUE;
26}
27//______________________________________________________________________
d2e7afa1 28AliRunLoader* AccessFile(TString FileName){
29 // Function used to open the input file and fetch the AliRun object
30
31 AliRunLoader* rl = AliRunLoader::Open(FileName.Data());
32 if (rl == 0x0){
33 cerr<<"AccessFile : Can not open session RL=NULL"<< endl;
34 return rl;
35 }
36
37 Int_t retval = rl->LoadgAlice();
38 if (retval){
39 cerr<<"AccessFile : LoadgAlice returned error"<<endl;
40 return rl;
41 }
42 return rl;
8d8f0259 43}
8d8f0259 44