, fLongT0seed(kTRUE)
, fFillClusterRes(kFALSE)
, fUseT0list(kTRUE)
+, fUseZ0list(kTRUE)
, fForceAlpha(kFALSE)
, fStreamer(0x0)
, fInputFile(0x0)
AliExternalTrackParam *dummy;
// prepare list of T0s
- TVectorF t0list(fTree->GetEntries());
- if (fUseT0list) {
+ TVectorF t0list(maxev);
+ TVectorF z0list(maxev);
+ if (fUseT0list || fUseZ0list) {
for (Int_t iev=0; iev<maxev; ++iev){
fTree->GetEvent(iev);
const Float_t t0=fEvent->GetT0();
+ const Float_t z0=fEvent->GetZ();
t0list[iev]=t0;
+ z0list[iev]=z0;
}
}
// in case the match with the real T0 infor is requested, find the
// closes T0 from the list of T0s
fTime0 = t0seed.GetZ()-zLength/vDrift;
- if (fUseT0list) {
- fTime0 = FindClosestT0(t0list, fTime0);
+ if (fUseT0list || fUseZ0list) {
+ fTime0 = FindClosestT0(t0list, z0list, t0seed);
}
// create real seed using the time 0 from the first seed
// set fCreateT0seed now to false to get the seed in z coordinates
}
//____________________________________________________________________________________
-Float_t AliToyMCReconstruction::FindClosestT0(const TVectorF &t0list, Float_t t0seed)
+Float_t AliToyMCReconstruction::FindClosestT0(const TVectorF &t0list, const TVectorF &z0list, AliExternalTrackParam &t0seed)
{
//
// find closes T0 in a list of T0s
Long64_t size=t0list.GetNrows();
const Float_t *array=t0list.GetMatrixArray();
+ Float_t vDrift=GetVDrift();
+ Float_t zLength=GetZLength(0);
+
+ Float_t sign=(1-2*(t0seed.GetTgl()>0));
+
+ Float_t vtxCorr=0.;
+ Float_t t0=t0seed.GetZ()-zLength/vDrift;
+
Int_t index=0;
Float_t minDist=1e20;
for (Int_t it0=0; it0<size; ++it0) {
- const Float_t dist=TMath::Abs(t0list[it0]-t0seed);
+ if (fUseZ0list) vtxCorr=sign*z0list[it0]/vDrift;
+ printf("vtxcorr %d: %.2g, %.2g\n",it0, vtxCorr, z0list[it0]);
+ const Float_t dist=TMath::Abs(t0list[it0]-t0-vtxCorr);
if (dist<minDist) {
index=it0;
minDist=dist;
void SetUseT0list(Bool_t use) { fUseT0list=use; }
Bool_t GetUseT0list() const { return fUseT0list; }
+ void SetUseZ0list(Bool_t use) { fUseZ0list=use; }
+ Bool_t GetUseZ0list() const { return fUseZ0list; }
+
void SetForceAlpha(Bool_t use) { fForceAlpha=use; }
Bool_t GetForceAlpha() const { return fForceAlpha; }
void MarkClustersUsed(AliTPCseed *seed);
void ResetClustersZtoTime(AliTPCseed *seed);
- Float_t FindClosestT0(const TVectorF &t0list, Float_t t0seed);
+ Float_t FindClosestT0(const TVectorF &t0list, const TVectorF &z0list, AliExternalTrackParam &t0seed);
// reco settings
Int_t fSeedingRow; // first row used for seeding
Bool_t fLongT0seed; // if we should use a t0 seed including all clusters in the seed range
Bool_t fFillClusterRes; // fill cluster residuals?
Bool_t fUseT0list; // if the list of T0 information should be used to guess the T0
+ Bool_t fUseZ0list; // if the list of Z vertex information should be used to guess the T0
Bool_t fForceAlpha; // force the correct alpha for the t0 seed extrapolation
TTreeSRedirector *fStreamer; // debug streamer