CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/Alignment/MuonAlignmentAlgorithms/interface/MuonResiduals6DOFFitter.h

Go to the documentation of this file.
00001 #ifndef Alignment_MuonAlignmentAlgorithms_MuonResiduals6DOFFitter_H
00002 #define Alignment_MuonAlignmentAlgorithms_MuonResiduals6DOFFitter_H
00003 
00010 #ifdef STANDALONE_FITTER
00011 #include "MuonResidualsFitter.h"
00012 #else
00013 #include "Alignment/MuonAlignmentAlgorithms/interface/MuonResidualsFitter.h"
00014 #endif
00015 
00016 class TTree;
00017 
00018 class MuonResiduals6DOFFitter: public MuonResidualsFitter
00019 {
00020 public:
00021   enum {
00022     kAlignX = 0,
00023     kAlignY,
00024     kAlignZ,
00025     kAlignPhiX,
00026     kAlignPhiY,
00027     kAlignPhiZ,
00028     kResidXSigma,
00029     kResidYSigma,
00030     kResSlopeXSigma,
00031     kResSlopeYSigma,
00032     kAlphaX,
00033     kAlphaY,
00034     kResidXGamma,
00035     kResidYGamma,
00036     kResSlopeXGamma,
00037     kResSlopeYGamma,
00038     kNPar
00039   };
00040 
00041   enum {
00042     kResidX = 0,
00043     kResidY,
00044     kResSlopeX,
00045     kResSlopeY,
00046     kPositionX,
00047     kPositionY,
00048     kAngleX,
00049     kAngleY,
00050     kRedChi2,
00051     kPz,
00052     kPt,
00053     kCharge,
00054     kNData
00055   };
00056 
00057   MuonResiduals6DOFFitter(int residualsModel, int minHits, int useResiduals, bool weightAlignment=true): MuonResidualsFitter(residualsModel, minHits, useResiduals, weightAlignment) {}
00058   virtual ~MuonResiduals6DOFFitter() {}
00059 
00060   int type() const { return MuonResidualsFitter::k6DOF; }
00061 
00062   int npar() {
00063     if (residualsModel() == kPureGaussian || residualsModel() == kPureGaussian2D || residualsModel() == kGaussPowerTails) return kNPar - 4;
00064     else if (residualsModel() == kPowerLawTails) return kNPar;
00065     else if (residualsModel() == kROOTVoigt) return kNPar;
00066     else assert(false);
00067   }
00068   int ndata() { return kNData; }
00069 
00070   double sumofweights();
00071   bool fit(Alignable *ali);
00072   double plot(std::string name, TFileDirectory *dir, Alignable *ali);
00073 
00074   void correctBField();
00075 
00076   TTree * readNtuple(std::string fname, unsigned int wheel, unsigned int station, unsigned int sector, unsigned int preselected = 1);
00077 
00078 protected:
00079   void inform(TMinuit *tMinuit);
00080 };
00081 
00082 #endif // Alignment_MuonAlignmentAlgorithms_MuonResiduals6DOFFitter_H