1 #ifndef Alignment_MuonAlignmentAlgorithms_MuonResidualsFitter_H 2 #define Alignment_MuonAlignmentAlgorithms_MuonResidualsFitter_H 12 #ifndef STANDALONE_FITTER 24 #include "TMatrixDSym.h" 33 #ifdef STANDALONE_FITTER 40 double width() {
return 300.; }
41 double length() {
return 300.; }
49 template <
typename T,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
50 T *
make(
const A1 &a1,
const A2 &
a2,
const A3 &a3,
const A4 &a4,
const A5 &a5)
const {
51 T *
t =
new T(a1, a2, a3, a4, a5);
54 template <
typename T,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
typename A6,
typename A7>
55 T *
make(
const A1 &a1,
const A2 &
a2,
const A3 &a3,
const A4 &a4,
const A5 &a5,
const A6 &a6,
const A7 &a7)
const {
56 T *
t =
new T(a1, a2, a3, a4, a5, a6, a7);
59 template <
typename T,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
typename A6,
typename A7,
typename A8>
60 T *
make(
const A1 &a1,
const A2 &
a2,
const A3 &a3,
const A4 &a4,
const A5 &a5,
const A6 &a6,
const A7 &a7,
const A8 &a8)
62 T *
t =
new T(a1, a2, a3, a4, a5, a6, a7, a8);
76 std::cout << name <<
" exception: " << what << std::endl;
82 #endif // STANDALONE_FITTER 86 enum { kPureGaussian, kPowerLawTails,
kROOTVoigt, kGaussPowerTails, kPureGaussian2D };
88 enum { k1DOF, k5DOF, k6DOF, k6DOFrphi,
kPositionFitter, kAngleFitter, kAngleBfieldFitter };
90 enum {
k1111, k1110, k1100, k1010, k0010, k1000, k0100 };
115 virtual int type()
const = 0;
116 virtual int npar() = 0;
117 virtual int ndata() = 0;
122 return m_useResiduals;
127 void fix(
int parNum,
bool dofix =
true);
128 bool fixed(
int parNum);
139 void fill(
double *residual);
146 assert(0 <= parNum && parNum < npar());
147 return m_value[parNum];
150 assert(0 <= parNum && parNum < npar());
151 return m_error[parNum];
159 double covarianceElement(
int parNum1,
int parNum2);
160 TMatrixDSym correlationMatrix();
166 virtual double sumofweights() = 0;
174 #ifdef STANDALONE_FITTER 177 bool fit() {
return fit(&m_ali); }
179 void plotsimple(
std::string &name,
int which,
double multiplier) { plotsimple(name, &m_dir, which, multiplier); }
180 void plotweighted(
std::string &name,
int which,
int whichredchi2,
double multiplier) {
181 plotweighted(name, &m_dir, which, whichredchi2, multiplier);
187 void read(FILE *file,
int which = 0);
190 std::vector<double *>::const_iterator
residuals_begin()
const {
return m_residuals.begin(); }
191 std::vector<double *>::const_iterator
residuals_end()
const {
return m_residuals.end(); }
193 void computeHistogramRangeAndBinning(
int which,
int &
nbins,
double &
a,
double &
b);
194 void histogramChi2GaussianFit(
int which,
double &fit_mean,
double &fit_sigma);
195 void selectPeakResiduals_simple(
double nsigma,
int nvar,
int *
vars);
196 void selectPeakResiduals(
double nsigma,
int nvar,
int *vars);
200 void fiducialCuts(
double xMin = -80.0,
204 bool fidcut1 =
false);
206 virtual void correctBField() = 0;
207 virtual void correctBField(
int idx_momentum,
int idx_q);
211 void eraseNotSelectedResiduals();
214 void initialize_table();
215 bool dofit(
void (*
fcn)(
int &,
double *,
double &,
double *,
int),
216 std::vector<int> &parNum,
217 std::vector<std::string> &parName,
218 std::vector<double> &
start,
219 std::vector<double> &
step,
220 std::vector<double> &
low,
221 std::vector<double> &
high);
222 virtual void inform(TMinuit *tMinuit) = 0;
257 #ifdef STANDALONE_FITTER 261 #ifdef STANDALONE_FITTER 271 double toversigma,
double gammaoversigma,
double max = 1000.,
double step = 0.001,
double power = 4.);
281 #endif // Alignment_MuonAlignmentAlgorithms_MuonResidualsFitter_H
double MuonResidualsFitter_logGaussPowerTails(double residual, double center, double sigma)
double MuonResidualsFitter_integrate_pureGaussian(double low, double high, double center, double sigma)
std::vector< double * >::const_iterator residuals_begin() const
Double_t MuonResidualsFitter_powerLawTails_TF1(Double_t *xvec, Double_t *par)
std::vector< double * > m_residuals
double MuonResidualsFitter_logPureGaussian2D(double x, double y, double x0, double y0, double sx, double sy, double r)
long numResiduals() const
int parNum2parIdx(int parNum)
std::vector< double > m_error
S make(const edm::ParameterSet &cfg)
void MuonResidualsPositionFitter_FCN(int &npar, double *gin, double &fval, double *par, int iflag)
MuonResidualsFitter * fitter()
int residualsModel() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
TMatrixDSym covarianceMatrix()
double MuonResidualsFitter_logROOTVoigt(double residual, double center, double sigma, double gamma)
double MuonResidualsFitter_compute_log_convolution(double toversigma, double gammaoversigma, double max=1000., double step=0.001, double power=4.)
std::vector< double > m_value
std::map< int, int > m_parNum2parIdx
double MuonResidualsFitter_logPowerLawTails(double residual, double center, double sigma, double gamma)
ClassImp(AliDaqEventHeader)
std::vector< bool > m_residuals_ok
Double_t MuonResidualsFitter_GaussPowerTails_TF1(Double_t *xvec, Double_t *par)
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Double_t MuonResidualsFitter_pureGaussian_TF1(Double_t *xvec, Double_t *par)
Namespace of DDCMS conversion namespace.
void setStrategy(int strategy)
MuonResidualsFitter * m_fitter
double errorerror(int parNum)
std::map< int, double > m_parNum2InitValue
void fcn(int &, double *, double &, double *, int)
void setInitialValue(int parNum, double value)
int useRes(int pattern=-1)
std::vector< bool > & selectedResidualsFlags()
void MuonResidualsAngleFitter_FCN(int &npar, double *gin, double &fval, double *par, int iflag)
std::vector< double * >::const_iterator residuals_end() const
std::vector< bool > m_fixed
void setPrintLevel(int printLevel)
Double_t MuonResidualsFitter_ROOTVoigt_TF1(Double_t *xvec, Double_t *par)
MuonResidualsFitterFitInfo(MuonResidualsFitter *fitter)
double MuonResidualsFitter_logPureGaussian(double residual, double center, double sigma)