#include "AliITSV0Finder.h"
#include "AliITStrackerMI.h"
#include "AliMathBase.h"
+#include "AliPID.h"
ClassImp(AliITStrackerMI)
if (AliITSReconstructor::GetRecoParam()->GetComputePlaneEff() &&
AliITSReconstructor::GetRecoParam()->GetIPlanePlaneEff()>=0) {
Int_t iplane=AliITSReconstructor::GetRecoParam()->GetIPlanePlaneEff();
- if(!AliITSReconstructor::GetRecoParam()->GetLayersToSkip(iplane)==1)
+ if(AliITSReconstructor::GetRecoParam()->GetLayersToSkip(iplane)!=1)
AliWarning(Form("Evaluation of Plane Eff for layer %d will be attempted without removing it from tracker",iplane));
if (iplane<2) {
fPlaneEff = new AliITSPlaneEffSPD();
Float_t q = 0.; // this identifies virtual clusters
Float_t hit[6] = {xdead,
0.,
- AliITSReconstructor::GetRecoParam()->GetSigmaXDeadZoneHit2(),
- AliITSReconstructor::GetRecoParam()->GetSigmaZDeadZoneHit2(),
+ static_cast<Float_t>(AliITSReconstructor::GetRecoParam()->GetSigmaXDeadZoneHit2()),
+ static_cast<Float_t>(AliITSReconstructor::GetRecoParam()->GetSigmaZDeadZoneHit2()),
q,
0.};
Bool_t local = kTRUE;
// temporary
Int_t noesd = 0;
{/* Read ESD tracks */
- Double_t pimass = TDatabasePDG::Instance()->GetParticle(211)->Mass();
Int_t nentr=event->GetNumberOfTracks();
noesd=nentr;
// Info("Clusters2Tracks", "Number of ESD tracks: %d\n", nentr);
t->GetDZ(GetX(),GetY(),GetZ(),t->GetDP()); //I.B.
Double_t vdist = TMath::Sqrt(t->GetD(0)*t->GetD(0)+t->GetD(1)*t->GetD(1));
-
- // look at the ESD mass hypothesys !
- if (t->GetMass()<0.9*pimass) t->SetMass(pimass);
// write expected q
t->SetExpQ(TMath::Max(0.8*t->GetESDtrack()->GetTPCsignal(),30.));
fTrackingPhase="PropagateBack";
Int_t nentr=event->GetNumberOfTracks();
// Info("PropagateBack", "Number of ESD tracks: %d\n", nentr);
-
+ double bz0 = GetBz();
+ const double kWatchStep=10.; // for larger steps watch arc vs segment difference
+ //
Int_t ntrk=0;
for (Int_t i=0; i<nentr; i++) {
AliESDtrack *esd=event->GetTrack(i);
Double_t xyzTrk[3],xyzVtx[3]={GetX(),GetY(),GetZ()};
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; }
+ {
+ double dxs = xyzTrk[0] - xyzVtx[0];
+ double dys = xyzTrk[1] - xyzVtx[1];
+ double dzs = xyzTrk[2] - xyzVtx[2];
+ // RS: for large segment steps d use approximation of cicrular arc s by
+ // s = 2R*asin(d/2R) = d/p asin(p) \approx d/p (p + 1/6 p^3) = d (1+1/6 p^2)
+ // where R is the track radius, p = d/2R = 2C*d (C is the abs curvature)
+ // Hence s^2/d^2 = (1+1/6 p^2)^2
+ dst2 = dxs*dxs + dys*dys;
+ if (dst2 > kWatchStep*kWatchStep) { // correct circular part for arc/segment factor
+ double crv = TMath::Abs(esd->GetC(bz0));
+ double fcarc = 1.+crv*crv*dst2/6.;
+ dst2 *= fcarc*fcarc;
+ }
+ dst2 += dzs*dzs;
+ }
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);
+ Double_t times[AliPID::kSPECIESC];
+ t.GetIntegratedTimes(times,AliPID::kSPECIESC);
+ esd->SetIntegratedTimes(times);
esd->SetIntegratedLength(t.GetIntegratedLength());
//
if ((esd->GetStatus()&AliESDtrack::kITSin)==0) continue;
fTrackToFollow.ResetCovariance(10.); fTrackToFollow.ResetClusters();
if (RefitAt(AliITSRecoParam::GetrInsideITSscreen(),&fTrackToFollow,&t)) {
if (!CorrectForTPCtoITSDeadZoneMaterial(&fTrackToFollow)) continue;
- fTrackToFollow.SetLabel(t.GetLabel());
+ // fTrackToFollow.SetLabel(t.GetLabel()); // why do we neet this
//fTrackToFollow.CookdEdx();
- CookLabel(&fTrackToFollow,0.); //For comparison only
+ CookLabel(&fTrackToFollow,0.); //For comparison only // why do we need this?
fTrackToFollow.UpdateESDtrack(AliESDtrack::kITSout);
//UseClusters(&fTrackToFollow);
ntrk++;
// fTrackToFollow.CookdEdx();
CookdEdx(&fTrackToFollow);
- CookLabel(&fTrackToFollow,0.0); //For comparison only
+ CookLabel(&fTrackToFollow,0.0); //For comparison only // RS why do we need this?
//The beam pipe
if (CorrectForPipeMaterial(&fTrackToFollow,"inward")) {
// update TPC V0 information
//
if (otrack->GetESDtrack()->GetV0Index(0)>0){
- Float_t fprimvertex[3]={GetX(),GetY(),GetZ()};
+ Float_t fprimvertex[3]={static_cast<Float_t>(GetX()),static_cast<Float_t>(GetY()),static_cast<Float_t>(GetZ())};
for (Int_t i=0;i<3;i++){
Int_t index = otrack->GetESDtrack()->GetV0Index(i);
if (index==0) break;
for (int i=6;i--;) delete refArr[i];
}
+
+
+//------------------------------------------------------------------------
+void AliITStrackerMI::CookLabel(AliITStrackMI *track,Float_t wrong) const {
+ //--------------------------------------------------------------------
+ //This function "cooks" a track label. If label<0, this track is fake.
+ //--------------------------------------------------------------------
+ const int kMaxLbPerCl = 3;
+ int lbID[36],lbStat[36];
+ Int_t nLab=0, nCl = track->GetNumberOfClusters();
+ //
+ // track->SetLabel(-1);
+ // track->SetFakeRatio(0);
+ //
+ for (Int_t i=0;i<nCl;i++) { // fill all labels
+ Int_t cindex = track->GetClusterIndex(i);
+ // Int_t l=(cindex & 0xf0000000) >> 28;
+ AliITSRecPoint *cl = (AliITSRecPoint*)GetCluster(cindex);
+ //
+ for (int imc=0;imc<kMaxLbPerCl;imc++) { // labels within single cluster
+ int trLb = cl->GetLabel(imc);
+ if (trLb<0) break;
+ // search this mc track in already accounted ones
+ int iLab;
+ for (iLab=0;iLab<nLab;iLab++) if (lbID[iLab]==trLb) break;
+ if (iLab<nLab) lbStat[iLab]++;
+ else {
+ lbID[nLab] = trLb;
+ lbStat[nLab++] = 1;
+ }
+ } // loop over given cluster's labels
+ } // loop over clusters
+ //
+ if (nLab<1) return; // no labels at all
+ //
+ Int_t tpcLabel=-1;
+ if (track->GetESDtrack() && track->GetESDtrack()->IsOn(AliESDtrack::kTPCin)){
+ tpcLabel = TMath::Abs(track->GetESDtrack()->GetTPCLabel());
+ }
+ //
+ // find majority label
+ if (nCl && nLab) {
+ int maxLab=0,tpcLabID=-1;
+ for (int ilb=nLab;ilb--;) {
+ int st = lbStat[ilb];
+ if (lbStat[maxLab]<st) maxLab = ilb;
+ if (lbID[ilb] == tpcLabel) tpcLabID = ilb;
+ }
+ // if there is an equal choice, prefer ITS label consistent with TPC label
+ if (tpcLabel>0 && (tpcLabID!=maxLab) && lbStat[maxLab]==lbStat[tpcLabID]) maxLab=tpcLabID;
+
+ track->SetFakeRatio(1.-float(lbStat[maxLab])/nCl);
+ track->SetLabel( lbStat[maxLab]>=nCl-wrong ? lbID[maxLab] : -lbID[maxLab]);
+ }
+ //
+}
+
+/*
//------------------------------------------------------------------------
void AliITStrackerMI::CookLabel(AliITStrackMI *track,Float_t wrong) const {
//--------------------------------------------------------------------
} else {
track->SetLabel(tpcLabel);
}
- AliDebug(2,Form(" nls %d wrong %d label %d tpcLabel %d\n",nclusters,nwrong,track->GetLabel(),tpcLabel));
-
+ AliDebug(2,Form(" nls %d wrong %d label %d tpcLabel %d\n",nclusters,nwrong,track->GetLabel(),tpcLabel));
}
+*/
+
//------------------------------------------------------------------------
void AliITStrackerMI::CookdEdx(AliITStrackMI* track){
//
} else {
Error("BuildMaterialLUT","Wrong layer name\n");
}
-
+ const double kAngEps = 1e-4; // tiny slope to avoid tracks strictly normal to Z axis
for(Int_t imat=ifirst; imat<=ilast; imat++) {
Double_t param[5]={0.,0.,0.,0.,0.};
for (Int_t i=0; i<n; i++) {
point1[2] = z;
point2[0] = rmax[imat]*cosphi;
point2[1] = rmax[imat]*sinphi;
- point2[2] = z;
+ point2[2] = z+(rmax[imat]-rmin[imat])*kAngEps;
AliTracker::MeanMaterialBudget(point1,point2,mparam);
+ if (mparam[1]>999) {n--; continue;} // skip anomalous values in failed propagation
for(Int_t j=0;j<5;j++) param[j]+=mparam[j];
}
for(Int_t j=0;j<5;j++) param[j]/=(Float_t)n;
//
Double_t nsigx=AliITSReconstructor::GetRecoParam()->GetNSigXFromBoundaryPlaneEff();
Double_t nsigz=AliITSReconstructor::GetRecoParam()->GetNSigZFromBoundaryPlaneEff();
- Double_t dx=nsigx*TMath::Sqrt(tmp.GetSigmaY2()); // those are precisions in the tracking reference system
- Double_t dz=nsigz*TMath::Sqrt(tmp.GetSigmaZ2()); // Use it also for the module reference system, as it is
- // done for RecPoints
+ Double_t distx=AliITSReconstructor::GetRecoParam()->GetDistXFromBoundaryPlaneEff();
+ Double_t distz=AliITSReconstructor::GetRecoParam()->GetDistZFromBoundaryPlaneEff();
+ Double_t dx=nsigx*TMath::Sqrt(tmp.GetSigmaY2()) + distx;
+ // those are precisions in the tracking reference system
+ Double_t dz=nsigz*TMath::Sqrt(tmp.GetSigmaZ2()) + distz;
+ // Use it also for the module reference system, as it is done for RecPoints
+
+ if(AliITSReconstructor::GetRecoParam()->GetSwitchOnMaxDistNSigFrmBndPlaneEff()){
+ if(nsigx*TMath::Sqrt(tmp.GetSigmaY2())<=distx) dx -= nsigx*TMath::Sqrt(tmp.GetSigmaY2());
+ else dx -= distx;
+
+ if(nsigz*TMath::Sqrt(tmp.GetSigmaZ2())<=distz) dz -= nsigz*TMath::Sqrt(tmp.GetSigmaZ2());
+ else dz -= distz;
+ }
// exclude tracks at boundary between detectors
//Double_t boundaryWidth=AliITSRecoParam::GetBoundaryWidthPlaneEff();
msz *= AliITSReconstructor::GetRecoParam()->GetNSigma2RoadZNonC();
msy *= AliITSReconstructor::GetRecoParam()->GetNSigma2RoadYNonC();
}
+
+ if(AliITSReconstructor::GetRecoParam()->GetSwitchOffStdSearchClusPlaneEff()){
+ Double_t nsigx=AliITSReconstructor::GetRecoParam()->GetNSigXSearchClusterPlaneEff();
+ Double_t nsigz=AliITSReconstructor::GetRecoParam()->GetNSigZSearchClusterPlaneEff();
+ Double_t distx=AliITSReconstructor::GetRecoParam()->GetDistXSearchClusterPlaneEff();
+ Double_t distz=AliITSReconstructor::GetRecoParam()->GetDistZSearchClusterPlaneEff();
+ msy = nsigx*TMath::Sqrt(tmp.GetSigmaY2()) + distx;
+ msz = nsigz*TMath::Sqrt(tmp.GetSigmaZ2()) + distz;
+
+ if(AliITSReconstructor::GetRecoParam()->GetSwitchOnMaxDistNSigSrhClusPlaneEff()){
+ if(nsigx*TMath::Sqrt(tmp.GetSigmaY2())<=distx) msy -= nsigx*TMath::Sqrt(tmp.GetSigmaY2());
+ else msy -= distx;
+
+ if(nsigz*TMath::Sqrt(tmp.GetSigmaZ2())<=distz) msz -= nsigz*TMath::Sqrt(tmp.GetSigmaZ2());
+ else msz -= distz;
+ }
+
+ msy *= msy;
+ msz *= msz;
+
+ }
+
+ if(msz==0 || msy==0){AliWarning("UseTrackForPlaneEff: null search frame"); return;}
+
msz = 1./msz; // 1/RoadZ^2
msy = 1./msy; // 1/RoadY^2
-//
const AliITSRecPoint *cl=0; Int_t clidx=-1, ci=-1;
Int_t idetc=-1;