From 96b967d557307f90812b5f5465ed8ad23c34b06d Mon Sep 17 00:00:00 2001 From: Vincenzo Innocente Date: Tue, 25 Dec 2012 14:59:34 +0000 Subject: [PATCH] migrating to new Surface --- interface/ForwardRingDiskBuilderFromDet.h | 6 +++--- interface/RodPlaneBuilderFromDet.h | 2 +- src/BarrelDetLayer.cc | 6 +++--- src/CylinderBuilderFromDet.cc | 16 +++++++++------- src/ForwardDetLayer.cc | 4 ++-- src/ForwardRingDiskBuilderFromDet.cc | 7 +++---- src/RodPlaneBuilderFromDet.cc | 7 +++---- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/interface/ForwardRingDiskBuilderFromDet.h b/interface/ForwardRingDiskBuilderFromDet.h index 1058c9d..cea455c 100644 --- a/interface/ForwardRingDiskBuilderFromDet.h +++ b/interface/ForwardRingDiskBuilderFromDet.h @@ -5,8 +5,8 @@ * As it's name indicates, it's a builder of BoundDisk from a collection of * Dets. The disk has the minimal size fully containing all Dets. * - * $Date: $ - * $Revision: $ + * $Date: 2007/03/07 16:28:39 $ + * $Revision: 1.3 $ */ #include "TrackingTools/DetLayers/interface/GeometricSearchDet.h" @@ -25,7 +25,7 @@ class ForwardRingDiskBuilderFromDet { /// Should be changed to return a ReferenceCountingPointer BoundDisk* operator()( const std::vector& dets) const; - std::pair + std::pair computeBounds( const std::vector& dets) const; }; diff --git a/interface/RodPlaneBuilderFromDet.h b/interface/RodPlaneBuilderFromDet.h index b338a18..f1df48c 100644 --- a/interface/RodPlaneBuilderFromDet.h +++ b/interface/RodPlaneBuilderFromDet.h @@ -20,7 +20,7 @@ class RodPlaneBuilderFromDet { /// Should be changed to return a ReferenceCountingPointer Plane* operator()( const std::vector& dets) const; - std::pair + std::pair computeBounds( const std::vector& dets, const Plane& plane) const; Surface::RotationType diff --git a/src/BarrelDetLayer.cc b/src/BarrelDetLayer.cc index 4aaaee4..85614f4 100644 --- a/src/BarrelDetLayer.cc +++ b/src/BarrelDetLayer.cc @@ -64,9 +64,9 @@ BoundCylinder* BarrelDetLayer::computeSurface() { PositionType pos(0.,0.,0.); RotationType rot; - return new BoundCylinder( pos, rot, - SimpleCylinderBounds( theRmin, theRmax, - theZmin, theZmax)); + auto scp = new SimpleCylinderBounds( theRmin, theRmax, + theZmin, theZmax); + return new Cylinder(Cylinder::computeRadius(*scp), pos, rot, scp); } diff --git a/src/CylinderBuilderFromDet.cc b/src/CylinderBuilderFromDet.cc index 8fb658f..3043f51 100644 --- a/src/CylinderBuilderFromDet.cc +++ b/src/CylinderBuilderFromDet.cc @@ -56,9 +56,10 @@ CylinderBuilderFromDet::operator()( vector::const_iterator first, PositionType pos( 0, 0, 0.5*(zmin+zmax)); RotationType rot; // only "barrel" orientation supported - return new BoundCylinder( pos, rot, - SimpleCylinderBounds( rmin, rmax, - zmin-pos.z(), zmax-pos.z())); + auto scp = new SimpleCylinderBounds( rmin, rmax, + zmin-pos.z(), zmax-pos.z()); + return new Cylinder(Cylinder::computeRadius(*scp), pos, rot, scp); + } void CylinderBuilderFromDet::operator()(const Det& det) { @@ -84,8 +85,9 @@ BoundCylinder* CylinderBuilderFromDet::build() const { PositionType pos( 0, 0, 0.5*(zmin+zmax)); RotationType rot; // only "barrel" orientation supported - - return new BoundCylinder( pos, rot, - SimpleCylinderBounds( rmin, rmax, - zmin-pos.z(), zmax-pos.z())); + + auto scp = new SimpleCylinderBounds( rmin, rmax, + zmin-pos.z(), zmax-pos.z()); + return new Cylinder(Cylinder::computeRadius(*scp), pos, rot, scp); + } diff --git a/src/ForwardDetLayer.cc b/src/ForwardDetLayer.cc index e8fc759..bbfed7e 100644 --- a/src/ForwardDetLayer.cc +++ b/src/ForwardDetLayer.cc @@ -95,8 +95,8 @@ BoundDisk* ForwardDetLayer::computeSurface() { RotationType rot; return new BoundDisk( pos, rot, - SimpleDiskBounds( theRmin, theRmax, - theZmin-zPos, theZmax-zPos)); + new SimpleDiskBounds( theRmin, theRmax, + theZmin-zPos, theZmax-zPos)); } diff --git a/src/ForwardRingDiskBuilderFromDet.cc b/src/ForwardRingDiskBuilderFromDet.cc index b0a5c51..891ee7b 100644 --- a/src/ForwardRingDiskBuilderFromDet.cc +++ b/src/ForwardRingDiskBuilderFromDet.cc @@ -8,8 +8,7 @@ using namespace std; BoundDisk* ForwardRingDiskBuilderFromDet::operator()( const vector& dets) const { - pair bo = - computeBounds( dets ); + auto bo = computeBounds( dets ); // LogDebug("DetLayers") << "Creating disk at Z: " << bo.second << "\n" // << "Bounds are (rmin/rmax/thick) " << bo.first.innerRadius() @@ -31,7 +30,7 @@ ForwardRingDiskBuilderFromDet::operator()( const vector& dets) c return new BoundDisk( pos, rot, bo.first); } -pair +pair ForwardRingDiskBuilderFromDet::computeBounds( const vector& dets) const { // go over all corners and compute maximum deviations from mean pos. @@ -86,5 +85,5 @@ ForwardRingDiskBuilderFromDet::computeBounds( const vector& dets float zPos = (zmax+zmin)/2.; - return make_pair(SimpleDiskBounds(rmin,rmax,zmin-zPos,zmax-zPos), zPos); + return make_pair(new SimpleDiskBounds(rmin,rmax,zmin-zPos,zmax-zPos), zPos); } diff --git a/src/RodPlaneBuilderFromDet.cc b/src/RodPlaneBuilderFromDet.cc index 2b7c95c..c82a29e 100644 --- a/src/RodPlaneBuilderFromDet.cc +++ b/src/RodPlaneBuilderFromDet.cc @@ -21,8 +21,7 @@ RodPlaneBuilderFromDet::operator()( const vector& dets) const // temporary plane - for the computation of bounds Surface::RotationType rotation = computeRotation( dets, meanPos); Plane tmpPlane( meanPos, rotation); - pair bo = - computeBounds( dets, tmpPlane); + auto bo = computeBounds( dets, tmpPlane); // LogDebug("DetLayers") << "Creating plane at position " << meanPos // << " displaced by " << bo.second ; @@ -33,7 +32,7 @@ RodPlaneBuilderFromDet::operator()( const vector& dets) const return new Plane( meanPos+bo.second, rotation, bo.first); } -pair +pair RodPlaneBuilderFromDet::computeBounds( const vector& dets, const Plane& plane) const { @@ -73,7 +72,7 @@ RodPlaneBuilderFromDet::computeBounds( const vector& dets, LocalVector localOffset( (xmin+xmax)/2., (ymin+ymax)/2., (zmin+zmax)/2.); GlobalVector offset( plane.toGlobal(localOffset)); - pair result(RectangularPlaneBounds((xmax-xmin)/2, (ymax-ymin)/2, (zmax-zmin)/2), offset); + pair result(new RectangularPlaneBounds((xmax-xmin)/2, (ymax-ymin)/2, (zmax-zmin)/2), offset); return result; }