ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/FastOpenGlDisplayer/src/OpenGLDisplayer.cc
(Generate patch)

Comparing UserCode/FastOpenGlDisplayer/src/OpenGLDisplayer.cc (file contents):
Revision 1.4 by querten, Tue Mar 18 10:52:55 2008 UTC vs.
Revision 1.7 by querten, Fri Mar 21 08:03:08 2008 UTC

# Line 61 | Line 61
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"
# Line 129 | Line 130 | OpenGLDisplayer::beginJob(const edm::Eve
130   //      int    SubDet = Detid.subdetId();
131    
132        GeomDet* DetUnit = Det[i];
132 //      StripGeomDetUnit* DetUnit     = dynamic_cast<StripGeomDetUnit*> (Det[i]);
133        if(!DetUnit)continue;
134
134        const BoundPlane plane = DetUnit->surface();
135 <      float width     = DetUnit->surface().bounds().width();
136 <      float length    = DetUnit->surface().bounds().length();
137 <      float thickness = DetUnit->surface().bounds().thickness();
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];
147 >         length           = parameters[3];  
148 >         thickness        =  (*trapezoidalBounds).thickness();
149 >         TrapezoidalParam = parameters[1]/parameters[0];
150 >
151 >      }else if(rectangularBounds){
152 >         width            = DetUnit->surface().bounds().width();
153 >         length           = DetUnit->surface().bounds().length();
154 >         thickness        = DetUnit->surface().bounds().thickness();
155 >         TrapezoidalParam = 1;
156 >      }
157  
158        Surface::GlobalPoint WidthVector  = plane.toGlobal( LocalPoint(width/2, 0, 0) );
159        Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) );
160        Surface::GlobalPoint ThickVector  = plane.toGlobal( LocalPoint(0, 0, thickness/2) );
161  
144
162        GlobalVector Pos =  GlobalVector(DetUnit->position().basicVector());
163  
164 <      Geom->Add_TrackerDet(Detid.rawId(),
165 <                           Pos.x(),                  Pos.y(),                  Pos.z(),
166 <                           WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(),
167 <                           LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(),
168 <                           ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z());
164 >      Geom->Add_TrackerDet(Detid.rawId(), TrapezoidalParam,
165 >           Pos.x(),                  Pos.y(),                  Pos.z(),
166 >           WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(),
167 >           LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(),
168 >           ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z());
169 >      
170 >
171     }
172     Geom->Save("Tracker.geom");    
173  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines