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 6db3989 commit ec40113
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 31 deletions.
12 changes: 6 additions & 6 deletions interface/DetRod.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#define DetLayers_DetRod_H

/** \class DetRod
* Abstract interface for a rod of detectors sitting on a BoundPlane.
* Abstract interface for a rod of detectors sitting on a Plane.
*/

#include "TrackingTools/DetLayers/interface/GeometricSearchDet.h"
#include "DataFormats/GeometrySurface/interface/BoundPlane.h"
#include "DataFormats/GeometrySurface/interface/Plane.h"

class MeasurementEstimator;

Expand All @@ -21,21 +21,21 @@ class DetRod : public virtual GeometricSearchDet {

//--- Extension of the interface

/// Return the rod surface as a BoundPlane
virtual const BoundPlane& specificSurface() const GCC11_FINAL {return *thePlane;}
/// Return the rod surface as a Plane
virtual const Plane& specificSurface() const GCC11_FINAL {return *thePlane;}


protected:
/// Set the rod's plane
void setPlane( BoundPlane* plane) { thePlane = plane;}
void setPlane( Plane* plane) { thePlane = plane;}

//obsolete?
// Return the range in Z to be checked for compatibility
//float zError( const TrajectoryStateOnSurface& tsos,
// const MeasurementEstimator& est) const;

private:
ReferenceCountingPointer<BoundPlane> thePlane;
ReferenceCountingPointer<Plane> thePlane;

};

Expand Down
2 changes: 1 addition & 1 deletion interface/DetRodOneR.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define DetLayers_DetRodOneR_H

/** \class DetRodOneR
* A rod of detectors, all having the same BoundPlane.
* A rod of detectors, all having the same Plane.
*/

#include "TrackingTools/DetLayers/interface/GeometricSearchDet.h"
Expand Down
16 changes: 8 additions & 8 deletions interface/MeasurementEstimator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
#include "DataFormats/GeometryVector/interface/LocalTag.h"
#include <utility>

class BoundPlane;
class Plane;
class TrajectoryStateOnSurface;
class Surface;
class TransientTrackingRecHit;

/** The MeasurementEstimator defines the compatibility of a
* TrajectoryStateOnSurface and a RecHit, and of a
* TrajectoryStateOnSurface and a BoundPlane.
* TrajectoryStateOnSurface and a Plane.
* It is used in the Det interface to obtain compatible measurements.
*/

Expand All @@ -25,7 +25,7 @@ class MeasurementEstimator {
virtual ~MeasurementEstimator() {}

typedef std::pair<bool,double> HitReturnType;
typedef bool SurfaceReturnType;
typedef bool SurfaceReturnType;

/** Returns pair( true, value) if the TrajectoryStateOnSurface is compatible
* with the RecHit, and pair( false, value) if it is not compatible.
Expand All @@ -37,14 +37,14 @@ class MeasurementEstimator {
const TransientTrackingRecHit& hit) const = 0;

/** Returns true if the TrajectoryStateOnSurface is compatible with the
* BoundPlane, false otherwise.
* Plane, false otherwise.
* The TrajectoryStateOnSurface must be on the plane.
*/
virtual SurfaceReturnType estimate( const TrajectoryStateOnSurface& ts,
const BoundPlane& plane) const = 0;
const Plane& plane) const = 0;

/* virtual SurfaceReturnType estimate( const TrajectoryStateOnSurface& ts, */
/* const BoundSurface& plane) const; */
/* const Surface& plane) const; */

virtual MeasurementEstimator* clone() const = 0;

Expand All @@ -53,12 +53,12 @@ class MeasurementEstimator {
* The TrajectoryStateOnSurface must be on the plane.
* This method allows to limit the search for compatible detectors or RecHits.
* The MeasurementEstimator should not return "true" for any RecHit or
* BoundPlane which is entirely outside of the compatibility region defined
* Plane which is entirely outside of the compatibility region defined
* by maximalLocalDisplacement().
*/
virtual Local2DVector
maximalLocalDisplacement( const TrajectoryStateOnSurface& ts,
const BoundPlane& plane) const;
const Plane& plane) const;
};

#endif // Tracker_MeasurementEstimator_H
8 changes: 4 additions & 4 deletions interface/RodPlaneBuilderFromDet.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define DetLayers_RodPlaneBuilderFromDet_H

#include "Geometry/CommonDetUnit/interface/GeomDet.h"
#include "DataFormats/GeometrySurface/interface/BoundPlane.h"
#include "DataFormats/GeometrySurface/interface/Plane.h"

