Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:45:25

0001 #ifndef Alignment_MuonAlignmentAlgorithms_MuonResiduals6DOFFitter_H
0002 #define Alignment_MuonAlignmentAlgorithms_MuonResiduals6DOFFitter_H
0003 
0004 /** \class MuonResiduals6DOFFitter
0005  *  $Date: Thu Apr 16 14:20:58 CDT 2009
0006  *  $Revision: 1.5 $ 
0007  *  \author J. Pivarski - Texas A&M University <pivarski@physics.tamu.edu>
0008  */
0009 
0010 #ifdef STANDALONE_FITTER
0011 #include "MuonResidualsFitter.h"
0012 #else
0013 #include "Alignment/MuonAlignmentAlgorithms/interface/MuonResidualsFitter.h"
0014 #endif
0015 
0016 class TTree;
0017 
0018 class MuonResiduals6DOFFitter : public MuonResidualsFitter {
0019 public:
0020   enum {
0021     kAlignX = 0,
0022     kAlignY,
0023     kAlignZ,
0024     kAlignPhiX,
0025     kAlignPhiY,
0026     kAlignPhiZ,
0027     kResidXSigma,
0028     kResidYSigma,
0029     kResSlopeXSigma,
0030     kResSlopeYSigma,
0031     kAlphaX,
0032     kAlphaY,
0033     kResidXGamma,
0034     kResidYGamma,
0035     kResSlopeXGamma,
0036     kResSlopeYGamma,
0037     kNPar
0038   };
0039 
0040   enum {
0041     kResidX = 0,
0042     kResidY,
0043     kResSlopeX,
0044     kResSlopeY,
0045     kPositionX,
0046     kPositionY,
0047     kAngleX,
0048     kAngleY,
0049     kRedChi2,
0050     kPz,
0051     kPt,
0052     kCharge,
0053     kStation,
0054     kWheel,
0055     kSector,
0056     kChambW,
0057     kChambl,
0058     kNData
0059   };
0060 
0061   MuonResiduals6DOFFitter(int residualsModel, int minHits, int useResiduals, bool weightAlignment = true)
0062       : MuonResidualsFitter(residualsModel, minHits, useResiduals, weightAlignment) {}
0063   ~MuonResiduals6DOFFitter() override {}
0064 
0065   int type() const override { return MuonResidualsFitter::k6DOF; }
0066 
0067   int npar() override {
0068     if (residualsModel() == kPureGaussian || residualsModel() == kPureGaussian2D ||
0069         residualsModel() == kGaussPowerTails)
0070       return kNPar - 4;
0071     else if (residualsModel() == kPowerLawTails)
0072       return kNPar;
0073     else if (residualsModel() == kROOTVoigt)
0074       return kNPar;
0075     else
0076       assert(false);
0077   }
0078   int ndata() override { return kNData; }
0079 
0080   double sumofweights() override;
0081   bool fit(Alignable *ali) override;
0082   double plot(std::string name, TFileDirectory *dir, Alignable *ali) override;
0083 
0084   void correctBField() override;
0085 
0086   TTree *readNtuple(
0087       std::string fname, unsigned int wheel, unsigned int station, unsigned int sector, unsigned int preselected = 1);
0088 
0089 protected:
0090   void inform(TMinuit *tMinuit) override;
0091 };
0092 
0093 #endif  // Alignment_MuonAlignmentAlgorithms_MuonResiduals6DOFFitter_H