]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
accept tracks in DCal acceptance for cluster-track matching
authorgconesab <gustavo.conesa.balbastre@cern.ch>
Sat, 14 Feb 2015 15:42:50 +0000 (16:42 +0100)
committergconesab <gustavo.conesa.balbastre@cern.ch>
Sat, 14 Feb 2015 15:43:15 +0000 (16:43 +0100)
EMCAL/EMCALUtils/AliEMCALRecoUtils.cxx
EMCAL/EMCALrec/AliEMCALTracker.cxx

index 0538a9bedb30af01aedcc033b67b38640731d9f0..037979326fb5174aa9f37c30a7590e7119f03100 100644 (file)
@@ -1852,8 +1852,16 @@ void AliEMCALRecoUtils::FindMatches(AliVEvent *event,
       if (!esdTrack) continue;
       if (!IsAccepted(esdTrack)) continue;
       if (esdTrack->Pt()<fCutMinTrackPt) continue;
-      Double_t phi = esdTrack->Phi()*TMath::RadToDeg();
-      if (TMath::Abs(esdTrack->Eta())>0.9 || phi <= 10 || phi >= 250 ) continue;
+
+      if ( TMath::Abs(esdTrack->Eta()) > 0.9 ) continue;
+      
+      // Save some time and memory in case of no DCal present
+      if( geom->GetNumberOfSuperModules() < 13 )
+      {
+        Double_t phi = esdTrack->Phi()*TMath::RadToDeg();
+        if ( phi <= 10 || phi >= 250 ) continue;
+      }
+
       if (!fITSTrackSA)
        trackParam =  const_cast<AliExternalTrackParam*>(esdTrack->GetInnerParam());  // if TPC Available
       else
@@ -1880,9 +1888,15 @@ void AliEMCALRecoUtils::FindMatches(AliVEvent *event,
       
       if (aodTrack->Pt()<fCutMinTrackPt) continue;
 
-      Double_t phi = aodTrack->Phi()*TMath::RadToDeg();
-      if (TMath::Abs(aodTrack->Eta())>0.9 || phi <= 10 || phi >= 250 ) 
-       continue;
+      if ( TMath::Abs(aodTrack->Eta()) > 0.9 ) continue;
+      
+      // Save some time and memory in case of no DCal present
+      if( geom->GetNumberOfSuperModules() < 13 )
+      {
+        Double_t phi = aodTrack->Phi()*TMath::RadToDeg();
+        if ( phi <= 10 || phi >= 250 ) continue;
+      }
+      
       Double_t pos[3],mom[3];
       aodTrack->GetXYZ(pos);
       aodTrack->GetPxPyPz(mom);
@@ -1912,12 +1926,20 @@ void AliEMCALRecoUtils::FindMatches(AliVEvent *event,
       continue;
     }
 
-    if (TMath::Abs(eta)>0.75 || (phi) < 70*TMath::DegToRad() || (phi) > 190*TMath::DegToRad()) {
-      if (aodevent && trackParam) delete trackParam;
-      if (fITSTrackSA && trackParam) delete trackParam;
+    if ( TMath::Abs(eta) > 0.75 ) 
+    {
+      if ( trackParam && (aodevent || fITSTrackSA) )   delete trackParam;
       continue;
     }
-
+    
+    // Save some time and memory in case of no DCal present
+    if ( geom->GetNumberOfSuperModules() < 13 && 
+        ( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad())) 
+    {
+      if ( trackParam && (aodevent || fITSTrackSA) )   delete trackParam;
+      continue;
+    }
+    
     //Find matched clusters
     Int_t index = -1;
     Float_t dEta = -999, dPhi = -999;
@@ -1961,8 +1983,16 @@ Int_t AliEMCALRecoUtils::FindMatchedClusterInEvent(const AliESDtrack *track,
   // This function returns the index of matched cluster to input track
   // Returns -1 if no match is found
   Int_t index = -1;
-  Double_t phiV = track->Phi()*TMath::RadToDeg();
-  if (TMath::Abs(track->Eta())>0.9 || phiV <= 10 || phiV >= 250 ) return index;
+  
+  if ( TMath::Abs(track->Eta()) > 0.9 ) return index;
+  
+  // Save some time and memory in case of no DCal present
+  if( geom->GetNumberOfSuperModules() < 13 )
+  {
+    Double_t phiV = track->Phi()*TMath::RadToDeg();
+    if ( phiV <= 10 || phiV >= 250 ) return index;
+  }
+  
   AliExternalTrackParam *trackParam = 0;
   if (!fITSTrackSA)
     trackParam = const_cast<AliExternalTrackParam*>(track->GetInnerParam());  // If TPC
@@ -1977,11 +2007,21 @@ Int_t AliEMCALRecoUtils::FindMatchedClusterInEvent(const AliESDtrack *track,
     if (fITSTrackSA) delete trackParam;
     return index;
   }
-  if (TMath::Abs(eta)>0.75 || (phi) < 70*TMath::DegToRad() || (phi) > 190*TMath::DegToRad()) {
+    
+  if ( TMath::Abs(eta) > 0.75 ) 
+  {
     if (fITSTrackSA) delete trackParam;
     return index;
   }
   
+  // Save some time and memory in case of no DCal present
+  if ( geom->GetNumberOfSuperModules() < 13 && 
+      ( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad())) 
+  {
+    if (fITSTrackSA) delete trackParam;
+    return index;    
+  }
+
   TObjArray *clusterArr = new TObjArray(event->GetNumberOfCaloClusters());
 
   for (Int_t icl=0; icl<event->GetNumberOfCaloClusters(); icl++)
@@ -2064,12 +2104,18 @@ Bool_t AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(AliVTrack *track,
 
   track->SetTrackPhiEtaPtOnEMCal(-999, -999, -999);
 
-  if (track->Pt()<minpt)
+  if ( track->Pt() < minpt )
     return kFALSE;
 
-  Double_t phi = track->Phi()*TMath::RadToDeg();
-  if (TMath::Abs(track->Eta())>0.9 || phi <= 10 || phi >= 250) 
-    return kFALSE;
+  if ( TMath::Abs(track->Eta()) > 0.9 ) return kFALSE;
+  
+  // Save some time and memory in case of no DCal present
+  AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance();
+  if ( geom->GetNumberOfSuperModules() < 13 )
+  {
+    Double_t phi = track->Phi()*TMath::RadToDeg();
+    if ( phi <= 10 || phi >= 250 ) return kFALSE;
+  }
 
   AliESDtrack *esdt = dynamic_cast<AliESDtrack*>(track);
   AliAODTrack *aodt = 0;
@@ -2121,12 +2167,21 @@ Bool_t AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(AliVTrack *track,
                                              etaout, 
                                              phiout,
                                              ptout);
+  
   delete trackParam;
-  if (!ret)
-    return kFALSE;
-  if (TMath::Abs(etaout)>0.75 || (phiout<70*TMath::DegToRad()) || (phiout>190*TMath::DegToRad()))
-    return kFALSE;
+  
+  if (!ret) return kFALSE;
+  
+  if ( TMath::Abs(etaout) > 0.75 ) return kFALSE;
+  
+  // Save some time and memory in case of no DCal present
+  if ( geom->GetNumberOfSuperModules() < 13 )
+  {
+    if ( (phiout < 70*TMath::DegToRad()) || (phiout > 190*TMath::DegToRad()) )  return kFALSE;
+  }
+
   track->SetTrackPhiEtaPtOnEMCal(phiout, etaout, ptout);
+  
   return kTRUE;
 }
 
index 54d371b5eea94bbb8c6973f7195e4152ace91e70..cae6cedb4846c84bf865f96b8c9c9834362bc319 100644 (file)
@@ -256,7 +256,7 @@ Int_t AliEMCALTracker::LoadTracks(AliESDEvent *esd)
   //
   // Load ESD tracks.
   //
-
+  
   UInt_t mask1 = esd->GetESDRun()->GetDetectorsInDAQ();
   UInt_t mask2 = esd->GetESDRun()->GetDetectorsInReco();
   Bool_t desc1 = (mask1 >> 3) & 0x1;
@@ -270,7 +270,7 @@ Int_t AliEMCALTracker::LoadTracks(AliESDEvent *esd)
   
   Clear("TRACKS");
   fTracks = new TObjArray(0);
-       
+
   Int_t nTracks = esd->GetNumberOfTracks();
   //Bool_t isKink=kFALSE;
   for (Int_t i = 0; i < nTracks; i++) {
@@ -285,8 +285,17 @@ Int_t AliEMCALTracker::LoadTracks(AliESDEvent *esd)
       if (esdTrack->GetNcls(1)<fCutNTPC) continue;
     
     //Loose geometric cut
-    Double_t phi = esdTrack->Phi()*TMath::RadToDeg();
-    if (TMath::Abs(esdTrack->Eta())>0.9 || phi <= 10 || phi >= 250) continue;
+    
+    if ( TMath::Abs(esdTrack->Eta()) > 0.9 ) continue;
+
+    // Save some time and memory in case of no DCal present
+    
+    if(fGeom->GetNumberOfSuperModules() < 13)
+    {
+      Double_t phi = esdTrack->Phi()*TMath::RadToDeg();
+      if ( phi <= 10 || phi >= 250 ) continue;
+    }
+        
     fTracks->AddLast(esdTrack);
   }
   
@@ -336,6 +345,8 @@ Int_t AliEMCALTracker::PropagateBack(AliESDEvent* esd)
     return 1;
   }
        
+  if( !fGeom ) fGeom = AliEMCALGeometry::GetInstance();
+  
   // step 1: collect clusters
   Int_t okLoadClusters = 0;  
   if (!fClusters || (fClusters && fClusters->IsEmpty()))
@@ -409,8 +420,16 @@ Int_t AliEMCALTracker::FindMatchedCluster(AliESDtrack *track)
   }
   
   track->SetTrackPhiEtaPtOnEMCal(phi,eta,pt);
+
+  if ( TMath::Abs(eta) > 0.75 ) 
+  {
+    if (fITSTrackSA) delete trkParam;
+    return index;
+  }
   
-  if (TMath::Abs(eta)>0.75 || (phi) < 70*TMath::DegToRad() || (phi) > 190*TMath::DegToRad())
+  // Save some time and memory in case of no DCal present
+  if ( fGeom->GetNumberOfSuperModules() < 13 && 
+      ( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad())) 
   {
     if (fITSTrackSA) delete trkParam;
     return index;