00001 #ifndef Alignment_MuonAlignmentAlgorithms_MuonResiduals6DOFFitter_H 00002 #define Alignment_MuonAlignmentAlgorithms_MuonResiduals6DOFFitter_H 00003 00010 #include "Alignment/MuonAlignmentAlgorithms/interface/MuonResidualsFitter.h" 00011 00012 class MuonResiduals6DOFFitter: public MuonResidualsFitter { 00013 public: 00014 enum { 00015 kAlignX = 0, 00016 kAlignY, 00017 kAlignZ, 00018 kAlignPhiX, 00019 kAlignPhiY, 00020 kAlignPhiZ, 00021 kResidXSigma, 00022 kResidYSigma, 00023 kResSlopeXSigma, 00024 kResSlopeYSigma, 00025 kAlphaX, 00026 kAlphaY, 00027 kResidXGamma, 00028 kResidYGamma, 00029 kResSlopeXGamma, 00030 kResSlopeYGamma, 00031 kNPar 00032 }; 00033 00034 enum { 00035 kResidX = 0, 00036 kResidY, 00037 kResSlopeX, 00038 kResSlopeY, 00039 kPositionX, 00040 kPositionY, 00041 kAngleX, 00042 kAngleY, 00043 kRedChi2, 00044 kNData 00045 }; 00046 00047 MuonResiduals6DOFFitter(int residualsModel, int minHits, bool weightAlignment=true): MuonResidualsFitter(residualsModel, minHits, weightAlignment) {}; 00048 00049 int type() const { return MuonResidualsFitter::k6DOF; }; 00050 00051 int npar() { 00052 if (residualsModel() == kPureGaussian || residualsModel() == kGaussPowerTails) return kNPar - 4; 00053 else if (residualsModel() == kPowerLawTails) return kNPar; 00054 else if (residualsModel() == kROOTVoigt) return kNPar; 00055 else assert(false); 00056 }; 00057 int ndata() { return kNData; }; 00058 00059 double sumofweights(); 00060 bool fit(Alignable *ali); 00061 double plot(std::string name, TFileDirectory *dir, Alignable *ali); 00062 00063 protected: 00064 void inform(TMinuit *tMinuit); 00065 }; 00066 00067 double MuonResiduals6DOFFitter_x(double delta_x, double delta_y, double delta_z, double delta_phix, double delta_phiy, double delta_phiz, double track_x, double track_y, double track_dxdz, double track_dydz, double alphax, double residual_dxdz); 00068 double MuonResiduals6DOFFitter_y(double delta_x, double delta_y, double delta_z, double delta_phix, double delta_phiy, double delta_phiz, double track_x, double track_y, double track_dxdz, double track_dydz, double alphay, double residual_dydz); 00069 double MuonResiduals6DOFFitter_dxdz(double delta_x, double delta_y, double delta_z, double delta_phix, double delta_phiy, double delta_phiz, double track_x, double track_y, double track_dxdz, double track_dydz); 00070 double MuonResiduals6DOFFitter_dydz(double delta_x, double delta_y, double delta_z, double delta_phix, double delta_phiy, double delta_phiz, double track_x, double track_y, double track_dxdz, double track_dydz); 00071 00072 #endif // Alignment_MuonAlignmentAlgorithms_MuonResiduals6DOFFitter_H