47{
49 Int_t vnb = (
fDetectorID - statnb*10000000)/1000000;
50 Int_t pnb = (
fDetectorID- statnb*10000000 - vnb*1000000)/100000;
51 Int_t lnb = (
fDetectorID - statnb*10000000 - vnb*1000000 - pnb*100000)/10000;
52 TString stat = "Tr";stat+=+statnb;stat+="_";stat+=statnb;
53 if (statnb==5){stat="Veto_5";}
54 TString view;
55 switch (vnb) {
56 case 0:
57 view = "_x1";
58 if (statnb==5){view = "_x";}
59 break;
60 case 1:
61 view = "_u";
62 break;
63 case 2:
64 view = "_v";
65 break;
66 case 3:
67 view = "_x2";
68 break;
69 default:
70 view = "_x1";}
71 TGeoNavigator*
nav = gGeoManager->GetCurrentNavigator();
73 if (statnb==5){
prefix=
"Veto";}
76 TString plane =
prefix;plane+=statnb;plane+=vnb;plane+=+pnb;plane+=
"00000";
77 TString layer =
prefix+
"layer_";layer+=lnb;layer+=
"_";layer+=statnb;layer+=vnb;layer+=pnb;layer+=lnb;layer+=
"0000";
78 TString wire = "wire_";
79 if (statnb==5){wire+="veto_";}
81 if (statnb<3){wire =
"wire_12_";wire+=(
fDetectorID+1000);}
83 Bool_t
rc =
nav->cd(path);
84 if (not rc){
85 cout <<
"strawtubes::StrawDecode, TgeoNavigator failed "<<
path<<endl;
86 return;
87 }
88 TGeoNode* W =
nav->GetCurrentNode();
89 TGeoTube*
S =
dynamic_cast<TGeoTube*
>(W->GetVolume()->GetShape());
90 Double_t
top[3] = {0,0,
S->GetDZ()};
91 Double_t bot[3] = {0,0,-
S->GetDZ()};
92 Double_t Gtop[3],Gbot[3];
93 nav->LocalToMaster(top, Gtop);
nav->LocalToMaster(bot, Gbot);
94 vtop.SetXYZ(Gtop[0],Gtop[1],Gtop[2]);
95 vbot.SetXYZ(Gbot[0],Gbot[1],Gbot[2]);
96}