{
  gSystem->Load("libGeom.so");
  new TGeoManager();
  gGeoManager->Import("geometry.root");
  gGeoManager->CloseGeometry();
//Print out global positions of the TSPA sensors
 for (Int_t plNo = 1; plNo<=6; plNo++){
   for(Int_t padNo = 1; padNo<=6; padNo++){
     Int_t i = (plNo-1)*6+padNo;
     TString path = "/PAME_1/SPEB";
     if(plNo<=5){ 
       path+="_1/MGF";
       path += plNo;
     }
     path +="_1/TRP";
     path += plNo;
     path +="_1/TPA";
     path += plNo;
     path +="_";
     path += plNo;
     path +="/TRSL_";
     path += i;
     //cout<<"changing path to "<<path<<endl;
     gGeoManager->cd(path);
     Double_t master[3];
     Double_t local[3];

     for (Int_t j=0; j<3; ++j) local[j] = (Double_t)0.;

     Double_t * m = &master[0];
     Double_t * l = &local[0];
     
     gGeoManager->LocalToMaster(l,m);
     
     cout<<"TSPA_"<<i<<" x,y,z,"<<master[0]<<","<<master[1]<<","<<master[2]<<","<<endl;
     gGeoManager->GetCurrentNode()->GetMatrix()->Print();
     
   }
 }
}
