AliPhysics  3b4a69f (3b4a69f)
AliEMCalTriggerEventSelection.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
17 #include <TString.h>
18 #include "AliAnalysisUtils.h"
19 #include "AliVEvent.h"
20 
24 
25 namespace EMCalTriggerPtAnalysis {
26 
30 AliEMCalTriggerEventSelection::AliEMCalTriggerEventSelection():
31  TObject(),
32  fOldPileupSelection(kFALSE),
33  fOldVertexSelection(kFALSE),
34  fVertexCut(-10., 10.)
35 {
36 
37 }
38 
48  AliAnalysisUtils evutils;
49  AliVEvent *recEvent = ev->GetRecEvent();
50  if(!fOldVertexSelection && !evutils.IsVertexSelected2013pA(recEvent)) return kFALSE;
51  if(fOldVertexSelection && !FalseVertexSelectionPA2013(recEvent)) return kFALSE;
52  if(!fOldPileupSelection && evutils.IsPileUpEvent(recEvent)) return kFALSE;
53  if(fOldPileupSelection && recEvent->IsPileupFromSPD(3, 0.8, 3., 2., 5.)) return kFALSE;
54  if(!fVertexCut.IsInRange(recEvent->GetPrimaryVertex()->GetZ())) return kFALSE;
55  return true;
56 }
57 
63 bool AliEMCalTriggerEventSelection::FalseVertexSelectionPA2013(const AliVEvent *const ev) const{
64  const AliVVertex *trkVtx = ev->GetPrimaryVertex();
65  if(!trkVtx || trkVtx->GetNContributors() < 1) return kFALSE;
66  if (!TString(trkVtx->GetTitle()).Contains("VertexerTracks")) return kFALSE;
67 
68  Float_t zvtx = trkVtx->GetZ();
69  const AliVVertex* spdVtx = ev->GetPrimaryVertexSPD();
70 
71  if (spdVtx->GetNContributors()< 1) return kFALSE;
72  Double_t cov[6]={0};
73  spdVtx->GetCovarianceMatrix(cov);
74  Double_t zRes = TMath::Sqrt(cov[5]);
75  if (spdVtx->IsFromVertexerZ() && (zRes>0.25)) return kFALSE; // doing this incorrectly on purpose
76  if(TMath::Abs(spdVtx->GetZ() - trkVtx->GetZ())>0.5) return kFALSE;
77 
78  if (TMath::Abs(zvtx) > 10) return kFALSE;
79  return kTRUE;
80 }
81 
82 } /* namespace EMCalTriggerPtAnalysis */
double Double_t
Definition: External.C:58
virtual bool IsEventSelected(const AliEMCalTriggerEventData *const ev) const
float Float_t
Definition: External.C:68
Bool_t FalseVertexSelectionPA2013(const AliVEvent *const ev) const
AliCutValueRange< double > fVertexCut
cut range for the vertex selection
Class for event selection in the analysis of triggered events.
Analysis of high- tracks in triggered events.
Simple event container within the high- track analysis.
Event Data used in exchange to the different analysis components.
Class for event selection (apart from trigger selection)