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