#include <TMatrixD.h>
#include <TTree.h>
-#include <TTreeStream.h>
#include <TDatabasePDG.h>
#include <TString.h>
#include <TRandom.h>
-
+#include <TTreeStream.h>
#include "AliLog.h"
+#include "AliITSPlaneEff.h"
+#include "AliITSCalibrationSPD.h"
+#include "AliITSCalibrationSDD.h"
+#include "AliITSCalibrationSSD.h"
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
+#include "AliAlignObj.h"
+#include "AliTrackPointArray.h"
+#include "AliESDVertex.h"
#include "AliESDEvent.h"
#include "AliESDtrack.h"
-#include "AliESDVertex.h"
#include "AliV0.h"
#include "AliHelix.h"
+#include "AliITSChannelStatus.h"
+#include "AliITSDetTypeRec.h"
#include "AliITSRecPoint.h"
#include "AliITSgeomTGeo.h"
#include "AliITSReconstructor.h"
-#include "AliTrackPointArray.h"
-#include "AliAlignObj.h"
#include "AliITSClusterParam.h"
-#include "AliCDBManager.h"
-#include "AliCDBEntry.h"
#include "AliITSsegmentation.h"
#include "AliITSCalibration.h"
-#include "AliITSCalibrationSPD.h"
-#include "AliITSCalibrationSDD.h"
-#include "AliITSCalibrationSSD.h"
-#include "AliITSPlaneEff.h"
#include "AliITSPlaneEffSPD.h"
#include "AliITSPlaneEffSDD.h"
#include "AliITSPlaneEffSSD.h"
+#include "AliITSV0Finder.h"
#include "AliITStrackerMI.h"
ClassImp(AliITStrackerMI)
fxTimesRhoLayerTrks(0),
fDebugStreamer(0),
fITSChannelStatus(0),
-fDetTypeRec(0),
+fkDetTypeRec(0),
fPlaneEff(0) {
//Default constructor
Int_t i;
fxTimesRhoLayerTrks(0),
fDebugStreamer(0),
fITSChannelStatus(0),
-fDetTypeRec(0),
+fkDetTypeRec(0),
fPlaneEff(0) {
//--------------------------------------------------------------------
//This is the AliITStrackerMI constructor
} // end loop on detectors
} // end loop on ladders
+ fForceSkippingOfLayer[i] = 0;
} // end loop on layers
AliITSReconstructor::GetRecoParam()->GetSigmaZVdef()};
SetVertex(xyzVtx,ersVtx);
- for (Int_t i=0; i<AliITSgeomTGeo::GetNLayers(); i++) fLayersNotToSkip[i]=AliITSRecoParam::GetLayersNotToSkip(i);
fLastLayerToTrackTo=AliITSRecoParam::GetLastLayerToTrackTo();
for (Int_t i=0;i<100000;i++){
fBestTrackIndex[i]=0;
fDebugStreamer = new TTreeSRedirector("ITSdebug.root");
// only for plane efficiency evaluation
- if (AliITSReconstructor::GetRecoParam()->GetComputePlaneEff()) {
+ if (AliITSReconstructor::GetRecoParam()->GetComputePlaneEff() &&
+ AliITSReconstructor::GetRecoParam()->GetIPlanePlaneEff()>=0) {
Int_t iplane=AliITSReconstructor::GetRecoParam()->GetIPlanePlaneEff();
- if(AliITSReconstructor::GetRecoParam()->GetLayersToSkip(iplane))
+ 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();
else if (iplane<4) fPlaneEff = new AliITSPlaneEffSDD();
fxTimesRhoLayerTrks(0),
fDebugStreamer(tracker.fDebugStreamer),
fITSChannelStatus(tracker.fITSChannelStatus),
-fDetTypeRec(tracker.fDetTypeRec),
+fkDetTypeRec(tracker.fkDetTypeRec),
fPlaneEff(tracker.fPlaneEff) {
//Copy constructor
Int_t i;
if(fPlaneEff) delete fPlaneEff;
}
//------------------------------------------------------------------------
-void AliITStrackerMI::SetLayersNotToSkip(Int_t *l) {
- //--------------------------------------------------------------------
- //This function set masks of the layers which must be not skipped
- //--------------------------------------------------------------------
- for (Int_t i=0; i<AliITSgeomTGeo::GetNLayers(); i++) fLayersNotToSkip[i]=l[i];
-}
-//------------------------------------------------------------------------
void AliITStrackerMI::ReadBadFromDetTypeRec() {
//--------------------------------------------------------------------
//This function read ITS bad detectors, chips, channels from AliITSDetTypeRec
Info("ReadBadFromDetTypeRec","Reading info about bad ITS detectors and channels");
- if(!fDetTypeRec) Error("ReadBadFromDetTypeRec","AliITSDetTypeRec nof found!\n");
+ if(!fkDetTypeRec) Error("ReadBadFromDetTypeRec","AliITSDetTypeRec nof found!\n");
// ITS channels map
if(fITSChannelStatus) delete fITSChannelStatus;
- fITSChannelStatus = new AliITSChannelStatus(fDetTypeRec);
+ fITSChannelStatus = new AliITSChannelStatus(fkDetTypeRec);
// ITS detectors and chips
Int_t i=0,j=0,k=0,ndet=0;
for (j=1; j<AliITSgeomTGeo::GetNLadders(i)+1; j++) {
for (k=1; k<ndet+1; k++) {
AliITSdetector &det=fgLayers[i-1].GetDetector((j-1)*ndet + k-1);
- det.ReadBadDetectorAndChips(i-1,(j-1)*ndet + k-1,fDetTypeRec);
+ det.ReadBadDetectorAndChips(i-1,(j-1)*ndet + k-1,fkDetTypeRec);
if(det.IsBad()) {nBadDetsPerLayer++;}
} // end loop on detectors
} // end loop on ladders
dummy.Clear();
+ // check whether we have to skip some layers
+ SetForceSkippingOfLayer();
+
return 0;
}
//------------------------------------------------------------------------
return;
}
//------------------------------------------------------------------------
-static Int_t CorrectForTPCtoITSDeadZoneMaterial(AliITStrackMI *t) {
+Int_t AliITStrackerMI::CorrectForTPCtoITSDeadZoneMaterial(AliITStrackMI *t) {
//--------------------------------------------------------------------
// Correction for the material between the TPC and the ITS
//--------------------------------------------------------------------
if (!t->PropagateToTGeo(AliITSRecoParam::Getrcd(),1)) return 0;// TPC central drum
if (!t->PropagateToTGeo(AliITSRecoParam::Getriw()+0.001,1)) return 0;// TPC inner wall
} else {
- Error("CorrectForTPCtoITSDeadZoneMaterial","Track is already in the dead zone !");
+ printf("CorrectForTPCtoITSDeadZoneMaterial: Track is already in the dead zone !\n");
return 0;
}
// The clusters must be already loaded !
//--------------------------------------------------------------------
+ AliDebug(2,Form("SKIPPING %d %d %d %d %d %d",ForceSkippingOfLayer(0),ForceSkippingOfLayer(1),ForceSkippingOfLayer(2),ForceSkippingOfLayer(3),ForceSkippingOfLayer(4),ForceSkippingOfLayer(5)));
fTrackingPhase="Clusters2Tracks";
GetBestHypothesysMIP(itsTracks);
} // end loop on the two tracking passes
- if(event->GetNumberOfV0s()>0) UpdateTPCV0(event);
- if(AliITSReconstructor::GetRecoParam()->GetFindV0s()) FindV02(event);
+ if(event->GetNumberOfV0s()>0) AliITSV0Finder::UpdateTPCV0(event,this);
+ if(AliITSReconstructor::GetRecoParam()->GetFindV0s()) AliITSV0Finder::FindV02(event,this);
fAfterV0 = kTRUE;
//
itsTracks.Delete();
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")) {
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);
+ 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));
fTrackToFollow.ResetCovariance(10.); fTrackToFollow.ResetClusters();
if (RefitAt(AliITSRecoParam::GetrInsideITSscreen(),&fTrackToFollow,t)) {
// The clusters must be loaded !
//--------------------------------------------------------------------
fTrackingPhase="RefitInward";
- if(AliITSReconstructor::GetRecoParam()->GetFindV0s()) RefitV02(event);
+
+ if(AliITSReconstructor::GetRecoParam()->GetFindV0s()) AliITSV0Finder::RefitV02(event,this);
+
Int_t nentr=event->GetNumberOfTracks();
Info("RefitInward", "Number of ESD tracks: %d\n", nentr);
fTrackToFollow.ResetCovariance(10.);
//Refitting...
- Bool_t pe=AliITSReconstructor::GetRecoParam()->GetComputePlaneEff();
+ Bool_t pe=(AliITSReconstructor::GetRecoParam()->GetComputePlaneEff() &&
+ AliITSReconstructor::GetRecoParam()->GetIPlanePlaneEff()>=0);
+
AliDebug(2,Form("Refit LABEL %d %d",t->GetLabel(),t->GetNumberOfClusters()));
if (RefitAt(AliITSRecoParam::GetrInsideSPD1(),&fTrackToFollow,t,kTRUE,pe)) {
AliDebug(2," refit OK");
p.SetXYZ(xyz, cov);
p.SetCharge(cl->GetQ());
p.SetDriftTime(cl->GetDriftTime());
+ p.SetChargeRatio(cl->GetChargeRatio());
+ p.SetClusterType(cl->GetClusterType());
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
switch (l) {
case 0:
Float_t tgl = t->GetTgl(); // tgl about const along track
Float_t expQ = TMath::Max(0.8*t->GetTPCsignal(),30.);
- Float_t errlocalx,errlocalz;
+ Float_t errtrky,errtrkz,covyz;
Bool_t addMisalErr=kFALSE;
- AliITSClusterParam::GetError(l,cl,tgl,tgphi,expQ,errlocalx,errlocalz,addMisalErr);
+ AliITSClusterParam::GetError(l,cl,tgl,tgphi,expQ,errtrky,errtrkz,covyz,addMisalErr);
Float_t xyz[3];
Float_t cov[6];
cl->GetGlobalXYZ(xyz);
// cl->GetGlobalCov(cov);
Float_t pos[3] = {0.,0.,0.};
- AliCluster tmpcl((UShort_t)cl->GetVolumeId(),pos[0],pos[1],pos[2],errlocalx*errlocalx,errlocalz*errlocalz,0);
+ AliCluster tmpcl((UShort_t)cl->GetVolumeId(),pos[0],pos[1],pos[2],errtrky*errtrky,errtrkz*errtrkz,covyz);
tmpcl.GetGlobalCov(cov);
p.SetXYZ(xyz, cov);
p.SetCharge(cl->GetQ());
p.SetDriftTime(cl->GetDriftTime());
+ p.SetChargeRatio(cl->GetChargeRatio());
+ p.SetClusterType(cl->GetClusterType());
AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
switch (l) {
// apply correction for material of the current layer
CorrectForLayerMaterial(vtrack,ilayer,trackGlobXYZ1,"inward");
vtrack->SetNDeadZone(vtrack->GetNDeadZone()+1);
- vtrack->SetClIndex(ilayer,0);
+ vtrack->SetDeadZoneProbability(ilayer,1.); // no penalty for missing cluster
+ vtrack->SetClIndex(ilayer,-1);
modstatus = (skip==1 ? 3 : 4); // skipped : out in z
if(LocalModuleCoord(ilayer,idet,vtrack,xloc,zloc)) { // local module coords
vtrack->SetModuleIndexInfo(ilayer,idet,modstatus,xloc,zloc);
(noClusters &&
AliITSReconstructor::GetRecoParam()->GetAllowProlongationWithEmptyRoad())) {
AliITStrackMI * updatetrack = new (&tracks[ilayer][ntracks[ilayer]]) AliITStrackMI(*currenttrack);
- updatetrack->SetClIndex(ilayer,0);
+ updatetrack->SetClIndex(ilayer,-1);
if (dead==0) {
modstatus = 5; // no cls in road
} else if (dead==1) {
modstatus = 7; // holes in z in SPD
- } else if (dead==2 || dead==3) {
+ } else if (dead==2 || dead==3 || dead==4) {
modstatus = 2; // dead from OCDB
}
updatetrack->SetModuleIndexInfo(ilayer,idet,modstatus,xloc,zloc);
}
if (isPrim) updatetrack->Improve(budgetToPrimVertex,xyzVtx,ersVtx);
}
+ updatetrack->SetNDeadZone(updatetrack->GetNDeadZone()+1);
if (dead) {
- updatetrack->SetNDeadZone(updatetrack->GetNDeadZone()+1);
if (dead==1) { // dead zone at z=0,+-7cm in SPD
- updatetrack->SetDeadZoneProbability(GetSPDDeadZoneProbability(updatetrack->GetZ(),TMath::Sqrt(updatetrack->GetSigmaZ2())));
+ updatetrack->SetDeadZoneProbability(ilayer,GetSPDDeadZoneProbability(updatetrack->GetZ(),TMath::Sqrt(updatetrack->GetSigmaZ2())));
deadzoneSPD=kTRUE;
- }
+ } else if (dead==2 || dead==3) { // dead module or chip from OCDB
+ updatetrack->SetDeadZoneProbability(ilayer,1.);
+ } else if (dead==4) { // at least a single dead channel from OCDB
+ updatetrack->SetDeadZoneProbability(ilayer,0.);
+ }
}
ntracks[ilayer]++;
}
if (cl->GetQ()==0) deadzoneSPD=kTRUE; // only 1 prolongation with virtual cluster
if (ntracks[ilayer]>=100) continue;
AliITStrackMI * updatetrack = new (&tracks[ilayer][ntracks[ilayer]]) AliITStrackMI(*currenttrack);
- updatetrack->SetClIndex(ilayer,0);
+ updatetrack->SetClIndex(ilayer,-1);
if (changedet) new (¤ttrack2) AliITStrackMI(backuptrack);
if (cl->GetQ()!=0) { // real cluster
AliDebug(2,"update failed");
continue;
}
- updatetrack->SetSampledEdx(cl->GetQ(),updatetrack->GetNumberOfClusters()-1); //b.b.
+ updatetrack->SetSampledEdx(cl->GetQ(),ilayer-2);
modstatus = 1; // found
} else { // virtual cluster in dead zone
updatetrack->SetNDeadZone(updatetrack->GetNDeadZone()+1);
- updatetrack->SetDeadZoneProbability(GetSPDDeadZoneProbability(updatetrack->GetZ(),TMath::Sqrt(updatetrack->GetSigmaZ2())));
+ updatetrack->SetDeadZoneProbability(ilayer,GetSPDDeadZoneProbability(updatetrack->GetZ(),TMath::Sqrt(updatetrack->GetSigmaZ2())));
modstatus = 7; // holes in z in SPD
}
AliITStrackMI* vtrack = new (&tracks[ilayer][ntracks[ilayer]]) AliITStrackMI(currenttrack1);
// apply correction for material of the current layer
CorrectForLayerMaterial(vtrack,ilayer,trackGlobXYZ1,"inward");
- vtrack->SetClIndex(ilayer,0);
+ vtrack->SetClIndex(ilayer,-1);
modstatus = 3; // skipped
vtrack->SetModuleIndexInfo(ilayer,idet,modstatus,xloc,zloc);
vtrack->Improve(budgetToPrimVertex,xyzVtx,ersVtx);
AliITStrackMI* vtrack = new (&tracks[ilayer][ntracks[ilayer]]) AliITStrackMI(currenttrack1);
// apply correction for material of the current layer
CorrectForLayerMaterial(vtrack,ilayer,trackGlobXYZ1,"inward");
- vtrack->SetClIndex(ilayer,0);
+ vtrack->SetClIndex(ilayer,-1);
modstatus = 3; // skipped
vtrack->SetModuleIndexInfo(ilayer,idet,modstatus,xloc,zloc);
vtrack->Improve(budgetToPrimVertex,xyzVtx,ersVtx);
fZcs(0),
fNcs(0),
fCurrentSlice(-1),
+fZmin(0),
fZmax(0),
fYmin(0),
fYmax(0),
fImax(0),
fSkip(0),
fAccepted(0),
-fRoad(0){
+fRoad(0),
+fMaxSigmaClY(0),
+fMaxSigmaClZ(0),
+fNMaxSigmaCl(3)
+{
//--------------------------------------------------------------------
//default AliITSlayer constructor
//--------------------------------------------------------------------
fZcs(0),
fNcs(0),
fCurrentSlice(-1),
+fZmin(0),
fZmax(0),
fYmin(0),
fYmax(0),
fImax(0),
fSkip(0),
fAccepted(0),
-fRoad(0) {
+fRoad(0),
+fMaxSigmaClY(0),
+fMaxSigmaClZ(0),
+fNMaxSigmaCl(3) {
//--------------------------------------------------------------------
//main AliITSlayer constructor
//--------------------------------------------------------------------
fZcs(layer.fZcs),
fNcs(layer.fNcs),
fCurrentSlice(layer.fCurrentSlice),
+fZmin(layer.fZmin),
fZmax(layer.fZmax),
fYmin(layer.fYmin),
fYmax(layer.fYmax),
fImax(layer.fImax),
fSkip(layer.fSkip),
fAccepted(layer.fAccepted),
-fRoad(layer.fRoad){
+fRoad(layer.fRoad),
+fMaxSigmaClY(layer.fMaxSigmaClY),
+fMaxSigmaClZ(layer.fMaxSigmaClZ),
+fNMaxSigmaCl(layer.fNMaxSigmaCl)
+{
//Copy constructor
}
//------------------------------------------------------------------------
fClusters[fN]=cl;
fN++;
AliITSdetector &det=GetDetector(cl->GetDetectorIndex());
+ //AD
+ Double_t nSigmaY=fNMaxSigmaCl*TMath::Sqrt(cl->GetSigmaY2());
+ Double_t nSigmaZ=fNMaxSigmaCl*TMath::Sqrt(cl->GetSigmaZ2());
+ if (cl->GetY()-nSigmaY<det.GetYmin()) det.SetYmin(cl->GetY()-nSigmaY);
+ if (cl->GetY()+nSigmaY>det.GetYmax()) det.SetYmax(cl->GetY()+nSigmaY);
+ if (cl->GetZ()-nSigmaZ<det.GetZmin()) det.SetZmin(cl->GetZ()-nSigmaZ);
+ if (cl->GetZ()+nSigmaZ>det.GetZmax()) det.SetZmax(cl->GetZ()+nSigmaZ);
+ //AD
+ /*
if (cl->GetY()<det.GetYmin()) det.SetYmin(cl->GetY());
if (cl->GetY()>det.GetYmax()) det.SetYmax(cl->GetY());
if (cl->GetZ()<det.GetZmin()) det.SetZmin(cl->GetZ());
if (cl->GetZ()>det.GetZmax()) det.SetZmax(cl->GetZ());
-
+ */
return 0;
}
//------------------------------------------------------------------------
Float_t *z = new Float_t[fN];
Int_t * index = new Int_t[fN];
//
+ fMaxSigmaClY=0.; //AD
+ fMaxSigmaClZ=0.; //AD
+
for (Int_t i=0;i<fN;i++){
z[i] = fClusters[i]->GetZ();
+ // save largest errors in y and z for this layer
+ fMaxSigmaClY=TMath::Max(fMaxSigmaClY,TMath::Sqrt(fClusters[i]->GetSigmaY2()));
+ fMaxSigmaClZ=TMath::Max(fMaxSigmaClZ,TMath::Sqrt(fClusters[i]->GetSigmaZ2()));
}
TMath::Sort(fN,z,index,kFALSE);
for (Int_t i=0;i<fN;i++){
//--------------------------------------------------------------------
Double_t circle=2*TMath::Pi()*fR;
- fYmin = ymin; fYmax =ymax;
+ fYmin = ymin;
+ fYmax = ymax;
+ fZmin = zmin;
+ fZmax = zmax;
+ // AD
+ // enlarge road in y by maximum cluster error on this layer (3 sigma)
+ fYmin -= fNMaxSigmaCl*fMaxSigmaClY;
+ fYmax += fNMaxSigmaCl*fMaxSigmaClY;
+ fZmin -= fNMaxSigmaCl*fMaxSigmaClZ;
+ fZmax += fNMaxSigmaCl*fMaxSigmaClZ;
+
Float_t ymiddle = (fYmin+fYmax)*0.5;
if (ymiddle<fYB[0]) {
fYmin+=circle; fYmax+=circle; ymiddle+=circle;
}
}
//
- fI=FindClusterIndex(zmin); fZmax=zmax;
- fImax = TMath::Min(FindClusterIndex(zmax)+1,fNcs);
- fSkip = 0;
- fAccepted =0;
+ fI = FindClusterIndex(fZmin);
+ fImax = TMath::Min(FindClusterIndex(fZmax)+1,fNcs);
+ fSkip = 0;
+ fAccepted = 0;
return;
}
Double_t rpi2 = 2.*fR*TMath::Pi();
for (Int_t i=fI; i<fImax; i++) {
Double_t y = fY[i];
+ Double_t z = fZ[i];
if (fYmax<y) y -= rpi2;
if (fYmin>y) y += rpi2;
if (y<fYmin) continue;
if (y>fYmax) continue;
+ // AD
+ // skip clusters that are in "extended" road but they
+ // 3sigma error does not touch the original road
+ if (z+fNMaxSigmaCl*TMath::Sqrt(fClusters[i]->GetSigmaZ2())<fZmin+fNMaxSigmaCl*fMaxSigmaClZ) continue;
+ if (z-fNMaxSigmaCl*TMath::Sqrt(fClusters[i]->GetSigmaZ2())>fZmax-fNMaxSigmaCl*fMaxSigmaClZ) continue;
+ //
if (fClusters[i]->GetQ()==0&&fSkip==2) continue;
ci=i;
if (!test) fI=i+1;
}
//------------------------------------------------------------------------
void AliITStrackerMI::AliITSdetector::ReadBadDetectorAndChips(Int_t ilayer,Int_t idet,
- AliITSDetTypeRec *detTypeRec)
+ const AliITSDetTypeRec *detTypeRec)
{
//--------------------------------------------------------------------
// Read bad detectors and chips from calibration objects in AliITSDetTypeRec
for(innermostlayer=0; innermostlayer<AliITSgeomTGeo::GetNLayers(); innermostlayer++) {
if(drphi < fgLayers[innermostlayer].GetR()) break;
}
- //printf(" drphi %f innermost %d\n",drphi,innermostlayer);
+ AliDebug(2,Form(" drphi %f innermost %d",drphi,innermostlayer));
Int_t modstatus=1; // found
Float_t xloc,zloc;
for (Int_t ilayer = from; ilayer != to; ilayer += step) {
AliITSlayer &layer=fgLayers[ilayer];
Double_t r=layer.GetR();
+
if (step<0 && xx>r) break;
// material between SSD and SDD, SDD and SPD
if (TMath::Abs(hI-1.5)<0.01) // SPDouter
if(!CorrectForShieldMaterial(track,"SPD",dir)) return kFALSE;
- // remember old position [SR, GSI 18.02.2003]
- Double_t oldX=0., oldY=0., oldZ=0.;
- if (track->IsStartedTimeIntegral() && step==1) {
- if (!track->GetGlobalXYZat(track->GetX(),oldX,oldY,oldZ)) return kFALSE;
- }
- //
Double_t oldGlobXYZ[3];
if (!track->GetXYZ(oldGlobXYZ)) return kFALSE;
- //TMath::Sqrt(track->GetSigmaY2());
+
+ // continue if we are already beyond this layer
+ Double_t oldGlobR = TMath::Sqrt(oldGlobXYZ[0]*oldGlobXYZ[0]+oldGlobXYZ[1]*oldGlobXYZ[1]);
+ if(step>0 && oldGlobR > r) continue; // going outward
+ if(step<0 && oldGlobR < r) continue; // going inward
Double_t phi,z;
if (!track->GetPhiZat(r,phi,z)) return kFALSE;
// check if we allow a prolongation without point for large-eta tracks
Int_t skip = CheckSkipLayer(track,ilayer,idet);
if (skip==2) {
- // propagate to the layer radius
- Double_t xToGo; if (!track->GetLocalXat(r,xToGo)) return kFALSE;
- if (!track->Propagate(xToGo)) return kFALSE;
- // apply correction for material of the current layer
- CorrectForLayerMaterial(track,ilayer,oldGlobXYZ,dir);
modstatus = 4; // out in z
if(LocalModuleCoord(ilayer,idet,track,xloc,zloc)) { // local module coords
track->SetModuleIndexInfo(ilayer,idet,modstatus,xloc,zloc);
}
- // track time update [SR, GSI 17.02.2003]
- if (track->IsStartedTimeIntegral() && step==1) {
- Double_t newX, newY, newZ;
- if (!track->GetGlobalXYZat(track->GetX(),newX,newY,newZ)) return kFALSE;
- Double_t dL2 = (oldX-newX)*(oldX-newX) + (oldY-newY)*(oldY-newY) +
- (oldZ-newZ)*(oldZ-newZ);
- track->AddTimeStep(TMath::Sqrt(dL2));
- }
+ // cross layer
+ // apply correction for material of the current layer
+ // add time if going outward
+ CorrectForLayerMaterial(track,ilayer,oldGlobXYZ,dir);
continue;
}
if (idet<0) return kFALSE;
+
const AliITSdetector &det=layer.GetDetector(idet);
if (!track->Propagate(det.GetPhi(),det.GetR())) return kFALSE;
dy = 0.5*(ymax-ymin);
Int_t dead = CheckDeadZone(track,ilayer,idet,dz,dy,kTRUE);
if (dead==1) modstatus = 7; // holes in z in SPD
- if (dead==2 || dead==3) modstatus = 2; // dead from OCDB
+ if (dead==2 || dead==3 || dead==4) modstatus = 2; // dead from OCDB
}
}
if (clAcc) {
if (!UpdateMI(track,clAcc,maxchi2,idx)) return kFALSE;
- track->SetSampledEdx(clAcc->GetQ(),track->GetNumberOfClusters()-1);
+ track->SetSampledEdx(clAcc->GetQ(),ilayer-2);
}
track->SetModuleIndexInfo(ilayer,idet,modstatus,xloc,zloc);
} // end search for extra clusters in overlapped modules
// Correct for material of the current layer
+ // cross material
+ // add time if going outward
if(!CorrectForLayerMaterial(track,ilayer,oldGlobXYZ,dir)) return kFALSE;
- // track time update [SR, GSI 17.02.2003]
- if (track->IsStartedTimeIntegral() && step==1) {
- Double_t newX, newY, newZ;
- if (!track->GetGlobalXYZat(track->GetX(),newX,newY,newZ)) return kFALSE;
- Double_t dL2 = (oldX-newX)*(oldX-newX) + (oldY-newY)*(oldY-newY) +
- (oldZ-newZ)*(oldZ-newZ);
- track->AddTimeStep(TMath::Sqrt(dL2));
- }
- //
-
} // end loop on layers
if (!track->PropagateTo(xx,0.,0.)) return kFALSE;
Float_t *ny = GetNy(fCurrentEsdTrack), *nz = GetNz(fCurrentEsdTrack);
if (mode<100){
for (Int_t i = 0;i<6;i++){
- if (track->GetClIndex(i)>0){
+ if (track->GetClIndex(i)>=0){
Float_t cerry, cerrz;
if (ny[i]>0) {cerry = erry[i]; cerrz=errz[i];}
else
}
else{
for (Int_t i = 0;i<4;i++){
- if (track->GetClIndex(i)>0){
+ if (track->GetClIndex(i)>=0){
Float_t cerry, cerrz;
if (ny[i]>0) {cerry = erry[i]; cerrz=errz[i];}
else { cerry= track->GetSigmaY(i); cerrz = track->GetSigmaZ(i);}
}
}
for (Int_t i = 4;i<6;i++){
- if (track->GetClIndex(i)>0){
+ if (track->GetClIndex(i)>=0){
Float_t cerry, cerrz;
if (ny[i]>0) {cerry = erry[i]; cerrz=errz[i];}
else { cerry= track->GetSigmaY(i); cerrz = track->GetSigmaZ(i);}
}
}
if (match<0) match=0;
- Float_t deadzonefactor = (track->GetNDeadZone()>0) ? 3*(1.1-track->GetDeadZoneProbability()):0.;
+
+ // penalty factor for missing points (NDeadZone>0), but no penalty
+ // for layer with deadZoneProb close to 1 (either we wanted to skip layer
+ // or there is a dead from OCDB)
+ Float_t deadzonefactor = 0.;
+ if (track->GetNDeadZone()>0.) {
+ Float_t sumDeadZoneProbability=0;
+ for(Int_t ilay=0;ilay<6;ilay++) sumDeadZoneProbability+=track->GetDeadZoneProbability(ilay);
+ Float_t nDeadZoneWithProbNot1=(Float_t)(track->GetNDeadZone())-sumDeadZoneProbability;
+ if(nDeadZoneWithProbNot1>0.) {
+ Float_t deadZoneProbability = sumDeadZoneProbability - (Float_t)((Int_t)sumDeadZoneProbability);
+ deadZoneProbability /= nDeadZoneWithProbNot1;
+ deadzonefactor = 3.*(1.1-deadZoneProbability);
+ }
+ }
+
Double_t normchi2 = 2*track->GetNSkipped()+match+deadzonefactor+(1+(2*track->GetNSkipped()+deadzonefactor)/track->GetNumberOfClusters())*
(chi2)/TMath::Max(double(sum-track->GetNSkipped()),
1./(1.+track->GetNSkipped()));
return normchi2;
}
//------------------------------------------------------------------------
-Double_t AliITStrackerMI::GetMatchingChi2(AliITStrackMI * track1, AliITStrackMI * track2)
+Double_t AliITStrackerMI::GetMatchingChi2(const AliITStrackMI * track1,const AliITStrackMI * track2)
{
//
// return matching chi2 between two tracks
return chi2(0,0);
}
//------------------------------------------------------------------------
-Double_t AliITStrackerMI::GetSPDDeadZoneProbability(Double_t zpos, Double_t zerr)
+Double_t AliITStrackerMI::GetSPDDeadZoneProbability(Double_t zpos, Double_t zerr) const
{
//
// return probability that given point (characterized by z position and error)
return probability;
}
//------------------------------------------------------------------------
-Double_t AliITStrackerMI::GetTruncatedChi2(AliITStrackMI * track, Float_t fac)
+Double_t AliITStrackerMI::GetTruncatedChi2(const AliITStrackMI * track, Float_t fac)
{
//
// calculate normalized chi2
return normchi2;
}
//------------------------------------------------------------------------
-Double_t AliITStrackerMI::GetInterpolatedChi2(AliITStrackMI * forwardtrack, AliITStrackMI * backtrack)
+Double_t AliITStrackerMI::GetInterpolatedChi2(const AliITStrackMI * forwardtrack,const AliITStrackMI * backtrack)
{
//
// calculate normalized chi2
return fgLayers[l].GetWeight(c);
}
//------------------------------------------------------------------------
-void AliITStrackerMI::RegisterClusterTracks(AliITStrackMI* track,Int_t id)
+void AliITStrackerMI::RegisterClusterTracks(const AliITStrackMI* track,Int_t id)
{
//---------------------------------------------
// register track to the list
}
}
//------------------------------------------------------------------------
-void AliITStrackerMI::UnRegisterClusterTracks(AliITStrackMI* track, Int_t id)
+void AliITStrackerMI::UnRegisterClusterTracks(const AliITStrackMI* track, Int_t id)
{
//---------------------------------------------
// unregister track from the list
return shared;
}
//------------------------------------------------------------------------
-Int_t AliITStrackerMI::GetOverlapTrack(AliITStrackMI *track, Int_t trackID, Int_t &shared, Int_t clusterlist[6],Int_t overlist[6])
+Int_t AliITStrackerMI::GetOverlapTrack(const AliITStrackMI *track, Int_t trackID, Int_t &shared, Int_t clusterlist[6],Int_t overlist[6])
{
//
// find first shared track
Float_t *erry = GetErrY(esdindex), *errz = GetErrZ(esdindex);
Float_t *ny = GetNy(esdindex), *nz = GetNz(esdindex);
for (Int_t j=0;j<6;j++) {
- if (besttrack->GetClIndex(j)>0){
+ if (besttrack->GetClIndex(j)>=0){
erry[j] = besttrack->GetSigmaY(j); erry[j+6] = besttrack->GetSigmaY(j+6);
errz[j] = besttrack->GetSigmaZ(j); errz[j+6] = besttrack->GetSigmaZ(j+6);
ny[j] = besttrack->GetNy(j);
besttrack = (AliITStrackMI*)array->At(index[0]);
if (besttrack&&besttrack->GetChi2MIP(0)<AliITSReconstructor::GetRecoParam()->GetMaxChi2PerCluster(0)){
for (Int_t j=0;j<6;j++){
- if (besttrack->GetClIndex(j)>0){
+ if (besttrack->GetClIndex(j)>=0){
erry[j] = besttrack->GetSigmaY(j); erry[j+6] = besttrack->GetSigmaY(j+6);
errz[j] = besttrack->GetSigmaZ(j); erry[j+6] = besttrack->GetSigmaY(j+6);
ny[j] = besttrack->GetNy(j);
Float_t *ny = GetNy(esdindex), *nz = GetNz(esdindex);
for (Int_t i=0;i<6;i++){
Int_t index = besttrack->GetClIndex(i);
- if (index<=0) continue;
+ if (index<0) continue;
Int_t ilayer = (index & 0xf0000000) >> 28;
if (besttrack->GetSigmaY(ilayer)<0.00000000001) continue;
AliITSRecPoint *c = (AliITSRecPoint*)GetCluster(index);
AliITStrackMI * track = (AliITStrackMI*)array->At(i);
if (!track) continue;
if (track->GetChi2MIP(0)>besttrack->GetChi2MIP(0)+2.*shared+1.) break;
- if ( (track->GetClIndex(ilayer)>0) && (track->GetClIndex(ilayer)!=besttrack->GetClIndex(ilayer))){
+ if ( (track->GetClIndex(ilayer)>=0) && (track->GetClIndex(ilayer)!=besttrack->GetClIndex(ilayer))){
cansign = kFALSE;
break;
}
void AliITStrackerMI::CookdEdx(AliITStrackMI* track)
{
//
- //
- // Int_t list[6];
- //AliITSRecPoint * clist[6];
- // Int_t shared = GetNumberOfSharedClusters(track,index,list,clist);
- Float_t dedx[4];
- Int_t accepted=0;
track->SetChi2MIP(9,0);
for (Int_t i=0;i<track->GetNumberOfClusters();i++){
Int_t cindex = track->GetClusterIndex(i);
if (cl->GetLabel(ind)==lab) isWrong=0;
}
track->SetChi2MIP(9,track->GetChi2MIP(9)+isWrong*(2<<l));
- if (l<2) continue;
- //if (l>3 && (cl->GetNy()>4) || (cl->GetNz()>4)) continue; //shared track
- //if (l>3&& !(cl->GetType()==1||cl->GetType()==10)) continue;
- //if (l<4&& !(cl->GetType()==1)) continue;
- dedx[accepted]= track->GetSampledEdx(i);
- //dedx[accepted]= track->fNormQ[l];
- accepted++;
- }
- if (accepted<1) {
- track->SetdEdx(0);
- return;
}
- Int_t indexes[4];
- TMath::Sort(accepted,dedx,indexes,kFALSE);
Double_t low=0.;
Double_t up=0.51;
- Double_t nl=low*accepted, nu =up*accepted;
- Float_t sumamp = 0;
- Float_t sumweight =0;
- for (Int_t i=0; i<accepted; i++) {
- Float_t weight =1;
- if (i<nl+0.1) weight = TMath::Max(1.-(nl-i),0.);
- if (i>nu-1) weight = TMath::Max(nu-i,0.);
- sumamp+= dedx[indexes[i]]*weight;
- sumweight+=weight;
- }
- track->SetdEdx(sumamp/sumweight);
+ track->CookdEdx(low,up);
}
//------------------------------------------------------------------------
void AliITStrackerMI::MakeCoefficients(Int_t ntracks){
//
+ // Create some arrays
//
if (fCoefficients) delete []fCoefficients;
fCoefficients = new Float_t[ntracks*48];
Double_t AliITStrackerMI::GetPredictedChi2MI(AliITStrackMI* track, const AliITSRecPoint *cluster,Int_t layer)
{
//
+ // Compute predicted chi2
//
- //
- Float_t erry,errz;
+ Float_t erry,errz,covyz;
Float_t theta = track->GetTgl();
Float_t phi = track->GetSnp();
- phi = TMath::Sqrt(phi*phi/(1.-phi*phi));
- AliITSClusterParam::GetError(layer,cluster,theta,phi,track->GetExpQ(),erry,errz);
+ phi = TMath::Abs(phi)*TMath::Sqrt(1./((1.-phi)*(1.+phi)));
+ AliITSClusterParam::GetError(layer,cluster,theta,phi,track->GetExpQ(),erry,errz,covyz);
AliDebug(2,Form(" chi2: tr-cl %f %f tr X %f cl X %f",track->GetY()-cluster->GetY(),track->GetZ()-cluster->GetZ(),track->GetX(),cluster->GetX()));
// Take into account the mis-alignment (bring track to cluster plane)
Double_t xTrOrig=track->GetX();
if (!track->Propagate(xTrOrig+cluster->GetX())) return 1000.;
AliDebug(2,Form(" chi2: tr-cl %f %f tr X %f cl X %f",track->GetY()-cluster->GetY(),track->GetZ()-cluster->GetZ(),track->GetX(),cluster->GetX()));
- Double_t chi2 = track->GetPredictedChi2MI(cluster->GetY(),cluster->GetZ(),erry,errz);
+ Double_t chi2 = track->GetPredictedChi2MI(cluster->GetY(),cluster->GetZ(),erry,errz,covyz);
// Bring the track back to detector plane in ideal geometry
// [mis-alignment will be accounted for in UpdateMI()]
if (!track->Propagate(xTrOrig)) return 1000.;
track->SetNz(layer,nz);
track->SetSigmaY(layer,erry);
track->SetSigmaZ(layer, errz);
+ track->SetSigmaYZ(layer,covyz);
//track->fNormQ[layer] = cluster->GetQ()/TMath::Sqrt(1+theta*theta+phi*phi);
- track->SetNormQ(layer,cluster->GetQ()/TMath::Sqrt((1.+ track->GetTgl()*track->GetTgl())/(1.- track->GetSnp()*track->GetSnp())));
+ track->SetNormQ(layer,cluster->GetQ()/TMath::Sqrt((1.+ track->GetTgl()*track->GetTgl())/((1.-track->GetSnp())*(1.+track->GetSnp()))));
return chi2;
}
Int_t AliITStrackerMI::UpdateMI(AliITStrackMI* track, const AliITSRecPoint* cl,Double_t chi2,Int_t index) const
{
//
- //
+ // Update ITS track
//
Int_t layer = (index & 0xf0000000) >> 28;
track->SetClIndex(layer, index);
AliDebug(2,Form(" xtr %f xcl %f",track->GetX(),cl->GetX()));
if (!track->Propagate(xTrOrig+cl->GetX())) return 0;
-
AliCluster c(*cl);
c.SetSigmaY2(track->GetSigmaY(layer)*track->GetSigmaY(layer));
c.SetSigmaZ2(track->GetSigmaZ(layer)*track->GetSigmaZ(layer));
+ c.SetSigmaYZ(track->GetSigmaYZ(layer));
Int_t updated = track->UpdateMI(&c,chi2,index);
-
// Bring the track back to detector plane in ideal geometry
if (!track->Propagate(xTrOrig)) return 0;
-
+
if(!updated) AliDebug(2,"update failed");
return updated;
}
//------------------------------------------------------------------------
-void AliITStrackerMI::GetDCASigma(AliITStrackMI* track, Float_t & sigmarfi, Float_t &sigmaz)
+void AliITStrackerMI::GetDCASigma(const AliITStrackMI* track, Float_t & sigmarfi, Float_t &sigmaz)
{
//
//DCA sigmas parameterization
sigmaz = 0.0110+4.37*TMath::Abs(track->GetC());
}
//------------------------------------------------------------------------
-void AliITStrackerMI::SignDeltas( TObjArray *ClusterArray, Float_t vz)
+void AliITStrackerMI::SignDeltas(const TObjArray *clusterArray, Float_t vz)
{
//
+ // Clusters from delta electrons?
//
- Int_t entries = ClusterArray->GetEntriesFast();
+ Int_t entries = clusterArray->GetEntriesFast();
if (entries<4) return;
- AliITSRecPoint* cluster = (AliITSRecPoint*)ClusterArray->At(0);
+ AliITSRecPoint* cluster = (AliITSRecPoint*)clusterArray->At(0);
Int_t layer = cluster->GetLayer();
if (layer>1) return;
Int_t index[10000];
Float_t r = (layer>0)? 7:4;
//
for (Int_t i=0;i<entries;i++){
- AliITSRecPoint* cl0 = (AliITSRecPoint*)ClusterArray->At(i);
+ AliITSRecPoint* cl0 = (AliITSRecPoint*)clusterArray->At(i);
Float_t nz = 1+TMath::Abs((cl0->GetZ()-vz)/r);
if (cl0->GetNy()+cl0->GetNz()<=5+2*layer+nz) continue;
index[ncandidates] = i; //candidate to belong to delta electron track
//
//
for (Int_t i=0;i<ncandidates;i++){
- AliITSRecPoint* cl0 = (AliITSRecPoint*)ClusterArray->At(index[i]);
+ AliITSRecPoint* cl0 = (AliITSRecPoint*)clusterArray->At(index[i]);
if (cl0->GetDeltaProbability()>0.8) continue;
//
Int_t ncl = 0;
sumy=sumz=sumy2=sumyz=sumw=0.0;
for (Int_t j=0;j<ncandidates;j++){
if (i==j) continue;
- AliITSRecPoint* cl1 = (AliITSRecPoint*)ClusterArray->At(index[j]);
+ AliITSRecPoint* cl1 = (AliITSRecPoint*)clusterArray->At(index[j]);
//
Float_t dz = cl0->GetZ()-cl1->GetZ();
Float_t dy = cl0->GetY()-cl1->GetY();
void AliITStrackerMI::UpdateESDtrack(AliITStrackMI* track, ULong_t flags) const
{
//
+ // Update ESD track
//
track->UpdateESDtrack(flags);
AliITStrackMI * oldtrack = (AliITStrackMI*)(track->GetESDtrack()->GetITStrack());
return res;
}
//------------------------------------------------------------------------
-void AliITStrackerMI::UpdateTPCV0(AliESDEvent *event){
- //
- //try to update, or reject TPC V0s
- //
- Int_t nv0s = event->GetNumberOfV0s();
- Int_t nitstracks = fTrackHypothesys.GetEntriesFast();
-
- for (Int_t i=0;i<nv0s;i++){
- AliESDv0 * vertex = event->GetV0(i);
- Int_t ip = vertex->GetIndex(0);
- Int_t im = vertex->GetIndex(1);
- //
- TObjArray * arrayp = (ip<nitstracks) ? (TObjArray*)fTrackHypothesys.At(ip):0;
- TObjArray * arraym = (im<nitstracks) ? (TObjArray*)fTrackHypothesys.At(im):0;
- AliITStrackMI * trackp = (arrayp!=0) ? (AliITStrackMI*)arrayp->At(0):0;
- AliITStrackMI * trackm = (arraym!=0) ? (AliITStrackMI*)arraym->At(0):0;
- //
- //
- if (trackp){
- if (trackp->GetNumberOfClusters()+trackp->GetNDeadZone()>5.5){
- if (trackp->GetConstrain()&&trackp->GetChi2MIP(0)<3) vertex->SetStatus(-100);
- if (!trackp->GetConstrain()&&trackp->GetChi2MIP(0)<2) vertex->SetStatus(-100);
- }
- }
-
- if (trackm){
- if (trackm->GetNumberOfClusters()+trackm->GetNDeadZone()>5.5){
- if (trackm->GetConstrain()&&trackm->GetChi2MIP(0)<3) vertex->SetStatus(-100);
- if (!trackm->GetConstrain()&&trackm->GetChi2MIP(0)<2) vertex->SetStatus(-100);
- }
- }
- if (vertex->GetStatus()==-100) continue;
- //
- Double_t xrp[3]; vertex->GetXYZ(xrp[0],xrp[1],xrp[2]); //I.B.
- Int_t clayer = GetNearestLayer(xrp); //I.B.
- vertex->SetNBefore(clayer); //
- vertex->SetChi2Before(9*clayer); //
- vertex->SetNAfter(6-clayer); //
- vertex->SetChi2After(0); //
- //
- if (clayer >1 ){ // calculate chi2 before vertex
- Float_t chi2p = 0, chi2m=0;
- //
- if (trackp){
- for (Int_t ilayer=0;ilayer<clayer;ilayer++){
- if (trackp->GetClIndex(ilayer)>0){
- chi2p+=trackp->GetDy(ilayer)*trackp->GetDy(ilayer)/(trackp->GetSigmaY(ilayer)*trackp->GetSigmaY(ilayer))+
- trackp->GetDz(ilayer)*trackp->GetDz(ilayer)/(trackp->GetSigmaZ(ilayer)*trackp->GetSigmaZ(ilayer));
- }
- else{
- chi2p+=9;
- }
- }
- }else{
- chi2p = 9*clayer;
- }
- //
- if (trackm){
- for (Int_t ilayer=0;ilayer<clayer;ilayer++){
- if (trackm->GetClIndex(ilayer)>0){
- chi2m+=trackm->GetDy(ilayer)*trackm->GetDy(ilayer)/(trackm->GetSigmaY(ilayer)*trackm->GetSigmaY(ilayer))+
- trackm->GetDz(ilayer)*trackm->GetDz(ilayer)/(trackm->GetSigmaZ(ilayer)*trackm->GetSigmaZ(ilayer));
- }
- else{
- chi2m+=9;
- }
- }
- }else{
- chi2m = 9*clayer;
- }
- vertex->SetChi2Before(TMath::Min(chi2p,chi2m));
- if (TMath::Min(chi2p,chi2m)/Float_t(clayer)<4) vertex->SetStatus(-10); // track exist before vertex
- }
-
- if (clayer < 5 ){ // calculate chi2 after vertex
- Float_t chi2p = 0, chi2m=0;
- //
- if (trackp&&TMath::Abs(trackp->GetTgl())<1.){
- for (Int_t ilayer=clayer;ilayer<6;ilayer++){
- if (trackp->GetClIndex(ilayer)>0){
- chi2p+=trackp->GetDy(ilayer)*trackp->GetDy(ilayer)/(trackp->GetSigmaY(ilayer)*trackp->GetSigmaY(ilayer))+
- trackp->GetDz(ilayer)*trackp->GetDz(ilayer)/(trackp->GetSigmaZ(ilayer)*trackp->GetSigmaZ(ilayer));
- }
- else{
- chi2p+=9;
- }
- }
- }else{
- chi2p = 0;
- }
- //
- if (trackm&&TMath::Abs(trackm->GetTgl())<1.){
- for (Int_t ilayer=clayer;ilayer<6;ilayer++){
- if (trackm->GetClIndex(ilayer)>0){
- chi2m+=trackm->GetDy(ilayer)*trackm->GetDy(ilayer)/(trackm->GetSigmaY(ilayer)*trackm->GetSigmaY(ilayer))+
- trackm->GetDz(ilayer)*trackm->GetDz(ilayer)/(trackm->GetSigmaZ(ilayer)*trackm->GetSigmaZ(ilayer));
- }
- else{
- chi2m+=9;
- }
- }
- }else{
- chi2m = 0;
- }
- vertex->SetChi2After(TMath::Max(chi2p,chi2m));
- if (TMath::Max(chi2m,chi2p)/Float_t(6-clayer)>9) vertex->SetStatus(-20); // track not found in ITS
- }
- }
- //
-}
-//------------------------------------------------------------------------
-void AliITStrackerMI::FindV02(AliESDEvent *event)
-{
- //
- // V0 finder
- //
- // Cuts on DCA - R dependent
- // max distance DCA between 2 tracks cut
- // maxDist = TMath::Min(kMaxDist,kMaxDist0+pvertex->GetRr()*kMaxDist);
- //
- const Float_t kMaxDist0 = 0.1;
- const Float_t kMaxDist1 = 0.1;
- const Float_t kMaxDist = 1;
- const Float_t kMinPointAngle = 0.85;
- const Float_t kMinPointAngle2 = 0.99;
- const Float_t kMinR = 0.5;
- const Float_t kMaxR = 220;
- //const Float_t kCausality0Cut = 0.19;
- //const Float_t kLikelihood01Cut = 0.25;
- //const Float_t kPointAngleCut = 0.9996;
- const Float_t kCausality0Cut = 0.19;
- const Float_t kLikelihood01Cut = 0.45;
- const Float_t kLikelihood1Cut = 0.5;
- const Float_t kCombinedCut = 0.55;
-
- //
- //
- TTreeSRedirector &cstream = *fDebugStreamer;
- Int_t ntracks = event->GetNumberOfTracks();
- Int_t nitstracks = fTrackHypothesys.GetEntriesFast();
- fOriginal.Expand(ntracks);
- fTrackHypothesys.Expand(ntracks);
- fBestHypothesys.Expand(ntracks);
- //
- AliHelix * helixes = new AliHelix[ntracks+2];
- TObjArray trackarray(ntracks+2); //array with tracks - with vertex constrain
- TObjArray trackarrayc(ntracks+2); //array of "best tracks" - without vertex constrain
- TObjArray trackarrayl(ntracks+2); //array of "longest tracks" - without vertex constrain
- Bool_t * forbidden = new Bool_t [ntracks+2];
- Int_t *itsmap = new Int_t [ntracks+2];
- Float_t *dist = new Float_t[ntracks+2];
- Float_t *normdist0 = new Float_t[ntracks+2];
- Float_t *normdist1 = new Float_t[ntracks+2];
- Float_t *normdist = new Float_t[ntracks+2];
- Float_t *norm = new Float_t[ntracks+2];
- Float_t *maxr = new Float_t[ntracks+2];
- Float_t *minr = new Float_t[ntracks+2];
- Float_t *minPointAngle= new Float_t[ntracks+2];
- //
- AliV0 *pvertex = new AliV0;
- AliITStrackMI * dummy= new AliITStrackMI;
- dummy->SetLabel(0);
- AliITStrackMI trackat0; //temporary track for DCA calculation
- //
- Float_t primvertex[3]={GetX(),GetY(),GetZ()};
- //
- // make ITS - ESD map
- //
- for (Int_t itrack=0;itrack<ntracks+2;itrack++) {
- itsmap[itrack] = -1;
- forbidden[itrack] = kFALSE;
- maxr[itrack] = kMaxR;
- minr[itrack] = kMinR;
- minPointAngle[itrack] = kMinPointAngle;
- }
- for (Int_t itrack=0;itrack<nitstracks;itrack++){
- AliITStrackMI * original = (AliITStrackMI*)(fOriginal.At(itrack));
- Int_t esdindex = original->GetESDtrack()->GetID();
- itsmap[esdindex] = itrack;
- }
- //
- // create ITS tracks from ESD tracks if not done before
- //
- for (Int_t itrack=0;itrack<ntracks;itrack++){
- if (itsmap[itrack]>=0) continue;
- AliITStrackMI * tpctrack = new AliITStrackMI(*(event->GetTrack(itrack)));
- //tpctrack->fD[0] = tpctrack->GetD(GetX(),GetY());
- //tpctrack->fD[1] = tpctrack->GetZat(GetX())-GetZ();
- tpctrack->GetDZ(GetX(),GetY(),GetZ(),tpctrack->GetDP()); //I.B.
- if (tpctrack->GetD(0)<20 && tpctrack->GetD(1)<20){
- // tracks which can reach inner part of ITS
- // propagate track to outer its volume - with correction for material
- CorrectForTPCtoITSDeadZoneMaterial(tpctrack);
- }
- itsmap[itrack] = nitstracks;
- fOriginal.AddAt(tpctrack,nitstracks);
- nitstracks++;
- }
- //
- // fill temporary arrays
- //
- for (Int_t itrack=0;itrack<ntracks;itrack++){
- AliESDtrack * esdtrack = event->GetTrack(itrack);
- Int_t itsindex = itsmap[itrack];
- AliITStrackMI *original = (AliITStrackMI*)fOriginal.At(itsmap[itrack]);
- if (!original) continue;
- AliITStrackMI *bestConst = 0;
- AliITStrackMI *bestLong = 0;
- AliITStrackMI *best = 0;
- //
- //
- TObjArray * array = (TObjArray*) fTrackHypothesys.At(itsindex);
- Int_t hentries = (array==0) ? 0 : array->GetEntriesFast();
- // Get best track with vertex constrain
- for (Int_t ih=0;ih<hentries;ih++){
- AliITStrackMI * trackh = (AliITStrackMI*)array->At(ih);
- if (!trackh->GetConstrain()) continue;
- if (!bestConst) bestConst = trackh;
- if (trackh->GetNumberOfClusters()>5.0){
- bestConst = trackh; // full track - with minimal chi2
- break;
- }
- if (trackh->GetNumberOfClusters()+trackh->GetNDeadZone()<=bestConst->GetNumberOfClusters()+bestConst->GetNDeadZone()) continue;
- bestConst = trackh;
- break;
- }
- // Get best long track without vertex constrain and best track without vertex constrain
- for (Int_t ih=0;ih<hentries;ih++){
- AliITStrackMI * trackh = (AliITStrackMI*)array->At(ih);
- if (trackh->GetConstrain()) continue;
- if (!best) best = trackh;
- if (!bestLong) bestLong = trackh;
- if (trackh->GetNumberOfClusters()>5.0){
- bestLong = trackh; // full track - with minimal chi2
- break;
- }
- if (trackh->GetNumberOfClusters()+trackh->GetNDeadZone()<=bestLong->GetNumberOfClusters()+bestLong->GetNDeadZone()) continue;
- bestLong = trackh;
- }
- if (!best) {
- best = original;
- bestLong = original;
- }
- //I.B. trackat0 = *bestLong;
- new (&trackat0) AliITStrackMI(*bestLong);
- Double_t xx,yy,zz,alpha;
- if (!bestLong->GetGlobalXYZat(bestLong->GetX(),xx,yy,zz)) continue;
- alpha = TMath::ATan2(yy,xx);
- if (!trackat0.Propagate(alpha,0)) continue;
- // calculate normalized distances to the vertex
- //
- Float_t ptfac = (1.+100.*TMath::Abs(trackat0.GetC()));
- if ( bestLong->GetNumberOfClusters()>3 ){
- dist[itsindex] = trackat0.GetY();
- norm[itsindex] = ptfac*TMath::Sqrt(trackat0.GetSigmaY2());
- normdist0[itsindex] = TMath::Abs(trackat0.GetY()/norm[itsindex]);
- normdist1[itsindex] = TMath::Abs((trackat0.GetZ()-primvertex[2])/(ptfac*TMath::Sqrt(trackat0.GetSigmaZ2())));
- normdist[itsindex] = TMath::Sqrt(normdist0[itsindex]*normdist0[itsindex]+normdist1[itsindex]*normdist1[itsindex]);
- if (!bestConst){
- if (bestLong->GetNumberOfClusters()+bestLong->GetNDeadZone()<6) normdist[itsindex]*=2.;
- if (bestLong->GetNumberOfClusters()+bestLong->GetNDeadZone()<5) normdist[itsindex]*=2.;
- if (bestLong->GetNumberOfClusters()+bestLong->GetNDeadZone()<4) normdist[itsindex]*=2.;
- }else{
- if (bestConst->GetNumberOfClusters()+bestConst->GetNDeadZone()<6) normdist[itsindex]*=1.5;
- if (bestConst->GetNumberOfClusters()+bestConst->GetNDeadZone()<5) normdist[itsindex]*=1.5;
- }
- }
- else{
- if (bestConst&&bestConst->GetNumberOfClusters()+bestConst->GetNDeadZone()>4.5){
- dist[itsindex] = bestConst->GetD(0);
- norm[itsindex] = bestConst->GetDnorm(0);
- normdist0[itsindex] = TMath::Abs(bestConst->GetD(0)/norm[itsindex]);
- normdist1[itsindex] = TMath::Abs(bestConst->GetD(0)/norm[itsindex]);
- normdist[itsindex] = TMath::Sqrt(normdist0[itsindex]*normdist0[itsindex]+normdist1[itsindex]*normdist1[itsindex]);
- }else{
- dist[itsindex] = trackat0.GetY();
- norm[itsindex] = ptfac*TMath::Sqrt(trackat0.GetSigmaY2());
- normdist0[itsindex] = TMath::Abs(trackat0.GetY()/norm[itsindex]);
- normdist1[itsindex] = TMath::Abs((trackat0.GetZ()-primvertex[2])/(ptfac*TMath::Sqrt(trackat0.GetSigmaZ2())));
- normdist[itsindex] = TMath::Sqrt(normdist0[itsindex]*normdist0[itsindex]+normdist1[itsindex]*normdist1[itsindex]);
- if (TMath::Abs(trackat0.GetTgl())>1.05){
- if (normdist[itsindex]<3) forbidden[itsindex]=kTRUE;
- if (normdist[itsindex]>3) {
- minr[itsindex] = TMath::Max(Float_t(40.),minr[itsindex]);
- }
- }
- }
- }
- //
- //-----------------------------------------------------------
- //Forbid primary track candidates -
- //
- //treetr->SetAlias("forbidden0","Tr0.fN<4&&Tr1.fN+Tr1.fNDeadZone>4.5");
- //treetr->SetAlias("forbidden1","ND<3&&Tr1.fN+Tr1.fNDeadZone>5.5");
- //treetr->SetAlias("forbidden2","ND<2&&Tr1.fClIndex[0]>0&&Tr1.fClIndex[0]>0");
- //treetr->SetAlias("forbidden3","ND<1&&Tr1.fClIndex[0]>0");
- //treetr->SetAlias("forbidden4","ND<4&&Tr1.fNormChi2[0]<2");
- //treetr->SetAlias("forbidden5","ND<5&&Tr1.fNormChi2[0]<1");
- //-----------------------------------------------------------
- if (bestConst){
- if (bestLong->GetNumberOfClusters()<4 && bestConst->GetNumberOfClusters()+bestConst->GetNDeadZone()>4.5) forbidden[itsindex]=kTRUE;
- if (normdist[itsindex]<3 && bestConst->GetNumberOfClusters()+bestConst->GetNDeadZone()>5.5) forbidden[itsindex]=kTRUE;
- if (normdist[itsindex]<2 && bestConst->GetClIndex(0)>0 && bestConst->GetClIndex(1)>0 ) forbidden[itsindex]=kTRUE;
- if (normdist[itsindex]<1 && bestConst->GetClIndex(0)>0) forbidden[itsindex]=kTRUE;
- if (normdist[itsindex]<4 && bestConst->GetNormChi2(0)<2) forbidden[itsindex]=kTRUE;
- if (normdist[itsindex]<5 && bestConst->GetNormChi2(0)<1) forbidden[itsindex]=kTRUE;
- if (bestConst->GetNormChi2(0)<2.5) {
- minPointAngle[itsindex]= 0.9999;
- maxr[itsindex] = 10;
- }
- }
- //
- //forbid daughter kink candidates
- //
- if (esdtrack->GetKinkIndex(0)>0) forbidden[itsindex] = kTRUE;
- Bool_t isElectron = kTRUE;
- Bool_t isProton = kTRUE;
- Double_t pid[5];
- esdtrack->GetESDpid(pid);
- for (Int_t i=1;i<5;i++){
- if (pid[0]<pid[i]) isElectron= kFALSE;
- if (pid[4]<pid[i]) isProton= kFALSE;
- }
- if (isElectron){
- forbidden[itsindex]=kFALSE;
- normdist[itsindex]*=-1;
- }
- if (isProton){
- if (normdist[itsindex]>2) forbidden[itsindex]=kFALSE;
- normdist[itsindex]*=-1;
- }
-
- //
- // Causality cuts in TPC volume
- //
- if (esdtrack->GetTPCdensity(0,10) >0.6) maxr[itsindex] = TMath::Min(Float_t(110),maxr[itsindex]);
- if (esdtrack->GetTPCdensity(10,30)>0.6) maxr[itsindex] = TMath::Min(Float_t(120),maxr[itsindex]);
- if (esdtrack->GetTPCdensity(20,40)>0.6) maxr[itsindex] = TMath::Min(Float_t(130),maxr[itsindex]);
- if (esdtrack->GetTPCdensity(30,50)>0.6) maxr[itsindex] = TMath::Min(Float_t(140),maxr[itsindex]);
- //
- if (esdtrack->GetTPCdensity(0,60)<0.4&&bestLong->GetNumberOfClusters()<3) minr[itsindex]=100;
- //
- //
- if (kFALSE){
- cstream<<"Track"<<
- "Tr0.="<<best<<
- "Tr1.="<<((bestConst)? bestConst:dummy)<<
- "Tr2.="<<bestLong<<
- "Tr3.="<<&trackat0<<
- "Esd.="<<esdtrack<<
- "Dist="<<dist[itsindex]<<
- "ND0="<<normdist0[itsindex]<<
- "ND1="<<normdist1[itsindex]<<
- "ND="<<normdist[itsindex]<<
- "Pz="<<primvertex[2]<<
- "Forbid="<<forbidden[itsindex]<<
- "\n";
- //
- }
- trackarray.AddAt(best,itsindex);
- trackarrayc.AddAt(bestConst,itsindex);
- trackarrayl.AddAt(bestLong,itsindex);
- new (&helixes[itsindex]) AliHelix(*best);
- }
- //
- //
- //
- // first iterration of V0 finder
- //
- for (Int_t iesd0=0;iesd0<ntracks;iesd0++){
- Int_t itrack0 = itsmap[iesd0];
- if (forbidden[itrack0]) continue;
- AliITStrackMI * btrack0 = (AliITStrackMI*)trackarray.At(itrack0);
- if (!btrack0) continue;
- if (btrack0->GetSign()>0) continue;
- AliITStrackMI *trackc0 = (AliITStrackMI*)trackarrayc.At(itrack0);
- //
- for (Int_t iesd1=0;iesd1<ntracks;iesd1++){
- Int_t itrack1 = itsmap[iesd1];
- if (forbidden[itrack1]) continue;
-
- AliITStrackMI * btrack1 = (AliITStrackMI*)trackarray.At(itrack1);
- if (!btrack1) continue;
- if (btrack1->GetSign()<0) continue;
- Bool_t isGold = kFALSE;
- if (TMath::Abs(TMath::Abs(btrack0->GetLabel())-TMath::Abs(btrack1->GetLabel()))==1){
- isGold = kTRUE;
- }
- AliITStrackMI *trackc1 = (AliITStrackMI*)trackarrayc.At(itrack1);
- AliHelix &h1 = helixes[itrack0];
- AliHelix &h2 = helixes[itrack1];
- //
- // find linear distance
- Double_t rmin =0;
- //
- //
- //
- Double_t phase[2][2],radius[2];
- Int_t points = h1.GetRPHIintersections(h2, phase, radius);
- if (points==0) continue;
- Double_t delta[2]={1000000,1000000};
- rmin = radius[0];
- h1.ParabolicDCA(h2,phase[0][0],phase[0][1],radius[0],delta[0]);
- if (points==2){
- if (radius[1]<rmin) rmin = radius[1];
- h1.ParabolicDCA(h2,phase[1][0],phase[1][1],radius[1],delta[1]);
- }
- rmin = TMath::Sqrt(rmin);
- Double_t distance = 0;
- Double_t radiusC = 0;
- Int_t iphase = 0;
- if (points==1 || delta[0]<delta[1]){
- distance = TMath::Sqrt(delta[0]);
- radiusC = TMath::Sqrt(radius[0]);
- }else{
- distance = TMath::Sqrt(delta[1]);
- radiusC = TMath::Sqrt(radius[1]);
- iphase=1;
- }
- if (radiusC<TMath::Max(minr[itrack0],minr[itrack1])) continue;
- if (radiusC>TMath::Min(maxr[itrack0],maxr[itrack1])) continue;
- Float_t maxDist = TMath::Min(kMaxDist,Float_t(kMaxDist0+radiusC*kMaxDist1));
- if (distance>maxDist) continue;
- Float_t pointAngle = h1.GetPointAngle(h2,phase[iphase],primvertex);
- if (pointAngle<TMath::Max(minPointAngle[itrack0],minPointAngle[itrack1])) continue;
- //
- //
- // Double_t distance = TestV0(h1,h2,pvertex,rmin);
- //
- // if (distance>maxDist) continue;
- // if (pvertex->GetRr()<kMinR) continue;
- // if (pvertex->GetRr()>kMaxR) continue;
- AliITStrackMI * track0=btrack0;
- AliITStrackMI * track1=btrack1;
- // if (pvertex->GetRr()<3.5){
- if (radiusC<3.5){
- //use longest tracks inside the pipe
- track0 = (AliITStrackMI*)trackarrayl.At(itrack0);
- track1 = (AliITStrackMI*)trackarrayl.At(itrack1);
- }
- //
- //
- pvertex->SetParamN(*track0);
- pvertex->SetParamP(*track1);
- pvertex->Update(primvertex);
- pvertex->SetClusters(track0->ClIndex(),track1->ClIndex()); // register clusters
-
- if (pvertex->GetRr()<kMinR) continue;
- if (pvertex->GetRr()>kMaxR) continue;
- if (pvertex->GetV0CosineOfPointingAngle()<kMinPointAngle) continue;
-//Bo: if (pvertex->GetDist2()>maxDist) continue;
- if (pvertex->GetDcaV0Daughters()>maxDist) continue;
-//Bo: pvertex->SetLab(0,track0->GetLabel());
-//Bo: pvertex->SetLab(1,track1->GetLabel());
- pvertex->SetIndex(0,track0->GetESDtrack()->GetID());
- pvertex->SetIndex(1,track1->GetESDtrack()->GetID());
- //
- AliITStrackMI * htrackc0 = trackc0 ? trackc0:dummy;
- AliITStrackMI * htrackc1 = trackc1 ? trackc1:dummy;
-
- //
- //
- TObjArray * array0b = (TObjArray*)fBestHypothesys.At(itrack0);
- if (!array0b&&pvertex->GetRr()<40 && TMath::Abs(track0->GetTgl())<1.1) {
- fCurrentEsdTrack = itrack0;
- FollowProlongationTree((AliITStrackMI*)fOriginal.At(itrack0),itrack0, kFALSE);
- }
- TObjArray * array1b = (TObjArray*)fBestHypothesys.At(itrack1);
- if (!array1b&&pvertex->GetRr()<40 && TMath::Abs(track1->GetTgl())<1.1) {
- fCurrentEsdTrack = itrack1;
- FollowProlongationTree((AliITStrackMI*)fOriginal.At(itrack1),itrack1, kFALSE);
- }
- //
- AliITStrackMI * track0b = (AliITStrackMI*)fOriginal.At(itrack0);
- AliITStrackMI * track1b = (AliITStrackMI*)fOriginal.At(itrack1);
- AliITStrackMI * track0l = (AliITStrackMI*)fOriginal.At(itrack0);
- AliITStrackMI * track1l = (AliITStrackMI*)fOriginal.At(itrack1);
-
- Float_t minchi2before0=16;
- Float_t minchi2before1=16;
- Float_t minchi2after0 =16;
- Float_t minchi2after1 =16;
- Double_t xrp[3]; pvertex->GetXYZ(xrp[0],xrp[1],xrp[2]); //I.B.
- Int_t maxLayer = GetNearestLayer(xrp); //I.B.
-
- if (array0b) for (Int_t i=0;i<5;i++){
- // best track after vertex
- AliITStrackMI * btrack = (AliITStrackMI*)array0b->At(i);
- if (!btrack) continue;
- if (btrack->GetNumberOfClusters()>track0l->GetNumberOfClusters()) track0l = btrack;
- // if (btrack->fX<pvertex->GetRr()-2.-0.5/(0.1+pvertex->GetAnglep()[2])) {
- if (btrack->GetX()<pvertex->GetRr()-2.) {
- if ( (maxLayer>i+2|| (i==0)) && btrack->GetNumberOfClusters()==(6-i)&&i<3){
- Float_t sumchi2= 0;
- Float_t sumn = 0;
- if (maxLayer<3){ // take prim vertex as additional measurement
- if (normdist[itrack0]>0 && htrackc0){
- sumchi2 += TMath::Min((3.-maxLayer)*normdist[itrack0]*normdist[itrack0],16.);
- }else{
- sumchi2 += TMath::Min((3.-maxLayer)*(3*normdist[itrack0]*normdist[itrack0]+3.),16.);
- }
- sumn += 3-maxLayer;
- }
- for (Int_t ilayer=i;ilayer<maxLayer;ilayer++){
- sumn+=1.;
- if (!btrack->GetClIndex(ilayer)){
- sumchi2+=25;
- continue;
- }else{
- Int_t c=( btrack->GetClIndex(ilayer) & 0x0fffffff);
- for (Int_t itrack=0;itrack<4;itrack++){
- if (fgLayers[ilayer].GetClusterTracks(itrack,c)>=0 && fgLayers[ilayer].GetClusterTracks(itrack,c)!=itrack0){
- sumchi2+=18.; //shared cluster
- break;
- }
- }
- sumchi2+=btrack->GetDy(ilayer)*btrack->GetDy(ilayer)/(btrack->GetSigmaY(ilayer)*btrack->GetSigmaY(ilayer));
- sumchi2+=btrack->GetDz(ilayer)*btrack->GetDz(ilayer)/(btrack->GetSigmaZ(ilayer)*btrack->GetSigmaZ(ilayer));
- }
- }
- sumchi2/=sumn;
- if (sumchi2<minchi2before0) minchi2before0=sumchi2;
- }
- continue; //safety space - Geo manager will give exact layer
- }
- track0b = btrack;
- minchi2after0 = btrack->GetNormChi2(i);
- break;
- }
- if (array1b) for (Int_t i=0;i<5;i++){
- // best track after vertex
- AliITStrackMI * btrack = (AliITStrackMI*)array1b->At(i);
- if (!btrack) continue;
- if (btrack->GetNumberOfClusters()>track1l->GetNumberOfClusters()) track1l = btrack;
- // if (btrack->fX<pvertex->GetRr()-2-0.5/(0.1+pvertex->GetAnglep()[2])){
- if (btrack->GetX()<pvertex->GetRr()-2){
- if ((maxLayer>i+2 || (i==0))&&btrack->GetNumberOfClusters()==(6-i)&&(i<3)){
- Float_t sumchi2= 0;
- Float_t sumn = 0;
- if (maxLayer<3){ // take prim vertex as additional measurement
- if (normdist[itrack1]>0 && htrackc1){
- sumchi2 += TMath::Min((3.-maxLayer)*normdist[itrack1]*normdist[itrack1],16.);
- }else{
- sumchi2 += TMath::Min((3.-maxLayer)*(3*normdist[itrack1]*normdist[itrack1]+3.),16.);
- }
- sumn += 3-maxLayer;
- }
- for (Int_t ilayer=i;ilayer<maxLayer;ilayer++){
- sumn+=1.;
- if (!btrack->GetClIndex(ilayer)){
- sumchi2+=30;
- continue;
- }else{
- Int_t c=( btrack->GetClIndex(ilayer) & 0x0fffffff);
- for (Int_t itrack=0;itrack<4;itrack++){
- if (fgLayers[ilayer].GetClusterTracks(itrack,c)>=0 && fgLayers[ilayer].GetClusterTracks(itrack,c)!=itrack1){
- sumchi2+=18.; //shared cluster
- break;
- }
- }
- sumchi2+=btrack->GetDy(ilayer)*btrack->GetDy(ilayer)/(btrack->GetSigmaY(ilayer)*btrack->GetSigmaY(ilayer));
- sumchi2+=btrack->GetDz(ilayer)*btrack->GetDz(ilayer)/(btrack->GetSigmaZ(ilayer)*btrack->GetSigmaZ(ilayer));
- }
- }
- sumchi2/=sumn;
- if (sumchi2<minchi2before1) minchi2before1=sumchi2;
- }
- continue; //safety space - Geo manager will give exact layer
- }
- track1b = btrack;
- minchi2after1 = btrack->GetNormChi2(i);
- break;
- }
- //
- // position resolution - used for DCA cut
- Float_t sigmad = track0b->GetSigmaY2()+track0b->GetSigmaZ2()+track1b->GetSigmaY2()+track1b->GetSigmaZ2()+
- (track0b->GetX()-pvertex->GetRr())*(track0b->GetX()-pvertex->GetRr())*(track0b->GetSigmaSnp2()+track0b->GetSigmaTgl2())+
- (track1b->GetX()-pvertex->GetRr())*(track1b->GetX()-pvertex->GetRr())*(track1b->GetSigmaSnp2()+track1b->GetSigmaTgl2());
- sigmad =TMath::Sqrt(sigmad)+0.04;
- if (pvertex->GetRr()>50){
- Double_t cov0[15],cov1[15];
- track0b->GetESDtrack()->GetInnerExternalCovariance(cov0);
- track1b->GetESDtrack()->GetInnerExternalCovariance(cov1);
- sigmad = cov0[0]+cov0[2]+cov1[0]+cov1[2]+
- (80.-pvertex->GetRr())*(80.-pvertex->GetRr())*(cov0[5]+cov0[9])+
- (80.-pvertex->GetRr())*(80.-pvertex->GetRr())*(cov1[5]+cov1[9]);
- sigmad =TMath::Sqrt(sigmad)+0.05;
- }
- //
- AliV0 vertex2;
- vertex2.SetParamN(*track0b);
- vertex2.SetParamP(*track1b);
- vertex2.Update(primvertex);
- //Bo: if (vertex2.GetDist2()<=pvertex->GetDist2()&&(vertex2.GetV0CosineOfPointingAngle()>=pvertex->GetV0CosineOfPointingAngle())){
- if (vertex2.GetDcaV0Daughters()<=pvertex->GetDcaV0Daughters()&&(vertex2.GetV0CosineOfPointingAngle()>=pvertex->GetV0CosineOfPointingAngle())){
- pvertex->SetParamN(*track0b);
- pvertex->SetParamP(*track1b);
- pvertex->Update(primvertex);
- pvertex->SetClusters(track0b->ClIndex(),track1b->ClIndex()); // register clusters
- pvertex->SetIndex(0,track0->GetESDtrack()->GetID());
- pvertex->SetIndex(1,track1->GetESDtrack()->GetID());
- }
- pvertex->SetDistSigma(sigmad);
- //Bo: pvertex->SetDistNorm(pvertex->GetDist2()/sigmad);
- pvertex->SetNormDCAPrim(normdist[itrack0],normdist[itrack1]);
- //
- // define likelihhod and causalities
- //
- Float_t pa0=1, pa1=1, pb0=0.26, pb1=0.26;
- if (maxLayer<1){
- Float_t fnorm0 = normdist[itrack0];
- if (fnorm0<0) fnorm0*=-3;
- Float_t fnorm1 = normdist[itrack1];
- if (fnorm1<0) fnorm1*=-3;
- if ((pvertex->GetAnglep()[2]>0.1) || ( (pvertex->GetRr()<10.5)&& pvertex->GetAnglep()[2]>0.05 ) || (pvertex->GetRr()<3)){
- pb0 = TMath::Exp(-TMath::Min(fnorm0,Float_t(16.))/12.);
- pb1 = TMath::Exp(-TMath::Min(fnorm1,Float_t(16.))/12.);
- }
- pvertex->SetChi2Before(normdist[itrack0]);
- pvertex->SetChi2After(normdist[itrack1]);
- pvertex->SetNAfter(0);
- pvertex->SetNBefore(0);
- }else{
- pvertex->SetChi2Before(minchi2before0);
- pvertex->SetChi2After(minchi2before1);
- if (pvertex->GetAnglep()[2]>0.1 || ( pvertex->GetRr()<10.5 && pvertex->GetAnglep()[2]>0.05) || pvertex->GetRr()<3){
- pb0 = TMath::Exp(-TMath::Min(minchi2before0,Float_t(16))/12.);
- pb1 = TMath::Exp(-TMath::Min(minchi2before1,Float_t(16))/12.);
- }
- pvertex->SetNAfter(maxLayer);
- pvertex->SetNBefore(maxLayer);
- }
- if (pvertex->GetRr()<90){
- pa0 *= TMath::Min(track0->GetESDtrack()->GetTPCdensity(0,60),Double_t(1.));
- pa1 *= TMath::Min(track1->GetESDtrack()->GetTPCdensity(0,60),Double_t(1.));
- }
- if (pvertex->GetRr()<20){
- pa0 *= (0.2+TMath::Exp(-TMath::Min(minchi2after0,Float_t(16))/8.))/1.2;
- pa1 *= (0.2+TMath::Exp(-TMath::Min(minchi2after1,Float_t(16))/8.))/1.2;
- }
- //
- pvertex->SetCausality(pb0,pb1,pa0,pa1);
- //
- // Likelihood calculations - apply cuts
- //
- Bool_t v0OK = kTRUE;
- Float_t p12 = pvertex->GetParamP()->GetParameter()[4]*pvertex->GetParamP()->GetParameter()[4];
- p12 += pvertex->GetParamN()->GetParameter()[4]*pvertex->GetParamN()->GetParameter()[4];
- p12 = TMath::Sqrt(p12); // "mean" momenta
- Float_t sigmap0 = 0.0001+0.001/(0.1+pvertex->GetRr());
- Float_t sigmap = 0.5*sigmap0*(0.6+0.4*p12); // "resolution: of point angle - as a function of radius and momenta
-
- Float_t causalityA = (1.0-pvertex->GetCausalityP()[0])*(1.0-pvertex->GetCausalityP()[1]);
- Float_t causalityB = TMath::Sqrt(TMath::Min(pvertex->GetCausalityP()[2],Double_t(0.7))*
- TMath::Min(pvertex->GetCausalityP()[3],Double_t(0.7)));
- //
- //Bo: Float_t likelihood0 = (TMath::Exp(-pvertex->GetDistNorm())+0.1) *(pvertex->GetDist2()<0.5)*(pvertex->GetDistNorm()<5);
- Float_t lDistNorm = pvertex->GetDcaV0Daughters()/pvertex->GetDistSigma();
- Float_t likelihood0 = (TMath::Exp(-lDistNorm)+0.1) *(pvertex->GetDcaV0Daughters()<0.5)*(lDistNorm<5);
-
- Float_t likelihood1 = TMath::Exp(-(1.0001-pvertex->GetV0CosineOfPointingAngle())/sigmap)+
- 0.4*TMath::Exp(-(1.0001-pvertex->GetV0CosineOfPointingAngle())/(4.*sigmap))+
- 0.4*TMath::Exp(-(1.0001-pvertex->GetV0CosineOfPointingAngle())/(8.*sigmap))+
- 0.1*TMath::Exp(-(1.0001-pvertex->GetV0CosineOfPointingAngle())/0.01);
- //
- if (causalityA<kCausality0Cut) v0OK = kFALSE;
- if (TMath::Sqrt(likelihood0*likelihood1)<kLikelihood01Cut) v0OK = kFALSE;
- if (likelihood1<kLikelihood1Cut) v0OK = kFALSE;
- if (TMath::Power(likelihood0*likelihood1*causalityB,0.33)<kCombinedCut) v0OK = kFALSE;
-
- //
- //
- if (kFALSE){
- Bool_t gold = TMath::Abs(TMath::Abs(track0->GetLabel())-TMath::Abs(track1->GetLabel()))==1;
- cstream<<"It0"<<
- "Tr0.="<<track0<< //best without constrain
- "Tr1.="<<track1<< //best without constrain
- "Tr0B.="<<track0b<< //best without constrain after vertex
- "Tr1B.="<<track1b<< //best without constrain after vertex
- "Tr0C.="<<htrackc0<< //best with constrain if exist
- "Tr1C.="<<htrackc1<< //best with constrain if exist
- "Tr0L.="<<track0l<< //longest best
- "Tr1L.="<<track1l<< //longest best
- "Esd0.="<<track0->GetESDtrack()<< // esd track0 params
- "Esd1.="<<track1->GetESDtrack()<< // esd track1 params
- "V0.="<<pvertex<< //vertex properties
- "V0b.="<<&vertex2<< //vertex properties at "best" track
- "ND0="<<normdist[itrack0]<< //normalize distance for track0
- "ND1="<<normdist[itrack1]<< //normalize distance for track1
- "Gold="<<gold<< //
- // "RejectBase="<<rejectBase<< //rejection in First itteration
- "OK="<<v0OK<<
- "rmin="<<rmin<<
- "sigmad="<<sigmad<<
- "\n";
- }
- //if (rejectBase) continue;
- //
- pvertex->SetStatus(0);
- // if (rejectBase) {
- // pvertex->SetStatus(-100);
- //}
- if (pvertex->GetV0CosineOfPointingAngle()>kMinPointAngle2) {
- //Bo: pvertex->SetESDindexes(track0->GetESDtrack()->GetID(),track1->GetESDtrack()->GetID());
- pvertex->SetIndex(0,track0->GetESDtrack()->GetID());//Bo: consistency 0 for neg
- pvertex->SetIndex(1,track1->GetESDtrack()->GetID());//Bo: consistency 1 for pos
- if (v0OK){
- // AliV0vertex vertexjuri(*track0,*track1);
- // vertexjuri.SetESDindexes(track0->fESDtrack->GetID(),track1->fESDtrack->GetID());
- // event->AddV0(&vertexjuri);
- pvertex->SetStatus(100);
- }
- pvertex->SetOnFlyStatus(kTRUE);
- pvertex->ChangeMassHypothesis(kK0Short);
- event->AddV0(pvertex);
- }
- }
- }
- //
- //
- // delete temporary arrays
- //
- delete[] forbidden;
- delete[] minPointAngle;
- delete[] maxr;
- delete[] minr;
- delete[] norm;
- delete[] normdist;
- delete[] normdist1;
- delete[] normdist0;
- delete[] dist;
- delete[] itsmap;
- delete[] helixes;
- delete pvertex;
-}
-//------------------------------------------------------------------------
-void AliITStrackerMI::RefitV02(AliESDEvent *event)
-{
- //
- //try to refit V0s in the third path of the reconstruction
- //
- TTreeSRedirector &cstream = *fDebugStreamer;
- //
- Int_t nv0s = event->GetNumberOfV0s();
- Float_t primvertex[3]={GetX(),GetY(),GetZ()};
- AliV0 v0temp;
- for (Int_t iv0 = 0; iv0<nv0s;iv0++){
- AliV0 * v0mi = (AliV0*)event->GetV0(iv0);
- if (!v0mi) continue;
- Int_t itrack0 = v0mi->GetIndex(0);
- Int_t itrack1 = v0mi->GetIndex(1);
- AliESDtrack *esd0 = event->GetTrack(itrack0);
- AliESDtrack *esd1 = event->GetTrack(itrack1);
- if (!esd0||!esd1) continue;
- AliITStrackMI tpc0(*esd0);
- AliITStrackMI tpc1(*esd1);
- Double_t x,y,z; v0mi->GetXYZ(x,y,z); //I.B.
- Double_t alpha =TMath::ATan2(y,x); //I.B.
- if (v0mi->GetRr()>85){
- if (tpc0.Propagate(alpha,v0mi->GetRr())&&tpc1.Propagate(alpha,v0mi->GetRr())){
- v0temp.SetParamN(tpc0);
- v0temp.SetParamP(tpc1);
- v0temp.Update(primvertex);
- if (kFALSE) cstream<<"Refit"<<
- "V0.="<<v0mi<<
- "V0refit.="<<&v0temp<<
- "Tr0.="<<&tpc0<<
- "Tr1.="<<&tpc1<<
- "\n";
- //Bo: if (v0temp.GetDist2()<v0mi->GetDist2() || v0temp.GetV0CosineOfPointingAngle()>v0mi->GetV0CosineOfPointingAngle()){
- if (v0temp.GetDcaV0Daughters()<v0mi->GetDcaV0Daughters() || v0temp.GetV0CosineOfPointingAngle()>v0mi->GetV0CosineOfPointingAngle()){
- v0mi->SetParamN(tpc0);
- v0mi->SetParamP(tpc1);
- v0mi->Update(primvertex);
- }
- }
- continue;
- }
- if (v0mi->GetRr()>35){
- CorrectForTPCtoITSDeadZoneMaterial(&tpc0);
- CorrectForTPCtoITSDeadZoneMaterial(&tpc1);
- if (tpc0.Propagate(alpha,v0mi->GetRr())&&tpc1.Propagate(alpha,v0mi->GetRr())){
- v0temp.SetParamN(tpc0);
- v0temp.SetParamP(tpc1);
- v0temp.Update(primvertex);
- if (kFALSE) cstream<<"Refit"<<
- "V0.="<<v0mi<<
- "V0refit.="<<&v0temp<<
- "Tr0.="<<&tpc0<<
- "Tr1.="<<&tpc1<<
- "\n";
- //Bo: if (v0temp.GetDist2()<v0mi->GetDist2() || v0temp.GetV0CosineOfPointingAngle()>v0mi->GetV0CosineOfPointingAngle()){
- if (v0temp.GetDcaV0Daughters()<v0mi->GetDcaV0Daughters() || v0temp.GetV0CosineOfPointingAngle()>v0mi->GetV0CosineOfPointingAngle()){
- v0mi->SetParamN(tpc0);
- v0mi->SetParamP(tpc1);
- v0mi->Update(primvertex);
- }
- }
- continue;
- }
- CorrectForTPCtoITSDeadZoneMaterial(&tpc0);
- CorrectForTPCtoITSDeadZoneMaterial(&tpc1);
- // if (tpc0.Propagate(alpha,v0mi->GetRr())&&tpc1.Propagate(alpha,v0mi->GetRr())){
- if (RefitAt(v0mi->GetRr(),&tpc0, v0mi->GetClusters(0)) && RefitAt(v0mi->GetRr(),&tpc1, v0mi->GetClusters(1))){
- v0temp.SetParamN(tpc0);
- v0temp.SetParamP(tpc1);
- v0temp.Update(primvertex);
- if (kFALSE) cstream<<"Refit"<<
- "V0.="<<v0mi<<
- "V0refit.="<<&v0temp<<
- "Tr0.="<<&tpc0<<
- "Tr1.="<<&tpc1<<
- "\n";
- //Bo: if (v0temp.GetDist2()<v0mi->GetDist2() || v0temp.GetV0CosineOfPointingAngle()>v0mi->GetV0CosineOfPointingAngle()){
- if (v0temp.GetDcaV0Daughters()<v0mi->GetDcaV0Daughters() || v0temp.GetV0CosineOfPointingAngle()>v0mi->GetV0CosineOfPointingAngle()){
- v0mi->SetParamN(tpc0);
- v0mi->SetParamP(tpc1);
- v0mi->Update(primvertex);
- }
- }
- }
-}
-//------------------------------------------------------------------------
void AliITStrackerMI::BuildMaterialLUT(TString material) {
//--------------------------------------------------------------------
// Fill a look-up table with mean material
//-------------------------------------------------------------------
// Propagate beyond beam pipe and correct for material
// (material budget in different ways according to fUseTGeo value)
+ // Add time if going outward (PropagateTo or PropagateToTGeo)
//-------------------------------------------------------------------
// Define budget mode:
if (!t->GetLocalXat(rToGo,xToGo)) return 0;
Double_t xOverX0,x0,lengthTimesMeanDensity;
- Bool_t anglecorr=kTRUE;
switch(mode) {
case 0:
x0 = AliITSRecoParam::GetX0Be();
lengthTimesMeanDensity = xOverX0*x0;
lengthTimesMeanDensity *= dir;
- if (!t->Propagate(xToGo)) return 0;
- if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
+ if (!t->PropagateTo(xToGo,xOverX0,lengthTimesMeanDensity/xOverX0)) return 0;
break;
case 1:
if (!t->PropagateToTGeo(xToGo,1)) return 0;
xOverX0 = fxOverX0Pipe;
lengthTimesMeanDensity = fxTimesRhoPipe;
lengthTimesMeanDensity *= dir;
- if (!t->Propagate(xToGo)) return 0;
- if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
+ if (!t->PropagateTo(xToGo,xOverX0,lengthTimesMeanDensity/xOverX0)) return 0;
break;
case 3:
if(!fxOverX0PipeTrks || index<0 || index>=fNtracks) Error("CorrectForPipeMaterial","Incorrect usage of UseTGeo option!\n");
if(fxOverX0PipeTrks[index]<0) {
if (!t->PropagateToTGeo(xToGo,1,xOverX0,lengthTimesMeanDensity)) return 0;
Double_t angle=TMath::Sqrt((1.+t->GetTgl()*t->GetTgl())/
- (1.-t->GetSnp()*t->GetSnp()));
+ ((1.-t->GetSnp())*(1.+t->GetSnp())));
fxOverX0PipeTrks[index] = TMath::Abs(xOverX0)/angle;
fxTimesRhoPipeTrks[index] = TMath::Abs(lengthTimesMeanDensity)/angle;
return 1;
xOverX0 = fxOverX0PipeTrks[index];
lengthTimesMeanDensity = fxTimesRhoPipeTrks[index];
lengthTimesMeanDensity *= dir;
- if (!t->Propagate(xToGo)) return 0;
- if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
+ if (!t->PropagateTo(xToGo,xOverX0,lengthTimesMeanDensity/xOverX0)) return 0;
break;
}
//-------------------------------------------------------------------
// Propagate beyond SPD or SDD shield and correct for material
// (material budget in different ways according to fUseTGeo value)
+ // Add time if going outward (PropagateTo or PropagateToTGeo)
//-------------------------------------------------------------------
// Define budget mode:
Error("CorrectForShieldMaterial"," Wrong shield name\n");
return 0;
}
+
+ // do nothing if we are already beyond the shield
+ Double_t rTrack = TMath::Sqrt(t->GetX()*t->GetX()+t->GetY()*t->GetY());
+ if(dir<0 && rTrack > rToGo) return 1; // going outward
+ if(dir>0 && rTrack < rToGo) return 1; // going inward
+
+
Double_t xToGo;
if (!t->GetLocalXat(rToGo,xToGo)) return 0;
Int_t index=2*fCurrentEsdTrack+shieldindex;
Double_t xOverX0,x0,lengthTimesMeanDensity;
- Bool_t anglecorr=kTRUE;
Int_t nsteps=1;
switch(mode) {
x0 = AliITSRecoParam::GetX0shield(shieldindex);
lengthTimesMeanDensity = xOverX0*x0;
lengthTimesMeanDensity *= dir;
- if (!t->Propagate(xToGo)) return 0;
- if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
+ if (!t->PropagateTo(xToGo,xOverX0,lengthTimesMeanDensity/xOverX0)) return 0;
break;
case 1:
nsteps= (Int_t)(TMath::Abs(t->GetX()-xToGo)/AliITSReconstructor::GetRecoParam()->GetStepSizeTGeo())+1;
xOverX0 = fxOverX0Shield[shieldindex];
lengthTimesMeanDensity = fxTimesRhoShield[shieldindex];
lengthTimesMeanDensity *= dir;
- if (!t->Propagate(xToGo)) return 0;
- if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
+ if (!t->PropagateTo(xToGo,xOverX0,lengthTimesMeanDensity/xOverX0)) return 0;
break;
case 3:
if(!fxOverX0ShieldTrks || index<0 || index>=2*fNtracks) Error("CorrectForShieldMaterial","Incorrect usage of UseTGeo option!\n");
if(fxOverX0ShieldTrks[index]<0) {
if (!t->PropagateToTGeo(xToGo,1,xOverX0,lengthTimesMeanDensity)) return 0;
Double_t angle=TMath::Sqrt((1.+t->GetTgl()*t->GetTgl())/
- (1.-t->GetSnp()*t->GetSnp()));
+ ((1.-t->GetSnp())*(1.+t->GetSnp())));
fxOverX0ShieldTrks[index] = TMath::Abs(xOverX0)/angle;
fxTimesRhoShieldTrks[index] = TMath::Abs(lengthTimesMeanDensity)/angle;
return 1;
xOverX0 = fxOverX0ShieldTrks[index];
lengthTimesMeanDensity = fxTimesRhoShieldTrks[index];
lengthTimesMeanDensity *= dir;
- if (!t->Propagate(xToGo)) return 0;
- if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
+ if (!t->PropagateTo(xToGo,xOverX0,lengthTimesMeanDensity/xOverX0)) return 0;
break;
}
//-------------------------------------------------------------------
// Propagate beyond layer and correct for material
// (material budget in different ways according to fUseTGeo value)
+ // Add time if going outward (PropagateTo or PropagateToTGeo)
//-------------------------------------------------------------------
// Define budget mode:
Double_t xOverX0=0.0,x0=0.0,lengthTimesMeanDensity=0.0;
- Double_t mparam[7];
- Bool_t anglecorr=kTRUE;
Int_t nsteps=1;
+
+ // back before material (no correction)
Double_t rOld,xOld;
+ rOld=TMath::Sqrt(oldGlobXYZ[0]*oldGlobXYZ[0]+oldGlobXYZ[1]*oldGlobXYZ[1]);
+ if (!t->GetLocalXat(rOld,xOld)) return 0;
+ if (!t->Propagate(xOld)) return 0;
- Bool_t addTime = kFALSE;
switch(mode) {
case 0:
xOverX0 = fgLayers[layerindex].GetThickness(t->GetY(),t->GetZ(),x0);
lengthTimesMeanDensity = xOverX0*x0;
- // Bring the track beyond the material
- if (!t->Propagate(xToGo)) return 0;
lengthTimesMeanDensity *= dir;
- if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
+ // Bring the track beyond the material
+ if (!t->PropagateTo(xToGo,xOverX0,lengthTimesMeanDensity/xOverX0)) return 0;
break;
case 1:
- rOld=TMath::Sqrt(oldGlobXYZ[0]*oldGlobXYZ[0]+oldGlobXYZ[1]*oldGlobXYZ[1]);
- if (!t->GetLocalXat(rOld,xOld)) return 0;
- if (!t->Propagate(xOld)) return 0; // back before material (no correction)
nsteps = (Int_t)(TMath::Abs(xOld-xToGo)/AliITSReconstructor::GetRecoParam()->GetStepSizeTGeo())+1;
- if (!t->PropagateToTGeo(xToGo,nsteps,addTime)) return 0; // cross the material and apply correction
+ if (!t->PropagateToTGeo(xToGo,nsteps)) return 0; // cross the material and apply correction
break;
case 2:
if(fxOverX0Layer[layerindex]<0) BuildMaterialLUT("Layers");
xOverX0 = fxOverX0Layer[layerindex];
lengthTimesMeanDensity = fxTimesRhoLayer[layerindex];
- // Bring the track beyond the material
- if (!t->Propagate(xToGo)) return 0;
lengthTimesMeanDensity *= dir;
- if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
+ // Bring the track beyond the material
+ if (!t->PropagateTo(xToGo,xOverX0,lengthTimesMeanDensity/xOverX0)) return 0;
break;
case 3:
if(!fxOverX0LayerTrks || index<0 || index>=6*fNtracks) Error("CorrectForLayerMaterial","Incorrect usage of UseTGeo option!\n");
- // Bring the track beyond the material
- if (!t->Propagate(xToGo)) return 0;
- Double_t globXYZ[3];
- if (!t->GetXYZ(globXYZ)) return 0;
- if (fxOverX0LayerTrks[index]<0) {
- AliTracker::MeanMaterialBudget(oldGlobXYZ,globXYZ,mparam);
- if(mparam[1]>900000) return 0;
+ if(fxOverX0LayerTrks[index]<0) {
+ nsteps = (Int_t)(TMath::Abs(xOld-xToGo)/AliITSReconstructor::GetRecoParam()->GetStepSizeTGeo())+1;
+ if (!t->PropagateToTGeo(xToGo,nsteps,xOverX0,lengthTimesMeanDensity)) return 0;
Double_t angle=TMath::Sqrt((1.+t->GetTgl()*t->GetTgl())/
- (1.-t->GetSnp()*t->GetSnp()));
- xOverX0=mparam[1]/angle;
- lengthTimesMeanDensity=mparam[0]*mparam[4]/angle;
- fxOverX0LayerTrks[index] = TMath::Abs(xOverX0);
- fxTimesRhoLayerTrks[index] = TMath::Abs(lengthTimesMeanDensity);
+ ((1.-t->GetSnp())*(1.+t->GetSnp())));
+ fxOverX0LayerTrks[index] = TMath::Abs(xOverX0)/angle;
+ fxTimesRhoLayerTrks[index] = TMath::Abs(lengthTimesMeanDensity)/angle;
+ return 1;
}
xOverX0 = fxOverX0LayerTrks[index];
lengthTimesMeanDensity = fxTimesRhoLayerTrks[index];
lengthTimesMeanDensity *= dir;
- if (!t->CorrectForMeanMaterial(xOverX0,lengthTimesMeanDensity,anglecorr)) return 0;
+ if (!t->PropagateTo(xToGo,xOverX0,lengthTimesMeanDensity/xOverX0)) return 0;
break;
}
+
return 1;
}
//------------------------------------------------------------------------
return;
}
//------------------------------------------------------------------------
-Int_t AliITStrackerMI::CheckSkipLayer(AliITStrackMI *track,
+void AliITStrackerMI::SetForceSkippingOfLayer() {
+ //-----------------------------------------------------------------
+ // Check if we are forced to skip layers
+ // either we set to skip them in RecoParam
+ // or they were off during data-taking
+ //-----------------------------------------------------------------
+
+ const AliEventInfo *eventInfo = GetEventInfo();
+
+ for(Int_t l=0; l<AliITSgeomTGeo::kNLayers; l++) {
+ fForceSkippingOfLayer[l] = 0;
+ // check reco param
+ if(AliITSReconstructor::GetRecoParam()->GetLayersToSkip(l)) fForceSkippingOfLayer[l] = 1;
+ // check run info
+
+ if(eventInfo) {
+ AliDebug(2,Form("GetEventInfo->GetTriggerCluster: %s",eventInfo->GetTriggerCluster()));
+ if(l==0 || l==1) {
+ if(!strstr(eventInfo->GetTriggerCluster(),"ITSSPD")) fForceSkippingOfLayer[l] = 1;
+ } else if(l==2 || l==3) {
+ if(!strstr(eventInfo->GetTriggerCluster(),"ITSSDD")) fForceSkippingOfLayer[l] = 1;
+ } else {
+ if(!strstr(eventInfo->GetTriggerCluster(),"ITSSSD")) fForceSkippingOfLayer[l] = 1;
+ }
+ }
+ }
+ return;
+}
+//------------------------------------------------------------------------
+Int_t AliITStrackerMI::CheckSkipLayer(const AliITStrackMI *track,
Int_t ilayer,Int_t idet) const {
//-----------------------------------------------------------------
// This method is used to decide whether to allow a prolongation
// return 2: track outside z acceptance of SSD/SDD and will cross both SPD
//-----------------------------------------------------------------
- if (AliITSReconstructor::GetRecoParam()->GetLayersToSkip(ilayer)) return 1;
+ if (ForceSkippingOfLayer(ilayer)) return 1;
if (idet<0 && ilayer>1 && AliITSReconstructor::GetRecoParam()->GetExtendedEtaAcceptance()) {
// check if track will cross SPD outer layer
// In this case the return value is > 0:
// return 1: dead zone at z=0,+-7cm in SPD
// return 2: all road is "bad" (dead or noisy) from the OCDB
- // return 3: something "bad" (dead or noisy) from the OCDB
+ // return 3: at least a chip is "bad" (dead or noisy) from the OCDB
+ // return 4: at least a single channel is "bad" (dead or noisy) from the OCDB
//-----------------------------------------------------------------
// check dead zones at z=0,+-7cm in the SPD
} else if (ilayer==4 || ilayer==5) { // ---------- SSD
detType = 2;
}
- AliITSsegmentation *segm = (AliITSsegmentation*)fDetTypeRec->GetSegmentationModel(detType);
+ AliITSsegmentation *segm = (AliITSsegmentation*)fkDetTypeRec->GetSegmentationModel(detType);
if (detType==2) segm->SetLayer(ilayer+1);
Float_t detSizeX = detSizeFactorX*segm->Dx();
Float_t detSizeZ = detSizeFactorZ*segm->Dz();
if (!AliITSReconstructor::GetRecoParam()->GetUseSingleBadChannelsFromOCDB()
- || ilayer==4 || ilayer==5 // SSD
|| !noClusters) return 0;
// There are no clusters in road: check if there is at least
- // a bad SPD pixel or SDD anode
+ // a bad SPD pixel or SDD anode or SSD strips on both sides
Int_t idetInITS=idet;
for(Int_t l=0;l<ilayer;l++) idetInITS+=AliITSgeomTGeo::GetNLadders(l+1)*AliITSgeomTGeo::GetNDetectors(l+1);
if (fITSChannelStatus->AnyBadInRoad(idetInITS,zlocmin,zlocmax,xlocmin,xlocmax)) {
AliDebug(2,Form("Bad channel in det %d of layer %d\n",idet,ilayer));
- return 3;
+ return 4;
}
//if (fITSChannelStatus->FractionOfBadInRoad(idet,zlocmin,zlocmax,xlocmin,xlocmax) > AliITSReconstructor::GetRecoParam()->GetMinFractionOfBadInRoad()) return 3;
}
//------------------------------------------------------------------------
Bool_t AliITStrackerMI::LocalModuleCoord(Int_t ilayer,Int_t idet,
- AliITStrackMI *track,
+ const AliITStrackMI *track,
Float_t &xloc,Float_t &zloc) const {
//-----------------------------------------------------------------
// Gives position of track in local module ref. frame
return kTRUE;
}
//------------------------------------------------------------------------
-Bool_t AliITStrackerMI::IsOKForPlaneEff(AliITStrackMI* track, const Int_t *clusters, Int_t ilayer) const {
+Bool_t AliITStrackerMI::IsOKForPlaneEff(const AliITStrackMI* track, const Int_t *clusters, Int_t ilayer) const {
//
// Method to be optimized further:
// Aim: decide whether a track can be used for PlaneEff evaluation
for(Int_t lay=AliITSgeomTGeo::kNLayers-1;lay>ilayer;lay--) {
AliDebug(2,Form("trak=%d lay=%d ; index=%d ESD label= %d",tmp.GetLabel(),lay,
tmp.GetClIndex(lay),((AliESDtrack*)tmp.GetESDtrack())->GetLabel())) ;
- if (tmp.GetClIndex(lay)>0) ncl++;
+ if (tmp.GetClIndex(lay)>=0) ncl++;
}
Bool_t nextout = kFALSE;
if(ilayer==AliITSgeomTGeo::kNLayers-1) nextout=kTRUE; // you are already on the outermost layer
- else nextout = ((tmp.GetClIndex(ilayer+1)>0)? kTRUE : kFALSE );
+ else nextout = ((tmp.GetClIndex(ilayer+1)>=0)? kTRUE : kFALSE );
Bool_t nextin = kFALSE;
if(ilayer==0) nextin=kTRUE; // you are already on the innermost layer
else nextin = ((index[ilayer-1]>=0)? kTRUE : kFALSE );
return kTRUE;
}
//------------------------------------------------------------------------
-void AliITStrackerMI::UseTrackForPlaneEff(AliITStrackMI* track, Int_t ilayer) {
+void AliITStrackerMI::UseTrackForPlaneEff(const AliITStrackMI* track, Int_t ilayer) {
//
// This Method has to be optimized! For the time-being it uses the same criteria
// as those used in the search of extra clusters for overlapping modules.