471f69dc |
1 | #ifndef ALIEMCALJETFINDER_H |
2 | #define ALIEMCALJETFINDER_H |
3 | |
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
5 | * See cxx source for full Copyright notice */ |
6 | |
7 | /* $Id$ */ |
8 | //*-- Author: |
9 | //*-- Andreas Morsch (CERN) |
10 | |
11 | #include <TTask.h> |
12 | #include "AliEMCALJet.h" |
13 | |
14 | class TClonesArray; |
d594b22e |
15 | class AliEMCALHadronCorrection; |
16 | |
471f69dc |
17 | class TH2F; |
c44ecd4c |
18 | class TH1F; |
19 | class TCanvas; |
471f69dc |
20 | |
21 | class AliEMCALJetFinder : public TTask { |
22 | public: |
3bc109a9 |
23 | AliEMCALJetFinder(); |
24 | AliEMCALJetFinder(const char* name, const char *title); |
25 | virtual ~AliEMCALJetFinder(); |
08a3fb06 |
26 | virtual void Init(); |
a942c029 |
27 | virtual void Find(Int_t ncell, Int_t ncell_tot, Float_t etc[30000], |
3bc109a9 |
28 | Float_t etac[30000], Float_t phic[30000], |
29 | Float_t min_move, Float_t max_move, Int_t mode, |
30 | Float_t prec_bg, Int_t ierror); |
a942c029 |
31 | virtual void Find(); |
32 | virtual void FindTracksInJetCone(); |
33 | virtual void Test(); |
d594b22e |
34 | virtual void BuildTrackFlagTable(); |
35 | virtual Int_t SetTrackFlag(Float_t radius, Int_t pdgCode, Double_t charge); |
3bc109a9 |
36 | // Geometry |
37 | virtual void SetCellSize(Float_t eta, Float_t phi); |
38 | // Parameters |
d594b22e |
39 | virtual void SetDebug(Int_t flag = 0) {fDebug = flag;} |
3bc109a9 |
40 | virtual void SetConeRadius(Float_t par); |
41 | virtual void SetEtSeed(Float_t par); |
42 | virtual void SetMinJetEt(Float_t par); |
43 | virtual void SetMinCellEt(Float_t par); |
d594b22e |
44 | virtual void SetPtCut(Float_t par = 1.); |
45 | virtual void SetMomentumSmearing(Bool_t flag = kFALSE) {fSmear = flag;} |
46 | virtual void SetEfficiencySim(Bool_t flag = kFALSE) {fEffic = flag;} |
47 | virtual void SetSamplingFraction(Float_t par = 12.9) {fSamplingF = par;} |
d53b7b0b |
48 | virtual void SetIncludeK0andN(Bool_t flag = kFALSE) {fK0N = flag;} |
d594b22e |
49 | // Correction of hadronic energy |
50 | virtual void SetHadronCorrector(AliEMCALHadronCorrection* corr) |
51 | {fHadronCorrector = corr;} |
52 | virtual void SetHadronCorrection(Int_t flag = 1) {fHCorrection = flag;} |
b7a73953 |
53 | // PAI |
54 | void SetWriteKey(Bool_t flag = kFALSE) {fWrite = flag;} |
55 | void SetMode(Int_t mode = 0) {fMode = mode;} |
56 | void SetMinMove(Float_t minMove = 0.05) {fMinMove = minMove;} |
57 | void SetMaxMove(Float_t maxMove = 0.15) {fMaxMove = maxMove;} |
58 | void SetPrecBg (Float_t precBg = 0.035) {fPrecBg = precBg;} |
59 | void SetParametersForBgSubtraction |
60 | (Int_t mode=0, Float_t minMove=0.05, Float_t maxMove=0.15, Float_t precBg=0.035); |
61 | // virtual void Print(Option_t* option="") const; // *MENU* |
62 | |
63 | Bool_t GetWriteKey() {return fWrite;} |
64 | AliEMCALJet* GetJetT() {return fJetT[0];} |
c44ecd4c |
65 | virtual void DrawHistsForTuning(Int_t mode=0); // *MENU* |
66 | virtual void PrintParameters(Int_t mode=0); // *MENU* |
67 | virtual const Char_t* GetFileNameForParameters(Char_t* dir="RES/"); |
b7a73953 |
68 | |
a942c029 |
69 | // Access to Results |
3bc109a9 |
70 | virtual Int_t Njets(); |
71 | virtual Float_t JetEnergy(Int_t); |
72 | virtual Float_t JetPhiL(Int_t); |
73 | virtual Float_t JetPhiW(Int_t); |
74 | virtual Float_t JetEtaL(Int_t); |
75 | virtual Float_t JetEtaW(Int_t); |
76 | virtual TH2F* GetLego() {return fLego;} |
c44ecd4c |
77 | TH2F* GetLegoEMCAL() {return fhLegoEMCAL;} |
78 | TH2F* GethEff() {return fhEff;} |
79 | TH1F* GetCellEt() {return fhCellEt;} |
80 | TH1F* GetCellEMCALEt() {return fhCellEMCALEt;} |
81 | TH1F* GetTrackPt() {return fhTrackPt;} |
82 | TH1F* GetTrackPtBcut() {return fhTrackPtBcut;} |
83 | void DrawLego(Char_t *opt="lego"); // *MENU* |
84 | void DrawLegoEMCAL(Char_t *opt="lego"); // *MENU* |
85 | void DrawLegos(); // *MENU* |
3bc109a9 |
86 | // I/O |
08a3fb06 |
87 | virtual void SetOutputFileName(char* name) {fOutFileName = name;} |
3bc109a9 |
88 | virtual void FillFromHits(Int_t flag = 0); |
d594b22e |
89 | virtual void FillFromHitFlaggedTracks(Int_t flag = 0); |
90 | virtual void FillFromDigits(Int_t flag = 0); |
3bc109a9 |
91 | virtual void FillFromTracks(Int_t flag = 0, Int_t ich = 0); |
c44ecd4c |
92 | virtual void FillFromParticles(); |
b7a73953 |
93 | virtual void FillFromPartons(); |
94 | |
a942c029 |
95 | virtual void SaveBackgroundEvent(); |
96 | virtual void InitFromBackground(); |
3bc109a9 |
97 | virtual void AddJet(const AliEMCALJet& jet); |
98 | virtual void WriteJets(); |
99 | virtual void ResetJets(); |
100 | virtual TClonesArray* Jets() {return fJets;} |
471f69dc |
101 | private: |
3bc109a9 |
102 | virtual void BookLego(); |
103 | virtual void DumpLego(); |
104 | virtual void ResetMap(); |
26dadf3a |
105 | virtual Float_t PropagatePhi(Float_t pt, Float_t charge, Bool_t& curls); |
c44ecd4c |
106 | virtual void RearrangeParticlesMemory(Int_t npart); |
471f69dc |
107 | protected: |
b7a73953 |
108 | Bool_t fWrite; // Key for writing |
d594b22e |
109 | TClonesArray* fJets; //! List of Jets |
110 | TH2F* fLego; //! Lego Histo |
c44ecd4c |
111 | TH2F* fLegoB; //! Lego Histo Backg |
112 | TH2F* fhLegoTracks; //! Lego for Tracks |
113 | TH2F* fhLegoEMCAL; //! Lego for EMCAL itself |
114 | TH2F* fhLegoHadrCorr; //! Lego for hadron correction |
115 | TH2F* fhEff; //! Hist. for controling eff. |
116 | TH1F* fhCellEt; //! Et distr. for cells from fLego |
117 | TH1F* fhCellEMCALEt; //! Et distr. for cells from fLegoEMCAL |
118 | TH1F* fhTrackPt; //! Pt distr. for charge particles |
119 | TH1F* fhTrackPtBcut; //! Pt distr. for charge particles + cut due to magnetic field |
120 | TH1F* fh;// ?? |
121 | TCanvas* fC1; //! first canvas for drawing |
d594b22e |
122 | AliEMCALJet* fJetT[10]; //! Jet temporary storage |
123 | AliEMCALHadronCorrection* fHadronCorrector; //! Pointer to hadronic correction |
124 | Int_t fHCorrection; // Hadron correction flag |
125 | Int_t fDebug; //! Debug flag |
a942c029 |
126 | Int_t fBackground; //! Background flag |
d594b22e |
127 | Float_t fConeRadius; // Cone radius |
128 | Float_t fPtCut; // Pt cut on charged tracks |
129 | Float_t fEtSeed; // Min. Et for seed |
130 | Float_t fMinJetEt; // Min Et of jet |
131 | Float_t fMinCellEt; // Min Et in one cell |
a942c029 |
132 | Float_t fSamplingF; // Sampling Fraction |
d594b22e |
133 | Bool_t fSmear; // Flag for momentum smearing |
134 | Bool_t fEffic; // Flag for efficiency simulation |
d53b7b0b |
135 | Bool_t fK0N; // Flag for efficiency simulation |
d594b22e |
136 | Int_t fNjets; //! Number of Jets |
137 | Float_t fDeta; //! eta cell size |
138 | Float_t fDphi; //! phi cell size |
139 | Int_t fNcell; //! number of cells |
140 | Int_t fNtot; //! total number of cells |
141 | Int_t fNbinEta; //! number of cells in eta |
142 | Int_t fNbinPhi; //! number of cells in phi |
be9787fe |
143 | Float_t fEtaMin; //! minimum eta |
144 | Float_t fEtaMax; //! maximum eta |
145 | Float_t fPhiMin; //! minimun phi |
146 | Float_t fPhiMax; //! maximum phi |
d594b22e |
147 | Float_t fEtCell[30000]; //! Cell Energy |
148 | Float_t fEtaCell[30000]; //! Cell eta |
149 | Float_t fPhiCell[30000]; //! Cell phi |
150 | Int_t* fTrackList; //! List of selected tracks |
a942c029 |
151 | Int_t* fTrackListB; //! List of selected tracks in Bg |
d594b22e |
152 | Int_t fNt; //! number of tracks |
a942c029 |
153 | Int_t fNtS; //! number of tracks selected |
154 | Float_t* fPtT; //! Pt of tracks |
155 | Float_t* fEtaT; //! Eta of tracks |
156 | Float_t* fPhiT; //! Phi of tracks |
157 | Int_t fNtB; //! number of tracks in Bg |
158 | Float_t* fPtB; //! Pt of tracks in Bg |
159 | Float_t* fEtaB; //! Eta of tracks in Bg |
160 | Float_t* fPhiB; //! Phi of tracks in Bg |
b7a73953 |
161 | |
162 | // parameter for jet_finder_ua1 |
c44ecd4c |
163 | Int_t fMode; // key for BG subtraction |
b7a73953 |
164 | Float_t fMinMove; // min cone move |
165 | Float_t fMaxMove; // max cone move |
b7a73953 |
166 | Float_t fPrecBg; // max value of change for BG (in %) |
167 | Int_t fError; // error variables |
168 | |
08a3fb06 |
169 | char* fOutFileName; //! Output file name |
170 | TFile* fOutFile; //! Output file |
171 | TFile* fInFile; //! Output file |
172 | Int_t fEvent; //! Processed event |
b7a73953 |
173 | |
3bc109a9 |
174 | ClassDef(AliEMCALJetFinder,2) // JetFinder for EMCAL |
175 | } |
176 | ; |
471f69dc |
177 | #endif // ALIEMCALJetFinder_H |
178 | |
3bc109a9 |
179 | |
a942c029 |
180 | |
181 | |
182 | |
183 | |