1 #ifndef Alignment_MuonAlignmentAlgorithms_MuonResidualsFitter_H 2 #define Alignment_MuonAlignmentAlgorithms_MuonResidualsFitter_H 12 #ifndef STANDALONE_FITTER 24 #include "TMatrixDSym.h" 33 #ifdef STANDALONE_FITTER 42 double width() {
return 300.;}
43 double length() {
return 300.;}
52 template<
typename T,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5>
53 T *
make(
const A1 &a1,
const A2 &a2,
const A3 &a3,
const A4 &a4,
const A5 &a5 )
const {
T *
t =
new T(a1, a2, a3, a4, a5);
return t; }
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 {
T *
t =
new T(a1, a2, a3, a4, a5, a6, a7);
return t; }
56 template<
typename T,
typename A1,
typename A2,
typename A3,
typename A4,
typename A5,
typename A6,
typename A7,
typename A8>
57 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)
const {
T *
t =
new T(a1, a2, a3, a4, a5, a6, a7, a8);
return t; }
70 std::cout<<name<<
" exception: "<<what<<std::endl;
76 #endif // STANDALONE_FITTER 135 virtual int type()
const = 0;
136 virtual int npar() = 0;
137 virtual int ndata() = 0;
143 void fix(
int parNum,
bool dofix=
true);
144 bool fixed(
int parNum);
155 void fill(
double *residual);
161 double value(
int parNum) { assert(0 <= parNum && parNum < npar());
return m_value[parNum]; }
162 double errorerror(
int parNum) { assert(0 <= parNum && parNum < npar());
return m_error[parNum]; }
169 double covarianceElement(
int parNum1,
int parNum2);
170 TMatrixDSym correlationMatrix();
176 virtual double sumofweights() = 0;
184 #ifdef STANDALONE_FITTER 187 bool fit() {
return fit(&m_ali); }
189 void plotsimple(
std::string &name,
int which,
double multiplier) { plotsimple(name, &m_dir, which, multiplier); }
190 void plotweighted(
std::string &name,
int which,
int whichredchi2,
double multiplier) { plotweighted(name, &m_dir, which, whichredchi2, multiplier); }
195 void read(FILE *file,
int which=0);
198 std::vector<double*>::const_iterator
residuals_begin()
const {
return m_residuals.begin(); }
199 std::vector<double*>::const_iterator
residuals_end()
const {
return m_residuals.end(); }
201 void computeHistogramRangeAndBinning(
int which,
int &
nbins,
double &
a,
double &
b);
202 void histogramChi2GaussianFit(
int which,
double &fit_mean,
double &fit_sigma);
203 void selectPeakResiduals_simple(
double nsigma,
int nvar,
int *
vars);
204 void selectPeakResiduals(
double nsigma,
int nvar,
int *vars);
208 void fiducialCuts(
double xMin = -80.0,
double xMax = 80.0,
double yMin = -80.0,
double yMax = 80.0,
bool fidcut1=
false);
210 virtual void correctBField() = 0;
211 virtual void correctBField(
int idx_momentum,
int idx_q);
215 void eraseNotSelectedResiduals();
218 void initialize_table();
219 bool dofit(
void (*
fcn)(
int&,
double*,
double&,
double*,
int), std::vector<int> &parNum, std::vector<std::string> &parName, std::vector<double> &
start, std::vector<double> &
step, std::vector<double> &low, std::vector<double> &high);
220 virtual void inform(TMinuit *tMinuit) = 0;
255 #ifdef STANDALONE_FITTER 259 #ifdef STANDALONE_FITTER 278 #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)
Double_t MuonResidualsFitter_powerLawTails_TF1(Double_t *xvec, Double_t *par)
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::vector< double * > m_residuals
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)
std::map< int, int > m_parNum2parIdx
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)
std::vector< double * >::const_iterator residuals_end() const
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< bool > m_fixed
void setPrintLevel(int printLevel)
Double_t MuonResidualsFitter_ROOTVoigt_TF1(Double_t *xvec, Double_t *par)
std::vector< double * >::const_iterator residuals_begin() const
MuonResidualsFitterFitInfo(MuonResidualsFitter *fitter)
double MuonResidualsFitter_logPureGaussian(double residual, double center, double sigma)