}
AliKFParticle kfp1( *(paramP), spdg[p1] *TMath::Sign(1,p1) );
AliKFParticle kfp2( *(paramN), spdg[p2] *TMath::Sign(1,p2) );
- AliKFParticle *V0KF = new AliKFParticle;
- *(V0KF)+=kfp1;
- *(V0KF)+=kfp2;
- if (type==0) return V0KF->GetMass();
- if (type==1) return V0KF->GetErrMass();
- if (type==2) return V0KF->GetChi2();
+ AliKFParticle *v0KF = new AliKFParticle;
+ *(v0KF)+=kfp1;
+ *(v0KF)+=kfp2;
+ if (type==0) return v0KF->GetMass();
+ if (type==1) return v0KF->GetErrMass();
+ if (type==2) return v0KF->GetChi2();
return 0;
}
//
AliKFParticle kfp1( *paramP, spdg[p1] *TMath::Sign(1,p1) );
AliKFParticle kfp2( *paramN, spdg[p2] *TMath::Sign(1,p2) );
- AliKFParticle *V0KF = new AliKFParticle;
- *(V0KF)+=kfp1;
- *(V0KF)+=kfp2;
- if (type==0) return V0KF->GetMass();
- if (type==1) return V0KF->GetErrMass();
- if (type==2) return V0KF->GetChi2();
+ AliKFParticle *v0KF = new AliKFParticle;
+ *(v0KF)+=kfp1;
+ *(v0KF)+=kfp2;
+ if (type==0) return v0KF->GetMass();
+ if (type==1) return v0KF->GetErrMass();
+ if (type==2) return v0KF->GetChi2();
return 0;
}
}
//_____________________________________________________________________________
-void AliGRPManager::SetGRPEntry(AliGRPObject* source)
+void AliGRPManager::SetGRPEntry(const AliGRPObject* source)
{
// Create a GRP entry from the extrnaly provide GRP object
// To be used by HLT to create an online GRP instance
const AliGRPObject* GetGRPData() const { return fGRPData; }
- void SetGRPEntry(AliGRPObject* source);
+ void SetGRPEntry(const AliGRPObject* source);
Bool_t ReadGRPEntry();
Bool_t SetMagField();
{ SetVertexerTracksCuts(1,ncuts,cuts); return; }
void SetVertexerV0Cuts(Int_t ncuts,Double_t cuts[7]);
void SetVertexerCascadeCuts(Int_t ncuts,Double_t cuts[8]);
- void SetVertexerTracksTPCClusterization(Bool_t use, Double_t dzcut, Double_t nsigmazcut){
- if(use) fVertexerTracksTPCclusterize=1.;
- else fVertexerTracksTPCclusterize=0.;
- fVertexerTracksTPCclusterdz=dzcut;
- fVertexerTracksTPCclusternsigmaz=nsigmazcut;
- }
- void SetVertexerTracksITSClusterization(Bool_t use, Double_t dzcut, Double_t nsigmazcut){
- if(use) fVertexerTracksITSclusterize=1.;
- else fVertexerTracksITSclusterize=0.;
- fVertexerTracksITSclusterdz=dzcut;
- fVertexerTracksITSclusternsigmaz=nsigmazcut;
- }
-
-
+ void SetVertexerTracksTPCClusterization(Bool_t use, Double_t dzcut, Double_t nsigmazcut);
+ void SetVertexerTracksITSClusterization(Bool_t use, Double_t dzcut, Double_t nsigmazcut);
Bool_t GetVertexerTracksConstraintITS() const { return fVertexerTracksConstraintITS; }
Bool_t GetVertexerTracksConstraintTPC() const { return fVertexerTracksConstraintTPC; }
Int_t GetVertexerTracksNCuts() const { return fVertexerTracksNCuts; }
ClassDef(AliGRPRecoParam,7) // global reco parameters
};
+inline void AliGRPRecoParam::SetVertexerTracksTPCClusterization(Bool_t use, Double_t dzcut, Double_t nsigmazcut)
+{
+ // set TPC tracks clustering settings
+ if(use) fVertexerTracksTPCclusterize=1.;
+ else fVertexerTracksTPCclusterize=0.;
+ fVertexerTracksTPCclusterdz=dzcut;
+ fVertexerTracksTPCclusternsigmaz=nsigmazcut;
+}
+
+inline void AliGRPRecoParam::SetVertexerTracksITSClusterization(Bool_t use, Double_t dzcut, Double_t nsigmazcut)
+{
+ // set ITS tracks clustering settings
+ if(use) fVertexerTracksITSclusterize=1.;
+ else fVertexerTracksITSclusterize=0.;
+ fVertexerTracksITSclusterdz=dzcut;
+ fVertexerTracksITSclusternsigmaz=nsigmazcut;
+}
+
+
#endif
\r
//___________________________________________________________________\r
AliLHCData::AliLHCData(const TMap* dcsMap, double tmin, double tmax)\r
- : fTMin(0),fTMax(0),fFillNumber(0),fData(0),fFile2Process(0),fMap2Process(0)\r
+ : fTMin(0),fTMax(0),fFillNumber(0),fData(0),fkFile2Process(0),fkMap2Process(0)\r
{\r
FillData(dcsMap,tmin,tmax);\r
}\r
\r
//___________________________________________________________________\r
AliLHCData::AliLHCData(const Char_t* dcsFile, double tmin, double tmax)\r
- : fTMin(0),fTMax(0),fFillNumber(0),fData(0),fFile2Process(dcsFile),fMap2Process(0)\r
+ : fTMin(0),fTMax(0),fFillNumber(0),fData(0),fkFile2Process(dcsFile),fkMap2Process(0)\r
{\r
FillData(dcsFile,tmin,tmax);\r
}\r
{\r
// process DCS map and fill all fields. \r
Clear();\r
- fMap2Process = dcsMap;\r
+ fkMap2Process = dcsMap;\r
FillData(tmin,tmax);\r
return kTRUE;\r
}\r
{\r
// process DCS file and fill all fields. \r
Clear();\r
- fFile2Process = dcsFile;\r
+ fkFile2Process = dcsFile;\r
FillData(tmin,tmax);\r
return kTRUE;\r
}\r
int iFirst=0,iLast=0;\r
TObjArray* arr = GetDCSEntry(fgkDCSNames[kFillNum],iFirst,iLast,fTMin,fTMax);\r
if (arr) SetFillNumber( ExtractInt( (AliDCSArray*)arr->At(iFirst), 0) );\r
- if (fFile2Process) delete arr; // array was created on demand\r
+ if (fkFile2Process) delete arr; // array was created on demand\r
//\r
for (int ibm=0;ibm<2;ibm++) {\r
//\r
entry = -1;\r
last = -2;\r
TObjArray* arr;\r
- if (fMap2Process) arr = (TObjArray*)fMap2Process->GetValue(key);\r
- else if (fFile2Process) {\r
+ if (fkMap2Process) arr = (TObjArray*)fkMap2Process->GetValue(key);\r
+ else if (fkFile2Process) {\r
AliLHCReader rd;\r
- arr = rd.ReadSingleLHCDP(fFile2Process,key);\r
+ arr = rd.ReadSingleLHCDP(fkFile2Process,key);\r
}\r
else {\r
AliError("Neither DCS map nor DCS filename are set");\r
//\r
if (!arr || !arr->GetEntriesFast()) { \r
AliWarning(Form("No data for %s",key)); \r
- if (fMap2Process) delete arr; // created on demand\r
+ if (fkMap2Process) delete arr; // created on demand\r
return 0;\r
}\r
int ntot = arr->GetEntriesFast();\r
str += " : ";\r
str += AliLHCDipValD::TimeAsString(tmax);\r
AliWarning(Form("All entries for %s are outside the requested range:\n%s",key,str.Data()));\r
- if (fMap2Process) delete arr; // created on demand\r
+ if (fkMap2Process) delete arr; // created on demand\r
return 0;\r
}\r
if (entry>0) entry--;\r
// if (last) break;\r
}\r
//\r
- if (fFile2Process) {\r
+ if (fkFile2Process) {\r
delete arr;\r
delete arrE;\r
}\r
prevRecI = curValI;\r
}\r
//\r
- if (fFile2Process) delete arr;\r
+ if (fkFile2Process) delete arr;\r
return refs[kNStor];\r
}\r
\r
prevRecI = curValI;\r
}\r
//\r
- if (fFile2Process) delete arr;\r
+ if (fkFile2Process) delete arr;\r
return refs[kNStor];\r
}\r
\r
fData.Add(curValS);\r
refs[kNStor]++;\r
}\r
- if (fFile2Process) delete arr;\r
+ if (fkFile2Process) delete arr;\r
return refs[kNStor];\r
}\r
\r
fData.Add(curValF);\r
refs[kNStor]++;\r
}\r
- if (fFile2Process) delete arr;\r
+ if (fkFile2Process) delete arr;\r
return refs[kNStor];\r
//\r
}\r
fData.Add(curValF);\r
refs[kNStor]++;\r
}\r
- if (fFile2Process) {\r
+ if (fkFile2Process) {\r
delete arr;\r
delete arrE;\r
}\r
fFillNumber = 0;\r
fTMin = 0;\r
fTMax = 1e10;\r
- fFile2Process = 0;\r
- fMap2Process = 0;\r
+ fkFile2Process = 0;\r
+ fkMap2Process = 0;\r
//\r
for (int i=2;i--;) {\r
fRCInjScheme[i] = 0;\r
//le\r
public:\r
//\r
- AliLHCData() : fTMin(0),fTMax(1e10),fFillNumber(0),fData(0),fFile2Process(0),fMap2Process(0) {Clear();}\r
+ AliLHCData() : fTMin(0),fTMax(1e10),fFillNumber(0),fData(0),fkFile2Process(0),fkMap2Process(0) {Clear();}\r
AliLHCData(const TMap* dcsMap, double tmin=0, double tmax=1.e10);\r
AliLHCData(const Char_t* dcsFile, double tmin=0, double tmax=1.e10);\r
virtual ~AliLHCData() {}\r
Int_t ExtractInt(AliDCSArray* dcsArray,Int_t el) const;\r
Double_t ExtractDouble(AliDCSArray* dcsArray,Int_t el) const;\r
TString& ExtractString(AliDCSArray* dcsArray) const;\r
- AliLHCData(const AliLHCData& src) : TObject(src),fTMin(0),fTMax(0),fFillNumber(0),fData(0),fFile2Process(0),fMap2Process(0) { /*dummy*/ }\r
+ AliLHCData(const AliLHCData& src) : TObject(src),fTMin(0),fTMax(0),fFillNumber(0),fData(0),fkFile2Process(0),fkMap2Process(0) { /*dummy*/ }\r
AliLHCData& operator=(const AliLHCData& ) { /*dummy*/ return *this;}\r
Int_t TimeDifference(double v1,double v2,double tol=0.9) const;\r
Bool_t IzZero(double val, double tol=1e-16) const {return TMath::Abs(val)<tol;}\r
//\r
private:\r
// non-persistent objects used at the filling time\r
- const Char_t* fFile2Process; //! name of DCS file\r
- const TMap* fMap2Process; //! DCS map to process \r
+ const Char_t* fkFile2Process; //! name of DCS file\r
+ const TMap* fkMap2Process; //! DCS map to process \r
\r
ClassDef(AliLHCData,1)\r
};\r
/* */
/* Author: ruben.shahoyan@cern.ch */
/* */
+/* */
+/* */
/**********************************************************************************************/
//___________________________________________________________
AliMatrixSparse::AliMatrixSparse(Int_t sz)
: AliMatrixSq(),fVecs(0)
{
+ // constructor
fNcols=fNrows=sz;
//
fVecs = new AliVectorSparse*[sz];
AliMatrixSparse::AliMatrixSparse(const AliMatrixSparse& src)
: AliMatrixSq(src),fVecs(0)
{
+ // copy c-tor
fVecs = new AliVectorSparse*[src.GetSize()];
for (int i=GetSize();i--;) fVecs[i] = new AliVectorSparse( *src.GetRow(i));
}
//___________________________________________________________
AliVectorSparse* AliMatrixSparse::GetRowAdd(Int_t ir)
{
+ // get row, add if needed
if (ir>=fNrows) {
AliVectorSparse** arrv = new AliVectorSparse*[ir+1];
for (int i=GetSize();i--;) arrv[i] = fVecs[i];
//___________________________________________________________
AliMatrixSparse& AliMatrixSparse::operator=(const AliMatrixSparse& src)
{
+ // assignment op-r
if (this == &src) return *this;
AliMatrixSq::operator=(src);
//___________________________________________________________
void AliMatrixSparse::Clear(Option_t*)
{
+ // clear
for (int i=fNrows;i--;) delete GetRow(i);
delete [] fVecs;
fNcols = fNrows = 0;
//___________________________________________________________
void AliMatrixSparse::Print(Option_t* opt) const
{
+ // print itself
printf("Sparse Matrix of size %d x %d %s\n",fNrows,fNcols,IsSymmetric() ? " (Symmetric)":"");
for (int i=0;i<fNrows;i++) {
AliVectorSparse* row = GetRow(i);
//___________________________________________________________
void AliMatrixSparse::SortIndices(Bool_t valuesToo)
{
+ // sort columns in increasing order. Used to fix the matrix after ILUk decompostion
TStopwatch sw;
sw.Start();
printf("AliMatrixSparse:sort>>\n");
- // sort columns in increasing order. Used to fix the matrix after ILUk decompostion
for (int i=GetSize();i--;) GetRow(i)->SortIndices(valuesToo);
sw.Stop();
sw.Print();
//___________________________________________________
inline void AliMatrixSparse::MultiplyByVec(const TVectorD &vecIn, TVectorD &vecOut) const
{
+ // multiplication
MultiplyByVec((Double_t*)vecIn.GetMatrixArray(),(Double_t*)vecOut.GetMatrixArray());
}
//___________________________________________________
inline Double_t AliMatrixSparse::DiagElem(Int_t row) const
{
+ // get diag elem
AliVectorSparse* rowv = GetRow(row);
if (!rowv) return 0;
if (IsSymmetric()) return (rowv->GetNElems()>0 && rowv->GetLastIndex()==row) ? rowv->GetLastElem() : 0.;
//___________________________________________________
inline Double_t &AliMatrixSparse::DiagElem(Int_t row)
{
+ // get diag elem
AliVectorSparse* rowv = GetRowAdd(row);
if (row>=fNcols) fNcols = row+1;
if (IsSymmetric()) {
/**********************************************************************************************/
-/* Abstract class for matrix used for millepede2 operation. */
+/* */
+/* Abstract class for matrix used for */
+/* millepede2 operation. */
+/* Works for expandable square matrices */
+/* of arbitrary dimension */
/* Author: ruben.shahoyan@cern.ch */
/* */
+/* */
/**********************************************************************************************/
#include <stdlib.h>
#ifndef ALIMATRIXSQ_H
#define ALIMATRIXSQ_H
+
/**********************************************************************************************/
-/* Abstract class for matrix used for millepede2 operation. */
+/* */
+/* Abstract class for matrix used for */
+/* millepede2 operation. */
/* Author: ruben.shahoyan@cern.ch */
/* */
/**********************************************************************************************/
/**********************************************************************************************/
/* General class for alignment with large number of degrees of freedom */
/* Based on the original milliped2 by Volker Blobel */
+/* and AliMillepede class by Javier */
+/* Allows operations with large sparse matrices */
/* http://www.desy.de/~blobel/mptalks.html */
/* */
/* Author: ruben.shahoyan@cern.ch */
fNLocFits(0),
fNLocFitsRejected(0),
fNGloFix(0),
- fGloSolveStatus(gkFailed),
+ fGloSolveStatus(kFailed),
//
fChi2CutFactor(1.),
fChi2CutRef(1.),
//_____________________________________________________________________________________________
AliMillePede2::~AliMillePede2()
{
+ // destructor
CloseDataRecStorage();
CloseConsRecStorage();
//
//_____________________________________________________________________________________________
Int_t AliMillePede2::InitMille(int nGlo, int nLoc, int lNStdDev,double lResCut, double lResCutInit)
{
- //
+ // init all
if (nLoc>0) fNLocPar = nLoc;
if (nGlo>0) fNGloPar = nGlo;
if (lResCutInit>0) fResCutInit = lResCutInit;
//_____________________________________________________________________________________________
Bool_t AliMillePede2::ImposeDataRecFile(const char* fname)
{
+ // set filename for records
CloseDataRecStorage();
SetDataRecFName(fname);
return InitDataRecStorage(kTRUE); // open in read mode
//_____________________________________________________________________________________________
Bool_t AliMillePede2::ImposeConsRecFile(const char* fname)
{
+ // set filename for constraints
CloseConsRecStorage();
SetConsRecFName(fname);
return InitConsRecStorage(kTRUE); // open in read mode
//_____________________________________________________________________________________________
void AliMillePede2::CloseDataRecStorage()
{
+ // close records file
if (fTreeData) {
if (fDataRecFile && fDataRecFile->IsWritable()) {
fDataRecFile->cd();
//_____________________________________________________________________________________________
void AliMillePede2::CloseConsRecStorage()
{
+ // close constraints file
if (fTreeConstr) {
if (fConsRecFile->IsWritable()) {
fConsRecFile->cd();
//_____________________________________________________________________________________________
void AliMillePede2::SetRecordWeight(double wgh)
{
+ // assign weight
if (fRecFileStatus<2) InitDataRecStorage(); // create a buffer to store the data
fRecord->SetWeight(wgh);
}
//_____________________________________________________________________________________________
void AliMillePede2::SetRecordRun(Int_t run)
{
+ // assign run
if (fRecFileStatus<2) InitDataRecStorage(); // create a buffer to store the data
fRecord->SetRunID(run);
}
//_____________________________________________________________________________________________
void AliMillePede2::SetLocalEquation(double *dergb, double *derlc, double lMeas, double lSigma)
{
+ // assing derivs of loc.eq.
if (fRecFileStatus<2) InitDataRecStorage(); // create a buffer to store the data
//
// write data of single measurement
//_____________________________________________________________________________________________
-void AliMillePede2::SetGlobalConstraint(double *dergb, double val, double sigma)
+void AliMillePede2::SetGlobalConstraint(const double *dergb, double val, double sigma)
{
// Define a constraint equation.
if (!fConsRecFile || !fConsRecFile->IsWritable()) InitConsRecStorage(); // create a buffer to store the data
}
//_____________________________________________________________________________________________
-void AliMillePede2::SetGlobalConstraint(const int *indgb, double *dergb, int ngb, double val,double sigma)
+void AliMillePede2::SetGlobalConstraint(const int *indgb, const double *dergb, int ngb, double val,double sigma)
{
// Define a constraint equation.
if (!fConsRecFile || !fConsRecFile->IsWritable()) InitConsRecStorage(); // create a buffer to store the data
//
if (par) for (int i=fNGloPar;i--;) par[i] = fInitPar[i]+fDeltaPar[i];
//
- if (fGloSolveStatus==gkInvert) { // errors on params are available
+ if (fGloSolveStatus==kInvert) { // errors on params are available
if (error) for (int i=fNGloPar;i--;) error[i] = fProcPnt[i]>0 ? TMath::Sqrt(TMath::Abs(fMatCGlo->QueryDiag(i))) : 0.;
if (pull) for (int i=fNGloPar;i--;) pull[i] = fProcPnt[i]>0 && (fSigmaPar[i]*fSigmaPar[i]-fMatCGlo->QueryDiag(i))>0. && fSigmaPar[i]>0
? fDeltaPar[i]/TMath::Sqrt(fSigmaPar[i]*fSigmaPar[i]-fMatCGlo->QueryDiag(i)) : 0;
AliInfo(Form("Global Fit Iteration#%2d (Local Fit Chi^2 cut factor: %.2f)",fIter,fChi2CutFactor));
//
if (!fNGloPar || !fTreeData) {
- AliInfo("No data was stored, aborting iteration");
+ AliInfo("No data was stored, stopping iteration");
return 0;
}
TStopwatch sw,sws;
printf("Solve %d |",fIter); sws.Print();
//
sw.Stop();
- AliInfo(Form("Iteration#%2d %s. CPU time: %.1f",fIter,fGloSolveStatus==gkFailed ? "Failed":"Converged",sw.CpuTime()));
- if (fGloSolveStatus==gkFailed) return 0;
+ AliInfo(Form("Iteration#%2d %s. CPU time: %.1f",fIter,fGloSolveStatus==kFailed ? "Failed":"Converged",sw.CpuTime()));
+ if (fGloSolveStatus==kFailed) return 0;
//
for (int i=fNGloPar;i--;) fDeltaPar[i] += fVecBGlo[i]; // Update global parameters values (for iterations)
//
if (!fgIsMatGloSparse) {
//
if (fNLagrangeConstraints==0) { // pos-def systems are faster to solve by Cholesky
- if ( ((AliSymMatrix*)fMatCGlo)->SolveChol(fVecBGlo, fgInvChol) ) return fgInvChol ? gkInvert:gkNoInversion;
+ if ( ((AliSymMatrix*)fMatCGlo)->SolveChol(fVecBGlo, fgInvChol) ) return fgInvChol ? kInvert:kNoInversion;
else AliInfo("Solution of Global Dense System by Cholesky failed, trying Gaussian Elimiation");
}
//
- if (((AliSymMatrix*)fMatCGlo)->SolveSpmInv(fVecBGlo, kTRUE)) return gkInvert;
+ if (((AliSymMatrix*)fMatCGlo)->SolveSpmInv(fVecBGlo, kTRUE)) return kInvert;
else AliInfo("Solution of Global Dense System by Gaussian Elimination failed, trying iterative methods");
}
// try to solve by minres
TVectorD sol(fNGloSize);
//
AliMinResSolve *slv = new AliMinResSolve(fMatCGlo,fVecBGlo);
- if (!slv) return gkFailed;
+ if (!slv) return kFailed;
//
Bool_t res = kFALSE;
if (fgIterSol == AliMinResSolve::kSolMinRes)
int defout = dup(1);
if (defout<0) {
AliInfo("Failed on dup");
- return gkFailed;
+ return kFailed;
}
int slvDump = open(faildump, O_RDWR|O_CREAT, 0666);
if (slvDump>=0) {
}
else AliInfo("Failed on file open for matrix dumping");
close(defout);
- return gkFailed;
+ return kFailed;
}
for (int i=fNGloSize;i--;) fVecBGlo[i] = sol[i];
- return gkNoInversion;
+ return kNoInversion;
//
}
Double_t AliMillePede2::GetParError(int iPar) const
{
// return error for parameter iPar
- if (fGloSolveStatus==gkInvert) {
+ if (fGloSolveStatus==kInvert) {
double res = fMatCGlo->QueryDiag(iPar);
if (res>=0) return TMath::Sqrt(res);
}
lGlobalCor = 0.0;
//
double dg;
- if (fGloSolveStatus==gkInvert && TMath::Abs( (dg=fMatCGlo->QueryDiag(i)) *fDiagCGlo[i]) > 0) {
+ if (fGloSolveStatus==kInvert && TMath::Abs( (dg=fMatCGlo->QueryDiag(i)) *fDiagCGlo[i]) > 0) {
lGlobalCor = TMath::Sqrt(TMath::Abs(1.0-1.0/(dg*fDiagCGlo[i])));
AliInfo(Form("%d\t %.6f\t %.6f\t %.6f\t %.6f\t %.6f\t %.6f\t %6d",
i,fInitPar[i],fInitPar[i]+fDeltaPar[i],fDeltaPar[i],fVecBGlo[i],lError,lGlobalCor,fProcPnt[i]));
{
public:
//
- enum {gkFailed,gkInvert,gkNoInversion}; // used global matrix solution methods
+ enum {kFailed,kInvert,kNoInversion}; // used global matrix solution methods
//
AliMillePede2();
AliMillePede2(const AliMillePede2& src);
//
// constraints
- void SetGlobalConstraint(double *dergb, double val, double sigma=0);
- void SetGlobalConstraint(const int *indgb,double *dergb, int ngb, double val, double sigma=0);
+ void SetGlobalConstraint(const double *dergb, double val, double sigma=0);
+ void SetGlobalConstraint(const int *indgb, const double *dergb, int ngb, double val, double sigma=0);
//
// processing of the local measurement
void SetRecordRun(Int_t run);
AliMillePedeRecord::AliMillePedeRecord(const AliMillePedeRecord& src) :
TObject(src),fSize(src.fSize),fNGroups(src.fNGroups),fRunID(src.fRunID),fGroupID(0),fIndex(0),fValue(0),fWeight(src.fWeight)
{
+ // copy ct-r
fIndex = new Int_t[GetDtBufferSize()];
memcpy(fIndex,src.fIndex,fSize*sizeof(Int_t));
fValue = new Double_t[GetDtBufferSize()];
//_____________________________________________________________________________________________
AliMillePedeRecord& AliMillePedeRecord::operator=(const AliMillePedeRecord& rhs)
-{
+{
+ // assignment op-r
if (this!=&rhs) {
Reset();
for (int i=0;i<rhs.GetSize();i++) {
//_____________________________________________________________________________________________
void AliMillePedeRecord::Reset()
{
+ // reset all
fSize = 0;
for (int i=fNGroups;i--;) fGroupID[i] = 0;
fNGroups = 0;
//_____________________________________________________________________________________________
void AliMillePedeRecord::Print(const Option_t *) const
{
+ // print itself
if (!fSize) {AliInfo("No data"); return;}
int cnt=0,point=0;
//
+/* ----------------------------------------------------------------------------------------
+ Class to solve a set of N linearized parametric equations of the type
+ Eq(k): sum_i=0^n { g_i G_ik } + t_k T_k = res_k
+ whith n "global" parameters gi and one "local" parameter (per equation) t_k.
+ Each measured points provides 3 measured coordinates, with proper covariance matrix.
+
+ Used for Newton-Raphson iteration step in solution of non-linear parametric equations
+ F(g,t_k) - res_k = 0, with G_ik = dF(g,t_k)/dg_i and T_k = dF(g,t_k)/dt_k
+ Solution is obtained by elimination of local parameters via large (n+N) matrix partitioning
+
+ Author: ruben.shahoyan@cern.ch
+-------------------------------------------------------------------------------------------*/
#include "AliParamSolver.h"
#include "AliSymMatrix.h"
#include "AliLog.h"
}
//______________________________________________________________________________________
-AliParamSolver::AliParamSolver(AliParamSolver& src)
+AliParamSolver::AliParamSolver(const AliParamSolver& src)
: TObject(src),fMatrix(0),fSolGlo(0),fSolLoc(0),fMaxGlobal(src.fMaxGlobal),fNGlobal(src.fNGlobal),
fNPoints(0),fMaxPoints(0),fRHSGlo(0),fRHSLoc(0),fMatGamma(0),fMatG(0),fCovDGl(0)
{
//______________________________________________________________________________________
Bool_t AliParamSolver::SolveGlobals(Bool_t obtainCov)
{
+ // solve against global vars.
if (fNPoints<fNGlobal/3) {
AliError(Form("Number of points: %d is not enough for %d globals",fNPoints,fNGlobal));
return kFALSE;
//______________________________________________________________________________________
Bool_t AliParamSolver::SolveLocals()
{
+ // solve for locals
const double kTiny = 1e-16;
if (TestBit(kBitLocSol)) return kTRUE;
if (!TestBit(kBitGloSol)) {
//______________________________________________________________________________________
AliSymMatrix* AliParamSolver::GetCovMatrix()
{
+ // obtain cov.mat
if (!TestBit(kBitGloSol)) {
AliError("Cannot obtain Cov.Matrix before SolveGlobals is called");
return 0;
//______________________________________________________________________________________
Bool_t AliParamSolver::Solve(Bool_t obtainCov)
{
+ // solve all
return (SolveGlobals(obtainCov) && SolveLocals()) ? kTRUE : kFALSE;
}
//______________________________________________________________________________________
void AliParamSolver::Clear(Option_t*)
{
+ // reset all
fNPoints = 0;
fMatrix->Reset();
for (int i=fNGlobal;i--;) fRHSGlo[i] = 0;
//______________________________________________________________________________________
void AliParamSolver::Print(Option_t*) const
{
+ // print itself
AliInfo(Form("Solver with %d globals for %d points",fNGlobal,fNPoints));
}
//______________________________________________________________________________________
void AliParamSolver::SetNGlobal(Int_t n)
{
+ // set N global params
if (n>fMaxGlobal) {
AliError(Form("Maximum number of globals was set to %d",fMaxGlobal));
return;
//______________________________________________________________________________________
void AliParamSolver::SetMaxGlobal(Int_t n)
{
+ // set limit on N glob.
if (n>0 && n==fMaxGlobal) return;
fMaxGlobal = n;
fNGlobal = n;
AliParamSolver();
AliParamSolver(Int_t maxglo,Int_t locsize=16);
- AliParamSolver(AliParamSolver& src);
+ AliParamSolver(const AliParamSolver& src);
AliParamSolver& operator=(const AliParamSolver& src);
~AliParamSolver();
//
-#ifndef ALIQAChecker_H
-#define ALIQAChecker_H
+#ifndef ALIQACHECKER_H
+#define ALIQACHECKER_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
+/*********************************************************************************/
+/* */
+/* Class for rectangular matrix used for */
+/* millepede2 operation. */
+/* May be sparse or dense. */
+/* ----------------------- */
+/* Author: ruben.shahoyan@cern.ch */
+/* */
+/*********************************************************************************/
+
#include "AliRectMatrix.h"
#include <TString.h>
//
AliRectMatrix::AliRectMatrix(Int_t nrow,Int_t ncol)
: fNRows(nrow),fNCols(ncol),fRows(0)
{
- //
+ // c-tor
fRows = new Double_t*[fNRows];
for (int i=fNRows;i--;) {
fRows[i] = new Double_t[fNCols];
AliRectMatrix::AliRectMatrix(const AliRectMatrix &src)
: TObject(src),fNRows(src.fNRows), fNCols(src.fNCols), fRows(0)
{
+ // copy c-tor
fRows = new Double_t*[fNRows];
for (int i=fNRows;i--;) {
fRows[i] = new Double_t[fNCols];
//___________________________________________________________
AliRectMatrix::~AliRectMatrix()
{
+ // dest-tor
if (fNRows) for (int i=fNRows;i--;) delete[] fRows[i];
delete[] fRows;
}
//___________________________________________________________
AliRectMatrix& AliRectMatrix::operator=(const AliRectMatrix& src)
{
- //
+ // assignment op-r
if (&src == this) return *this;
if (fNRows) for (int i=fNRows;i--;) delete[] fRows[i];
delete[] fRows;
//___________________________________________________________
void AliRectMatrix::Print(Option_t* option) const
{
+ // print itself
printf("Rectangular Matrix: %d rows %d columns\n",fNRows,fNCols);
TString opt = option; opt.ToLower();
if (opt.IsNull()) return;
//___________________________________________________________
-void AliRectMatrix::Reset()
+void AliRectMatrix::Reset() const
{
+ // reset all
for (int i=fNRows;i--;) {
double *row = GetRow(i);
for (int j=fNCols;j--;) row[j] = 0.;
#ifndef ALIRECTMATRIX_H
#define ALIRECTMATRIX_H
+/*********************************************************************************/
+/* */
+/* Class for rectangular matrix used for */
+/* millepede2 operation. */
+/* Author: ruben.shahoyan@cern.ch */
+/* */
+/*********************************************************************************/
+
#include "TObject.h"
class TString;
Double_t* operator()(Int_t row) const {return GetRow(row);}
Double_t* GetRow(Int_t row) const {return fRows[row];}
//
- void Reset();
+ void Reset() const;
//
virtual void Print(Option_t* option="") const;
//
}
//___________________________________________________________
-Bool_t AliSymMatrix::SolveChol(TVectorD &brhs, TVectorD &bsol,Bool_t invert)
+Bool_t AliSymMatrix::SolveChol(const TVectorD &brhs, TVectorD &bsol,Bool_t invert)
{
bsol = brhs;
return SolveChol(bsol,invert);
Bool_t SolveChol(Double_t *brhs, Bool_t invert=kFALSE);
Bool_t SolveChol(Double_t *brhs, Double_t *bsol,Bool_t invert=kFALSE);
Bool_t SolveChol(TVectorD &brhs, Bool_t invert=kFALSE);
- Bool_t SolveChol(TVectorD &brhs, TVectorD& bsol,Bool_t invert=kFALSE);
+ Bool_t SolveChol(const TVectorD &brhs, TVectorD& bsol,Bool_t invert=kFALSE);
//
int SolveSpmInv(double *vecB, Bool_t stabilize=kTRUE);
* provided "as is" without express or implied warranty. *
**************************************************************************/
-//-----------------------------------------------------------------
-// Implementation of the base class for fast track fitters
-//
-//
-//-----------------------------------------------------------------
+/*************************************************************************
+ * AliTrackFitter: base class for the fast track fitters *
+ * *
+ * Supposed to be used for alignment framework *
+ * More information is available in
+ * http://agenda.cern.ch/askArchive.php?base=agenda&categ=a057717&id=a057717s1t6/transparencies
+ * Author: C.Cheskov *
+ * *
+ * *
+ *************************************************************************/
#include <TMatrixDSym.h>
#include <TArrayI.h>
/*************************************************************************
* AliTrackFitter: base class for the fast track fitters *
* *
+ * Supposed to be used for alignment framework *
+ * More information is available in
+ * http://agenda.cern.ch/askArchive.php?base=agenda&categ=a057717&id=a057717s1t6/transparencies
+ * Author: C.Cheskov *
* *
* *
*************************************************************************/
AliVectorSparse::AliVectorSparse(const AliVectorSparse& src)
: TObject(src),fNElems(src.fNElems),fIndex(0),fElems(0)
{
+ // copy c-tor
fIndex = new UShort_t[fNElems];
fElems = new Double_t[fNElems];
memcpy(fIndex,src.fIndex,fNElems*sizeof(UShort_t));
//___________________________________________________________
void AliVectorSparse::Clear(Option_t*)
{
+ // clear all
delete[] fIndex; fIndex = 0;
delete[] fElems; fElems = 0;
fNElems = 0;
//___________________________________________________________
AliVectorSparse& AliVectorSparse::operator=(const AliVectorSparse& src)
{
+ // assignment op-tor
if (&src==this) return *this;
Clear();
TObject::operator=(src);
//__________________________________________________________
void AliVectorSparse::ReSize(Int_t sz,Bool_t copy)
{
+ // change the size
if (sz<1) {Clear(); return;}
// need to insert a new element
UShort_t *arrI = new UShort_t[sz];
//__________________________________________________________
void AliVectorSparse::Print(Option_t* opt) const
{
+ // print itself
TString sopt = opt; sopt.ToLower();
int ndig = sopt.Atoi();
if (ndig<=1) ndig = 2;
Double_t &GetLastElem() {return fElems[fNElems-1];}
//
protected:
- Int_t fNElems; //
+ Int_t fNElems; // Number of elements
UShort_t* fIndex; // Index of stored elems
Double_t* fElems; // pointer on elements
//
//_____________________________________________________________________________
const char* AliMagF::GetBeamTypeText() const
{
+ // beam type in text form
const char *beamNA = "No Beam";
const char *beamPP = "p-p";
const char *beamPbPb= "A-A";
#include <TSystem.h>
#include <TArrayF.h>
#include <TArrayI.h>
+#include <AliCheb3D.h>
ClassImp(AliMagWrapCheb)
//__________________________________________________________________________________________
void AliMagWrapCheb::BuildTableSol()
{
+ // build lookup table
BuildTable(fNParamsSol,fParamsSol,
fNZSegSol,fNPSegSol,fNRSegSol,
fMinZSol,fMaxZSol,
//__________________________________________________________________________________________
void AliMagWrapCheb::BuildTableDip()
{
+ // build lookup table
BuildTable(fNParamsDip,fParamsDip,
fNZSegDip,fNYSegDip,fNXSegDip,
fMinZDip,fMaxZDip,
//__________________________________________________________________________________________
void AliMagWrapCheb::BuildTableTPCInt()
{
+ // build lookup table
BuildTable(fNParamsTPC,fParamsTPC,
fNZSegTPC,fNPSegTPC,fNRSegTPC,
fMinZTPC,fMaxZTPC,
//__________________________________________________________________________________________
void AliMagWrapCheb::BuildTableTPCRatInt()
{
+ // build lookup table
BuildTable(fNParamsTPCRat,fParamsTPCRat,
fNZSegTPCRat,fNPSegTPCRat,fNRSegTPCRat,
fMinZTPCRat,fMaxZTPCRat,
#include <TMath.h>
#include <TNamed.h>
-#include "AliCheb3D.h"
+#include <TObjArray.h>
+class AliCheb3D;
class TSystem;
class TArrayF;
AliRefArray::AliRefArray(UInt_t nelem,UInt_t depth) :
TObject(),fNElems(nelem),fRefSize(depth),fElems(0),fRefInd(0),fRefBuff(0)
{
+ // constructor
fNElems = nelem;
// create array with nelem initial referres
if (fNElems<1) fNElems = 1;