]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
1) Added AliESDtrack and AliAODtrack to GetTOFBunchCrossing(double b=0), to calculate
authorshahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 9 Jul 2011 00:05:30 +0000 (00:05 +0000)
committershahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 9 Jul 2011 00:05:30 +0000 (00:05 +0000)
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)

ITS/AliITStrackerMI.cxx
STEER/AliAODTrack.cxx
STEER/AliAODTrack.h
STEER/AliESDpid.cxx
STEER/AliESDtrack.cxx
STEER/AliESDtrack.h
STEER/AliVTrack.h

index bc883034b7f38f9bed949458a29ea4b3604bfdc4..0276c1cd3deac5cfd8606702d34b61438d07dfa0 100644 (file)
@@ -712,47 +712,38 @@ Int_t AliITStrackerMI::PropagateBack(AliESDEvent *event) {
   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;
   }
index b845d05f4712fbcdd6da3b8f13b305a07b1191a0..b6b5b873f0a2205e9c440f4036930011b2ba0064 100644 (file)
@@ -666,19 +666,37 @@ Double_t AliAODTrack::GetTRDmomentum(Int_t plane, Double_t */*sp*/) const
 }
 
 //_______________________________________________________________________
-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;
 }
index 676a20f6427430bf07abd8c5c0b45b549c3dc2b4..c74b7a052889593fe374eaab9fb24b8dd143d048 100644 (file)
@@ -155,7 +155,7 @@ class AliAODTrack : public AliVTrack {
   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];}
index 589d963f145a61d8ceb75ad0a139740f2813b27b..36f236f3a79ed7bcb705b0b99f253567e3413bbe 100644 (file)
@@ -181,6 +181,7 @@ void AliESDpid::MakeTOFPID(AliESDtrack *track, Float_t /*timeZeroTOF*/) const
 
   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);
index b72fda7981bae798604053e283637ba471da0034..03775e68932eebab7f3e294e58d3ada88020ad1b 100644 (file)
@@ -1169,16 +1169,30 @@ Int_t AliESDtrack::GetPID() const
 }
 
 //_______________________________________________________________________
-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;
 }
index 49096ccdcea0522ad9e69f4a994476ae5897834f..dec5f89edf0b38671668443a41727383eb67133b 100644 (file)
@@ -80,7 +80,7 @@ public:
   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;
index f09cdd171af7b4c65211fbca320d1bfc713fa3d2..ad597aaebeba3ef2d51e5e0d3816c887e8f57bbb 100644 (file)
@@ -75,7 +75,7 @@ public:
   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
 };