char path[255] ;
TGeoHMatrix * m ;
for(Int_t mod=0; mod<5; mod++){
- snprintf(path,255,"/ALIC_1/PHOS_%d",mod+1) ; //In Geometry modules numbered 1,2,.,5
- if (gGeoManager->cd(path)){
+ snprintf(path,255,"/ALIC_1/PHOS_%d",mod+1) ; //In Geometry modules numbered 1,2,.,5 without CPV
+ if (gGeoManager->CheckPath(path)){
+ gGeoManager->cd(path) ;
m = gGeoManager->GetCurrentMatrix() ;
esd->SetPHOSMatrix(new TGeoHMatrix(*m),mod) ;
}
else{
- esd->SetPHOSMatrix(NULL,mod) ;
+ snprintf(path,255,"/ALIC_1/PHOC_%d",mod+1) ; //In Geometry modules numbered 1,2,3 with CPV
+ if (gGeoManager->CheckPath(path)){
+ gGeoManager->cd(path) ;
+ m = gGeoManager->GetCurrentMatrix() ;
+ esd->SetPHOSMatrix(new TGeoHMatrix(*m),mod) ;
+ }
+ else{
+ snprintf(path,255,"/ALIC_1/PHOH_%d",mod+1) ; //In Geometry modules numbered 1,2,.,5
+ if (gGeoManager->CheckPath(path)){
+ gGeoManager->cd(path) ;
+ m = gGeoManager->GetCurrentMatrix() ;
+ esd->SetPHOSMatrix(new TGeoHMatrix(*m),mod) ;
+ }
+ else{
+ esd->SetPHOSMatrix(NULL,mod) ;
+ }
+ }
}
}