Non-buffering readers implemented, proper changes in analysis. Compiler warnings...
[u/mrichter/AliRoot.git] / ITS / AliITSPrintGeom.C
CommitLineData
7f7b1c24 1void AliITSPrintGeom(TString hfn="galice.root",Int_t mod=-1){
2 // Macro to print out the information kept in the AliITSgeom class, for
3 //all or a specific module
4
5 // Dynamically link some shared libs
6 if (gClassTable->GetID("AliRun") < 0) {
7 gROOT->LoadMacro("loadlibs.C");
8 loadlibs();
d2e7afa1 9 }
10 else {
11 if(gAlice){
12 delete gAlice->GetRunLoader();
13 delete gAlice;
14 gAlice=0;
15 }
16 }
7f7b1c24 17
d2e7afa1 18 AliRunLoader* rl = AliRunLoader::Open(hfn.Data());
19 if (rl == 0x0){
20 cerr<<"AliITSPrintGeom.C : Can not open session RL=NULL"<< endl;
21 return;
22 }
23
24 Int_t retval = rl->LoadgAlice();
25 if (retval)
26 {
27 cerr<<"AliITSHits2SDigits.C : LoadgAlice returned error"
28 << endl;
29 return 3;
30 }
31 // gAlice=rl->GetAliRun();
32 if(!gAlice){
33 cerr<<"AliITSPrintGeom.C. AliRun object not found\n";
34 return;
35 }
7f7b1c24 36
7f7b1c24 37 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
38 if(!ITS){
39 cout << "Error: no ITS found. Aborting"<<endl;
40 return;
41 } // end if !ITS
d2e7afa1 42
7f7b1c24 43 AliITSgeom *gm = ITS->GetITSgeom();
44 Int_t mod1 = 0;
45 Int_t mod2 = gm->GetIndexMax();
46 if(mod>=0){
47 mod1 = mod;
d2e7afa1 48 mod2 = mod+1;
7f7b1c24 49 } // end if mod>=0
50 AliITSgeomMatrix *gmm = gm->GetGeomMatrix(0);
51 Int_t m;
d2e7afa1 52 cout<<endl<<endl<<"====================================\n";
7f7b1c24 53 gmm->PrintComment(&cout); cout << endl;
d2e7afa1 54 cout<<endl<<endl<<"====================================\n";
7f7b1c24 55 for(m=mod1;m<mod2;m++){
56 gmm = gm->GetGeomMatrix(m);
57 gmm->Print(&cout); cout << endl;
58 } // end for m
59}