PairCut stuff moved from AliHBTAnalysis to AliAnalysis
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysis.h
CommitLineData
b26900d0 1#ifndef ALIANALYSIS_H
2#define ALIANALYSIS_H
3//________________________________
4///////////////////////////////////////////////////////////
5//
6// class AliAnalysis
7//
8// Base class for analysis
9//
10//
11// Piotr.Skowronski@cern.ch
12//
13///////////////////////////////////////////////////////////
14
15#include <TTask.h>
7b6503d6 16#include <AliAODParticleCut.h>
17#include <AliAODPairCut.h>
b26900d0 18
a5556ea5 19class AliAOD;
b26900d0 20class AliStack;
8e119ee7 21class AliEventCut;
7b6503d6 22class AliVAODParticle;
23class AliAODPair;
b26900d0 24
25class AliAnalysis: public TTask
26{
27 public:
28 AliAnalysis();
29 AliAnalysis(const char* name,const char* title);
30 virtual ~AliAnalysis();
31
32 virtual Int_t Init() = 0;
a5556ea5 33 virtual Int_t ProcessEvent(AliAOD* aodrec, AliAOD* aodsim = 0x0) = 0;
b26900d0 34 virtual Int_t Finish() = 0;
8e119ee7 35
7b6503d6 36 void SetCutsOnRec();
37 void SetCutsOnSim();
38 void SetCutsOnRecAndSim();
39
8e119ee7 40 void SetEventCut(AliEventCut* evcut);
7b6503d6 41 void SetPairCut(AliAODPairCut* cut);
b26900d0 42
b26900d0 43 protected:
8e119ee7 44 Bool_t Pass(AliAOD* recevent, AliAOD* simevent);
45 AliEventCut* fEventCut;//event cut
46
47 Bool_t fCutOnSim;//flag indicating that event cut is performed on simulated particles
48 Bool_t fCutOnRec;//flag indicating that event cut is performed on reconstructed tracks
7b6503d6 49
50 AliAODPairCut* fPairCut;// Pair cut applied for all mixed particles
51
52 /**********************************************/
53 /* C U T S */
54 /**********************************************/
55
56 Bool_t (AliAnalysis::*fkPass)(AliAODPair* partpair, AliAODPair* trackpair) const;//Pointer to function that performes pair cut
57 Bool_t (AliAnalysis::*fkPass1)(AliVAODParticle* partpair, AliVAODParticle* trackpair) const;//Pointer to function that performes cut on first particle
58 Bool_t (AliAnalysis::*fkPass2)(AliVAODParticle* partpair, AliVAODParticle* trackpair) const;//Pointer to function that performes cut on second particle
59 Bool_t (AliAnalysis::*fkPassPairProp)(AliAODPair* partpair, AliAODPair* trackpair) const;//Pointer to function that performes pair cut
60
61 Bool_t PassPartAndTrack (AliAODPair* partpair, AliAODPair* trackpair) const {return (fPairCut->Pass((AliAODPair*)partpair))?kTRUE:fPairCut->Pass((AliAODPair*)trackpair);}
62 Bool_t PassPartAndTrack1(AliVAODParticle* part, AliVAODParticle* track) const;
63 Bool_t PassPartAndTrack2(AliVAODParticle* part, AliVAODParticle* track) const;
64 Bool_t PassPairPropPartAndTrack (AliAODPair* partpair, AliAODPair* trackpair) const {return (fPairCut->PassPairProp((AliAODPair*)partpair))?kTRUE:fPairCut->PassPairProp((AliAODPair*)trackpair);}
65
66 Bool_t PassPart (AliAODPair* partpair, AliAODPair* /*trackpair*/) const {return fPairCut->Pass((AliAODPair*)partpair);}
67 Bool_t PassPart1(AliVAODParticle* part, AliVAODParticle* /*track*/) const {return fPairCut->GetFirstPartCut()->Pass(part);}
68 Bool_t PassPart2(AliVAODParticle* part, AliVAODParticle* /*track*/) const {return fPairCut->GetSecondPartCut()->Pass(part);}
69 Bool_t PassPairPropPart (AliAODPair* partpair, AliAODPair* /*trackpair*/) const {return fPairCut->PassPairProp((AliAODPair*)partpair);}
70
71 Bool_t PassTrack (AliAODPair* /*partpair*/, AliAODPair* trackpair) const {return fPairCut->Pass((AliAODPair*)trackpair);}
72 Bool_t PassTrack1(AliVAODParticle* /*part*/, AliVAODParticle* track) const {return fPairCut->GetFirstPartCut()->Pass(track);}
73 Bool_t PassTrack2(AliVAODParticle* /*part*/, AliVAODParticle* track) const {return fPairCut->GetSecondPartCut()->Pass(track);}
74 Bool_t PassPairPropTrack (AliAODPair* /*partpair*/, AliAODPair* trackpair) const {return fPairCut->PassPairProp((AliAODPair*)trackpair);}
75
b26900d0 76 private:
b26900d0 77 ClassDef(AliAnalysis,1)
78};
79
7b6503d6 80
81inline Bool_t AliAnalysis::PassPartAndTrack1(AliVAODParticle* part,AliVAODParticle* track) const
82{
83//Checks first particle from both, particle and track pairs
84 AliAODParticleCut* pc = fPairCut->GetFirstPartCut();
85 return (pc->Pass(part))?kTRUE:pc->Pass(track);
86}
87/*************************************************************************************/
88inline Bool_t AliAnalysis::PassPartAndTrack2(AliVAODParticle* part,AliVAODParticle* track) const
89{
90//Checks second particle from both, particle and track pairs
91 AliAODParticleCut* pc = fPairCut->GetSecondPartCut();
92 return (pc->Pass(part))?kTRUE:pc->Pass(track);
93}
94/*************************************************************************************/
95
b26900d0 96#endif