]> git.uio.no Git - u/mrichter/AliRoot.git/blob - JETAN/AliTkKtJetFinder.h
Version of the jet analysis module from v4-01-Release
[u/mrichter/AliRoot.git] / JETAN / AliTkKtJetFinder.h
1 // $Id$
2
3 #ifndef ALITKKTJETFINDER_H
4 #define ALITKKTJETFINDER_H
5
6 #include <TObject.h>
7 #include <Riostream.h>
8 #include <list>
9
10 struct TPreCluster;
11 struct TPreCluster {
12   Int_t id;
13   Float_t E;
14   Float_t px;
15   Float_t py;
16   Float_t pz;
17   TPreCluster *next;
18 };
19
20 struct Tdlist;
21 struct Tdlist {
22   Float_t d;
23   Int_t id1;
24   Int_t id2;
25   Tdlist *prev;
26   Tdlist *next;
27   bool operator==(const Tdlist &p1) const {return (d==p1.d);}
28   bool operator<(const Tdlist &p1) const {return (d > p1.d);}
29 };
30
31 struct TJetList;
32 struct TJetList {
33   Float_t E;
34   Float_t px;
35   Float_t py;
36   Float_t pz;
37   TJetList *next;
38 };
39
40 class AliTkKtJetFinder : public TObject {
41  public:
42   AliTkKtJetFinder() : TObject() {status = 0;}
43   ~AliTkKtJetFinder() {}
44   
45   // run functions - these ones should be called by the user...
46   void init();
47   void makeTParticles(TClonesArray *particles);
48   void clear();
49   void finish();
50
51   // main components of the jet finder - normally called by make()
52   // public to allow easier testing/timing analysis in macro
53   void initEvent();
54   void preclusterTParticles(TClonesArray *particles);
55   void findJets();
56
57   // precluster options
58   void setPhiMin(Float_t fPhiMin) {phiMin = fPhiMin;}
59   void setPhiMax(Float_t fPhiMax) {phiMax = fPhiMax;}
60   void setNPhiBins(Int_t nPhiBins) {phiBins = nPhiBins;}
61   void setPhiBins(Int_t nPhiBins, Float_t fPhiMin, Float_t fPhiMax);
62
63   void setThetaMin(Float_t fThetaMin) {thetaMin = fThetaMin;}
64   void setThetaMax(Float_t fThetaMax) {thetaMax = fThetaMax;}
65   void setNThetaBins(Int_t nThetaBins) {thetaBins = nThetaBins;}
66   void setThetaBins(Int_t nThetaBins, Float_t fThetaMin, Float_t fThetaMax);
67   
68   // jet finder options
69   void setD(Float_t fD) {finder_D = fD;}
70   void setDCut(Float_t fDCut) {finder_DCut = fDCut;}
71
72   // some "standard" options
73   void setDefaultOptions();
74
75   // debug options
76   void setDebugLevel(Int_t nDebugLevel);
77   void setDebugFilename(Char_t *sFilename) {debugFilename = sFilename;}
78
79  private:
80   Int_t status;
81
82   // precluster parameters
83   Float_t phiMin;
84   Float_t phiMax;
85   Int_t phiBins;
86
87   Float_t thetaMin;
88   Float_t thetaMax;
89   Int_t thetaBins;
90
91   // jet finder parameters
92   Float_t finder_D;
93   Float_t finder_DCut;
94
95   // debug parameters
96   Int_t debugLevel;
97   Char_t *debugFilename;
98
99   // data variables
100   // list of preclusters with pointer to last precluster
101   Int_t preClusterUID;
102   TPreCluster *firstPreCluster;
103   TPreCluster *lastPreCluster;
104
105   // array of pointers to preclusters
106   // makes access faster
107   TPreCluster **preClusterArray;
108
109   // functions related to preclusters...
110   void addPreCluster(TPreCluster *precluster);
111   void deletePreCluster(Int_t UID);
112   void dumpPreClusters();
113   void dumpPreClusterArray();
114
115   // double linked sorted list of (relativ) transverse momenta 
116   list<Tdlist *> myDList;
117   //priority_queue<Tdlist *> myNewDList;
118   //priority_queue<Tdlist *> myHeap;
119   // priority queues are not known to CINT... :-(
120
121   // functions related to (relativ) transverse momenta list...
122   void addD(Tdlist *newD);
123   void buildNewDList();
124   Float_t calcD(TPreCluster *p1, TPreCluster *p2 = NULL);
125
126   // list of final jets
127   TJetList *firstJet;
128
129   // private member functions
130   Bool_t isTParticleAccepted(TParticle *particle);
131   
132   // debug/output functions
133   void DebugOutput(Char_t *output);
134   void TimingOutput(Char_t *output);
135   void DetailedOutput(Char_t *output);
136   
137   ClassDef(AliTkKtJetFinder,1)
138 };
139 #endif
140