#include <TString.h>
#include <TRandom.h>
#include <TTreeStream.h>
+#include <TVector3.h>
#include "AliLog.h"
#include "AliGeomManager.h"
if (esd->GetStatus()&AliESDtrack::kTPCout) continue;
if (esd->GetStatus()&AliESDtrack::kITSin) continue;
if (esd->GetKinkIndex(0)>0) continue; //kink daughter
- AliITStrackMI *t=0;
- try {
- t=new AliITStrackMI(*esd);
- } catch (const Char_t *msg) {
- //Warning("Clusters2Tracks",msg);
- delete t;
- continue;
- }
+ AliITStrackMI *t = new AliITStrackMI(*esd);
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));
if ((esd->GetStatus()&AliESDtrack::kITSin)==0) continue;
if (esd->GetStatus()&AliESDtrack::kITSout) continue;
- AliITStrackMI *t=0;
- try {
- t=new AliITStrackMI(*esd);
- } catch (const Char_t *msg) {
- //Warning("PropagateBack",msg);
- delete t;
- continue;
- }
+ AliITStrackMI *t = new AliITStrackMI(*esd);
+
t->SetExpQ(TMath::Max(0.8*t->GetESDtrack()->GetTPCsignal(),30.));
ResetTrackToFollow(*t);
if(AliITSReconstructor::GetRecoParam()->GetFindV0s()) AliITSV0Finder::RefitV02(event,this);
+ Bool_t doExtra=AliITSReconstructor::GetRecoParam()->GetSearchForExtraClusters();
+ if(!doExtra) AliDebug(2,"Do not search for extra clusters");
+
Int_t nentr=event->GetNumberOfTracks();
// Info("RefitInward", "Number of ESD tracks: %d\n", nentr);
if (esd->GetStatus()&AliESDtrack::kTPCout)
if ((esd->GetStatus()&AliESDtrack::kTPCrefit)==0) continue;
- AliITStrackMI *t=0;
- try {
- t=new AliITStrackMI(*esd);
- } catch (const Char_t *msg) {
- //Warning("RefitInward",msg);
- delete t;
- continue;
- }
+ AliITStrackMI *t = new AliITStrackMI(*esd);
+
t->SetExpQ(TMath::Max(0.8*t->GetESDtrack()->GetTPCsignal(),30.));
if (!CorrectForTPCtoITSDeadZoneMaterial(t)) {
delete t;
AliITSReconstructor::GetRecoParam()->GetIPlanePlaneEff()>=0);
AliDebug(2,Form("Refit LABEL %d %d",t->GetLabel(),t->GetNumberOfClusters()));
- if (RefitAt(AliITSRecoParam::GetrInsideSPD1(),&fTrackToFollow,t,kTRUE,pe)) {
+ if (RefitAt(AliITSRecoParam::GetrInsideSPD1(),&fTrackToFollow,t,doExtra,pe)) {
AliDebug(2," refit OK");
fTrackToFollow.SetLabel(t->GetLabel());
// fTrackToFollow.CookdEdx();
return kTRUE;
}
//------------------------------------------------------------------------
+//------------------------------------------------------------------------
Bool_t AliITStrackerMI::IsOKForPlaneEff(const AliITStrackMI* track, const Int_t *clusters, Int_t ilayer) const {
//
// Method to be optimized further:
// require a minimal number of cluster in other layers and eventually clusters in closest layers
Int_t ncl_out=0; Int_t ncl_in=0;
for(Int_t lay=AliITSgeomTGeo::kNLayers-1;lay>ilayer;lay--) { // count n. of cluster in outermost layers
- AliDebug(2,Form("trak=%d lay=%d ; index=%d ESD label= %d",tmp.GetLabel(),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_out++;
+ // if (tmp.GetClIndex(lay)>=0) ncl_out++;
+if(index[lay]>=0)ncl_out++;
}
for(Int_t lay=ilayer-1; lay>=0;lay--) { // count n. of cluster in innermost layers
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_in++;
+ if (index[lay]>=0) ncl_in++;
}
Int_t ncl=ncl_out+ncl_in;
Bool_t nextout = kFALSE;
//***************
// DEFINITION OF SEARCH ROAD FOR accepting a track
//
- //For the time being they are hard-wired, later on from AliITSRecoParam
Double_t nsigx=AliITSReconstructor::GetRecoParam()->GetNSigXFromBoundaryPlaneEff();
Double_t nsigz=AliITSReconstructor::GetRecoParam()->GetNSigZFromBoundaryPlaneEff();
- // Double_t nsigz=4;
- // Double_t nsigx=4;
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
+ // done for RecPoints
// exclude tracks at boundary between detectors
//Double_t boundaryWidth=AliITSRecoParam::GetBoundaryWidthPlaneEff();
AliDebug(2,Form("Tracking: track impact x=%f, y=%f, z=%f",tmp.GetX(), tmp.GetY(), tmp.GetZ()));
AliDebug(2,Form("Local: track impact x=%f, z=%f",locx,locz));
AliDebug(2,Form("Search Road. Tracking: dy=%f , dz=%f",dx,dz));
-
if ( (locx-dx < blockXmn+boundaryWidth) ||
(locx+dx > blockXmx-boundaryWidth) ||
(locz-dz < blockZmn+boundaryWidth) ||
Float_t tr[4]={99999.,99999.,9999.,9999.}; // initialize to high values
Float_t clu[4]={-99999.,-99999.,9999.,9999.}; // (in some cases GetCov fails)
Int_t cltype[2]={-999,-999};
+ // and the module
+
+Float_t AngleModTrack[3]={99999.,99999.,99999.}; // angles (phi, z and "absolute angle") between the track and the mormal to the module (see below)
tr[0]=locx;
tr[1]=locz;
clu[3]=TMath::Sqrt(c.GetSigmaZ2());
//}
}
- fPlaneEff->FillHistos(key,found,tr,clu,cltype);
+ // Compute the angles between the track and the module
+ // compute the angle "in phi direction", i.e. the angle in the transverse plane
+ // between the normal to the module and the projection (in the transverse plane) of the
+ // track trajectory
+ // tgphi and tglambda of the track in tracking frame with alpha=det.GetPhi
+ Float_t tgl = tmp.GetTgl();
+ Float_t phitr = tmp.GetSnp();
+ phitr = TMath::ASin(phitr);
+ Int_t volId = AliGeomManager::LayerToVolUIDSafe(ilayer+1 ,idet );
+
+ Double_t tra[3]; AliGeomManager::GetOrigTranslation(volId,tra);
+ Double_t rot[9]; AliGeomManager::GetOrigRotation(volId,rot);
+ Double_t alpha =0.;
+ alpha = tmp.GetAlpha();
+ Double_t phiglob = alpha+phitr;
+ Double_t p[3];
+ p[0] = TMath::Cos(phiglob);
+ p[1] = TMath::Sin(phiglob);
+ p[2] = tgl;
+ TVector3 pvec(p[0],p[1],p[2]);
+ TVector3 normvec(rot[1],rot[4],rot[7]);
+ Double_t angle = pvec.Angle(normvec);
+
+ if(angle>0.5*TMath::Pi()) angle = (TMath::Pi()-angle);
+ angle *= 180./TMath::Pi();
+
+ //Trasverse Plane
+ TVector3 pt(p[0],p[1],0);
+ TVector3 normt(rot[1],rot[4],0);
+ Double_t anglet = pt.Angle(normt);
+
+ Double_t phiPt = TMath::ATan2(p[1],p[0]);
+ if(phiPt<0)phiPt+=2.*TMath::Pi();
+ Double_t phiNorm = TMath::ATan2(rot[4],rot[1]);
+ if(phiNorm<0) phiNorm+=2.*TMath::Pi();
+ if(anglet>0.5*TMath::Pi()) anglet = (TMath::Pi()-anglet);
+ if(phiNorm>phiPt) anglet*=-1.;// pt-->normt clockwise: anglet>0
+ if((phiNorm-phiPt)>TMath::Pi()) anglet*=-1.;
+ anglet *= 180./TMath::Pi();
+
+ AngleModTrack[2]=(Float_t) angle;
+ AngleModTrack[0]=(Float_t) anglet;
+ // now the "angle in z" (much easier, i.e. the angle between the z axis and the track momentum + 90)
+ AngleModTrack[1]=TMath::ACos(tgl/TMath::Sqrt(tgl*tgl+1.));
+ AngleModTrack[1]-=TMath::Pi()/2.; // range of angle is -pi/2 , pi/2
+ AngleModTrack[1]*=180./TMath::Pi(); // in degree
+
+ fPlaneEff->FillHistos(key,found,tr,clu,cltype,AngleModTrack);
}
return;
}
-