CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/Alignment/MillePedeAlignmentAlgorithm/src/PedeLabeler.h

Go to the documentation of this file.
00001 #ifndef PEDELABELER_H
00002 #define PEDELABELER_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 PedeLabeler : public PedeLabelerBase
00026 {
00027  public:
00028 
00030   PedeLabeler(const PedeLabelerBase::TopLevelAlignables &alignables,
00031               const edm::ParameterSet &config);
00033   ~PedeLabeler();
00034   
00038   unsigned int alignableLabel(Alignable *alignable) const;
00039   unsigned int alignableLabelFromParamAndInstance(Alignable *alignable,
00040                                                   unsigned int param,
00041                                                   unsigned int instance) const;
00042   unsigned int lasBeamLabel(unsigned int lasBeamId) const;
00043   unsigned int parameterLabel(unsigned int aliLabel, unsigned int parNum) const;
00044   unsigned int parameterLabel(Alignable *alignable, unsigned int parNum,
00045                               const AlignmentAlgorithmBase::EventInfo &eventInfo,
00046                               const TrajectoryStateOnSurface &tsos) const {
00047     return parameterLabel(alignableLabel(alignable), parNum);
00048   }
00049   bool hasSplitParameters(Alignable *alignable) const { return false; }
00050   unsigned int numberOfParameterInstances(Alignable *alignable,
00051                                           int param=-1) const { return 1; }
00052   unsigned int maxNumberOfParameterInstances() const { return 1; }
00053 
00055   unsigned int paramNumFromLabel(unsigned int paramLabel) const;
00057   unsigned int alignableLabelFromLabel(unsigned int label) const;
00060   Alignable* alignableFromLabel(unsigned int label) const;
00063   unsigned int lasBeamIdFromLabel(unsigned int label) const;
00064   
00065  private:
00066   typedef std::map <Alignable*, unsigned int> AlignableToIdMap;
00067   typedef AlignableToIdMap::value_type AlignableToIdPair;
00068   typedef std::map <unsigned int, Alignable*> IdToAlignableMap;
00069   typedef std::map <unsigned int, unsigned int> UintUintMap;
00070 
00072   unsigned int buildMap(const std::vector<Alignable*> &alis);
00074   unsigned int buildReverseMap();
00075 
00076   // data members
00077   AlignableToIdMap  theAlignableToIdMap; 
00078   IdToAlignableMap  theIdToAlignableMap; 
00079   UintUintMap       theLasBeamToLabelMap;  
00080   UintUintMap       theLabelToLasBeamMap; 
00081 };
00082 
00083 #endif