Moving some functionality to selection base class.
[u/mrichter/AliRoot.git] / PWGLF / totEt / AliAnalysisEtSelectorEmcal.cxx
1 //_________________________________________________________________________
2 //  Utility Class for transverse energy studies
3 //  Selection class for EMCAL
4 //
5 //*-- Authors: Oystein Djuvsland (Bergen)
6 //_________________________________________________________________________
7
8
9 #include "AliAnalysisEtSelectorEmcal.h"
10 #include "AliAnalysisEtCuts.h"
11 #include "TParticle.h"
12
13 AliAnalysisEtSelectorEmcal::AliAnalysisEtSelectorEmcal(AliAnalysisEtCuts* cuts):AliAnalysisEtSelector(cuts)
14 {
15
16 }
17
18 AliAnalysisEtSelectorEmcal::~AliAnalysisEtSelectorEmcal()
19 {
20
21 }
22
23 void AliAnalysisEtSelectorEmcal::Init()
24 {
25     AliAnalysisEtSelector::Init();
26 }
27
28 Int_t AliAnalysisEtSelectorEmcal::Init(const AliESDEvent* event)
29 { // Init
30     
31     AliAnalysisEtSelector::Init(event);
32     Printf("Initializing selector for run: %d", event->GetRunNumber());
33     fInitialized = kTRUE;
34     return 0;
35 }
36
37 TRefArray* AliAnalysisEtSelectorEmcal::GetClusters()
38 { // Get clusters
39     
40   if(!fClusterArray) fClusterArray = new TRefArray;
41   
42   if(fClusterArray)
43   {
44     fEvent->GetEMCALClusters(fClusterArray);
45   }
46   else
47   {
48     Printf("Could not initialize cluster array");
49   }
50   return fClusterArray;
51 }
52
53 Bool_t AliAnalysisEtSelectorEmcal::PassMinEnergyCut(const AliESDCaloCluster& cl) const
54 {
55   return cl.E() > fCuts->GetReconstructedEmcalClusterEnergyCut();
56 }
57
58 Bool_t AliAnalysisEtSelectorEmcal::PassMinEnergyCut(const TParticle& p) const
59 {
60     return p.Energy() > fCuts->GetReconstructedEmcalClusterEnergyCut();
61 }
62
63 Bool_t AliAnalysisEtSelectorEmcal::PassDistanceToBadChannelCut(const AliESDCaloCluster& ) const
64 {
65     return kTRUE;
66 }
67
68 Bool_t AliAnalysisEtSelectorEmcal::PassTrackMatchingCut(const AliESDCaloCluster& ) const
69 {
70     return kTRUE;
71 }
72
73 Bool_t AliAnalysisEtSelectorEmcal::CutGeometricalAcceptance(const TParticle& part) const
74 {
75   return TMath::Abs(part.Eta()) < fCuts->GetGeometryEmcalEtaAccCut() 
76           && part.Phi() < fCuts->GetGeometryEmcalPhiAccMaxCut()*TMath::Pi()/180.
77           && part.Phi() > fCuts->GetGeometryEmcalPhiAccMinCut()*TMath::Pi()/180.;
78 }
79
80 Bool_t AliAnalysisEtSelectorEmcal::CutGeometricalAcceptance(const AliVTrack& part) const
81 {
82   return TMath::Abs(part.Eta()) < fCuts->GetGeometryEmcalEtaAccCut() 
83           && part.Phi() < fCuts->GetGeometryEmcalPhiAccMaxCut()*TMath::Pi()/180.
84           && part.Phi() > fCuts->GetGeometryEmcalPhiAccMinCut()*TMath::Pi()/180.;
85 }
86
87
88
89
90
91