the BCid from TOFsignal and track kinematics when the time integration info is missing
2) The time integration (kTIME) will be done for all tracks with kTPCin (before required kITSin)
The TOF pid will be done requesting kITSin (as before)
for (Int_t i=0; i<nentr; i++) {
AliESDtrack *esd=event->GetTrack(i);
- if ((esd->GetStatus()&AliESDtrack::kITSin)==0) continue;
+ // Start time integral and add distance from current position to vertex
if (esd->GetStatus()&AliESDtrack::kITSout) continue;
-
AliITStrackMI *t = new AliITStrackMI(*esd);
-
- t->SetExpQ(TMath::Max(0.8*t->GetESDtrack()->GetTPCsignal(),30.));
-
- ResetTrackToFollow(*t);
-
- /*
- // propagate to vertex [SR, GSI 17.02.2003]
- // Start Time measurement [SR, GSI 17.02.2003], corrected by I.Belikov
- if (CorrectForPipeMaterial(&fTrackToFollow,"inward")) {
- if (fTrackToFollow.PropagateToVertex(event->GetVertex()))
- fTrackToFollow.StartTimeIntegral();
- // from vertex to outside pipe
- CorrectForPipeMaterial(&fTrackToFollow,"outward");
- }*/
- // Start time integral and add distance from current position to vertex
Double_t xyzTrk[3],xyzVtx[3]={GetX(),GetY(),GetZ()};
- fTrackToFollow.GetXYZ(xyzTrk);
+ t->GetXYZ(xyzTrk);
Double_t dst2 = 0.;
- for (Int_t icoord=0; icoord<3; icoord++) {
- Double_t di = xyzTrk[icoord] - xyzVtx[icoord];
- dst2 += di*di;
- }
- fTrackToFollow.StartTimeIntegral();
- fTrackToFollow.AddTimeStep(TMath::Sqrt(dst2));
+ for (Int_t icoord=0; icoord<3; icoord++) {Double_t di = xyzTrk[icoord] - xyzVtx[icoord];dst2 += di*di; }
+ t->StartTimeIntegral();
+ t->AddTimeStep(TMath::Sqrt(dst2));
+ //
+ // transfer the time integral to ESD track
+ esd->SetStatus(AliESDtrack::kTIME);
+ Double_t times[10];t->GetIntegratedTimes(times); esd->SetIntegratedTimes(times);
+ esd->SetIntegratedLength(t->GetIntegratedLength());
+ //
+ if ((esd->GetStatus()&AliESDtrack::kITSin)==0) continue;
+ t->SetExpQ(TMath::Max(0.8*t->GetESDtrack()->GetTPCsignal(),30.));
+ ResetTrackToFollow(*t);
+ //
fTrackToFollow.ResetCovariance(10.); fTrackToFollow.ResetClusters();
if (RefitAt(AliITSRecoParam::GetrInsideITSscreen(),&fTrackToFollow,t)) {
- if (!CorrectForTPCtoITSDeadZoneMaterial(&fTrackToFollow)) {
- delete t;
- continue;
- }
- fTrackToFollow.SetLabel(t->GetLabel());
- //fTrackToFollow.CookdEdx();
- CookLabel(&fTrackToFollow,0.); //For comparison only
- fTrackToFollow.UpdateESDtrack(AliESDtrack::kITSout);
- //UseClusters(&fTrackToFollow);
- ntrk++;
+ if (!CorrectForTPCtoITSDeadZoneMaterial(&fTrackToFollow)) {
+ delete t;
+ continue;
+ }
+ fTrackToFollow.SetLabel(t->GetLabel());
+ //fTrackToFollow.CookdEdx();
+ CookLabel(&fTrackToFollow,0.); //For comparison only
+ fTrackToFollow.UpdateESDtrack(AliESDtrack::kITSout);
+ //UseClusters(&fTrackToFollow);
+ ntrk++;
}
delete t;
}
}
//_______________________________________________________________________
-Int_t AliAODTrack::GetTOFBunchCrossing() const
+Int_t AliAODTrack::GetTOFBunchCrossing(Double_t b) const
{
// Returns the number of bunch crossings after trigger (assuming 25ns spacing)
- const UInt_t kAskBits = kESDpid | kTOFout | kTIME;
const double kSpacing = 25e3; // min interbanch spacing
const double kShift = 0;
Int_t bcid = -1; // defualt one
- if ( (GetStatus()&kAskBits) != kAskBits) return bcid;
- int pid = (int)GetMostProbablePID();
- if (pid<0) return bcid;
- double ttimes[10];
- GetIntegratedTimes(ttimes);
- double tdif = GetTOFsignal() - ttimes[pid];
+ if (!IsOn(kTOFout) || !IsOn(kESDpid)) return bcid; // no info
+ //
+ double tdif = GetTOFsignal();
+ if (IsOn(kTIME)) { // integrated time info is there
+ int pid = (int)GetMostProbablePID();
+ double ttimes[10];
+ GetIntegratedTimes(ttimes);
+ tdif -= ttimes[pid];
+ }
+ else { // assume integrated time info from TOF radius and momentum
+ const double kRTOF = 385.;
+ const double kCSpeed = 3.e-2; // cm/ps
+ double p = P();
+ if (p<0.001) p = 1.0;
+ double m = M();
+ double path = kRTOF; // mean TOF radius
+ if (TMath::Abs(b)>kAlmost0) { // account for curvature
+ double curv = Pt()/(b*kB2C);
+ if (curv>kAlmost0) {
+ double tgl = Pz()/Pt();
+ path = 2./curv*TMath::ASin(kRTOF*curv/2.)*TMath::Sqrt(1.+tgl*tgl);
+ }
+ }
+ tdif -= path/kCSpeed*TMath::Sqrt(1.+m*m/(p*p));
+ }
bcid = TMath::Nint((tdif - kShift)/kSpacing);
return bcid;
}
Bool_t IsHybridTPC() const { return TestBit(kIsHybridTPC); }
Bool_t IsTPCOnly() const { return TestBit(kIsTPCOnly); }
//
- Int_t GetTOFBunchCrossing() const;
+ Int_t GetTOFBunchCrossing(Double_t b=0) const;
//
template <class T> void GetP(T *p) const {
p[0]=fMomentum[0]; p[1]=fMomentum[1]; p[2]=fMomentum[2];}
if ((track->GetStatus()&AliESDtrack::kTOFout)==0) return;
if ((track->GetStatus()&AliESDtrack::kTIME)==0) return;
+ if ((track->GetStatus()&AliESDtrack::kITSin)==0) return;
Int_t ibin = fTOFResponse.GetMomBin(track->GetP());
Float_t timezero = fTOFResponse.GetT0bin(ibin);
}
//_______________________________________________________________________
-Int_t AliESDtrack::GetTOFBunchCrossing() const
+Int_t AliESDtrack::GetTOFBunchCrossing(Double_t b) const
{
// Returns the number of bunch crossings after trigger (assuming 25ns spacing)
- const UInt_t kAskBits = kESDpid | kTOFout | kTIME;
const double kSpacing = 25e3; // min interbanch spacing
const double kShift = 0;
Int_t bcid = -1; // defualt one
- if ( (GetStatus()&kAskBits) != kAskBits) return bcid;
- int pid = GetPID();
- double tdif = fTOFsignal - fTrackTime[pid];
+ if (!IsOn(kTOFout) || !IsOn(kESDpid)) return bcid; // no info
+ //
+ double tdif = fTOFsignal;
+ if (IsOn(kTIME)) { // integrated time info is there
+ int pid = GetPID();
+ tdif -= fTrackTime[pid];
+ }
+ else { // assume integrated time info from TOF radius and momentum
+ const double kRTOF = 385.;
+ const double kCSpeed = 3.e-2; // cm/ps
+ double p = GetP();
+ if (p<0.01) return bcid;
+ double m = GetMass();
+ double curv = GetC(b);
+ double path = TMath::Abs(curv)>kAlmost0 ? // account for curvature
+ 2./curv*TMath::ASin(kRTOF*curv/2.)*TMath::Sqrt(1.+GetTgl()*GetTgl()) : kRTOF;
+ tdif -= path/kCSpeed*TMath::Sqrt(1.+m*m/(p*p));
+ }
bcid = TMath::Nint((tdif - kShift)/kSpacing);
return bcid;
}
Double_t GetIntegratedLength() const {return fTrackLength;}
void GetIntegratedTimes(Double_t *times) const;
Int_t GetPID() const;
- Int_t GetTOFBunchCrossing() const;
+ Int_t GetTOFBunchCrossing(Double_t b=0) const;
Double_t GetMass() const {return AliPID::ParticleMass(GetPID());}
Double_t M() const;
Double_t E() const;
virtual Int_t GetNcls(Int_t /*idet*/) const { return 0; }
virtual Bool_t GetPxPyPz(Double_t */*p*/) const { return kFALSE; }
virtual void SetID(Short_t /*id*/) {;}
- virtual Int_t GetTOFBunchCrossing() const { return -1;}
+ virtual Int_t GetTOFBunchCrossing(Double_t = 0) const { return -1;}
ClassDef(AliVTrack,1) // base class for tracks
};