File indexing completed on 2024-04-06 11:56:42
0001 #ifndef Alignment_MuonAlignmentAlgorithms_MuonResiduals1DOFFitter_H
0002 #define Alignment_MuonAlignmentAlgorithms_MuonResiduals1DOFFitter_H
0003
0004
0005
0006
0007
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