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.8 by querten, Fri Mar 21 08:41:36 2008 UTC vs.
Revision 1.10 by querten, Fri Mar 21 19:40:46 2008 UTC

# Line 45 | Line 45
45   #include "DataFormats/GeometrySurface/interface/BoundSurface.h"
46   #include "DataFormats/DetId/interface/DetId.h"
47  
48 + #include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h"
49 + #include "Geometry/Records/interface/IdealGeometryRecord.h"
50 + #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
51 + #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
52 + #include "Geometry/EcalBarrelAlgo/interface/EcalBarrelGeometry.h"
53 + #include "Geometry/EcalEndcapAlgo/interface/EcalEndcapGeometry.h"
54 + #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
55 + #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
56 +
57 +
58 +
59   #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
60   #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
61   #include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h"
# Line 117 | Line 128 | OpenGLDisplayer::~OpenGLDisplayer()
128   void
129   OpenGLDisplayer::beginJob(const edm::EventSetup& iSetup)
130   {
131 +   DetId  Detid;
132 +   int    SubDet;
133  
134     MyEvents = new MySimEvents();
135     Geom     = new Geometry();
136  
137     edm::ESHandle<TrackerGeometry> tkGeom;
138     iSetup.get<TrackerDigiGeometryRecord>().get( tkGeom );
139 <   vector<GeomDet*> Det = tkGeom->dets();
139 >   vector<GeomDet*> TrackerDets = tkGeom->dets();
140  
141 <   for(unsigned int i=0;i<Det.size();i++){
142 <      DetId  Detid  = Det[i]->geographicalId();
143 < //      int    SubDet = Detid.subdetId();
141 >   for(unsigned int i=0;i<TrackerDets.size();i++){
142 >      Detid  = TrackerDets[i]->geographicalId();
143 > //    SubDet = Detid.subdetId();
144    
145 <      GeomDet* DetUnit = Det[i];
145 >      GeomDet* DetUnit = TrackerDets[i];
146        if(!DetUnit)continue;
147        const BoundPlane plane = DetUnit->surface();
148        const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds())));
149        const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds())));  
150  
151 <      float width;
152 <      float length;
153 <      float thickness;
154 <      float TrapezoidalParam;
151 >      float width            = 0;
152 >      float length           = 0;
153 >      float thickness        = 0;
154 >      float TrapezoidalParam = 0;
155  
156        if(trapezoidalBounds)
157        {
# Line 168 | Line 181 | OpenGLDisplayer::beginJob(const edm::Eve
181        
182  
183     }
184 +
185 +
186 +   // ### CALO GEOMETRY ###
187 +
188 +   edm::ESHandle<CaloGeometry> CaloGeom;
189 +   iSetup.get<IdealGeometryRecord>().get( CaloGeom );
190 +   const vector<DetId> CaloDets = CaloGeom->getValidDetIds();
191 +
192 +   for(unsigned int i=0;i<CaloDets.size();i++)
193 +   {
194 +      Detid  = CaloDets[i];
195 +      SubDet = Detid.subdetId();
196 +    
197 +      if(Detid.det()!=DetId::Ecal) continue;
198 +
199 +      //EcalBarrel=1, EcalEndcap=2, EcalPreshower=3, EcalTriggerTower=4, EcalLaserPnDiode=5
200 +      if(SubDet!=EcalBarrel)continue;
201 +
202 +      const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid);
203 +      GlobalPoint CellPos =  CellGeom->getPosition();
204 +
205 +      const CaloCellGeometry::CornersVec CellCorners =  CellGeom->getCorners();
206 +                
207 +      printf("Det = %i Subdet = %i --> %6.2f %6.2f %6.2f - %i\n",  Detid.det(), SubDet, CellPos.x(), CellPos.y(), CellPos.z(), CellCorners.size());
208 +   }
209 +
210 +
211     Geom->Save("Tracker.geom");    
212  
213  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines