]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALRecoUtils.cxx
speed up with binary search
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALRecoUtils.cxx
index 705746eb818c95c5ce9ef6cd5cecac91c198ac87..911724c709fb048d485a2006c726e70c6816beaf 100644 (file)
@@ -377,6 +377,7 @@ Bool_t AliEMCALRecoUtils::CheckCellFiducialRegion(const AliEMCALGeometry* geom,
   if (iSM < 0 || iphi < 0 || ieta < 0 ) {
     AliFatal(Form("Negative value for super module: %d, or cell ieta: %d, or cell iphi: %d, check EMCAL geometry name\n",
                   iSM,ieta,iphi));
+    return kFALSE; // trick coverity
   }
   
   //Check rows/phi
@@ -1761,7 +1762,7 @@ void AliEMCALRecoUtils::FindMatches(AliVEvent *event,
             
       if (fAODTPCOnlyTracks) { // Match with TPC only tracks, default from May 2013, before filter bit 32
         //printf("Match with TPC only tracks, accept? %d, test bit 128 <%d> \n", aodTrack->IsTPCOnly(), aodTrack->TestFilterMask(128));
-        if (!aodTrack->IsTPCOnly()) continue ;
+        if (!aodTrack->IsTPCConstrained()) continue ;
       } else if (fAODHybridTracks) { // Match with hybrid tracks
         //printf("Match with Hybrid tracks, accept? %d \n", aodTrack->IsHybridGlobalConstrainedGlobal());
         if (!aodTrack->IsHybridGlobalConstrainedGlobal()) continue ;
@@ -2487,8 +2488,13 @@ void AliEMCALRecoUtils::SetTracksMatchedToCluster(const AliVEvent *event)
     for (Int_t iTrk=0; iTrk<nTracks; ++iTrk) 
     {
       AliVTrack* track = dynamic_cast<AliVTrack*>(event->GetTrack(iTrk));
-      if (iTrk == matchTrackIndex) continue;
-      if (track->GetEMCALcluster() == iClus) {
+      
+      if( !track ) continue;
+      
+      if ( iTrk == matchTrackIndex ) continue;
+      
+      if ( track->GetEMCALcluster() == iClus )
+      {
         arrayTrackMatched[nMatched] = iTrk;
         ++nMatched;
       }