61 |
|
#include "DataFormats/TrackReco/interface/Track.h" |
62 |
|
|
63 |
|
#include "DataFormats/Math/interface/Point3D.h" |
64 |
< |
|
64 |
> |
#include "DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h" |
65 |
> |
#include "DataFormats/GeometrySurface/interface/RectangularPlaneBounds.h" |
66 |
|
|
67 |
|
#include "Visualisation/OpenGLDisplayer/interface/SimEvent.h" |
68 |
|
#include "Visualisation/OpenGLDisplayer/interface/Geometry.h" |
127 |
|
|
128 |
|
for(unsigned int i=0;i<Det.size();i++){ |
129 |
|
DetId Detid = Det[i]->geographicalId(); |
130 |
< |
int SubDet = Detid.subdetId(); |
131 |
< |
|
132 |
< |
StripGeomDetUnit* DetUnit = dynamic_cast<StripGeomDetUnit*> (Det[i]); |
130 |
> |
// int SubDet = Detid.subdetId(); |
131 |
> |
|
132 |
> |
GeomDet* DetUnit = Det[i]; |
133 |
|
if(!DetUnit)continue; |
134 |
+ |
const BoundPlane plane = DetUnit->surface(); |
135 |
+ |
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds()))); |
136 |
+ |
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds()))); |
137 |
+ |
|
138 |
+ |
float width; |
139 |
+ |
float length; |
140 |
+ |
float thickness; |
141 |
+ |
float TrapezoidalParam; |
142 |
+ |
|
143 |
+ |
if(trapezoidalBounds) |
144 |
+ |
{ |
145 |
+ |
std::vector<float> const & parameters = (*trapezoidalBounds).parameters(); |
146 |
+ |
width = parameters[0]*2; |
147 |
+ |
length = parameters[3]*2; |
148 |
+ |
thickness = (*trapezoidalBounds).thickness(); |
149 |
+ |
TrapezoidalParam = parameters[1]/parameters[0]; |
150 |
+ |
}else if(rectangularBounds){ |
151 |
+ |
width = DetUnit->surface().bounds().width(); |
152 |
+ |
length = DetUnit->surface().bounds().length(); |
153 |
+ |
thickness = DetUnit->surface().bounds().thickness(); |
154 |
+ |
TrapezoidalParam = 1; |
155 |
+ |
} |
156 |
+ |
|
157 |
+ |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) ); |
158 |
+ |
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) ); |
159 |
+ |
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) ); |
160 |
|
|
161 |
|
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
162 |
|
|
163 |
< |
Geom->Add_TrackerDet(SubDet,Pos.x(),Pos.y(),Pos.z(),Detid.rawId()); |
163 |
> |
Geom->Add_TrackerDet(Detid.rawId(), TrapezoidalParam, |
164 |
> |
Pos.x(), Pos.y(), Pos.z(), |
165 |
> |
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
166 |
> |
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
167 |
> |
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z()); |
168 |
> |
|
169 |
> |
|
170 |
|
} |
171 |
|
Geom->Save("Tracker.geom"); |
172 |
|
|