From: ddobrigk Date: Wed, 17 Apr 2013 15:28:07 +0000 (+0000) Subject: Removed AliAnalysisUtils-based PV selection for Cascade tasks; replaced with code... X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=ab47349edf0aa5ada0b6da26b975903b6920bb04;hp=d693307aedcc649b829da240d657fd4677cfc395 Removed AliAnalysisUtils-based PV selection for Cascade tasks; replaced with code snippet from Roberto. --- diff --git a/PWGLF/STRANGENESS/Cascades/AliAnalysisTaskExtractCascade.cxx b/PWGLF/STRANGENESS/Cascades/AliAnalysisTaskExtractCascade.cxx index 8fad5e85c25..b3dc3953228 100644 --- a/PWGLF/STRANGENESS/Cascades/AliAnalysisTaskExtractCascade.cxx +++ b/PWGLF/STRANGENESS/Cascades/AliAnalysisTaskExtractCascade.cxx @@ -849,28 +849,55 @@ void AliAnalysisTaskExtractCascade::UserExec(Option_t *) fHistPVy->Fill( lPrimaryVtxPosition[1] ); fHistPVz->Fill( lPrimaryVtxPosition[2] ); -//------------------------------------------------ -// Primary Vertex Z position: SKIP -//------------------------------------------------ - - if(TMath::Abs(lBestPrimaryVtxPos[2]) > 10.0 && fkpAVertexSelection==kFALSE) { - AliWarning("Pb / | Z position of Best Prim Vtx | > 10.0 cm ... return !"); + //------------------------------------------------ + // Primary Vertex Requirements Section: + // ---> pp and PbPb: Only requires |z|<10cm + // ---> pPb: all requirements checked at this stage + //------------------------------------------------ + + //Roberto's PV selection criteria, implemented 17th April 2013 + + /* vertex selection */ + Bool_t fHasVertex = kFALSE; + + const AliESDVertex *vertex = lESDevent->GetPrimaryVertexTracks(); + if (vertex->GetNContributors() < 1) { + vertex = lESDevent->GetPrimaryVertexSPD(); + if (vertex->GetNContributors() < 1) fHasVertex = kFALSE; + else fHasVertex = kTRUE; + TString vtxTyp = vertex->GetTitle(); + Double_t cov[6]={0}; + vertex->GetCovarianceMatrix(cov); + Double_t zRes = TMath::Sqrt(cov[5]); + if (vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) fHasVertex = kFALSE; + } + else fHasVertex = kTRUE; + + //Is First event in chunk rejection: Still present! + if(fkpAVertexSelection==kTRUE && fHasVertex == kFALSE) { + AliWarning("Pb / | PV does not satisfy selection criteria!"); PostData(1, fListHist); PostData(2, fTreeCascade); return; } + + //Is First event in chunk rejection: Still present! if(fkpAVertexSelection==kTRUE && fUtils->IsFirstEventInChunk(lESDevent)) { AliWarning("Pb / | This is the first event in the chunk!"); PostData(1, fListHist); PostData(2, fTreeCascade); return; } - if(fkpAVertexSelection==kTRUE && !fUtils->IsVertexSelected2013pA(lESDevent)) { - AliWarning("Pb / | Vertex not selected by 2013 pA criteria!"); + + //17 April Fix: Always do primary vertex Z selection, after pA vertex selection from Roberto + if(TMath::Abs(lBestPrimaryVtxPos[2]) > 10.0) { + AliWarning("Pb / | Z position of Best Prim Vtx | > 10.0 cm ... return !"); PostData(1, fListHist); PostData(2, fTreeCascade); return; } + + lMagneticField = lESDevent->GetMagneticField( ); fHistV0MultiplicityForSelEvt ->Fill( lNumberOfV0s ); fHistMultiplicity->Fill(lMultiplicity); diff --git a/PWGLF/STRANGENESS/Cascades/AliAnalysisTaskExtractPerformanceCascade.cxx b/PWGLF/STRANGENESS/Cascades/AliAnalysisTaskExtractPerformanceCascade.cxx index 1ebb6673d00..93fb31375b2 100644 --- a/PWGLF/STRANGENESS/Cascades/AliAnalysisTaskExtractPerformanceCascade.cxx +++ b/PWGLF/STRANGENESS/Cascades/AliAnalysisTaskExtractPerformanceCascade.cxx @@ -1848,24 +1848,49 @@ void AliAnalysisTaskExtractPerformanceCascade::UserExec(Option_t *) fHistPVy->Fill( lPrimaryVtxPosition[1] ); fHistPVz->Fill( lPrimaryVtxPosition[2] ); -//------------------------------------------------ -// Primary Vertex Z position: SKIP -//------------------------------------------------ + //------------------------------------------------ + // Primary Vertex Requirements Section: + // ---> pp and PbPb: Only requires |z|<10cm + // ---> pPb: all requirements checked at this stage + //------------------------------------------------ - if(TMath::Abs(lBestPrimaryVtxPos[2]) > 10.0 && fkpAVertexSelection==kFALSE) { - AliWarning("Pb / | Z position of Best Prim Vtx | > 10.0 cm ... return !"); + //Roberto's PV selection criteria, implemented 17th April 2013 + + /* vertex selection */ + Bool_t fHasVertex = kFALSE; + + const AliESDVertex *vertex = lESDevent->GetPrimaryVertexTracks(); + if (vertex->GetNContributors() < 1) { + vertex = lESDevent->GetPrimaryVertexSPD(); + if (vertex->GetNContributors() < 1) fHasVertex = kFALSE; + else fHasVertex = kTRUE; + TString vtxTyp = vertex->GetTitle(); + Double_t cov[6]={0}; + vertex->GetCovarianceMatrix(cov); + Double_t zRes = TMath::Sqrt(cov[5]); + if (vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) fHasVertex = kFALSE; + } + else fHasVertex = kTRUE; + + //Is First event in chunk rejection: Still present! + if(fkpAVertexSelection==kTRUE && fHasVertex == kFALSE) { + AliWarning("Pb / | PV does not satisfy selection criteria!"); PostData(1, fListHist); PostData(2, fTreeCascade); return; } + + //Is First event in chunk rejection: Still present! if(fkpAVertexSelection==kTRUE && fUtils->IsFirstEventInChunk(lESDevent)) { AliWarning("Pb / | This is the first event in the chunk!"); PostData(1, fListHist); PostData(2, fTreeCascade); return; } - if(fkpAVertexSelection==kTRUE && !fUtils->IsVertexSelected2013pA(lESDevent)) { - AliWarning("Pb / | Vertex not selected by 2013 pA criteria!"); + + //17 April Fix: Always do primary vertex Z selection, after pA vertex selection from Roberto + if(TMath::Abs(lBestPrimaryVtxPos[2]) > 10.0) { + AliWarning("Pb / | Z position of Best Prim Vtx | > 10.0 cm ... return !"); PostData(1, fListHist); PostData(2, fTreeCascade); return;