]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Moved vertex cuts outside the track loop (A.Palaha)
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 6 Jan 2011 14:25:27 +0000 (14:25 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 6 Jan 2011 14:25:27 +0000 (14:25 +0000)
ANALYSIS/examples/AliAnalysisTaskEx01.cxx

index a434d13bcdf8c42a02fda308b3b47aeb46196444..e29ae124a0c9d1c2b68c18c3358c374088fc2f69 100644 (file)
@@ -199,6 +199,14 @@ void AliAnalysisTaskEx01::UserExec(Option_t *)
     //
     // These booleans can then be used to fill different histograms for specific
     // conditions, or summed to make one cut for all events that fill histos.
+
+    // Do some fast cuts first
+    // check for good reconstructed vertex
+    if(!(esd->GetPrimaryVertex()->GetStatus())) return;
+    // if vertex is from spd vertexZ, require more stringent cut
+    if (esd->GetPrimaryVertex()->IsFromVertexerZ()) {
+        if (esd->GetPrimaryVertex()->GetDispersion()>0.02 ||  esd->GetPrimaryVertex()->GetZRes()>0.25 ) return; // bad vertex from VertexerZ
+    }
         
     // Track loop for reconstructed event
     Int_t ntracks = esd->GetNumberOfTracks();
@@ -209,13 +217,6 @@ void AliAnalysisTaskEx01::UserExec(Option_t *)
             continue; 
         }
                 
-        // Do some fast cuts first
-        // check for good reconstructed vertex
-        if(!(esd->GetPrimaryVertex()->GetStatus())) continue;
-        // if vertex is from spd vertexZ, require more stringent cut
-        if (esd->GetPrimaryVertex()->IsFromVertexerZ()) {
-            if (esd->GetPrimaryVertex()->GetDispersion()>0.02 ||  esd->GetPrimaryVertex()->GetZRes()>0.25 ) continue; // bad vertex from VertexerZ
-        }
         // Some MC checks, if MC is used
         //if(esdtrack->GetLabel() < 0) continue; // get rid of "ghost" tracks