Reset method introduced
[u/mrichter/AliRoot.git] / HBTAN / AliHBTAnalysis.h
CommitLineData
1b446896 1#ifndef ALIHBTANALYSIS_H
2#define ALIHBTANALYSIS_H
bfb09ece 3//_________________________________________________________
4////////////////////////////////////////////////////////////////////////////
5//
6// class AliHBTAnalysis
7//
8// Central Object Of HBTAnalyser:
9// This class performs main looping within HBT Analysis
78d7c6d3 10// User must plug a reader of Type AliReader
bfb09ece 11// User plugs in coorelation and monitor functions
12// as well as monitor functions
13//
14// HBT Analysis Tool, which is integral part of AliRoot,
15// ALICE Off-Line framework:
16//
17// Piotr.Skowronski@cern.ch
18// more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html
19//
20////////////////////////////////////////////////////////////////////////////
21//_________________________________________________________
1b446896 22
78d7c6d3 23#include <AliAnalysis.h>
24#include "AliAODPairCut.h"
25#include "AliAODParticleCut.h"
1b446896 26
1b446896 27class AliHBTCut;
78d7c6d3 28//class AliHBTPair;
1b446896 29
30class AliHBTRun;
78d7c6d3 31class AliAOD;
32class AliReader;
27b3fe5d 33class AliHBTOnePairFctn;
34class AliHBTTwoPairFctn;
1b446896 35
5c58441a 36class AliHBTMonOneParticleFctn;
37class AliHBTMonTwoParticleFctn;
1b446896 38
39class TList;
40
78d7c6d3 41class AliHBTAnalysis: public AliAnalysis
1b446896 42 {
43 public:
44 AliHBTAnalysis();
81b7b887 45 AliHBTAnalysis(const AliHBTAnalysis& in);
34914285 46 AliHBTAnalysis& operator=(const AliHBTAnalysis& /*right*/);
1b446896 47 virtual ~AliHBTAnalysis();
48
78d7c6d3 49 Int_t Init();
50 Int_t ProcessEvent(AliAOD* aodrec, AliAOD* aodsim = 0x0);
51 Int_t Finish();
52
1b446896 53 virtual void Process(Option_t* option = "TracksAndParticles");
54
78d7c6d3 55 void SetGlobalPairCut(AliAODPairCut* cut);
1b446896 56
5c58441a 57 void AddTrackFunction(AliHBTOnePairFctn* f);
58 void AddParticleFunction(AliHBTOnePairFctn* f);
59 void AddParticleAndTrackFunction(AliHBTTwoPairFctn* f);
1b446896 60
5c58441a 61 void AddParticleMonitorFunction(AliHBTMonOneParticleFctn* f); //z.ch.
62 void AddTrackMonitorFunction(AliHBTMonOneParticleFctn* f); //z.ch.
63 void AddParticleAndTrackMonitorFunction(AliHBTMonTwoParticleFctn* f);//z.ch.
64
27b3fe5d 65 void AddResolutionFunction(AliHBTTwoPairFctn* f){AddParticleAndTrackFunction(f);}
1b446896 66
78d7c6d3 67 void SetReader(AliReader* r){fReader = r;}
1b446896 68
491d1b5d 69 void WriteFunctions();
7a2c8238 70
71 void SetBufferSize(Int_t buffsize){fBufferSize=buffsize;}
81b7b887 72 void SetOwner(Bool_t owner=kTRUE){fIsOwner=owner;}
73 Bool_t IsOwner() const {return fIsOwner;}
dc2c3f36 74 Bool_t IsNonIdentAnalysis();
e4f2b1da 75 void ResetFunctions();
44e5b87b 76 void SetDisplayInfo(Int_t howoften){fDisplayMixingInfo = howoften;}//defines every each line info about mixing is displayed
9616170a 77
66d1d1a4 78 void SetCutsOnParticles(); // -- aplies only to Process Tracks And Particles
79 void SetCutsOnTracks();// -- aplies only to Process Tracks And Particles
80 void SetCutsOnTracksAndParticles();// Default // -- aplies only to Process Tracks And Particles
81
9616170a 82 static void PressAnyKey();//small utility function that helps to make comfortable macros
1b446896 83 protected:
84
85 Bool_t RunCoherencyCheck();
86
78d7c6d3 87 void FilterOut(AliAOD* outpart1, AliAOD* outpart2, AliAOD* inpart,
88 AliAOD* outtrack1, AliAOD* outtrack2, AliAOD* intrack)const;
89 void FilterOut(AliAOD* out1, AliAOD* out2, AliAOD* in)const;
81b7b887 90 void DeleteFunctions();
1b446896 91
92 virtual void ProcessTracks();
93 virtual void ProcessParticles();
94 virtual void ProcessTracksAndParticles();
95
dc2c3f36 96 virtual void ProcessTracksAndParticlesNonIdentAnal();
97 virtual void ProcessParticlesNonIdentAnal();
98 virtual void ProcessTracksNonIdentAnal();
81b7b887 99
78d7c6d3 100 AliReader* fReader;//! Pointer to reader
1b446896 101
81b7b887 102 UInt_t fNTrackFunctions; //! Number of Tracks functions
103 UInt_t fNParticleFunctions; //! Number of particles functions
104 UInt_t fNParticleAndTrackFunctions; //! Number of resolution functions
105
106 UInt_t fNTrackMonitorFunctions; //! Number of Track Monitor functions
107 UInt_t fNParticleMonitorFunctions; //! Number of Particles Monitor functions
108 UInt_t fNParticleAndTrackMonitorFunctions; //! Number of Resolution Monitor functions
109
27b3fe5d 110 AliHBTOnePairFctn** fTrackFunctions; //!array of pointers to functions that analyze rekonstructed tracks
111 AliHBTOnePairFctn** fParticleFunctions; //!array of pointers to functions that analyze generated particles
dc2c3f36 112 AliHBTTwoPairFctn** fParticleAndTrackFunctions; //!array of pointers to functions that analyze both
1b446896 113 //reconstructed tracks and generated particles
114 //i.e. - resolution analyzers
81b7b887 115 AliHBTMonOneParticleFctn** fParticleMonitorFunctions; //! array of pointers to monitoring functions
116 AliHBTMonOneParticleFctn** fTrackMonitorFunctions; //! which are used for single particle analysis,
117 AliHBTMonTwoParticleFctn** fParticleAndTrackMonitorFunctions; //! cut monitoring, etc.
5c58441a 118
5c58441a 119
1b446896 120 /**********************************************/
121 /* Control parameters */
81b7b887 122 /**********************************************/
1b446896 123
78d7c6d3 124 AliAODPairCut* fPairCut;//! Pair cut applied for all mixed particles
1b446896 125
81b7b887 126 Int_t fBufferSize; //!defines the size of buffer for mixed events; -1==MIX All
127 Int_t fDisplayMixingInfo;//!defines every which particle mixing info is displayed
128 Bool_t fIsOwner;//!defines of all functions are supposed to be deleted while by the way of analysis defaulr false
129
1b446896 130 private:
78d7c6d3 131 Bool_t (AliHBTAnalysis::*fkPass)(AliAODPair* partpair, AliAODPair* trackpair) const;//Pointer to function that performes pair cut
132 Bool_t (AliHBTAnalysis::*fkPass1)(AliVAODParticle* partpair, AliVAODParticle* trackpair) const;//Pointer to function that performes cut on first particle
133 Bool_t (AliHBTAnalysis::*fkPass2)(AliVAODParticle* partpair, AliVAODParticle* trackpair) const;//Pointer to function that performes cut on second particle
134 Bool_t (AliHBTAnalysis::*fkPassPairProp)(AliAODPair* partpair, AliAODPair* trackpair) const;//Pointer to function that performes pair cut
135
136 Bool_t PassPartAndTrack (AliAODPair* partpair, AliAODPair* trackpair) const {return (fPairCut->Pass((AliAODPair*)partpair))?kTRUE:fPairCut->Pass((AliAODPair*)trackpair);}
137 Bool_t PassPartAndTrack1(AliVAODParticle* part, AliVAODParticle* track) const;
138 Bool_t PassPartAndTrack2(AliVAODParticle* part, AliVAODParticle* track) const;
139 Bool_t PassPairPropPartAndTrack (AliAODPair* partpair, AliAODPair* trackpair) const {return (fPairCut->PassPairProp((AliAODPair*)partpair))?kTRUE:fPairCut->PassPairProp((AliAODPair*)trackpair);}
140
141 Bool_t PassPart (AliAODPair* partpair, AliAODPair* /*trackpair*/) const {return fPairCut->Pass((AliAODPair*)partpair);}
142 Bool_t PassPart1(AliVAODParticle* part, AliVAODParticle* /*track*/) const {return fPairCut->GetFirstPartCut()->Pass(part);}
143 Bool_t PassPart2(AliVAODParticle* part, AliVAODParticle* /*track*/) const {return fPairCut->GetSecondPartCut()->Pass(part);}
144 Bool_t PassPairPropPart (AliAODPair* partpair, AliAODPair* /*trackpair*/) const {return fPairCut->PassPairProp((AliAODPair*)partpair);}
145
146 Bool_t PassTrack (AliAODPair* /*partpair*/, AliAODPair* trackpair) const {return fPairCut->Pass((AliAODPair*)trackpair);}
147 Bool_t PassTrack1(AliVAODParticle* /*part*/, AliVAODParticle* track) const {return fPairCut->GetFirstPartCut()->Pass(track);}
148 Bool_t PassTrack2(AliVAODParticle* /*part*/, AliVAODParticle* track) const {return fPairCut->GetSecondPartCut()->Pass(track);}
149 Bool_t PassPairPropTrack (AliAODPair* /*partpair*/, AliAODPair* trackpair) const {return fPairCut->PassPairProp((AliAODPair*)trackpair);}
66d1d1a4 150
491d1b5d 151 static const UInt_t fgkFctnArraySize;//!
81b7b887 152 static const UInt_t fgkDefaultMixingInfo;//!
153 static const Int_t fgkDefaultBufferSize;//!
bfb09ece 154
1b446896 155 ClassDef(AliHBTAnalysis,0)
156 };
66d1d1a4 157
78d7c6d3 158inline Bool_t AliHBTAnalysis::PassPartAndTrack1(AliVAODParticle* part,AliVAODParticle* track) const
66d1d1a4 159{
160//Checks first particle from both, particle and track pairs
78d7c6d3 161 AliAODParticleCut* pc = fPairCut->GetFirstPartCut();
66d1d1a4 162 return (pc->Pass(part))?kTRUE:pc->Pass(track);
163}
164/*************************************************************************************/
78d7c6d3 165inline Bool_t AliHBTAnalysis::PassPartAndTrack2(AliVAODParticle* part,AliVAODParticle* track) const
66d1d1a4 166{
167//Checks second particle from both, particle and track pairs
78d7c6d3 168 AliAODParticleCut* pc = fPairCut->GetSecondPartCut();
66d1d1a4 169 return (pc->Pass(part))?kTRUE:pc->Pass(track);
170}
171/*************************************************************************************/
172
1b446896 173#endif