Skip to content

Commit

Permalink
migrating to new Surface
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincenzo Innocente committed Dec 25, 2012
1 parent ec40113 commit 96b967d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions interface/ForwardRingDiskBuilderFromDet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -25,7 +25,7 @@ class ForwardRingDiskBuilderFromDet {
/// Should be changed to return a ReferenceCountingPointer<BoundDisk>
BoundDisk* operator()( const std::vector<const GeomDet*>& dets) const;

std::pair<SimpleDiskBounds, float>
std::pair<SimpleDiskBounds *, float>
computeBounds( const std::vector<const GeomDet*>& dets) const;

};
Expand Down
2 changes: 1 addition & 1 deletion interface/RodPlaneBuilderFromDet.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class RodPlaneBuilderFromDet {
/// Should be changed to return a ReferenceCountingPointer<Plane>
Plane* operator()( const std::vector<const Det*>& dets) const;

std::pair<RectangularPlaneBounds, GlobalVector>
std::pair<RectangularPlaneBounds*, GlobalVector>
computeBounds( const std::vector<const Det*>& dets, const Plane& plane) const;

Surface::RotationType
Expand Down
6 changes: 3 additions & 3 deletions src/BarrelDetLayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
16 changes: 9 additions & 7 deletions src/CylinderBuilderFromDet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ CylinderBuilderFromDet::operator()( vector<const Det*>::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) {
Expand All @@ -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);

}
4 changes: 2 additions & 2 deletions src/ForwardDetLayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}


Expand Down
7 changes: 3 additions & 4 deletions src/ForwardRingDiskBuilderFromDet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ using namespace std;
BoundDisk*
ForwardRingDiskBuilderFromDet::operator()( const vector<const GeomDet*>& dets) const
{
pair<SimpleDiskBounds,float> bo =
computeBounds( dets );
auto bo = computeBounds( dets );

// LogDebug("DetLayers") << "Creating disk at Z: " << bo.second << "\n"
// << "Bounds are (rmin/rmax/thick) " << bo.first.innerRadius()
Expand All @@ -31,7 +30,7 @@ ForwardRingDiskBuilderFromDet::operator()( const vector<const GeomDet*>& dets) c
return new BoundDisk( pos, rot, bo.first);
}

pair<SimpleDiskBounds, float>
pair<SimpleDiskBounds*, float>
ForwardRingDiskBuilderFromDet::computeBounds( const vector<const GeomDet*>& dets) const
{
// go over all corners and compute maximum deviations from mean pos.
Expand Down Expand Up @@ -86,5 +85,5 @@ ForwardRingDiskBuilderFromDet::computeBounds( const vector<const GeomDet*>& 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);
}
7 changes: 3 additions & 4 deletions src/RodPlaneBuilderFromDet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ RodPlaneBuilderFromDet::operator()( const vector<const Det*>& dets) const
// temporary plane - for the computation of bounds
Surface::RotationType rotation = computeRotation( dets, meanPos);
Plane tmpPlane( meanPos, rotation);
pair<RectangularPlaneBounds,GlobalVector> bo =
computeBounds( dets, tmpPlane);
auto bo = computeBounds( dets, tmpPlane);

// LogDebug("DetLayers") << "Creating plane at position " << meanPos
// << " displaced by " << bo.second ;
Expand All @@ -33,7 +32,7 @@ RodPlaneBuilderFromDet::operator()( const vector<const Det*>& dets) const
return new Plane( meanPos+bo.second, rotation, bo.first);
}

pair<RectangularPlaneBounds, GlobalVector>
pair<RectangularPlaneBounds*, GlobalVector>
RodPlaneBuilderFromDet::computeBounds( const vector<const Det*>& dets,
const Plane& plane) const
{
Expand Down Expand Up @@ -73,7 +72,7 @@ RodPlaneBuilderFromDet::computeBounds( const vector<const Det*>& dets,
LocalVector localOffset( (xmin+xmax)/2., (ymin+ymax)/2., (zmin+zmax)/2.);
GlobalVector offset( plane.toGlobal(localOffset));

pair<RectangularPlaneBounds, GlobalVector> result(RectangularPlaneBounds((xmax-xmin)/2, (ymax-ymin)/2, (zmax-zmin)/2), offset);
pair<RectangularPlaneBounds*, GlobalVector> result(new RectangularPlaneBounds((xmax-xmin)/2, (ymax-ymin)/2, (zmax-zmin)/2), offset);

return result;
}
Expand Down

0 comments on commit 96b967d

Please sign in to comment.