Bug correction
[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>
1b446896 24
1b446896 25class AliHBTCut;
78d7c6d3 26//class AliHBTPair;
1b446896 27
28class AliHBTRun;
78d7c6d3 29class AliAOD;
30class AliReader;
e92ecbdf 31class AliEventBuffer;
7b6503d6 32class AliEventCut;
e92ecbdf 33
27b3fe5d 34class AliHBTOnePairFctn;
35class AliHBTTwoPairFctn;
1b446896 36
5c58441a 37class AliHBTMonOneParticleFctn;
38class AliHBTMonTwoParticleFctn;
1b446896 39
40class TList;
41
78d7c6d3 42class AliHBTAnalysis: public AliAnalysis
1b446896 43 {
44 public:
45 AliHBTAnalysis();
81b7b887 46 AliHBTAnalysis(const AliHBTAnalysis& in);
34914285 47 AliHBTAnalysis& operator=(const AliHBTAnalysis& /*right*/);
1b446896 48 virtual ~AliHBTAnalysis();
49
78d7c6d3 50 Int_t Init();
5994509d 51 Int_t ProcessEvent(AliAOD* aodrec, AliAOD* aodsim = 0x0);
52 Int_t Finish();
78d7c6d3 53
5994509d 54 enum EProcessOption{kReconstructed,kSimulated,kSimulatedAndReconstructed};
55 void SetProcessOption(EProcessOption option){fProcessOption = option;}//Init must be called to make effect
090e46d6 56
5994509d 57 void Process(Option_t* option = "TracksAndParticles");//Stand alone HBT analysis
1b446896 58
5994509d 59 void SetGlobalPairCut(AliAODPairCut* cut);
1b446896 60
5994509d 61 void AddTrackFunction(AliHBTOnePairFctn* f);
62 void AddParticleFunction(AliHBTOnePairFctn* f);
63 void AddParticleAndTrackFunction(AliHBTTwoPairFctn* f);
1b446896 64
5994509d 65 void AddParticleMonitorFunction(AliHBTMonOneParticleFctn* f); //z.ch.
66 void AddTrackMonitorFunction(AliHBTMonOneParticleFctn* f); //z.ch.
67 void AddParticleAndTrackMonitorFunction(AliHBTMonTwoParticleFctn* f);//z.ch.
5c58441a 68
5994509d 69 void AddResolutionFunction(AliHBTTwoPairFctn* f){AddParticleAndTrackFunction(f);}
1b446896 70
5994509d 71 void SetReader(AliReader* r){fReader = r;}
1b446896 72
5994509d 73 void WriteFunctions();
74 void SetOutputFileName(const char* fname);
8fba7c63 75
5994509d 76 void SetBufferSize(Int_t buffsize){fBufferSize=buffsize;}
77 void SetOwner(Bool_t owner=kTRUE){fIsOwner=owner;}
81b7b887 78 Bool_t IsOwner() const {return fIsOwner;}
dc2c3f36 79 Bool_t IsNonIdentAnalysis();
e4f2b1da 80 void ResetFunctions();
44e5b87b 81 void SetDisplayInfo(Int_t howoften){fDisplayMixingInfo = howoften;}//defines every each line info about mixing is displayed
9616170a 82
5994509d 83 void SetApparentVertex(Double_t x, Double_t y, Double_t z);//Sets apparent vertex
1b446896 84
5994509d 85 static void PressAnyKey();//small utility function that helps to make comfortable macros
1b446896 86
5994509d 87 protected:
1b446896 88
e92ecbdf 89 /**********************************************/
90 /* E V E N T P R O C E S S I N G */
91 /**********************************************/
92 // NEW AOD schema
93 Int_t (AliHBTAnalysis::*fProcEvent)(AliAOD* aodrec, AliAOD* aodsim);//Pointer to the processing method
94
5994509d 95 Int_t ProcessSim(AliAOD* /*aodrec*/, AliAOD* aodsim);
96 Int_t ProcessRec(AliAOD* aodrec, AliAOD* /*aodsim*/);
97 Int_t ProcessRecAndSim(AliAOD* aodrec, AliAOD* aodsim);
e92ecbdf 98
5994509d 99 Int_t ProcessRecAndSimNonId(AliAOD* aodrec, AliAOD* aodsim);
100 Int_t ProcessSimNonId(AliAOD* /*aodrec*/, AliAOD* aodsim);
101 Int_t ProcessRecNonId(AliAOD* aodrec, AliAOD* /*aodsim*/);
e92ecbdf 102
103
104 // OLD legacy schema
105
5994509d 106 void ProcessTracks();
107 void ProcessParticles();
108 void ProcessTracksAndParticles();
1b446896 109
5994509d 110 void ProcessTracksAndParticlesNonIdentAnal();
111 void ProcessParticlesNonIdentAnal();
112 void ProcessTracksNonIdentAnal();
81b7b887 113
5994509d 114 Bool_t RunCoherencyCheck();
115
116 void FilterOut(AliAOD* outpart1, AliAOD* outpart2, AliAOD* inpart,
117 AliAOD* outtrack1, AliAOD* outtrack2, AliAOD* intrack)const;
118 void FilterOut(AliAOD* out1, AliAOD* out2, AliAOD* in)const;
119 void DeleteFunctions();
120
e92ecbdf 121
78d7c6d3 122 AliReader* fReader;//! Pointer to reader
1b446896 123
81b7b887 124 UInt_t fNTrackFunctions; //! Number of Tracks functions
125 UInt_t fNParticleFunctions; //! Number of particles functions
126 UInt_t fNParticleAndTrackFunctions; //! Number of resolution functions
127
128 UInt_t fNTrackMonitorFunctions; //! Number of Track Monitor functions
129 UInt_t fNParticleMonitorFunctions; //! Number of Particles Monitor functions
130 UInt_t fNParticleAndTrackMonitorFunctions; //! Number of Resolution Monitor functions
131
27b3fe5d 132 AliHBTOnePairFctn** fTrackFunctions; //!array of pointers to functions that analyze rekonstructed tracks
133 AliHBTOnePairFctn** fParticleFunctions; //!array of pointers to functions that analyze generated particles
dc2c3f36 134 AliHBTTwoPairFctn** fParticleAndTrackFunctions; //!array of pointers to functions that analyze both
1b446896 135 //reconstructed tracks and generated particles
136 //i.e. - resolution analyzers
81b7b887 137 AliHBTMonOneParticleFctn** fParticleMonitorFunctions; //! array of pointers to monitoring functions
138 AliHBTMonOneParticleFctn** fTrackMonitorFunctions; //! which are used for single particle analysis,
139 AliHBTMonTwoParticleFctn** fParticleAndTrackMonitorFunctions; //! cut monitoring, etc.
5c58441a 140
5994509d 141 AliEventCut* fBkgEventCut;// We can narrow class of events used in
142
143 AliEventBuffer* fPartBuffer;//Sim Particles event buffer
144 AliEventBuffer* fTrackBuffer;//Rec Tracks event buffer
5c58441a 145
1b446896 146 /**********************************************/
5994509d 147 /* Control parameters */
81b7b887 148 /**********************************************/
1b446896 149
5994509d 150 Int_t fBufferSize; //defines the size of buffer for mixed events; -1==MIX All
151 Int_t fDisplayMixingInfo;//!defines every which particle mixing info is displayed
152 Bool_t fIsOwner;//!defines of all functions are supposed to be deleted while by the way of analysis defaulr false
153
154 EProcessOption fProcessOption;//Option that says waht analysis to do (Rec, Sim or SimAndRec)
155 Bool_t fNoCorrfctns;//Internal flag indicating that no cfs are set by the user (only monitor ones)
156 TString* fOutputFileName;//Fiele name where to dump results, if not specified reults are written to gDirectory
e92ecbdf 157
5994509d 158 Double_t fVertexX;//X position of apparent vertex
159 Double_t fVertexY;//Y position of apparent vertex
160 Double_t fVertexZ;//Z position of apparent vertex
e92ecbdf 161
1b446896 162 private:
66d1d1a4 163
491d1b5d 164 static const UInt_t fgkFctnArraySize;//!
81b7b887 165 static const UInt_t fgkDefaultMixingInfo;//!
166 static const Int_t fgkDefaultBufferSize;//!
bfb09ece 167
1b446896 168 ClassDef(AliHBTAnalysis,0)
169 };
1b446896 170#endif