CMS 3D CMS Logo

Enumerations | Functions

AlignmentParametersFactory Namespace Reference

Enumerations

enum  ParametersType {
  kRigidBody = 0, kSurvey, kRigidBody4D, kBeamSpot,
  kBowedSurface, kTwoBowedSurfaces
}
 

enums for all available AlignmentParameters

More...

Functions

AlignmentParameterscreateParameters (Alignable *ali, ParametersType parType, const std::vector< bool > &sel)
ParametersType parametersType (int typeInt)
 convert int to ParametersType (if same value) - exception if no corresponding type
ParametersType parametersType (const std::string &typeString)
 convert string to ParametersType - exception if not known
std::string parametersTypeName (ParametersType parType)
 convert ParametersType to string understood by parametersType(string &typeString)

Detailed Description

Factory interface to create AlignmentParameters for the known types, defined by the enum AlignmentParametersFactory::ParametersType.

Date:
2010/10/26 20:41:08
Revision:
1.5

(last update by

Author:
flucke

)

Date:
2010/10/26 20:41:08
Revision:
1.4

(last update by

Author:
flucke

)


Enumeration Type Documentation

enums for all available AlignmentParameters

Enumerator:
kRigidBody 
kSurvey 
kRigidBody4D 
kBeamSpot 
kBowedSurface 
kTwoBowedSurfaces 

Definition at line 21 of file AlignmentParametersFactory.h.

                      {
    kRigidBody = 0, // RigidBodyAlignmentParameters
    kSurvey,  // SurveyParameters GF: do not belong here, so remove in the long term...
    kRigidBody4D, // RigidBodyAlignmentParameters4D
    kBeamSpot, // BeamSpotAlignmentParameters
    kBowedSurface, // BowedSurfaceAlignmentParameters
    kTwoBowedSurfaces // TwoBowedSurfacesAlignmentParameters
  };

Function Documentation

AlignmentParameters * AlignmentParametersFactory::createParameters ( Alignable ali,
ParametersType  parType,
const std::vector< bool > &  sel 
)

create AlignmentParameters of type 'parType' for Alignable 'ali' with selection 'sel' for active parameters

Definition at line 75 of file AlignmentParametersFactory.cc.

References Exception, kBeamSpot, kBowedSurface, kRigidBody, kRigidBody4D, kSurvey, kTwoBowedSurfaces, TwoBowedSurfacesAlignmentParameters::N_PARAM, BeamSpotAlignmentParameters::N_PARAM, BowedSurfaceAlignmentParameters::N_PARAM, RigidBodyAlignmentParameters::N_PARAM, and Gflash::par.

Referenced by AlignmentParameterBuilder::add(), and AlignmentParametersIORoot::readOne().

  {
    switch (parType) {
    case kRigidBody:
      {
        const AlgebraicVector par(RigidBodyAlignmentParameters::N_PARAM, 0);
        const AlgebraicSymMatrix cov(RigidBodyAlignmentParameters::N_PARAM, 0);
        return new RigidBodyAlignmentParameters(ali, par, cov, sel);
      }
      break;
    case kSurvey:
// creates some unwanted dependencies - and does not fit into AlignmentParameters anyway!
      throw cms::Exception("BadConfig") 
        << "AlignmentParametersFactory cannot create SurveyParameters.";
//       edm::LogWarning("Alignment") << "@SUB=createParameters"
//                                 << "Creating SurveyParameters of length 0!";
//       return new SurveyParameters(ali, AlgebraicVector(), AlgebraicSymMatrix());
      break;
    case kRigidBody4D:
      {
        const AlgebraicVector par(RigidBodyAlignmentParameters4D::N_PARAM, 0);
        const AlgebraicSymMatrix cov(RigidBodyAlignmentParameters4D::N_PARAM, 0);
        return new RigidBodyAlignmentParameters4D(ali, par, cov, sel);
      }
      break;
    case kBeamSpot:
      {
        const AlgebraicVector par(BeamSpotAlignmentParameters::N_PARAM, 0);
        const AlgebraicSymMatrix cov(BeamSpotAlignmentParameters::N_PARAM, 0);
        return new BeamSpotAlignmentParameters(ali, par, cov, sel);
      }
      break;
    case kBowedSurface:
      {
        const AlgebraicVector par(BowedSurfaceAlignmentParameters::N_PARAM, 0);
        const AlgebraicSymMatrix cov(BowedSurfaceAlignmentParameters::N_PARAM, 0);
        return new BowedSurfaceAlignmentParameters(ali, par, cov, sel);
      }
      break;
    case kTwoBowedSurfaces:
      {
        const AlgebraicVector par(TwoBowedSurfacesAlignmentParameters::N_PARAM, 0);
        const AlgebraicSymMatrix cov(TwoBowedSurfacesAlignmentParameters::N_PARAM, 0);
        return new TwoBowedSurfacesAlignmentParameters(ali, par, cov, sel);
      }
      break;
    }
   
    return 0; // unreached (all ParametersType appear in switch), to please the compiler
  }
