Skip to content

Commit

Permalink
cleanup constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
VinInn committed Apr 28, 2014
1 parent cab33e7 commit e1353c3
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 262 deletions.
14 changes: 2 additions & 12 deletions RecoVertex/GaussianSumVertexFit/src/MultiRefittedTS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,7 @@ TrajectoryStateOnSurface MultiRefittedTS::trajectoryStateOnSurface(
it != theComponents.end(); it++) {
tsosComponents.push_back((**it).trajectoryStateOnSurface(surface));
}
// #ifndef CMS_NO_COMPLEX_RETURNS
return TrajectoryStateOnSurface(new BasicMultiTrajectoryState(tsosComponents));
// #else
// TrajectoryStateOnSurface result(new BasicMultiTrajectoryState(tsosComponents));
// return result;
// #endif
return TrajectoryStateOnSurface((BasicTrajectoryState*)new BasicMultiTrajectoryState(tsosComponents));
}

TrajectoryStateOnSurface MultiRefittedTS::trajectoryStateOnSurface(
Expand All @@ -165,12 +160,7 @@ TrajectoryStateOnSurface MultiRefittedTS::trajectoryStateOnSurface(
it != theComponents.end(); it++) {
tsosComponents.push_back((**it).trajectoryStateOnSurface(surface, propagator));
}
// #ifndef CMS_NO_COMPLEX_RETURNS
return TrajectoryStateOnSurface(new BasicMultiTrajectoryState(tsosComponents));
// #else
// TrajectoryStateOnSurface result(new BasicMultiTrajectoryState(tsosComponents));
// return result;
// #endif
return TrajectoryStateOnSurface((BasicTrajectoryState*)new BasicMultiTrajectoryState(tsosComponents));
}

reco::TransientTrack MultiRefittedTS::transientTrack() const
Expand Down
4 changes: 2 additions & 2 deletions TrackingTools/GsfTools/src/MultiTrajectoryStateAssembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ TrajectoryStateOnSurface MultiTrajectoryStateAssembler::combinedState () {
//
// Return new multi state without reweighting
//
return TSOS(new BasicMultiTrajectoryState(theStates));
return TSOS((BasicTrajectoryState *)(new BasicMultiTrajectoryState(theStates)));
}

TrajectoryStateOnSurface MultiTrajectoryStateAssembler::combinedState (const float newWeight) {
Expand Down Expand Up @@ -181,7 +181,7 @@ MultiTrajectoryStateAssembler::reweightedCombinedState (const double newWeight)
i->surfaceSide(),
factor*oldWeight));
}
return TSOS(new BasicMultiTrajectoryState(reweightedStates));
return TSOS((BasicTrajectoryState *)(new BasicMultiTrajectoryState(reweightedStates)));
}

void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ MultiTrajectoryStateTransform::stateOnSurface (const std::vector<double>& weight
components.push_back(TrajectoryStateOnSurface(lp,le,surface,field,weights[i]));
}
return
TrajectoryStateOnSurface(new BasicMultiTrajectoryState(components));
TrajectoryStateOnSurface((BasicTrajectoryState *)(new BasicMultiTrajectoryState(components)) );
}

bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace GaussianStateConversions {
LocalTrajectoryError((**ic).covariance()),
surface,field,side,(**ic).weight()));
}
return TrajectoryStateOnSurface(new BasicMultiTrajectoryState(components));
return TrajectoryStateOnSurface((BasicTrajectoryState*)new BasicMultiTrajectoryState(components));
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
class BasicSingleTrajectoryState GCC11_FINAL : public BasicTrajectoryState {
public:
BasicSingleTrajectoryState() : BasicTrajectoryState(){}
#if defined( __GXX_EXPERIMENTAL_CXX0X__)
template<typename... Args>
BasicSingleTrajectoryState(Args && ...args) : BasicTrajectoryState(std::forward<Args>(args)...){}

#endif
BasicSingleTrajectoryState* clone() const {
return new BasicSingleTrajectoryState(*this);
}
Expand Down
155 changes: 103 additions & 52 deletions TrackingTools/TrajectoryState/interface/BasicTrajectoryState.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,46 +94,73 @@ class BasicTrajectoryState : public BTSCount {

virtual ~BasicTrajectoryState();

#ifndef CMS_NOCXX11

/** Constructor from FTS and surface. For surfaces with material
* the side of the surface should be specified explicitely.
*/
BasicTrajectoryState( const FreeTrajectoryState& fts,
const SurfaceType& aSurface,
const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
/** Constructor from global parameters and surface. For surfaces with material
* the side of the surface should be specified explicitely.
const SurfaceType& aSurface,
const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);



/** Constructor from local parameters, errors and surface. For surfaces
* with material the side of the surface should be specified explicitely.
* For multi-states the weight should be specified explicitely.
*/
BasicTrajectoryState( const GlobalTrajectoryParameters& par,
const SurfaceType& aSurface,
const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface) :
theFreeState(par),
theLocalError(InvalidError()),
theLocalParameters(),
theLocalParametersValid(false),
theValid(true),
theSurfaceSide(side),
theSurfaceP( &aSurface),
theWeight(1.)
{}
BasicTrajectoryState( const LocalTrajectoryParameters& par,
const LocalTrajectoryError& err,
const SurfaceType& aSurface,
const MagneticField* field,
const SurfaceSide side,
double weight);

BasicTrajectoryState( const LocalTrajectoryParameters& par,
const LocalTrajectoryError& err,
const SurfaceType& aSurface,
const MagneticField* field) :
BasicTrajectoryState(par,err,aSurface,field, SurfaceSideDefinition::atCenterOfSurface, 1.){}
/** Constructor from local parameters, errors and surface. For multi-states the
* weight should be specified explicitely. For backward compatibility without
* specification of the side of the surface.
*/
BasicTrajectoryState( const LocalTrajectoryParameters& par,
const LocalTrajectoryError& err,
const SurfaceType& aSurface,
const MagneticField* field,
double weight) :
BasicTrajectoryState(par,err,aSurface,field, SurfaceSideDefinition::atCenterOfSurface, weight){}

/** Constructor from local parameters, errors and surface. For surfaces
* with material the side of the surface should be specified explicitely.
*/
BasicTrajectoryState( const LocalTrajectoryParameters& par,
const SurfaceType& aSurface,
const MagneticField* field,
const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface) :
BasicTrajectoryState(par, InvalidError(), aSurface, field, side, 1.){}




/** Constructor from global parameters, errors and surface. For surfaces
* with material the side of the surface should be specified explicitely.
*/
BasicTrajectoryState( const GlobalTrajectoryParameters& par,
const CartesianTrajectoryError& err,
const SurfaceType& aSurface,
const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
const CartesianTrajectoryError& err,
const SurfaceType& aSurface,
const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);

/** Constructor from global parameters, errors and surface. For surfaces
* with material the side of the surface should be specified explicitely.
* For multi-states the weight should be specified explicitely.
*/
BasicTrajectoryState( const GlobalTrajectoryParameters& par,
const CurvilinearTrajectoryError& err,
const SurfaceType& aSurface,
const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface,
double weight = 1.) :
const CurvilinearTrajectoryError& err,
const SurfaceType& aSurface,
const SurfaceSide side,
double weight) :
theFreeState(par, err),
theLocalError(InvalidError()),
theLocalParameters(),
Expand All @@ -145,40 +172,64 @@ class BasicTrajectoryState : public BTSCount {
{}


/** Constructor from global parameters, errors and surface. For multi-states the
* weight should be specified explicitely. For backward compatibility without
* specification of the side of the surface.
*/
BasicTrajectoryState( const GlobalTrajectoryParameters& par,
const CurvilinearTrajectoryError& err,
const SurfaceType& aSurface,
double weight);
/** Constructor from local parameters, errors and surface. For surfaces
* with material the side of the surface should be specified explicitely.
*/
BasicTrajectoryState( const LocalTrajectoryParameters& par,
const SurfaceType& aSurface,
const MagneticField* field,
const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
/** Constructor from local parameters, errors and surface. For surfaces
* with material the side of the surface should be specified explicitely.
* For multi-states the weight should be specified explicitely.
const CurvilinearTrajectoryError& err,
const SurfaceType& aSurface,
const SurfaceSide side) :
BasicTrajectoryState(par,err, aSurface, side, 1.){}

BasicTrajectoryState( const GlobalTrajectoryParameters& par,
const CurvilinearTrajectoryError& err,
const SurfaceType& aSurface) :
BasicTrajectoryState(par,err, aSurface, SurfaceSideDefinition::atCenterOfSurface, 1.){}


/** Constructor from global parameters and surface. For surfaces with material
* the side of the surface should be specified explicitely.
*/
BasicTrajectoryState( const LocalTrajectoryParameters& par,
const LocalTrajectoryError& err,
const SurfaceType& aSurface,
const MagneticField* field,
const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface,
double weight = 1.);
/** Constructor from local parameters, errors and surface. For multi-states the
BasicTrajectoryState( const GlobalTrajectoryParameters& par,
const SurfaceType& aSurface,
const SurfaceSide side) :
BasicTrajectoryState(par, InvalidError(), aSurface, side, 1.){}


/** Constructor from global parameters, errors and surface. For multi-states the
* weight should be specified explicitely. For backward compatibility without
* specification of the side of the surface.
*/
BasicTrajectoryState( const LocalTrajectoryParameters& par,
const LocalTrajectoryError& err,
const SurfaceType& aSurface,
const MagneticField* field,
double weight);
BasicTrajectoryState( const GlobalTrajectoryParameters& par,
const CurvilinearTrajectoryError& err,
const SurfaceType& aSurface,
double weight) :
BasicTrajectoryState(par,err, aSurface, SurfaceSideDefinition::atCenterOfSurface, weight){}

#endif


virtual void update( const GlobalTrajectoryParameters& par,
const SurfaceType& aSurface,
SurfaceSide side) GCC11_FINAL {
theFreeState = FreeTrajectoryState(par);
theLocalError = InvalidError();
theLocalParametersValid=false;
theValid=true;
theSurfaceSide=side;
theSurfaceP = &aSurface;
theWeight = 1.;
}
virtual void update( const GlobalTrajectoryParameters& par,
const CurvilinearTrajectoryError& err,
const SurfaceType& aSurface,
SurfaceSide side) GCC11_FINAL {
theFreeState = FreeTrajectoryState(par,err);
theLocalError = InvalidError();
theLocalParametersValid=false;
theValid=true;
theSurfaceSide=side;
theSurfaceP = &aSurface;
theWeight = 1.;
}


bool isValid() const { return theValid; }

Expand Down
Loading

0 comments on commit e1353c3

Please sign in to comment.