#include <utility>
#include <vector>
Expand All @@ -17,11 +17,11 @@ class RodPlaneBuilderFromDet {
typedef GeomDet Det;

/// Warning, remember to assign this pointer to a ReferenceCountingPointer!
/// Should be changed to return a ReferenceCountingPointer<BoundPlane>
BoundPlane* operator()( const std::vector<const Det*>& dets) const;
/// Should be changed to return a ReferenceCountingPointer<Plane>
Plane* operator()( const std::vector<const Det*>& dets) const;

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

Surface::RotationType
computeRotation( const std::vector<const Det*>& dets,
Expand Down
2 changes: 1 addition & 1 deletion src/BarrelDetLayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ BoundCylinder* BarrelDetLayer::computeSurface() {
for ( vector< const GeomDet*>::const_iterator deti = comps.begin();
deti != comps.end(); deti++) {
vector<GlobalPoint> corners =
BoundingBox().corners( dynamic_cast<const BoundPlane&>((*deti)->surface()));
BoundingBox().corners( dynamic_cast<const Plane&>((*deti)->surface()));
for (vector<GlobalPoint>::const_iterator ic = corners.begin();
ic != corners.end(); ic++) {
float r = ic->perp();
Expand Down
4 changes: 2 additions & 2 deletions src/CylinderBuilderFromDet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ CylinderBuilderFromDet::operator()( vector<const Det*>::const_iterator first,
float zmax = meanPos.z();
for (vector<const Det*>::const_iterator i=first; i!=last; i++) {
vector<GlobalPoint> corners =
BoundingBox::corners( dynamic_cast<const BoundPlane&>((**i).surface()));
BoundingBox::corners( dynamic_cast<const Plane&>((**i).surface()));
for (vector<GlobalPoint>::const_iterator ic = corners.begin();
ic != corners.end(); ic++) {
float r = ic->perp();
Expand Down Expand Up @@ -62,7 +62,7 @@ CylinderBuilderFromDet::operator()( vector<const Det*>::const_iterator first,
}

void CylinderBuilderFromDet::operator()(const Det& det) {
BoundingBox bb( dynamic_cast<const BoundPlane&>(det.surface()));
BoundingBox bb( dynamic_cast<const Plane&>(det.surface()));
for (int nc=0; nc<8; ++nc) {
float r = bb[nc].perp();
float z = bb[nc].z();
Expand Down
2 changes: 1 addition & 1 deletion src/ForwardDetLayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ BoundDisk* ForwardDetLayer::computeSurface() {
for ( vector<const GeomDet*>::const_iterator deti = ifirst;
deti != ilast; deti++) {
vector<GlobalPoint> corners =
BoundingBox().corners( dynamic_cast<const BoundPlane&>((**deti).surface()));
BoundingBox().corners( dynamic_cast<const Plane&>((**deti).surface()));
for (vector<GlobalPoint>::const_iterator ic = corners.begin();
ic != corners.end(); ic++) {
float r = ic->perp();
Expand Down
2 changes: 1 addition & 1 deletion src/ForwardRingDiskBuilderFromDet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ForwardRingDiskBuilderFromDet::computeBounds( const vector<const GeomDet*>& dets
for (vector<DetUnit*>::const_iterator detu=detUnits.begin();
detu!=detUnits.end(); detu++) {
vector<GlobalPoint> corners = BoundingBox().corners(
dynamic_cast<const BoundPlane&>((**detu).surface()));
dynamic_cast<const Plane&>((**detu).surface()));
}
----- */
vector<GlobalPoint> corners = BoundingBox().corners( (**idet).specificSurface() );
Expand Down
2 changes: 1 addition & 1 deletion src/MeasurementEstimator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

MeasurementEstimator::Local2DVector
MeasurementEstimator::maximalLocalDisplacement( const TrajectoryStateOnSurface& ts,
const BoundPlane& plane) const
const Plane& plane) const
{
throw cms::Exception("TrackingTools/PatternTools","MeasurementEstimator: base class maximalLocalDisplacement called");
}
12 changes: 6 additions & 6 deletions src/RodPlaneBuilderFromDet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using namespace std;

// Warning, remember to assign this pointer to a ReferenceCountingPointer!
BoundPlane*
Plane*
RodPlaneBuilderFromDet::operator()( const vector<const Det*>& dets) const
{
// find mean position
Expand All @@ -20,7 +20,7 @@ RodPlaneBuilderFromDet::operator()( const vector<const Det*>& dets) const

// temporary plane - for the computation of bounds
Surface::RotationType rotation = computeRotation( dets, meanPos);
BoundPlane tmpPlane( meanPos, rotation);
Plane tmpPlane( meanPos, rotation);
pair<RectangularPlaneBounds,GlobalVector> bo =
computeBounds( dets, tmpPlane);

Expand All @@ -30,12 +30,12 @@ RodPlaneBuilderFromDet::operator()( const vector<const Det*>& dets) const
// << " / " << bo.first.length()
// << " / " << bo.first.thickness() ;

return new BoundPlane( meanPos+bo.second, rotation, bo.first);
return new Plane( meanPos+bo.second, rotation, bo.first);
}

pair<RectangularPlaneBounds, GlobalVector>
RodPlaneBuilderFromDet::computeBounds( const vector<const Det*>& dets,
const BoundPlane& plane) const
const Plane& plane) const
{
// go over all corners and compute maximum deviations from mean pos.
vector<GlobalPoint> corners;
Expand Down Expand Up @@ -87,8 +87,8 @@ computeRotation( const vector<const Det*>& dets,
// the rotations of GluedDets coincide with the mono part
// Simply take the x,y of the first Det if z points out,
// or -x, y if it doesn't
const BoundPlane& plane =
dynamic_cast<const BoundPlane&>(dets.front()->surface());
const Plane& plane =
dynamic_cast<const Plane&>(dets.front()->surface());
//GlobalVector n = plane.normalVector();

GlobalVector xAxis;
Expand Down

0 comments on commit ec40113

Please sign in to comment.