1 void 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.
5 // TString hfn input file name
6 // Int_t mod The specific module to print out transformations for.
7 // if mod<0, does all modules.
13 // Dynamically link some shared libs
14 if (gClassTable->GetID("AliRun") < 0) {
15 gROOT->LoadMacro("loadlibs.C");
19 delete AliRunLoader::Instance();
23 } // end if aliroot or not.
25 AliRunLoader* rl = AliRunLoader::Open(hfn.Data());
27 cerr<<"AliITSPrintGeom.C : Can not open session RL=NULL"<< endl;
31 Int_t retval = rl->LoadgAlice();
33 cerr<<"AliITSHits2SDigits.C : LoadgAlice returned error"<< endl;
35 } // end if loader error
37 cerr<<"AliITSPrintGeom.C. AliRun object not found\n";
39 } // end if no gAlice error
41 AliITS *ITS = (AliITS*)gAlice->GetDetector("ITS");
43 cout << "Error: no ITS found. Aborting"<<endl;
47 AliITSgeom *gm = ITS->GetITSgeom();
49 Int_t mod2 = gm->GetIndexMax();
54 AliITSgeomMatrix *gmm = gm->GetGeomMatrix(0);
57 cout<<endl<<endl<<"====================================\n";
58 if(mod<-1){ gmm->PrintComment(&cout); cout << endl;}
59 cout<<endl<<endl<<"====================================\n";
60 for(m=mod1;m<mod2;m++){
61 gm->GetModuleId(m,lay,lad,det);
62 gmm = gm->GetGeomMatrix(m);
63 gmm->GetTranslation(xyz);
64 rcyl = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
69 cout << "module="<<m<<" "<<lay<<" "<<lad<<" "<<det;
70 cout << " Rcyl="<<rcyl<<" cm"<<endl;