CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/Alignment/MuonAlignmentAlgorithms/interface/MuonResiduals1DOFFitter.h

Go to the documentation of this file.
00001 #ifndef Alignment_MuonAlignmentAlgorithms_MuonResiduals1DOFFitter_H
00002 #define Alignment_MuonAlignmentAlgorithms_MuonResiduals1DOFFitter_H
00003 
00010 #include "Alignment/MuonAlignmentAlgorithms/interface/MuonResidualsFitter.h"
00011 
00012 class MuonResiduals1DOFFitter: public MuonResidualsFitter {
00013 public:
00014   enum {
00015     kAlign = 0,
00016     kSigma,
00017     kGamma,
00018     kNPar
00019   };
00020 
00021   enum {
00022     kResid = 0,
00023     kRedChi2,
00024     kNData
00025   };
00026 
00027   MuonResiduals1DOFFitter(int residualsModel, int minHits, int useResiduals, bool weightAlignment=true): MuonResidualsFitter(residualsModel, minHits, useResiduals, weightAlignment) {}
00028 
00029   int type() const { return MuonResidualsFitter::k1DOF; }
00030 
00031   int npar() {
00032     if (residualsModel() == kPureGaussian || residualsModel() == kGaussPowerTails) return kNPar - 1;
00033     else if (residualsModel() == kPowerLawTails) return kNPar;
00034     else if (residualsModel() == kROOTVoigt) return kNPar;
00035     else assert(false);
00036   }
00037   int ndata() { return kNData; }
00038 
00039   double sumofweights();
00040   bool fit(Alignable *ali);
00041   double plot(std::string name, TFileDirectory *dir, Alignable *ali);
00042 
00043 protected:
00044   void inform(TMinuit *tMinuit);
00045 };
00046 
00047 #endif // Alignment_MuonAlignmentAlgorithms_MuonResiduals1DOFFitter_H