]> git.uio.no Git - u/mrichter/AliRoot.git/blob - JETAN/AliTkConeJetFinder.h
Using AliLog (F.Carminati)
[u/mrichter/AliRoot.git] / JETAN / AliTkConeJetFinder.h
1 // $Id$
2
3 /*************************************************************************
4  * AliTkConeJetFinder.h                                                     *
5  * Thorsten Kollegger <kollegge@ikf.physik.uni-frankfurt.de>             *
6  * Jet finder based on a cone algorithm with seeds and addition of       *
7  * midpoints, for a description of the algorithm see hep-ex/0005012      *
8  ************************************************************************/
9
10 /*************************************************************************
11  * Some remarks:                                                         *
12  * ---                                                                   *
13  * This is a prototype finder - it's clearly not optimized for speed     *
14  * e.g. one could win much by using TClonesArrays instead of TObjArrays  *
15  * ---                                                                   *
16  * for MC studies, it keeps track of the particle/proto-jet/jet origin   *
17  ************************************************************************/
18
19 // NEXT STEPS: 09/03/02 12:30am
20 // Implement list of found stable protojets
21 // Implement function isProtoJetAlreadyFound()
22 // -> Finishes findProtoJets
23 // Implement merge/split process
24 // Implement seed + midpoint addition
25
26 // includes
27 #include <Riostream.h>
28 #include "TROOT.h"
29 #include "TObject.h"
30 #include "TH2.h"
31 #include "TMath.h"
32 #include "TClonesArray.h"
33 #include "TParticle.h"
34
35
36 //forward declarations
37 class AliTkTower;
38 class AliTkProtoJet;
39
40 class AliTkConeJetFinder : public TObject {
41  public:
42   AliTkConeJetFinder();
43   ~AliTkConeJetFinder();
44
45   void setDefaultSettings();
46   void Init();
47
48   void InitEvent();
49
50   void FillEtHistFromTParticles(TClonesArray *particles);
51   Bool_t isTParticleAccepted(TParticle * particle);
52   void AddEtHist(Float_t eta, Float_t phi, Double_t Et);
53   
54   
55   Int_t run();
56
57   /*
58   Int_t CreateSeedList();
59   Int_t CreateMidPoints();
60   */
61   Int_t FindProtoJets();
62   Int_t CalculateConeCentroid(Float_t *eta, Float_t *phi, Float_t *Et);
63   
64   Int_t FindJets();
65   /*
66   Bool_t isProtoJetConeShared();
67   Int_t FindNeighborCone(Int_t nProtoJet);
68   Int_t SplitProtoJetCone(Int_t nProtoJet1, Int_t nProtoJet2);
69   Int_t MergeProtoJetCone(Int_t nProtoJet1, Int_t nProtoJet2);
70   */
71
72   // eta binning
73   void setEtaNBins(Int_t nbins);
74   Int_t getEtaNBins();
75   void setEtaRange(Float_t min, Float_t max);
76   Float_t getEtaRangeMin();
77   Float_t getEtaRangeMax();
78   void setEtaGrid(Int_t nbins, Float_t min, Float_t max);
79
80   // phi binnig
81   void setPhiNBins(Int_t nbins);
82   Int_t getPhiNBins();
83   void setPhiRange(Float_t min, Float_t max);
84   Float_t getPhiRangeMin();
85   Float_t getPhiRangeMax();
86   void setPhiGrid(Int_t nbins, Float_t min, Float_t max);
87
88   // jet radius
89   void setJetConeRadius(Float_t r);
90   Float_t getJetConeRadius();
91   /*
92   // seed tower threshold
93   void setTowerSeedEt(Float_t minEt);
94   Float_t getTowerSeedEt();
95   */
96
97   // protojetlist
98   TObjArray *getProtoJetList();
99
100  protected:
101
102  private:
103   //----------------------------------------------------------------------
104   // member variables
105   TH2D *hEtHist;
106   TH2D *hTowerEt;
107   Int_t nEtaBins;
108   Float_t nEtaMin;
109   Float_t nEtaMax;
110   Int_t nPhiBins;
111   Float_t nPhiMin;
112   Float_t nPhiMax;
113
114   Float_t jetRadius;
115   TH2D *hEtConeHist;
116   TH2D *hStableProtoJetHist;
117
118   // number of "towers" - calcualted in Init()
119   Int_t nTower;
120   // array of towers
121   AliTkTower *towers;
122   // seed list - array of ints with tower id's
123   Int_t *SeedTower;
124   // will not work this way - this requires more towers than tower due to the additon of midpoint
125
126   // protojet list
127   TObjArray *protojets;
128
129   // private functions
130   Float_t calcPhiDiff(Float_t phi1, Float_t phi2);
131   Bool_t isProtoJetStable(Float_t etaDiff, Float_t phiDiff);
132   Bool_t isProtoJetInTower(Int_t etaBin,Int_t phiBin, 
133                            Float_t eta, Float_t phi);
134   Bool_t isProtoJetInTower(Int_t tower, Float_t eta, Float_t phi);
135
136   Int_t findTower(Float_t eta, Float_t phi);
137
138   ClassDef(AliTkConeJetFinder,1)
139 };
140
141 class AliTkTower : public TObject {
142  public:
143   AliTkTower() : TObject() { etaMin = 0; etaMax = 0; phiMin = 0; phiMax = 0;}
144   ~AliTkTower() { }
145   Int_t uid;
146   Float_t etaMin;
147   Float_t etaMax;
148   Float_t phiMin;
149   Float_t phiMax;
150   Float_t Et;
151  private:
152
153   ClassDef(AliTkTower,1)
154 };
155
156 class AliTkProtoJet : public TObject {
157  public:
158   AliTkProtoJet() : TObject() { }
159   ~AliTkProtoJet() { }
160   Float_t eta;
161   Float_t phi;
162   Float_t Et;
163
164   Bool_t IsEqual(AliTkProtoJet *other);
165  private:
166
167
168   ClassDef(AliTkProtoJet,1)
169 };
170
171 struct SProtoJet;
172 struct SProtoJet {
173   Float_t eta;
174   Float_t phi;
175   Float_t Et;
176   bool operator==(const SProtoJet &s1);
177 };
178