]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITStrackerMI.cxx
modifications to satisfy the coding conventions
[u/mrichter/AliRoot.git] / ITS / AliITStrackerMI.cxx
index 708f62c75639836d35d66ce21af5c03cb8e18b15..85b1ccdc68cdfce9562a0162675c08c873f2dc0b 100644 (file)
@@ -227,21 +227,15 @@ fPlaneEff(0) {
 
   // only for plane efficiency evaluation
   if (AliITSReconstructor::GetRecoParam()->GetComputePlaneEff()) {
-    for(Int_t ilay=0;ilay<6;ilay++) { 
-      if(AliITSReconstructor::GetRecoParam()->GetLayersToSkip(ilay)) {
-        if (ilay<2) fPlaneEff = new AliITSPlaneEffSPD();
-        else if (ilay<4) fPlaneEff = new AliITSPlaneEffSDD();
-        else fPlaneEff = new AliITSPlaneEffSSD();
-        break; // only one layer type to skip at once
-      }
-    }
+    Int_t iplane=AliITSReconstructor::GetRecoParam()->GetIPlanePlaneEff();
+    if(AliITSReconstructor::GetRecoParam()->GetLayersToSkip(iplane))
+      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();
+    else fPlaneEff = new AliITSPlaneEffSSD();
     if(AliITSReconstructor::GetRecoParam()->GetReadPlaneEffFromOCDB())
-      if(!fPlaneEff->ReadFromCDB()) 
-       {AliWarning("AliITStrackerMI reading of AliITSPlaneEff from OCDB failed") ;}
-    if(AliITSReconstructor::GetRecoParam()->GetHistoPlaneEff()) {
-      fPlaneEff->SetCreateHistos(kTRUE); 
-      //fPlaneEff->ReadHistosFromFile();
-    }
+       if(!fPlaneEff->ReadFromCDB()) {AliWarning("AliITStrackerMI reading of AliITSPlaneEff from OCDB failed") ;}
+    if(AliITSReconstructor::GetRecoParam()->GetHistoPlaneEff()) fPlaneEff->SetCreateHistos(kTRUE);
   }
 }
 //------------------------------------------------------------------------
@@ -780,7 +774,8 @@ Bool_t AliITStrackerMI::GetTrackPoint(Int_t index, AliTrackPoint& p) const {
   cl->GetGlobalXYZ(xyz);
   cl->GetGlobalCov(cov);
   p.SetXYZ(xyz, cov);
-
+  p.SetCharge(cl->GetQ());
+  p.SetDriftTime(cl->GetDriftTime());
   AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer; 
   switch (l) {
   case 0:
@@ -849,6 +844,8 @@ Bool_t AliITStrackerMI::GetTrackPointTrackingError(Int_t index,
   tmpcl.GetGlobalCov(cov);
 
   p.SetXYZ(xyz, cov);
+  p.SetCharge(cl->GetQ());
+  p.SetDriftTime(cl->GetDriftTime());
 
   AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer; 
   switch (l) {
@@ -2030,7 +2027,7 @@ void AliITStrackerMI::AliITSdetector::ReadBadDetectorAndChips(Int_t ilayer,Int_t
       (detType==0 && calibSPDdead->IsBad())) // TEMPORARY
     {
       SetBad();
-      printf("lay %d bad %d\n",ilayer,idet);
+      //      printf("lay %d bad %d\n",ilayer,idet);
     }
 
   // Get segmentation from AliITSDetTypeRec
@@ -2260,10 +2257,10 @@ Bool_t AliITStrackerMI::RefitAt(Double_t xx,AliITStrackMI *track,
      } else { // no cluster in this layer
        if (skip==1) {
         modstatus = 3; // skipped
-         // Plane Eff determination: 
-         if (planeeff && AliITSReconstructor::GetRecoParam()->GetLayersToSkip(ilayer)) { 
-           if (IsOKForPlaneEff(track,ilayer))  // only adequate track for plane eff. evaluation
-              UseTrackForPlaneEff(track,ilayer); 
+         // Plane Eff determination:
+         if (planeeff && ilayer==AliITSReconstructor::GetRecoParam()->GetIPlanePlaneEff()) {
+           if (IsOKForPlaneEff(track,clusters,ilayer))  // only adequate track for plane eff. evaluation
+              UseTrackForPlaneEff(track,ilayer);
          }
        } else {
         modstatus = 5; // no cls in road
@@ -4402,7 +4399,7 @@ void AliITStrackerMI::FindV02(AliESDEvent *event)
        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){
+       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.);
        }
@@ -4621,8 +4618,8 @@ void AliITStrackerMI::BuildMaterialLUT(TString material) {
   Double_t point1[3],point2[3];
   Double_t phi,cosphi,sinphi,z;
   // 0-5 layers, 6 pipe, 7-8 shields 
-  Double_t rmin[9]={ 3.5, 5.5,13.0,22.0,35.0,41.0, 2.0, 7.5,25.0};
-  Double_t rmax[9]={ 5.5, 7.3,17.0,26.0,41.0,47.0, 3.0,10.5,30.0};
+  Double_t rmin[9]={ 3.5, 5.5,13.0,22.0,35.0,41.0, 2.0, 8.0,25.0};
+  Double_t rmax[9]={ 5.5, 8.0,17.0,26.0,41.0,47.0, 3.0,10.5,30.0};
 
   Int_t ifirst=0,ilast=0;  
   if(material.Contains("Pipe")) {
@@ -4721,7 +4718,8 @@ Int_t AliITStrackerMI::CorrectForPipeMaterial(AliITStrackMI *t,
 
   Float_t  dir = (direction.Contains("inward") ? 1. : -1.);
   Double_t rToGo=(dir>0 ? AliITSRecoParam::GetrInsidePipe() : AliITSRecoParam::GetrOutsidePipe());
-  Double_t xToGo; t->GetLocalXat(rToGo,xToGo);
+  Double_t xToGo;
+  if (!t->GetLocalXat(rToGo,xToGo)) return 0;
 
   Double_t xOverX0,x0,lengthTimesMeanDensity;
   Bool_t anglecorr=kTRUE;
@@ -4815,7 +4813,8 @@ Int_t AliITStrackerMI::CorrectForShieldMaterial(AliITStrackMI *t,
     Error("CorrectForShieldMaterial"," Wrong shield name\n");
     return 0;
   }
-  Double_t xToGo; t->GetLocalXat(rToGo,xToGo);
+  Double_t xToGo;
+  if (!t->GetLocalXat(rToGo,xToGo)) return 0;
 
   Int_t index=2*fCurrentEsdTrack+shieldindex;
 
@@ -4905,7 +4904,8 @@ Int_t AliITStrackerMI::CorrectForLayerMaterial(AliITStrackMI *t,
   Double_t deltar=(layerindex<2 ? 0.10*r : 0.05*r);
 
   Double_t rToGo=TMath::Sqrt(t->GetX()*t->GetX()+t->GetY()*t->GetY())-deltar*dir;
-  Double_t xToGo; t->GetLocalXat(rToGo,xToGo);
+  Double_t xToGo;
+  if (!t->GetLocalXat(rToGo,xToGo)) return 0;
 
   Int_t index=6*fCurrentEsdTrack+layerindex;
 
@@ -5171,7 +5171,7 @@ Bool_t AliITStrackerMI::LocalModuleCoord(Int_t ilayer,Int_t idet,
   return kTRUE;
 }
 //------------------------------------------------------------------------
-Bool_t AliITStrackerMI::IsOKForPlaneEff(AliITStrackMI* track, Int_t ilayer) const {
+Bool_t AliITStrackerMI::IsOKForPlaneEff(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
@@ -5191,12 +5191,41 @@ Bool_t AliITStrackerMI::IsOKForPlaneEff(AliITStrackMI* track, Int_t ilayer) cons
 //
 // input: AliITStrackMI* track, ilayer= layer number [0,5]
 // return: Bool_t   -> kTRUE if usable track, kFALSE if not usable. 
+//
+  Int_t index[AliITSgeomTGeo::kNLayers];
+  Int_t k;
+  for (k=0; k<AliITSgeomTGeo::GetNLayers(); k++) index[k]=-1;
+  //
+  for (k=0; k<AliITSgeomTGeo::GetNLayers(); k++) {
+    index[k]=clusters[k];
+  }
+
   if(!fPlaneEff)
     {AliWarning("IsOKForPlaneEff: null pointer to AliITSPlaneEff"); return kFALSE;}
   AliITSlayer &layer=fgLayers[ilayer];
   Double_t r=layer.GetR();
   AliITStrackMI tmp(*track);
 
+// require a minimal number of cluster in other layers and eventually clusters in closest layers 
+  Int_t ncl=0; 
+  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++;
+  }
+  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 );
+  Bool_t nextin = kFALSE;
+  if(ilayer==0) nextin=kTRUE; // you are already on the innermost layer
+  else nextin = ((index[ilayer-1]>=0)? kTRUE : kFALSE );
+  if(ncl<AliITSgeomTGeo::kNLayers-(ilayer+1)-AliITSReconstructor::GetRecoParam()->GetMaxMissingClustersPlaneEff()) 
+     return kFALSE; 
+  if(AliITSReconstructor::GetRecoParam()->GetRequireClusterInOuterLayerPlaneEff() && !nextout)  return kFALSE;
+  if(AliITSReconstructor::GetRecoParam()->GetRequireClusterInInnerLayerPlaneEff() && !nextin)   return kFALSE;
+  if(tmp.Pt() < AliITSReconstructor::GetRecoParam()->GetMinPtPlaneEff()) return kFALSE;
+ //  if(AliITSReconstructor::GetRecoParam()->GetOnlyConstraintPlaneEff()  && !tmp.GetConstrain()) return kFALSE;
+
 // detector number
   Double_t phi,z;
   if (!tmp.GetPhiZat(r,phi,z)) return kFALSE;
@@ -5404,4 +5433,3 @@ void AliITStrackerMI::UseTrackForPlaneEff(AliITStrackMI* track, Int_t ilayer) {
   }
 return;
 }
-