19#ifndef ALICEO2_FWDALIGN_MILLEPEDE2_H
20#define ALICEO2_FWDALIGN_MILLEPEDE2_H
64 const int lNStdDev = -1,
const double lResCut = -1.,
65 const double lResCutInit = -1.,
const std::vector<int>& regroup = {});
186 std::vector<double>& error,
187 std::vector<double>& pull);
219 void SetAccRunList(
const int* runs,
const int nruns,
const float* wghList =
nullptr);
231 const double val,
const double sigma = 0,
232 const bool doPrint =
false);
236 const std::vector<double>& dergb,
237 const int ngb,
const double val,
238 double sigma = 0,
const bool doPrint =
false);
241 void SetLocalEquation(std::vector<double>& dergb, std::vector<double>& derlc,
242 const double lMeas,
const double lSigma);
247 int ngb, std::vector<int>& indlc,
248 std::vector<double>& derlc,
const int nlc,
249 const double lMeas,
const double lSigma);
294 void ReadRecordData(
const long recID,
const bool doPrint =
false);
302 int LocalFit(std::vector<double>& localParams);
304 bool IsZero(
const double v,
const double eps = 1e-16)
const {
return TMath::Abs(
v) < eps; }
Sparse matrix class (from AliROOT), used as a global matrix for MillePede2.
Abstract class (from AliROOT) for square matrix used for millepede2 operation.
Class to store the data of single track processing.
Class dedicated to read MillePedeRecords from ROOT files.
Class dedicated to write MillePedeRecords to output file for FWDALIGN.
General class (from AliROOT) for solving large system of linear equations.
Class for rectangular matrix used for millepede2 operation.
Fast symmetric matrix (from AliROOT) with dynamically expandable size.
void SetResCut(const float v)
std::vector< bool > fIsLinear
[fNGloPar] Flag for linear parameters
void ReadRecordConstraint(const long recID, const bool doPrint=false)
read constraint record (if any) at entry id recID
static void SetWeightSigma(const bool v=true)
std::vector< int > fkReGroup
optional regrouping of parameters wrt ID's from the records
void SetChi2CutFactor(const float v)
void SetMinPntValid(const int n)
std::vector< int > fCGlo2Glo
[fNGloPar] compressed ID to global ID buffer
static int fgNKrylovV
size of Krylov vectors buffer in FGMRES
void SetGlobalConstraint(const std::vector< double > &dergb, const double val, const double sigma=0, const bool doPrint=false)
define a constraint equation
o2::fwdalign::MilleRecordWriter * fConstraintsRecWriter
constraints record writer
o2::fwdalign::MilleRecordReader * fConstraintsRecReader
constraints record reader
TArrayL * fAccRunList
list of runs to select (if any)
float fResCut
Cut in residual for other iterartiona.
int GetMinRecordLength() const
int SolveGlobalMatEq()
solve global matrix equation MatCGlob*X=VecBGlo and store the result in the VecBGlo
int fNGloPar
number of global parameters
static void SetInvChol(const bool v=true)
TString fRecChi2TreeName
Name of chi2 per record tree.
bool GetUseRecordWeight() const
int GetNLocalFits() const
static double GetMinResTol()
std::vector< int > fProcPnt
[fNGloPar] N of processed points per global variable
int fIter
Current iteration.
static int fgMinResCondType
Type of the preconditioner for MinRes method.
void SetWghScale(const double wOdd=1, const double wEven=1)
void SetResCurInit(const float v)
bool InitChi2Storage(const int nEntriesAutoSave=10000)
initialize the file and tree to store chi2 from LocalFit()
std::vector< int > fFillIndex
[fNGloPar] auxilary index array for fast matrix fill
std::vector< int > fParamGrID
[fNGloPar] group id for the every parameter
static void SetIterSolverType(const int val=MinResSolve::kSolMinRes)
bool fLocFitAdd
Add contribution of carrent track (and not eliminate it)
int fNGloParIni
number of global parameters before grouping
static int fgMinResMaxIter
Max number of iterations for the MinRes method.
void SetRejRunList(const int *runs, const int nruns)
set the list of runs to be rejected
long fNLocFitsRejected
Number of local fits rejected.
SymMatrix * GetLocalMatrix() const
int LocalFit(std::vector< double > &localParams)
Perform local parameters fit once all the local equations have been set.
static bool IsGlobalMatSparse()
void DisableRecordWriter()
Disable record writer for DPL process.
std::vector< double > fVecBGlo
bool fDisableRecordWriter
disable record writer for DPL process
static void SetNKrylovV(const int val=60)
int GetNGlobalConstraints() const
int GlobalFitIteration()
perform global parameters fit once all the local equations have been fitted
static int fgIterSol
type of iterative solution: MinRes or FGMRES
int GetProcessedPoints(int i) const
o2::fwdalign::RectMatrix * fMatCGloLoc
Rectangular matrix C g*l.
long GetNLocalEquations() const
static int GetMinResMaxIter()
int fNLocPar
number of local parameters
std::vector< double > fVecBLoc
[fNLocPar] Vector B local (parameters)
const char * GetRecChi2FName() const
return file name where is stored chi2 from LocalFit()
long fCurrRecDataID
ID of the current data record.
long GetNLocalFitsRejected() const
std::vector< int > GetProcessedPoints() const
static void SetMinResPrecondType(const int tp=0)
int fGloSolveStatus
Status of global solver at current step.
o2::fwdalign::MilleRecordReader * fRecordReader
data record reader
int GetNGlobalsFixed() const
void SetNStdDev(const int n)
void SetNonLinear(int index, bool v=true)
std::vector< double > fDiagCGlo
[fNGloPar] Initial diagonal elements of C global matrix
long fNLocEquations
Number of local equations.
int fMinRecordLength
ignore shorter records
std::vector< double > fSigmaPar
[fNGloPar] Sigma of allowed variation of global parameter
int fNLagrangeConstraints
Number of constraint equations requiring Lagrange multiplier.
std::vector< bool > GetIsLinear() const
double fWghScl[2]
optional rescaling for odd/even residual weights (see its usage in LocalFit)
int fNStdDev
Number of standard deviations for chi2 cut.
int InitMille(int nGlo, const int nLoc, const int lNStdDev=-1, const double lResCut=-1., const double lResCutInit=-1., const std::vector< int > ®roup={})
init all
double GetFinalError(int i) const
std::vector< double > fDeltaPar
[fNGloPar] Variation of global parameters
std::vector< double > GetDeltaPars() const
void SetParSigma(int i, double par)
static void SetMinResTol(double val=1e-12)
float GetChi2CutFactor() const
static bool fgIsMatGloSparse
Type of the global matrix (sparse ...)
int GetParamGrID(int i) const
int fSelFirst
event selection start
void SetConstraintsRecWriter(o2::fwdalign::MilleRecordWriter *myP)
int fNGloFix
Number of globals fixed by user.
float fResCutInit
Cut in residual for first iterartion.
void SetConstraintsRecReader(o2::fwdalign::MilleRecordReader *myP)
static bool IsWeightSigma()
int GetNMaxIterations() const
int GetGlobalSolveStatus() const
std::vector< double > fFillValue
[fNGloPar] auxilary value array for fast matrix fill
void SetParamGrID(const int grID, int i)
static int GetMinResPrecondType()
void EndChi2Storage()
write tree and close file where are stored chi2 from LocalFit()
double GetParError(int iPar) const
return error for parameter iPar
double GetGlobal(int i) const
MillePede2 & operator=(const MillePede2 &)
o2::fwdalign::MilleRecordWriter * fRecordWriter
data record writer
std::vector< int > fGlo2CGlo
Flag for used constraints.
void SetNGloPar(const int n)
void SetLocalEquation(std::vector< double > &dergb, std::vector< double > &derlc, const double lMeas, const double lSigma)
assing derivs of loc.eq.
double GetPull(int i) const
return pull for parameter iPar
bool fUseRecordWeight
force or ignore the record weight
void ReadRecordData(const long recID, const bool doPrint=false)
read data record (if any) at entry recID
std::vector< double > GetGlobals() const
int SetIterations(const double lChi2CutFac)
Number of iterations is calculated from lChi2CutFac.
int fNGloSize
final size of the global matrix (NGloPar+NConstraints)
int fNGroupsSet
number of groups set
TArrayL * fRejRunList
list of runs to reject (if any)
void SetRecord(o2::fwdalign::MillePedeRecord *aRecord)
int PrintGlobalParameters() const
print the final results into the logfile
void SetMinRecordLength(const int v=1)
bool IsZero(const double v, const double eps=1e-16) const
double GetSigmaPar(int i) const
int fMinPntValid
min number of points for global to vary
int GetCurrentIteration() const
std::vector< bool > fConstrUsed
std::vector< double > GetSigmaPars() const
int fNGloConstraints
Number of constraint equations.
float fChi2CutFactor
Cut factor for chi2 cut to accept local fit.
int GetNGloParIni() const
std::vector< int > GetRegrouping() const
int GetNLagrangeConstraints() const
int fSelLast
event selection end
TArrayF * fAccRunListWgh
optional weights for data of accepted runs (if any)
float GetResCurInit() const
int GlobalFit(std::vector< double > &par, std::vector< double > &error, std::vector< double > &pull)
performs a requested number of global iterations
void SetNMaxIterations(const int n=10)
void SetSigmaPars(const double *par)
initialize sigmas, account for eventual grouping
void SetSigmaPar(int i, double par)
initialize sigma, account for eventual grouping
std::vector< double > GetInitPars() const
void SetRecordWriter(o2::fwdalign::MilleRecordWriter *myP)
static void SetGlobalMatSparse(const bool v=true)
int GetMinPntValid() const
void SetUseRecordWeight(const bool v=true)
o2::fwdalign::MillePedeRecord * GetRecord() const
double GetInitPar(int i) const
o2::fwdalign::MillePedeRecord * fRecord
Buffer of measurements records.
void SetRecordReader(o2::fwdalign::MilleRecordReader *myP)
void SetAccRunList(const int *runs, const int nruns, const float *wghList=nullptr)
set the list of runs to be selected
static bool fgInvChol
Invert global matrix in Cholesky solver.
void SetInitPars(const double *par)
initialize parameters, account for eventual grouping
float GetChi2CutRef() const
static int GetIterSolverType()
double GetFinalParam(int i) const
o2::fwdalign::MatrixSq * fMatCGlo
Matrix C global.
static double fgMinResTol
Tolerance for MinRes solution.
o2::fwdalign::SymMatrix * fMatCLoc
Matrix C local.
static void SetMinResMaxIter(const int val=2000)
std::vector< double > fInitPar
Vector B global (parameters)
MatrixSq * GetGlobalMatrix() const
long fCurrRecConstrID
ID of the current constraint record.
void SetNLocPar(const int n)
int fMaxIter
Maximum number of iterations.
void SetChi2CutRef(const float v)
float Chi2DoFLim(int nSig, int nDoF) const
return the limit in chi^2/nd for n sigmas stdev authorized
long fNLocFits
Number of local fits.
static bool fgWeightSigma
weight parameter constraint by statistics
bool IsRecordAcceptable()
validate record according run lists set by the user
bool GetIsLinear(int i) const
float fChi2CutRef
Reference cut for chi2 cut to accept local fit.
void SetGlobalParameters(double *par)
void SetInitPar(int i, double par)
initialize param, account for eventual grouping
Store residuals and local/global deriavtives from a single track processing.
Class for rectangular matrix used for millepede2 operation.
Fast symmetric matrix with dynamically expandable size.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
o2::InteractionRecord ir(0, 0)