Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:42

0001 #ifndef Alignment_MuonAlignmentAlgorithms_MuonResiduals6DOFrphiFitter_H
0002 #define Alignment_MuonAlignmentAlgorithms_MuonResiduals6DOFrphiFitter_H
0003 
0004 /** \class MuonResiduals6DOFrphiFitter
0005  *  $Date: Thu Apr 16 21:29:15 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 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
0015 #endif
0016 
0017 class TTree;
0018 
0019 class MuonResiduals6DOFrphiFitter : public MuonResidualsFitter {
0020 public:
0021   enum {
0022     kAlignX = 0,
0023     kAlignY,
0024     kAlignZ,
0025     kAlignPhiX,
0026     kAlignPhiY,
0027     kAlignPhiZ,
0028     kResidSigma,
0029     kResSlopeSigma,
0030     kAlpha,
0031     kResidGamma,
0032     kResSlopeGamma,
0033     kNPar
0034   };
0035 
0036   enum { kResid = 0, kResSlope, kPositionX, kPositionY, kAngleX, kAngleY, kRedChi2, kPz, kPt, kCharge, kNData };
0037 
0038   MuonResiduals6DOFrphiFitter(int residualsModel, int minHits, int useResiduals, bool weightAlignment = true)
0039       : MuonResidualsFitter(residualsModel, minHits, useResiduals, weightAlignment) {}
0040 
0041 #ifndef STANDALONE_FITTER
0042   MuonResiduals6DOFrphiFitter(
0043       int residualsModel, int minHits, int useResiduals, const CSCGeometry *cscGeometry, bool weightAlignment = true)
0044       : MuonResidualsFitter(residualsModel, minHits, useResiduals, weightAlignment) {}
0045 #endif
0046 
0047   ~MuonResiduals6DOFrphiFitter() override {}
0048 
0049   int type() const override { return MuonResidualsFitter::k6DOFrphi; }
0050 
0051   int npar() override {
0052     if (residualsModel() == kPureGaussian || residualsModel() == kPureGaussian2D ||
0053         residualsModel() == kGaussPowerTails)
0054       return kNPar - 2;
0055     else if (residualsModel() == kPowerLawTails)
0056       return kNPar;
0057     else if (residualsModel() == kROOTVoigt)
0058       return kNPar;
0059     else
0060       assert(false);
0061   }
0062   int ndata() override { return kNData; }
0063 
0064   double sumofweights() override;
0065   bool fit(Alignable *ali) override;
0066   double plot(std::string name, TFileDirectory *dir, Alignable *ali) override;
0067 
0068   void correctBField() override;
0069 
0070   TTree *readNtuple(std::string fname,
0071                     unsigned int endcap,
0072                     unsigned int station,
0073                     unsigned int ring,
0074                     unsigned int chamber,
0075                     unsigned int preselected = 1);
0076 
0077 protected:
0078   void inform(TMinuit *tMinuit) override;
0079 
0080 private:
0081   //const CSCGeometry *m_cscGeometry;
0082 };
0083 
0084 #endif  // Alignment_MuonAlignmentAlgorithms_MuonResiduals6DOFrphiFitter_H