]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Events with TPConly vertex rejected; Reject events without reconstructed Vtx at event...
authoramarin <amarin@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Aug 2010 13:20:15 +0000 (13:20 +0000)
committeramarin <amarin@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Aug 2010 13:20:15 +0000 (13:20 +0000)
PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx
PWG4/GammaConv/AliV0Reader.cxx
PWG4/GammaConv/AliV0Reader.h

index 1f41b4cb1aec583d38a002e62206a2349d45fd2a..e038b22b757d2b5f6c8fbec0cc35f6e998ea716a 100644 (file)
@@ -436,6 +436,12 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/)
     return;
   }
 
+  if(fV0Reader->CheckForPrimaryVertex() == kFALSE){
+    //    cout<< "Event not taken"<< endl;
+    return; // aborts if the primary vertex does not have contributors.
+  }
+
+
   // Process the MC information
   if(fDoMCTruth){
     ProcessMCData();
index ec02db0b91b8e9edf58532b631a148927458bcd1..edaa061cfd8b9945de1276f2d231cbad65c2b7c8 100644 (file)
@@ -374,9 +374,44 @@ AliESDv0* AliV0Reader::GetV0(Int_t index){
   return fCurrentV0;
 }
 
+Int_t AliV0Reader::GetNumberOfContributorsVtx(){
+  if(fESDEvent->GetPrimaryVertexTracks()->GetNContributors()>0) {
+    return fESDEvent->GetPrimaryVertexTracks()->GetNContributors();
+  }
+
+  if(fESDEvent->GetPrimaryVertexTracks()->GetNContributors()<1) {
+    if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
+      return fESDEvent->GetPrimaryVertexSPD()->GetNContributors();
+
+    }
+    if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()<1) {
+      cout<<"number of contributors from bad vertex type::"<< fESDEvent->GetPrimaryVertex()->GetName() << endl;
+      return 0;
+    }
+  }
+  return 0;
+}
 Bool_t AliV0Reader::CheckForPrimaryVertex(){
   //see headerfile for documentation
-  return fESDEvent->GetPrimaryVertex()->GetNContributors()>0;
+
+  if(fESDEvent->GetPrimaryVertexTracks()->GetNContributors()>0) {
+    return 1;
+  }
+
+  if(fESDEvent->GetPrimaryVertexTracks()->GetNContributors()<1) {
+  // SPD vertex
+    if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
+      //cout<<"spd vertex type::"<< fESDEvent->GetPrimaryVertex()->GetName() << endl;
+      return 1;
+
+    }
+    if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()<1) {
+      //      cout<<"bad vertex type::"<< fESDEvent->GetPrimaryVertex()->GetName() << endl;
+      return 0;
+    }
+  }
+  return 0;
+  //  return fESDEvent->GetPrimaryVertex()->GetNContributors()>0;
 }
 
 Bool_t AliV0Reader::CheckForPrimaryVertexZ(){
@@ -674,7 +709,8 @@ Bool_t AliV0Reader::NextV0(){
     }
 
     //checks if we have a prim vertex
-    if(fESDEvent->GetPrimaryVertex()->GetNContributors()<=0) { 
+    //if(fESDEvent->GetPrimaryVertex()->GetNContributors()<=0) { 
+    if(GetNumberOfContributorsVtx()<=0) { 
       if(fHistograms != NULL){
        fHistograms->FillHistogram("ESD_CutNContributors_InvMass",GetMotherCandidateMass());
       }
index 22fc4a40e60214607d29d3d324f13ae73e9a36ea..808b7f3ee30cbfe4434ec4d4bcbd0b03e08cf3f7 100644 (file)
@@ -108,7 +108,8 @@ class AliV0Reader : public TObject {
   /*
    *Returns the number of contributors to the vertex
    */
-  Int_t GetNumberOfContributorsVtx() const{return fESDEvent->GetPrimaryVertex()->GetNContributors();}
+  //  Int_t GetNumberOfContributorsVtx() const{return fESDEvent->GetPrimaryVertex()->GetNContributors();}
+  Int_t GetNumberOfContributorsVtx();
   
   /*
    * Check if there are any more good v0s left in the v0 stack