effc++ warnings
[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:
cea0a066 44 Bool_t Rejected(AliAOD* recevent, AliAOD* simevent);
8e119ee7 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
cea0a066 61 Bool_t PassPartAndTrack (AliAODPair* partpair, AliAODPair* trackpair) const {return (fPairCut->Rejected((AliAODPair*)partpair))?kTRUE:fPairCut->Rejected((AliAODPair*)trackpair);}
7b6503d6 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
cea0a066 66 Bool_t PassPart (AliAODPair* partpair, AliAODPair* /*trackpair*/) const {return fPairCut->Rejected((AliAODPair*)partpair);}
67 Bool_t PassPart1(AliVAODParticle* part, AliVAODParticle* /*track*/) const {return fPairCut->GetFirstPartCut()->Rejected(part);}
68 Bool_t PassPart2(AliVAODParticle* part, AliVAODParticle* /*track*/) const {return fPairCut->GetSecondPartCut()->Rejected(part);}
7b6503d6 69 Bool_t PassPairPropPart (AliAODPair* partpair, AliAODPair* /*trackpair*/) const {return fPairCut->PassPairProp((AliAODPair*)partpair);}
70
cea0a066 71 Bool_t PassTrack (AliAODPair* /*partpair*/, AliAODPair* trackpair) const {return fPairCut->Rejected((AliAODPair*)trackpair);}
72 Bool_t PassTrack1(AliVAODParticle* /*part*/, AliVAODParticle* track) const {return fPairCut->GetFirstPartCut()->Rejected(track);}
73 Bool_t PassTrack2(AliVAODParticle* /*part*/, AliVAODParticle* track) const {return fPairCut->GetSecondPartCut()->Rejected(track);}
7b6503d6 74 Bool_t PassPairPropTrack (AliAODPair* /*partpair*/, AliAODPair* trackpair) const {return fPairCut->PassPairProp((AliAODPair*)trackpair);}
75
5eac1680 76 AliAnalysis(const AliAnalysis&);
77
b26900d0 78 private:
5eac1680 79 AliAnalysis& operator=(const AliAnalysis&); // Not implemented
80
b26900d0 81 ClassDef(AliAnalysis,1)
82};
83
7b6503d6 84
85inline Bool_t AliAnalysis::PassPartAndTrack1(AliVAODParticle* part,AliVAODParticle* track) const
86{
87//Checks first particle from both, particle and track pairs
88 AliAODParticleCut* pc = fPairCut->GetFirstPartCut();
cea0a066 89 return (pc->Rejected(part))?kTRUE:pc->Rejected(track);
7b6503d6 90}
0d8a4589 91/*************************************************************************************/
92
7b6503d6 93inline Bool_t AliAnalysis::PassPartAndTrack2(AliVAODParticle* part,AliVAODParticle* track) const
94{
95//Checks second particle from both, particle and track pairs
96 AliAODParticleCut* pc = fPairCut->GetSecondPartCut();
cea0a066 97 return (pc->Rejected(part))?kTRUE:pc->Rejected(track);
7b6503d6 98}
99/*************************************************************************************/
100
b26900d0 101#endif