ParametersType AlignmentParametersFactory::parametersType ( int  typeInt)

convert int to ParametersType (if same value) - exception if no corresponding type

Definition at line 38 of file AlignmentParametersFactory.cc.

References Exception, kBeamSpot, kBowedSurface, kRigidBody, kRigidBody4D, kSurvey, and kTwoBowedSurfaces.

  {
    if (typeInt == kRigidBody) return kRigidBody;
    if (typeInt == kSurvey) return kSurvey; //GF: do not belong here, so remove in the long term...
    if (typeInt == kRigidBody4D) return kRigidBody4D;
    if (typeInt == kBeamSpot) return kBeamSpot;
    if (typeInt == kBowedSurface) return kBowedSurface;
    if (typeInt == kTwoBowedSurfaces) return kTwoBowedSurfaces;
    
    throw cms::Exception("BadConfig") 
      << "AlignmentParametersFactory" << " No AlignmentParameters with number " << typeInt << ".";
    
    return kRigidBody; // to please compiler...
  }
ParametersType AlignmentParametersFactory::parametersType ( const std::string &  typeString)

convert string to ParametersType - exception if not known

Definition at line 23 of file AlignmentParametersFactory.cc.

References Exception, kBeamSpot, kBowedSurface, kRigidBody, kRigidBody4D, kSurvey, and kTwoBowedSurfaces.

Referenced by AlignmentParameterBuilder::addAllSelections(), ParametersToParametersDerivatives::init(), and AlignmentParametersIORoot::readOne().

  {
    if (typeString == "RigidBody") return kRigidBody;
    else if (typeString == "Survey") return kSurvey; //GF: do not belong here, so remove in the long term...
    else if (typeString == "RigidBody4D") return kRigidBody4D;    
    else if (typeString == "BeamSpot") return kBeamSpot;
    else if (typeString == "BowedSurface") return kBowedSurface;
    else if (typeString == "TwoBowedSurfaces") return kTwoBowedSurfaces;
    throw cms::Exception("BadConfig") 
      << "AlignmentParametersFactory" << " No AlignmentParameters with name '" << typeString << "'.";
    
    return kRigidBody; // to please compiler...
  }
std::string AlignmentParametersFactory::parametersTypeName ( ParametersType  parType)

convert ParametersType to string understood by parametersType(string &typeString)

Definition at line 54 of file AlignmentParametersFactory.cc.

References kBeamSpot, kBowedSurface, kRigidBody, kRigidBody4D, kSurvey, and kTwoBowedSurfaces.

Referenced by AlignmentParameterBuilder::addSelections(), and ParametersToParametersDerivatives::init().

  {
    switch(parType) {
    case kRigidBody:
      return "RigiBody";
    case kSurvey: //GF: do not belong here, so remove in the long term...
      return "Survey";
    case kRigidBody4D:
      return "RigiBody4D"; 
    case kBeamSpot:
      return "BeamSpot"; 
    case kBowedSurface:
      return "BowedSurface"; 
    case kTwoBowedSurfaces:
      return "TwoBowedSurfaces"; 
    }

    return "unknown_should_never_reach"; // to please the compiler
  }