CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/Alignment/MuonAlignmentAlgorithms/interface/MuonResiduals6DOFrphiFitter.h

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