6 #include "G4LogicalVolume.hh"
23 static const std::string
prefix = strDetector.empty() ?
"" : strDetector+
"::";
25 prefix+
"LAr::EMB::ThinAbs::Straight");
27 for (
int stackid=0; stackid<14; stackid++) {
28 for (
int cellid=0; cellid<1024; cellid++) {
31 const double slant =
SlantAbs(pva, stackid,cellid);
32 sincos(slant, &
m_sinu[cellid][stackid], &
m_cosu[cellid][stackid]);
39 const int id=cellid+stackid*10000;
46 const G4ThreeVector& tv=
pv->GetTranslation();
49 m_xcent[cellid][stackid] = tv.x();
50 m_ycent[cellid][stackid] = tv.y();
53 const G4ThreeVector& tv2=pv2->GetTranslation();
54 const G4LogicalVolume* lv =
pv->GetLogicalVolume();
55 const G4Trap* trap = (G4Trap*) lv->GetSolid();
56 const G4LogicalVolume* lv2 = pv2->GetLogicalVolume();
57 const G4Trap* trap2 = (G4Trap*) lv2->GetSolid();
58 const double xl1=trap->GetYHalfLength1();
59 const double xl2=trap2->GetYHalfLength1();
60 m_xcent[cellid][stackid] = (tv.x()*xl1+tv2.x()*xl2)/(xl1+xl2);
61 m_ycent[cellid][stackid] = (tv.y()*xl1+tv2.y()*xl2)/(xl1+xl2);
68 const int id=cellid+stackid*10000;
71 const G4RotationMatrix *rm=
pv->GetRotation();
74 if((stackid%2 == (1-
m_parity)) && (rm->phiY() < 0)) Slant = - Slant;
81 const int id=cellid+stackid*10000;
84 const G4LogicalVolume* lv =
pv->GetLogicalVolume();
85 const G4Trap* trap = (G4Trap*) lv->GetSolid();
87 if (!pv2)
l = trap->GetYHalfLength1();
89 const G4LogicalVolume* lv2 = pv2->GetLogicalVolume();
90 const G4Trap* trap2 = (G4Trap*) lv2->GetSolid();
91 l = trap->GetYHalfLength1()+trap2->GetYHalfLength1();