CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/Alignment/MillePedeAlignmentAlgorithm/src/MomentumDependentPedeLabeler.h

Go to the documentation of this file.
00001 #ifndef MomentumDEPENDENTPEDELABELER_H
00002 #define MomentumDEPENDENTPEDELABELER_H
00003 
00016 #include <vector>
00017 #include <map> 
00018 
00019 #include <Alignment/MillePedeAlignmentAlgorithm/interface/PedeLabelerBase.h>
00020 
00021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00022 
00023 /***************************************
00024 ****************************************/
00025 class MomentumDependentPedeLabeler : public PedeLabelerBase
00026 {
00027  public:
00028 
00030   MomentumDependentPedeLabeler(const PedeLabelerBase::TopLevelAlignables& alignables,
00031                                const edm::ParameterSet& config);
00033   ~MomentumDependentPedeLabeler();
00034   
00038   unsigned int alignableLabel(Alignable *alignable) const;
00043   unsigned int alignableLabelFromParamAndInstance(Alignable *alignable,
00044                                                   unsigned int param,
00045                                                   unsigned int instance) const;
00046   unsigned int lasBeamLabel(unsigned int lasBeamId) const;
00048   unsigned int parameterLabel(unsigned int aliLabel, unsigned int parNum) const;
00051   unsigned int parameterLabel(Alignable *alignable, unsigned int parNum,
00052                               const AlignmentAlgorithmBase::EventInfo &eventInfo,
00053                               const TrajectoryStateOnSurface &tsos) const;
00055   bool hasSplitParameters(Alignable *alignable) const;
00057   unsigned int numberOfParameterInstances(Alignable *alignable, int param=-1) const;
00058   unsigned int maxNumberOfParameterInstances() const { return theMaxNumberOfParameterInstances; }
00059 
00061   unsigned int paramNumFromLabel(unsigned int paramLabel) const;
00063   unsigned int alignableLabelFromLabel(unsigned int label) const;
00066   Alignable* alignableFromLabel(unsigned int label) const;
00069   unsigned int lasBeamIdFromLabel(unsigned int label) const;
00070 
00071  private:
00072   typedef std::map <Alignable*, unsigned int> AlignableToIdMap;
00073   typedef AlignableToIdMap::value_type AlignableToIdPair;
00074   typedef std::pair <float,float> MomentumRange;
00075   typedef std::vector <MomentumRange> MomentumRangeVector;
00076   typedef std::map <unsigned int, MomentumRangeVector> MomentumRangeParamMap;
00077   typedef std::map <Alignable*, MomentumRangeParamMap> AlignableToMomentumRangeMap;
00078   typedef AlignableToMomentumRangeMap::value_type AlignableToMomentumRangePair;
00079   typedef std::map <unsigned int, Alignable*> IdToAlignableMap;
00080   typedef std::map <unsigned int, unsigned int> UintUintMap;
00081   
00082   std::vector<std::string> decompose(const std::string &s, std::string::value_type delimiter) const;
00083   std::vector<unsigned int> convertParamSel(const std::string &selString) const;
00084   unsigned int buildMomentumDependencyMap(AlignableTracker *aliTracker, AlignableMuon* aliMuon,
00085                                           AlignableExtras *extras,
00086                                           const edm::ParameterSet &config);
00087 
00089   unsigned int buildMap(const std::vector<Alignable*> &alis);
00091   unsigned int buildReverseMap();
00092 
00093   // data members
00094   AlignableToIdMap            theAlignableToIdMap; 
00095   AlignableToMomentumRangeMap theAlignableToMomentumRangeMap; 
00096   IdToAlignableMap            theIdToAlignableMap; 
00097   UintUintMap                 theLasBeamToLabelMap;  
00098   UintUintMap                 theLabelToLasBeamMap; 
00099   const MomentumRange         theOpenMomentumRange;
00100   unsigned int                theMaxNumberOfParameterInstances;
00101 };
00102 
00103 #endif