Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Alignment_MuonAlignmentAlgorithms_MuonResiduals1DOFFitter_H
0002 #define Alignment_MuonAlignmentAlgorithms_MuonResiduals1DOFFitter_H
0003 
0004 /** \class MuonResiduals1DOFFitter
0005  *  $Date: Fri Apr 17 16:09:40 CDT 2009
0006  *  $Revision: 1.4 $ 
0007  *  \author J. Pivarski - Texas A&M University <pivarski@physics.tamu.edu>
0008  */
0009 
0010 #include "Alignment/MuonAlignmentAlgorithms/interface/MuonResidualsFitter.h"
0011 
0012 class MuonResiduals1DOFFitter : public MuonResidualsFitter {
0013 public:
0014   enum { kAlign = 0, kSigma, kGamma, kNPar };
0015 
0016   enum { kResid = 0, kRedChi2, kNData };
0017 
0018   MuonResiduals1DOFFitter(int residualsModel, int minHits, int useResiduals, bool weightAlignment = true)
0019       : MuonResidualsFitter(residualsModel, minHits, useResiduals, weightAlignment) {}
0020 
0021   int type() const override { return MuonResidualsFitter::k1DOF; }
0022 
0023   int npar() override {
0024     if (residualsModel() == kPureGaussian || residualsModel() == kGaussPowerTails)
0025       return kNPar - 1;
0026     else if (residualsModel() == kPowerLawTails)
0027       return kNPar;
0028     else if (residualsModel() == kROOTVoigt)
0029       return kNPar;
0030     else
0031       assert(false);
0032   }
0033   int ndata() override { return kNData; }
0034 
0035   double sumofweights() override;
0036   bool fit(Alignable *ali) override;
0037   double plot(std::string name, TFileDirectory *dir, Alignable *ali) override;
0038 
0039 protected:
0040   void inform(TMinuit *tMinuit) override;
0041 };
0042 
0043 #endif  // Alignment_MuonAlignmentAlgorithms_MuonResiduals1DOFFitter_H