Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75678
b: "refs/heads/CMSSW_7_1_X"
c: d774bc9
h: "refs/heads/CMSSW_7_1_X"
v: v3
  • Loading branch information
fambrogl committed Oct 19, 2009
1 parent 414f280 commit 07e347f
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e
"refs/heads/CMSSW_7_1_X": ec65606711105f8d6513be9974ab53d604c9cdbe
"refs/heads/CMSSW_7_1_X": d774bc9adf6abfda7d9f984ee62e60edf472a601
28 changes: 15 additions & 13 deletions trunk/Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class TrackerGeometry : public TrackingGeometry {

explicit TrackerGeometry(GeometricDet const* gd=0);

virtual ~TrackerGeometry() ;

virtual const DetTypeContainer& detTypes() const;
virtual const DetUnitContainer& detUnits() const;
virtual const DetContainer& dets() const;
Expand Down Expand Up @@ -62,20 +64,20 @@ class TrackerGeometry : public TrackingGeometry {
/// Aligner has access to map
friend class GeometryAligner;

DetTypeContainer theDetTypes;
DetUnitContainer theDetUnits;
DetContainer theDets;
DetTypeContainer theDetTypes; // owns the DetTypes
DetUnitContainer theDetUnits; // they're all also into 'theDets', so we assume 'theDets' owns them
DetContainer theDets; // owns *ONLY* the GeomDet * corresponding to GluedDets.
DetIdContainer theDetUnitIds;
DetIdContainer theDetIds;
mapIdToDetUnit theMapUnit;
mapIdToDet theMap;

DetContainer thePXBDets;
DetContainer thePXFDets;
DetContainer theTIBDets;
DetContainer theTIDDets;
DetContainer theTOBDets;
DetContainer theTECDets;
DetIdContainer theDetIds;
mapIdToDetUnit theMapUnit; // does not own GeomDetUnit *
mapIdToDet theMap; // does not own GeomDet *

DetContainer thePXBDets; // not owned: they're also in 'theDets'
DetContainer thePXFDets; // not owned: they're also in 'theDets'
DetContainer theTIBDets; // not owned: they're also in 'theDets'
DetContainer theTIDDets; // not owned: they're also in 'theDets'
DetContainer theTOBDets; // not owned: they're also in 'theDets'
DetContainer theTECDets; // not owned: they're also in 'theDets'


};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "DataFormats/GeometrySurface/interface/Surface.h"
#include "DataFormats/GeometrySurface/interface/BoundingBox.h"
#include "DataFormats/GeometrySurface/interface/MediumProperties.h"
#include "DataFormats/GeometrySurface/interface/OpenBounds.h"

#include <algorithm>

Expand All @@ -18,15 +19,15 @@ PlaneBuilderForGluedDet::ResultType PlaneBuilderForGluedDet::plane( const std::v

Surface::RotationType rotation = dets.front()->surface().rotation();
// Surface::RotationType rotation = computeRotation( dets, meanPos);
BoundPlane tmpPlane( meanPos, rotation);
BoundPlane::BoundPlanePointer tmpPlane = BoundPlane::build( meanPos, rotation, OpenBounds());

// Take the medium properties from the first DetUnit
const MediumProperties* mp = dets.front()->surface().mediumProperties();
MediumProperties* newmp = 0;
if (mp != 0) newmp = new MediumProperties( mp->radLen()*2.0,mp->xi()*2.0);
MediumProperties newmp(0,0);
if (mp != 0) newmp = MediumProperties( mp->radLen()*2.0,mp->xi()*2.0);

std::pair<RectangularPlaneBounds,GlobalVector> bo = computeRectBounds( dets, tmpPlane);
return new BoundPlane( meanPos+bo.second, rotation, bo.first, newmp);
std::pair<RectangularPlaneBounds,GlobalVector> bo = computeRectBounds( dets, *tmpPlane);
return new BoundPlane( meanPos+bo.second, rotation, bo.first, &newmp);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
detector element?
*/

PlaneBuilderFromGeometricDet::ResultType PlaneBuilderFromGeometricDet::plane(const GeometricDet* gd) const{
return ResultType( new BoundPlane( gd->positionBounds(), gd->rotationBounds(),gd-> bounds()));
PlaneBuilderFromGeometricDet::ResultType PlaneBuilderFromGeometricDet::plane(const GeometricDet* gd) const {
std::auto_ptr<const Bounds> bounds(gd->bounds()); // gd->bounds() returns a pointer owned by the caller!
// BoundSurface's constructor clones, does *not* take ownership
return ResultType( new BoundPlane( gd->positionBounds(), gd->rotationBounds(), *bounds));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ void TrackerGeomBuilderFromGeometricDet::buildPixel(std::vector<const GeometricD

std::string const & detName = gdv[i]->name().fullname();
if (detTypeMap.find(detName) == detTypeMap.end()) {

std::auto_ptr<const Bounds> bounds(gdv[i]->bounds());
PixelTopology* t =
theTopologyBuilder->buildPixel(gdv[i]->bounds(),
theTopologyBuilder->buildPixel(&*bounds,
gdv[i]->pixROCRows(),
gdv[i]->pixROCCols(),
gdv[i]->pixROCx(),
Expand Down Expand Up @@ -96,9 +96,9 @@ void TrackerGeomBuilderFromGeometricDet::buildSilicon(std::vector<const Geometri

std::string const & detName = gdv[i]->name().fullname();
if (detTypeMap.find(detName) == detTypeMap.end()) {

std::auto_ptr<const Bounds> bounds(gdv[i]->bounds());
StripTopology* t =
theTopologyBuilder->buildStrip(gdv[i]->bounds(),
theTopologyBuilder->buildStrip(&*bounds,
gdv[i]->siliconAPVNum(),
part);
detTypeMap[detName] = new StripGeomDetType( t,detName,det,
Expand Down
6 changes: 6 additions & 0 deletions trunk/Geometry/TrackerGeometryBuilder/src/TrackerGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
#include "Geometry/CommonDetUnit/interface/GeomDetUnit.h"
#include "Geometry/CommonDetUnit/interface/GeomDetType.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
Expand All @@ -14,6 +15,11 @@

TrackerGeometry::TrackerGeometry(GeometricDet const* gd) : theTrackerDet(gd){}

TrackerGeometry::~TrackerGeometry() {
for (DetContainer::iterator it = theDets.begin(), ed = theDets.end(); it != ed; ++it) delete *it;
for (DetTypeContainer::iterator it = theDetTypes.begin(), ed = theDetTypes.end(); it != ed; ++it) delete *it;
}

GeometricDet const * TrackerGeometry::trackerDet() const {
return theTrackerDet;
}
Expand Down

0 comments on commit 07e347f

Please sign in to comment.