]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALJetFinder.h
445b7ecace64073c70b27dcc51e12075117e5a56
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALJetFinder.h
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;
15 class AliEMCALHadronCorrection;
16
17 class TH2F;
18
19 class AliEMCALJetFinder : public TTask {
20  public:
21     AliEMCALJetFinder();
22     AliEMCALJetFinder(const char* name, const char *title);
23     virtual ~AliEMCALJetFinder();
24     virtual void  Init();
25     virtual void  Find(Int_t ncell, Int_t ncell_tot, Float_t etc[30000], 
26                       Float_t etac[30000], Float_t phic[30000],
27                       Float_t min_move, Float_t max_move, Int_t mode,
28                       Float_t prec_bg, Int_t ierror);
29     virtual void  Find();
30     virtual void  FindTracksInJetCone();
31     virtual void  Test();
32     virtual void  BuildTrackFlagTable();
33     virtual Int_t SetTrackFlag(Float_t radius, Int_t pdgCode, Double_t charge);
34     // Geometry
35     virtual void SetCellSize(Float_t eta, Float_t phi);
36     // Parameters
37     virtual void SetDebug(Int_t flag = 0) {fDebug = flag;}
38     virtual void SetConeRadius(Float_t par);
39     virtual void SetEtSeed(Float_t par);
40     virtual void SetMinJetEt(Float_t par);
41     virtual void SetMinCellEt(Float_t par);
42     virtual void SetPtCut(Float_t par = 1.);
43     virtual void SetMomentumSmearing(Bool_t flag = kFALSE) {fSmear = flag;}
44     virtual void SetEfficiencySim(Bool_t flag = kFALSE)    {fEffic = flag;}
45     virtual void SetSamplingFraction(Float_t par = 12.9) {fSamplingF = par;}
46     virtual void SetIncludeK0andN(Bool_t flag = kFALSE) {fK0N = flag;}
47     // Correction of hadronic energy
48     virtual void SetHadronCorrector(AliEMCALHadronCorrection* corr)
49         {fHadronCorrector = corr;}
50     virtual void SetHadronCorrection(Int_t flag = 1) {fHCorrection = flag;}
51     // PAI
52     void SetWriteKey(Bool_t flag = kFALSE) {fWrite = flag;}
53     void SetMode(Int_t mode = 0) {fMode = mode;}
54     void SetMinMove(Float_t minMove = 0.05) {fMinMove = minMove;}
55     void SetMaxMove(Float_t maxMove = 0.15) {fMaxMove = maxMove;}
56     void SetPrecBg (Float_t precBg = 0.035) {fPrecBg = precBg;}
57     void SetParametersForBgSubtraction
58     (Int_t mode=0, Float_t minMove=0.05, Float_t maxMove=0.15, Float_t precBg=0.035);
59     //    virtual void Print(Option_t* option="") const;    // *MENU*
60
61     Bool_t GetWriteKey() {return fWrite;}
62     AliEMCALJet* GetJetT() {return fJetT[0];}
63
64     // Access to Results
65     virtual Int_t   Njets();
66     virtual Float_t JetEnergy(Int_t);
67     virtual Float_t JetPhiL(Int_t);
68     virtual Float_t JetPhiW(Int_t);
69     virtual Float_t JetEtaL(Int_t);  
70     virtual Float_t JetEtaW(Int_t);
71     virtual TH2F* GetLego() {return fLego;}
72     // I/O
73     virtual void SetOutputFileName(char* name) {fOutFileName = name;}
74     virtual void FillFromHits(Int_t flag = 0);
75     virtual void FillFromHitFlaggedTracks(Int_t flag = 0);
76     virtual void FillFromDigits(Int_t flag = 0);
77     virtual void FillFromTracks(Int_t flag = 0, Int_t ich = 0);
78     virtual void FillFromPartons();
79
80     virtual void SaveBackgroundEvent();
81     virtual void InitFromBackground();
82     virtual void AddJet(const AliEMCALJet& jet);
83     virtual void WriteJets();
84     virtual void ResetJets();
85     virtual TClonesArray* Jets() {return fJets;}
86  private:
87     virtual void BookLego();
88     virtual void DumpLego();
89     virtual void ResetMap();
90     virtual Float_t PropagatePhi(Float_t pt, Float_t charge, Bool_t& curls);
91  protected:
92     Bool_t                         fWrite;           // Key for writing
93     TClonesArray*                  fJets;            //! List of Jets
94     TH2F*                          fLego;            //! Lego Histo
95     TH2F*                          fLegoB;           //! Lego Histo Backg    
96     AliEMCALJet*                   fJetT[10];        //! Jet temporary storage
97     AliEMCALHadronCorrection*      fHadronCorrector; //! Pointer to hadronic correction
98     Int_t                          fHCorrection;     //  Hadron correction flag
99     Int_t                          fDebug;           //! Debug flag
100     Int_t                          fBackground;      //! Background flag
101     Float_t                        fConeRadius;      //  Cone radius
102     Float_t                        fPtCut;           //  Pt cut on charged tracks
103     Float_t                        fEtSeed;          //  Min. Et for seed
104     Float_t                        fMinJetEt;        //  Min Et of jet
105     Float_t                        fMinCellEt;       //  Min Et in one cell
106     Float_t                        fSamplingF;       //  Sampling Fraction
107     Bool_t                         fSmear;           //  Flag for momentum smearing
108     Bool_t                         fEffic;           //  Flag for efficiency simulation
109     Bool_t                         fK0N;             //  Flag for efficiency simulation
110     Int_t                          fNjets;           //! Number of Jets
111     Float_t                        fDeta;            //! eta cell size 
112     Float_t                        fDphi;            //! phi cell size
113     Int_t                          fNcell;           //! number of cells
114     Int_t                          fNtot;            //! total number of cells
115     Int_t                          fNbinEta;         //! number of cells in eta
116     Int_t                          fNbinPhi;         //! number of cells in phi
117     Float_t                        fEtaMin;          //! minimum eta  
118     Float_t                        fEtaMax;          //! maximum eta
119     Float_t                        fPhiMin;          //! minimun phi
120     Float_t                        fPhiMax;          //! maximum phi
121     Float_t                        fEtCell[30000];   //! Cell Energy
122     Float_t                        fEtaCell[30000];  //! Cell eta
123     Float_t                        fPhiCell[30000];  //! Cell phi
124     Int_t*                         fTrackList;       //! List of selected tracks
125     Int_t*                         fTrackListB;      //! List of selected tracks in Bg
126     Int_t                          fNt;              //! number of tracks
127     Int_t                          fNtS;             //! number of tracks selected
128     Float_t*                       fPtT;             //! Pt   of tracks 
129     Float_t*                       fEtaT;            //! Eta  of tracks
130     Float_t*                       fPhiT;            //! Phi  of tracks
131     Int_t                          fNtB;             //! number of tracks in Bg
132     Float_t*                       fPtB;             //! Pt   of tracks in Bg
133     Float_t*                       fEtaB;            //! Eta  of tracks in Bg
134     Float_t*                       fPhiB;            //! Phi  of tracks in Bg
135
136     // parameter for jet_finder_ua1
137     Float_t                        fMinMove;         // min cone move 
138     Float_t                        fMaxMove;         // max cone move
139     Int_t                          fMode;            // key for BG subtraction
140     Float_t                        fPrecBg;          // max value of change for BG (in %)
141     Int_t                          fError;           // error variables 
142
143     char*                          fOutFileName;     //! Output file name
144     TFile*                         fOutFile;         //! Output file
145     TFile*                         fInFile;          //! Output file
146     Int_t                          fEvent;           //! Processed event
147
148     ClassDef(AliEMCALJetFinder,2)        // JetFinder for EMCAL
149 }
150 ;
151 #endif // ALIEMCALJetFinder_H
152
153
154
155
156
157