chamber numerotation according to reality
[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;
e92ecbdf 33class AliEventBuffer;
34
27b3fe5d 35class AliHBTOnePairFctn;
36class AliHBTTwoPairFctn;
1b446896 37
5c58441a 38class AliHBTMonOneParticleFctn;
39class AliHBTMonTwoParticleFctn;
1b446896 40
41class TList;
42
78d7c6d3 43class AliHBTAnalysis: public AliAnalysis
1b446896 44 {
45 public:
46 AliHBTAnalysis();
81b7b887 47 AliHBTAnalysis(const AliHBTAnalysis& in);
34914285 48 AliHBTAnalysis& operator=(const AliHBTAnalysis& /*right*/);
1b446896 49 virtual ~AliHBTAnalysis();
50
78d7c6d3 51 Int_t Init();
52 Int_t ProcessEvent(AliAOD* aodrec, AliAOD* aodsim = 0x0);
53 Int_t Finish();
54
1b446896 55 virtual void Process(Option_t* option = "TracksAndParticles");
56
78d7c6d3 57 void SetGlobalPairCut(AliAODPairCut* cut);
1b446896 58
5c58441a 59 void AddTrackFunction(AliHBTOnePairFctn* f);
60 void AddParticleFunction(AliHBTOnePairFctn* f);
61 void AddParticleAndTrackFunction(AliHBTTwoPairFctn* f);
1b446896 62
5c58441a 63 void AddParticleMonitorFunction(AliHBTMonOneParticleFctn* f); //z.ch.
64 void AddTrackMonitorFunction(AliHBTMonOneParticleFctn* f); //z.ch.
65 void AddParticleAndTrackMonitorFunction(AliHBTMonTwoParticleFctn* f);//z.ch.
66
27b3fe5d 67 void AddResolutionFunction(AliHBTTwoPairFctn* f){AddParticleAndTrackFunction(f);}
1b446896 68
78d7c6d3 69 void SetReader(AliReader* r){fReader = r;}
1b446896 70
491d1b5d 71 void WriteFunctions();
7a2c8238 72
73 void SetBufferSize(Int_t buffsize){fBufferSize=buffsize;}
81b7b887 74 void SetOwner(Bool_t owner=kTRUE){fIsOwner=owner;}
75 Bool_t IsOwner() const {return fIsOwner;}
dc2c3f36 76 Bool_t IsNonIdentAnalysis();
e4f2b1da 77 void ResetFunctions();
44e5b87b 78 void SetDisplayInfo(Int_t howoften){fDisplayMixingInfo = howoften;}//defines every each line info about mixing is displayed
9616170a 79
66d1d1a4 80 void SetCutsOnParticles(); // -- aplies only to Process Tracks And Particles
81 void SetCutsOnTracks();// -- aplies only to Process Tracks And Particles
82 void SetCutsOnTracksAndParticles();// Default // -- aplies only to Process Tracks And Particles
83
9616170a 84 static void PressAnyKey();//small utility function that helps to make comfortable macros
1b446896 85 protected:
86
87 Bool_t RunCoherencyCheck();
88
78d7c6d3 89 void FilterOut(AliAOD* outpart1, AliAOD* outpart2, AliAOD* inpart,
90 AliAOD* outtrack1, AliAOD* outtrack2, AliAOD* intrack)const;
91 void FilterOut(AliAOD* out1, AliAOD* out2, AliAOD* in)const;
81b7b887 92 void DeleteFunctions();
1b446896 93
e92ecbdf 94
95 /**********************************************/
96 /* E V E N T P R O C E S S I N G */
97 /**********************************************/
98 // NEW AOD schema
99 Int_t (AliHBTAnalysis::*fProcEvent)(AliAOD* aodrec, AliAOD* aodsim);//Pointer to the processing method
100
101 virtual Int_t ProcessSim(AliAOD* /*aodrec*/, AliAOD* aodsim);
102 virtual Int_t ProcessRec(AliAOD* aodrec, AliAOD* /*aodsim*/);
103 virtual Int_t ProcessRecAndSim(AliAOD* aodrec, AliAOD* aodsim);
104
105 virtual Int_t ProcessRecAndSimNonId(AliAOD* aodrec, AliAOD* aodsim);
106 virtual Int_t ProcessSimNonId(AliAOD* aodrec, AliAOD* /*aodsim*/);
107 virtual Int_t ProcessRecNonId(AliAOD* /*aodrec*/, AliAOD* aodsim);
108
109
110 // OLD legacy schema
111
1b446896 112 virtual void ProcessTracks();
113 virtual void ProcessParticles();
114 virtual void ProcessTracksAndParticles();
115
dc2c3f36 116 virtual void ProcessTracksAndParticlesNonIdentAnal();
117 virtual void ProcessParticlesNonIdentAnal();
118 virtual void ProcessTracksNonIdentAnal();
81b7b887 119
e92ecbdf 120
78d7c6d3 121 AliReader* fReader;//! Pointer to reader
1b446896 122
81b7b887 123 UInt_t fNTrackFunctions; //! Number of Tracks functions
124 UInt_t fNParticleFunctions; //! Number of particles functions
125 UInt_t fNParticleAndTrackFunctions; //! Number of resolution functions
126
127 UInt_t fNTrackMonitorFunctions; //! Number of Track Monitor functions
128 UInt_t fNParticleMonitorFunctions; //! Number of Particles Monitor functions
129 UInt_t fNParticleAndTrackMonitorFunctions; //! Number of Resolution Monitor functions
130
27b3fe5d 131 AliHBTOnePairFctn** fTrackFunctions; //!array of pointers to functions that analyze rekonstructed tracks
132 AliHBTOnePairFctn** fParticleFunctions; //!array of pointers to functions that analyze generated particles
dc2c3f36 133 AliHBTTwoPairFctn** fParticleAndTrackFunctions; //!array of pointers to functions that analyze both
1b446896 134 //reconstructed tracks and generated particles
135 //i.e. - resolution analyzers
81b7b887 136 AliHBTMonOneParticleFctn** fParticleMonitorFunctions; //! array of pointers to monitoring functions
137 AliHBTMonOneParticleFctn** fTrackMonitorFunctions; //! which are used for single particle analysis,
138 AliHBTMonTwoParticleFctn** fParticleAndTrackMonitorFunctions; //! cut monitoring, etc.
5c58441a 139
5c58441a 140
1b446896 141 /**********************************************/
142 /* Control parameters */
81b7b887 143 /**********************************************/
1b446896 144
78d7c6d3 145 AliAODPairCut* fPairCut;//! Pair cut applied for all mixed particles
1b446896 146
81b7b887 147 Int_t fBufferSize; //!defines the size of buffer for mixed events; -1==MIX All
148 Int_t fDisplayMixingInfo;//!defines every which particle mixing info is displayed
149 Bool_t fIsOwner;//!defines of all functions are supposed to be deleted while by the way of analysis defaulr false
e92ecbdf 150
151 AliEventBuffer* fPartBuffer;//Sim Particles event buffer
152 AliEventBuffer* fTrackBuffer;//Rec Tracks event buffer
153
154 Bool_t fNoCorrfctns;//Internal flag indicating that no cfs are set by the user (only monitor ones)
155
1b446896 156 private:
e92ecbdf 157
158 /**********************************************/
159 /* C U T S */
160 /**********************************************/
161
78d7c6d3 162 Bool_t (AliHBTAnalysis::*fkPass)(AliAODPair* partpair, AliAODPair* trackpair) const;//Pointer to function that performes pair cut
163 Bool_t (AliHBTAnalysis::*fkPass1)(AliVAODParticle* partpair, AliVAODParticle* trackpair) const;//Pointer to function that performes cut on first particle
164 Bool_t (AliHBTAnalysis::*fkPass2)(AliVAODParticle* partpair, AliVAODParticle* trackpair) const;//Pointer to function that performes cut on second particle
165 Bool_t (AliHBTAnalysis::*fkPassPairProp)(AliAODPair* partpair, AliAODPair* trackpair) const;//Pointer to function that performes pair cut
166
167 Bool_t PassPartAndTrack (AliAODPair* partpair, AliAODPair* trackpair) const {return (fPairCut->Pass((AliAODPair*)partpair))?kTRUE:fPairCut->Pass((AliAODPair*)trackpair);}
168 Bool_t PassPartAndTrack1(AliVAODParticle* part, AliVAODParticle* track) const;
169 Bool_t PassPartAndTrack2(AliVAODParticle* part, AliVAODParticle* track) const;
170 Bool_t PassPairPropPartAndTrack (AliAODPair* partpair, AliAODPair* trackpair) const {return (fPairCut->PassPairProp((AliAODPair*)partpair))?kTRUE:fPairCut->PassPairProp((AliAODPair*)trackpair);}
171
172 Bool_t PassPart (AliAODPair* partpair, AliAODPair* /*trackpair*/) const {return fPairCut->Pass((AliAODPair*)partpair);}
173 Bool_t PassPart1(AliVAODParticle* part, AliVAODParticle* /*track*/) const {return fPairCut->GetFirstPartCut()->Pass(part);}
174 Bool_t PassPart2(AliVAODParticle* part, AliVAODParticle* /*track*/) const {return fPairCut->GetSecondPartCut()->Pass(part);}
175 Bool_t PassPairPropPart (AliAODPair* partpair, AliAODPair* /*trackpair*/) const {return fPairCut->PassPairProp((AliAODPair*)partpair);}
176
177 Bool_t PassTrack (AliAODPair* /*partpair*/, AliAODPair* trackpair) const {return fPairCut->Pass((AliAODPair*)trackpair);}
178 Bool_t PassTrack1(AliVAODParticle* /*part*/, AliVAODParticle* track) const {return fPairCut->GetFirstPartCut()->Pass(track);}
179 Bool_t PassTrack2(AliVAODParticle* /*part*/, AliVAODParticle* track) const {return fPairCut->GetSecondPartCut()->Pass(track);}
180 Bool_t PassPairPropTrack (AliAODPair* /*partpair*/, AliAODPair* trackpair) const {return fPairCut->PassPairProp((AliAODPair*)trackpair);}
66d1d1a4 181
491d1b5d 182 static const UInt_t fgkFctnArraySize;//!
81b7b887 183 static const UInt_t fgkDefaultMixingInfo;//!
184 static const Int_t fgkDefaultBufferSize;//!
bfb09ece 185
1b446896 186 ClassDef(AliHBTAnalysis,0)
187 };
66d1d1a4 188
78d7c6d3 189inline Bool_t AliHBTAnalysis::PassPartAndTrack1(AliVAODParticle* part,AliVAODParticle* track) const
66d1d1a4 190{
191//Checks first particle from both, particle and track pairs
78d7c6d3 192 AliAODParticleCut* pc = fPairCut->GetFirstPartCut();
66d1d1a4 193 return (pc->Pass(part))?kTRUE:pc->Pass(track);
194}
195/*************************************************************************************/
78d7c6d3 196inline Bool_t AliHBTAnalysis::PassPartAndTrack2(AliVAODParticle* part,AliVAODParticle* track) const
66d1d1a4 197{
198//Checks second particle from both, particle and track pairs
78d7c6d3 199 AliAODParticleCut* pc = fPairCut->GetSecondPartCut();
66d1d1a4 200 return (pc->Pass(part))?kTRUE:pc->Pass(track);
201}
202/*************************************************************************************/
203
1b446896 204#endif