fPMeasurementCov(new TMatrixDSym( fgkNMeasurementParams )),
fPMeasurementPrediction(new TVectorD( fgkNMeasurementParams )),
fOutRejSigmas(1.),
- fDelta(new Double_t[fgkNSystemParams]),
+ //fDelta(new Double_t[fgkNSystemParams]),
fNumericalParanoia(kTRUE),
fRejectOutliers(kTRUE),
fRequireMatchInTPC(kFALSE),
fNProcessedEvents(0),
fTrackInBuffer(0),
fTimeStamp(0),
+ fRunNumber(0),
fTPCvd(2.64),
fTPCZLengthA(2.4972500e02),
fTPCZLengthC(2.4969799e02)
fPMeasurementCov(new TMatrixDSym( *a.fPMeasurementCov )),
fPMeasurementPrediction(new TVectorD( *a.fPMeasurement )),
fOutRejSigmas(a.fOutRejSigmas),
- fDelta(new Double_t[fgkNSystemParams]),
+ //fDelta(new Double_t[fgkNSystemParams]),
fNumericalParanoia(a.fNumericalParanoia),
fRejectOutliers(a.fRejectOutliers),
fRequireMatchInTPC(a.fRequireMatchInTPC),
fNProcessedEvents(a.fNProcessedEvents),
fTrackInBuffer(a.fTrackInBuffer),
fTimeStamp(a.fTimeStamp),
+ fRunNumber(a.fRunNumber),
fTPCvd(a.fTPCvd),
fTPCZLengthA(a.fTPCZLengthA),
fTPCZLengthC(a.fTPCZLengthC)
fNProcessedEvents=a.fNProcessedEvents;
fTrackInBuffer=a.fTrackInBuffer;
fTimeStamp=a.fTimeStamp;
+ fRunNumber=a.fRunNumber;
//fApplyCovarianceCorrection=a.fApplyCovarianceCorrection;
//fCalibrationMode=a.fCalibrationMode;
//fFillHistograms=a.fFillHistograms;
if (fPH) delete fPH;
if (fPMeasurement) delete fPMeasurement;
if (fPMeasurementCov) delete fPMeasurementCov;
- if (fDelta) delete [] fDelta;
+ //if (fDelta) delete [] fDelta;
//if (fPMes0Hist) delete fPMes0Hist;
//if (fPMes1Hist) delete fPMes1Hist;
//if (fPMes2Hist) delete fPMes2Hist;
success = ( AddESDtrack( track ) || success );
}
}
- if (success) fTimeStamp = pEvent->GetTimeStamp();
+ if (success)
+ {
+ fTimeStamp = pEvent->GetTimeStamp();
+ fRunNumber = pEvent->GetRunNumber();
+ }
return success;
}
else
continue;
}
- if (success) fTimeStamp=pEvent->GetTimeStamp();
+ fTimeStamp=pEvent->GetTimeStamp(); //always update timestamp even when no update performed
+ fRunNumber=pEvent->GetRunNumber();
return success;
}
if (fgkNSystemParams>6) printf(" vd corr % .5g ± (%.2g) [ vd should be %.4g (was %.4g in reco) ]\n", (*fPX)(6), TMath::Sqrt((*fPXcov)(6,6)), (*fPX)(6)*fTPCvd, fTPCvd);
if (fgkNSystemParams>7) printf(" t0 % .5g ± (%.2g) us | %.4g ± (%.2g) cm [ t0_real = t0_rec+t0 ]\n",(*fPX)(7), TMath::Sqrt((*fPXcov)(7,7)), fTPCvd*(*fPX)(7), fTPCvd*TMath::Sqrt((*fPXcov)(7,7)));
if (fgkNSystemParams>8) printf(" vd/dy % .5f ± (%.2f) (cm/us)/m\n", (*fPX)(8), TMath::Sqrt((*fPXcov)(8,8)));
+ printf(" run: %i, timestamp: %i\n", fRunNumber, fTimeStamp);
printf("\n");
return;
}
fNOutliers=0;
fNTracks=0;
fNProcessedEvents=0;
+ fRunNumber=0;
+ fTimeStamp=0;
}
//______________________________________________________________________________
}
}
+//______________________________________________________________________________
Bool_t AliRelAlignerKalman::Merge( const AliRelAlignerKalman* al )
{
//Merge two aligners
if (!al) return kFALSE;
+ if (al==this) return kTRUE;
if (al->fgkNSystemParams != fgkNSystemParams) return kFALSE;
+ if (fRunNumber != al->fRunNumber) return kFALSE;
+ if (al->fNUpdates == 0) return kTRUE; //no point in merging with an empty one
//store the pointers to current stuff
TVectorD* pmes = fPMeasurement;
fNTracks += al->fNTracks;
fNMatchedTPCtracklets += al->fNMatchedTPCtracklets;
fNMatchedCosmics += al->fNMatchedCosmics;
- if (fTimeStamp < al->fTimeStamp) fTimeStamp = al->fTimeStamp; //a bit arbitrary: take the older one
+ if (fTimeStamp < al->fTimeStamp) fTimeStamp = al->fTimeStamp; //take the older one
return success;
}
+//______________________________________________________________________________
+Int_t AliRelAlignerKalman::Compare(const TObject *obj) const
+{
+ if (this == obj) return 0;
+ const AliRelAlignerKalman* aobj = dynamic_cast<const AliRelAlignerKalman*>(obj);
+ if (!aobj) return 0;
+ if (fTimeStamp < aobj->fTimeStamp) return -1;
+ else if (fTimeStamp > aobj->fTimeStamp) return 1;
+ else return 0;
+}
+
+//______________________________________________________________________________
+//Int_t AliRelAlignerKalman::Compare(const AliRelAlignerKalman *al) const
+//{
+// if (this == al) return 0;
+// if (fTimeStamp > al->fTimeStamp) return -1;
+// else if (fTimeStamp < al->fTimeStamp) return 1;
+// else return 0;
+//}
+
//______________________________________________________________________________
//void AliRelAlignerKalman::PrintCovarianceCorrection()
//{
Bool_t IsPositiveDefinite( const TMatrixD& mat ) const;
void SetTimeStamp( const UInt_t ts ) { fTimeStamp = ts; }
UInt_t GetTimeStamp() const {return fTimeStamp;}
+ void SetRunNumber( const UInt_t rn ) { fRunNumber = rn; }
+ UInt_t GetRunNumber() const {return fRunNumber;}
+ Int_t Compare(const TObject *obj) const;
+ Bool_t IsSortable() const { return kTRUE; }
protected:
Bool_t UpdateEstimateKalman();
TMatrixDSym* fPMeasurementCov; //!measurement vec cvariance
TVectorD* fPMeasurementPrediction; //!prediction of the measurement
Double_t fOutRejSigmas; //number of sigmas for outlier rejection
- Double_t* fDelta; //array with differentials for calculating derivatives for every parameter(see PrepareSystemMatrix())
+ Double_t fDelta[fgkNSystemParams]; //array with differentials for calculating derivatives for every parameter(see PrepareSystemMatrix())
//Control
Bool_t fNumericalParanoia; //!whether to perform additional checks for numerical stability
Int_t fNMatchedTPCtracklets;//number of cosmic events with 2 matching TPC tracklets
Int_t fNProcessedEvents; //number of processed events
Int_t fTrackInBuffer; //!number of tracks in buffer
- UInt_t fTimeStamp;
+ UInt_t fTimeStamp; //time stamp
+ UInt_t fRunNumber; //run number
//TPC stuff
Double_t fTPCvd; //TPC drift velocity
Double_t fTPCZLengthA; //TPC length side A
Double_t fTPCZLengthC; //TPC length side C
- ClassDef(AliRelAlignerKalman,1) //AliRelAlignerKalman class
+ ClassDef(AliRelAlignerKalman,2) //AliRelAlignerKalman class
};
#endif