]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
bug fix in finding particle's mother
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Feb 2011 14:15:07 +0000 (14:15 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Feb 2011 14:15:07 +0000 (14:15 +0000)
PWG4/JetTasks/AliAnalyseLeadingTrackUE.cxx

index 269c29ed452497315b5684684c109448a8c359b3..9b8eafc221ef17ec4526ad95edef6e734340e88a 100644 (file)
@@ -308,6 +308,13 @@ AliVParticle*  AliAnalyseLeadingTrackUE::ParticleWithCuts(TObject* obj, Int_t ip
                   if (particleSpecies == 3 && (TMath::Abs(pdgCode)==211 || TMath::Abs(pdgCode)==321 || TMath::Abs(pdgCode)==2212))
                           return 0;
                 }
+                else
+                {
+                  // if mother not found, accept particle only in case of particleSpecies == 3. To include it in all or no sample is no solution
+                  Printf("WARNING: No mother found for particle %d", part->GetLabel());
+                  if (particleSpecies != 3)
+                    return 0;
+                }
         }
   
   }else if (obj->InheritsFrom("TObjArray")){ // list of AliVParticle
@@ -506,6 +513,8 @@ TObjArray*  AliAnalyseLeadingTrackUE::SortRegions(const AliVParticle* leading, T
 //____________________________________________________________________
 Bool_t  AliAnalyseLeadingTrackUE::TriggerSelection(const TObject* obj)
 {
+  if (!obj) // MC
+    return kFALSE;
 
   //Use AliPhysicsSelection to select good events
   if( !obj->InheritsFrom("AliAODInputHandler") ) { // not needed for AOD input 
@@ -515,7 +524,6 @@ Bool_t  AliAnalyseLeadingTrackUE::TriggerSelection(const TObject* obj)
   // TODO for AOD input trigger bit needs to be checked too (is stored in the AOD)
 
   return kTRUE;
-
 }
 
 //____________________________________________________________________