126 |
|
|
127 |
|
for(unsigned int i=0;i<Det.size();i++){ |
128 |
|
DetId Detid = Det[i]->geographicalId(); |
129 |
< |
int SubDet = Detid.subdetId(); |
130 |
< |
|
131 |
< |
StripGeomDetUnit* DetUnit = dynamic_cast<StripGeomDetUnit*> (Det[i]); |
129 |
> |
// int SubDet = Detid.subdetId(); |
130 |
> |
|
131 |
> |
GeomDet* DetUnit = Det[i]; |
132 |
> |
// StripGeomDetUnit* DetUnit = dynamic_cast<StripGeomDetUnit*> (Det[i]); |
133 |
|
if(!DetUnit)continue; |
134 |
|
|
135 |
+ |
const BoundPlane plane = DetUnit->surface(); |
136 |
+ |
float width = DetUnit->surface().bounds().width(); |
137 |
+ |
float length = DetUnit->surface().bounds().length(); |
138 |
+ |
float thickness = DetUnit->surface().bounds().thickness(); |
139 |
+ |
|
140 |
+ |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
141 |
+ |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
142 |
+ |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
143 |
+ |
|
144 |
+ |
|
145 |
|
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
146 |
|
|
147 |
< |
Geom->Add_TrackerDet(SubDet,Pos.x(),Pos.y(),Pos.z(),Detid.rawId()); |
147 |
> |
Geom->Add_TrackerDet(Detid.rawId(), |
148 |
> |
Pos.x(), Pos.y(), Pos.z(), |
149 |
> |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
150 |
> |
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
151 |
> |
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
152 |
|
} |
153 |
|
Geom->Save("Tracker.geom"); |
154 |
|
|