CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 #ifndef Alignment_MillePedeAlignmentAlgorithm_PedeLabelerBase_h
00002 #define Alignment_MillePedeAlignmentAlgorithm_PedeLabelerBase_h
00003 
00015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00016 
00017 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h"
00018 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00019 
00020 #include "CondFormats/Common/interface/Time.h"
00021 
00022 #include <vector>
00023 
00024 class Alignable;
00025 class AlignableTracker;
00026 class AlignableMuon;
00027 class AlignableExtras;
00028 class IntegratedCalibrationBase;
00029 
00030 /***************************************
00031 ****************************************/
00032 class PedeLabelerBase
00033 {
00034  public:
00035 
00036   typedef AlignmentAlgorithmBase::RunNumber  RunNumber;
00037   typedef AlignmentAlgorithmBase::RunRange   RunRange;
00038   typedef std::vector<RunRange>              RunRanges;
00039 
00040   class TopLevelAlignables
00041   {
00042   public:
00043     TopLevelAlignables(AlignableTracker *aliTracker,
00044                        AlignableMuon *aliMuon,
00045                        AlignableExtras *extras)
00046       :aliTracker_(aliTracker), aliMuon_(aliMuon), aliExtras_(extras) {}
00047     AlignableTracker *aliTracker_;
00048     AlignableMuon *aliMuon_;
00049     AlignableExtras *aliExtras_;
00050   };
00051 
00053   PedeLabelerBase(const TopLevelAlignables& alignables,
00054                   const edm::ParameterSet & config);
00055   virtual ~PedeLabelerBase() {}
00057   virtual void addCalibrations(const std::vector<IntegratedCalibrationBase*> &iCals);
00058 
00062   virtual unsigned int alignableLabel(Alignable *alignable) const = 0;
00067   virtual unsigned int alignableLabelFromParamAndInstance(Alignable *alignable,
00068                                                           unsigned int param,
00069                                                           unsigned int instance) const = 0;
00070   virtual unsigned int lasBeamLabel(unsigned int lasBeamId) const = 0;
00072   virtual unsigned int parameterLabel(unsigned int aliLabel, unsigned int parNum) const = 0;
00075   virtual unsigned int parameterLabel(Alignable *alignable, unsigned int parNum,
00076                                       const AlignmentAlgorithmBase::EventInfo &eventInfo,
00077                                       const TrajectoryStateOnSurface &tsos) const = 0;
00079   virtual bool hasSplitParameters(Alignable *alignable) const = 0;
00081   virtual unsigned int numberOfParameterInstances(Alignable *alignable,
00082                                                   int param=-1) const = 0;
00084   virtual unsigned int maxNumberOfParameterInstances() const = 0;
00086   unsigned int parameterInstanceOffset() const { return theParamInstanceOffset; }
00087 
00089   virtual unsigned int paramNumFromLabel(unsigned int paramLabel) const = 0;
00091   virtual unsigned int alignableLabelFromLabel(unsigned int label) const = 0;
00094   virtual Alignable* alignableFromLabel(unsigned int label) const = 0;
00097   virtual unsigned int lasBeamIdFromLabel(unsigned int label) const = 0;
00100   virtual std::pair<IntegratedCalibrationBase*, unsigned int>
00101     calibrationParamFromLabel(unsigned int label) const;
00102 
00103   virtual const RunRange& runRangeFromLabel(unsigned int label) const {
00104     return theOpenRunRange;
00105   }
00108   virtual unsigned int firstFreeLabel() const;
00109 
00111   virtual unsigned int calibrationLabel(const IntegratedCalibrationBase* calib,
00112                                         unsigned int paramNum) const;
00113 
00114   static const unsigned int theMaxNumParam;
00115   static const unsigned int theParamInstanceOffset;
00116   static const unsigned int theMinLabel;
00117 
00118  protected:
00121   virtual unsigned int firstNonAlignableLabel() const;
00122 
00123   const RunRange theOpenRunRange;
00124 
00125  private:
00127   std::vector<std::pair<IntegratedCalibrationBase*, unsigned int> > theCalibrationLabels;
00128 
00129 };
00130 
00131 #endif