]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/jetfinder/AliEMCALJetFinder.h
updates for Effective C++ compiler flags
[u/mrichter/AliRoot.git] / EMCAL / jetfinder / 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 #include <TString.h>
14
15 class TClonesArray;
16 class TH2F;
17 class TH1F;
18 class TCanvas;
19 class TList;
20 class AliEMCALHadronCorrection;
21
22 class AliEMCALJetFinder : public TTask {
23   friend class AliEMCALJetMicroDst; //PH Temporary solution
24  public:
25     AliEMCALJetFinder();
26     AliEMCALJetFinder(const char* name, const char *title);
27     virtual ~AliEMCALJetFinder();
28
29     AliEMCALJetFinder (const AliEMCALJetFinder&);
30     AliEMCALJetFinder & operator = (const AliEMCALJetFinder & ) {
31       Fatal("operator =", "not implemented") ;
32       return *this ;
33     }
34
35     virtual void  Init();
36     virtual void  Find(Int_t ncell, Int_t ncelltot, Float_t etc[30000], 
37                       Float_t etac[30000], Float_t phic[30000],
38                       Float_t minmove, Float_t maxmove, Int_t mode,
39                       Float_t precbg, Int_t ierror);
40     virtual void  Find();
41     virtual void  FindChargedJet();
42     virtual void  FindTracksInJetCone();
43     virtual void  Test();
44     virtual void  BuildTrackFlagTable();
45     virtual Int_t SetTrackFlag(Float_t radius, Int_t pdgCode, Double_t charge);
46     // Geometry
47     virtual void SetCellSize(Float_t eta, Float_t phi);
48     // Parameters
49     virtual void SetDebug(Int_t flag = 0) {fDebug = flag;}
50     virtual void SetConeRadius(Float_t par);
51     virtual void SetEtSeed(Float_t par);
52     virtual void SetMinJetEt(Float_t par);
53     virtual void SetMinCellEt(Float_t par);
54     virtual void SetPtCut(Float_t par = 1.);
55     virtual void SetMomentumSmearing(Bool_t flag = kFALSE) {fSmear = flag;}
56     virtual void SetEfficiencySim(Bool_t flag = kFALSE)    {fEffic = flag;}
57     virtual void SetSamplingFraction(Float_t par) {fSamplingF = par;}
58     virtual void SetEnergyWeightingFlag(Bool_t flag) {fWeightingMethod = flag;}
59     virtual void SetEMCALWeight(Float_t par) {fEMCALWeight = par;}
60     virtual void SetTrackWeight(Float_t par) {fTrackWeight = par;}
61     virtual void SetIncludeK0andN(Bool_t flag = kFALSE) {fK0N = flag;}
62     // Correction of hadronic energy
63     virtual void SetHadronCorrector(AliEMCALHadronCorrection* corr)
64         {fHadronCorrector = corr;}
65     virtual void SetHadronCorrection(Int_t flag = 1) {fHCorrection = flag;}
66     // PAI
67     void SetWriteKey(Bool_t flag = kFALSE) {fWrite = flag;}
68     void SetMode(Int_t mode = 0) {fMode = mode;}
69     void SetMinMove(Float_t minMove = 0.05) {fMinMove = minMove;}
70     void SetMaxMove(Float_t maxMove = 0.15) {fMaxMove = maxMove;}
71     void SetPrecBg (Float_t precBg = 0.035) {fPrecBg = precBg;}
72     void SetParametersForBgSubtraction
73     (Int_t mode=0, Float_t minMove=0.05, Float_t maxMove=0.15, Float_t precBg=0.035);
74     //    virtual void Print(Option_t* option="") const;    // *MENU*
75     void  SetRandomBg(Bool_t flag) {fRandomBg = flag;}
76     Bool_t GetWriteKey() const {return fWrite;}
77   //AliEMCALJet* GetJetT() {return fJetT[0];}
78     AliEMCALJet* GetJetT(Int_t n = 0) {return fJetT[n];}
79     virtual void DrawHistsForTuning(Int_t mode=0);           // *MENU*
80     virtual void PrintParameters(Int_t mode=0);              // *MENU*
81     virtual const Char_t* GetFileNameForParameters(const char* dir="RES/");
82
83     // Access to Results
84     virtual Int_t Njets() const;
85     virtual Float_t JetEnergy (Int_t count) const;
86     virtual Float_t JetPhiL  (Int_t count) const;
87     virtual Float_t JetPhiW  (Int_t count) const ;
88     virtual Float_t JetEtaL (Int_t count) const ;  
89     virtual Float_t JetEtaW (Int_t count) const;
90     TH2F*   GetLego() const {return fLego;}
91     TH2F*   GetLegoB() const {return fLegoB;}
92     TH2F*   GetLegoEMCAL() const {return fhLegoEMCAL;}
93     TH2F*   GetLegoTracks() const {return fhLegoTracks;}
94     TH2F*   GethEff() const {return fhEff;}
95     TH1F*   GetCellEt() const {return fhCellEt;}
96     TH1F*   GetCellEMCALEt() const {return fhCellEMCALEt;}
97     TH1F*   GetTrackPt() const {return fhTrackPt;}
98     TH1F*   GetTrackPtBcut() const {return fhTrackPtBcut;}
99     TList*  GetHistsList() const {return fHistsList;}
100     Int_t   GetNChTpc() const {return fNChTpc;}
101     Bool_t  GetEnergyWeightingFlag() const {return fWeightingMethod ;}
102     Float_t GetEMCALWeight() const {return fEMCALWeight;}
103     Float_t GetTrackWeight() const {return fTrackWeight;}
104     void    DrawLego(const char *opt="lego");         // *MENU*
105     void    DrawLegoEMCAL(const char *opt="lego");    // *MENU*
106     void    DrawLegos();                          // *MENU*
107     void    DrawLegoBackground(const char *opt="lego"); // *MENU*
108     Bool_t  IsThisPartonsOrDiQuark(Int_t pdg);
109     // I/O
110     virtual void SetOutputFileName(const char* name) {fOutFileName = name;}
111     virtual void FillFromHits(Int_t flag = 0);
112     virtual void FillFromHitFlaggedTracks(Int_t flag = 0);
113     virtual void FillFromDigits(Int_t flag = 0);
114     virtual void FillFromTracks(Int_t flag = 0, Int_t ich = 0);
115     virtual void FillFromParticles();
116     virtual void FillFromPartons();
117
118     virtual void SaveBackgroundEvent(const char *name="");
119     virtual void InitFromBackground();
120     virtual void AddJet(const AliEMCALJet& jet);
121     virtual void WriteJets();
122     virtual void ResetJets();
123     virtual TClonesArray* Jets() const {return fJets;}
124     const char* GetNameOfVariant();
125
126     virtual Bool_t  IsFolder() const;
127     virtual void Browse(TBrowser* b);
128
129
130
131     
132  protected:
133     TString fBGFileName;                                // file name for background
134     Float_t                        fEMCALWeight;        // EMCal energy weighting
135     Float_t                        fTrackWeight;        // Track energy weighting
136     Bool_t                         fRandomBg;        //  Flag for Random Background 
137     Bool_t                         fWrite;           // Key for writing
138     Bool_t                         fWeightingMethod; // Key for writing
139     TClonesArray*                  fJets;            //! List of Jets
140     TH2F*                          fLego;            //! Lego Histo
141     TH2F*                          fLegoB;           //! Lego Histo Backg
142     TH2F*                          fhLegoTracks;     //! Lego for Tracks
143     TH2F*                          fhLegoEMCAL;      //! Lego for EMCAL itself
144     TH2F*                          fhLegoHadrCorr;   //! Lego for hadron correction
145     TH2F*                          fhEff;            //! Hist. for controling eff.
146     TH1F*                          fhCellEt;         //! Et distr. for cells from fLego
147     TH1F*                          fhCellEMCALEt;    //! Et distr. for cells from fLegoEMCAL
148     TH1F*                          fhTrackPt;        //! Pt distr. for charge particles
149     TH1F*                          fhTrackPtBcut;    //! Pt distr. for charge particles + cut due to magnetic field
150     TH1F*                          fhChPartMultInTpc;//! Ch. part. multiplicity in TPC acceptance
151     TH1F*                          fhSinTheta;       //! sin(theta)
152     TCanvas*                       fC1;              //! first canvas for drawing
153     TList*                         fHistsList;       //! List of hists - 4-mar-2002
154     AliEMCALJet*                   fJetT[10];        //! Jet temporary storage
155     AliEMCALHadronCorrection*      fHadronCorrector; //! Pointer to hadronic correction
156     Int_t                          fHCorrection;     //  Hadron correction flag
157     Int_t                          fDebug;           //! Debug flag
158     Int_t                          fBackground;      //! Background flag
159     Float_t                        fConeRadius;      //  Cone radius
160     Float_t                        fPtCut;           //  Pt cut on charged tracks
161     Float_t                        fEtSeed;          //  Min. Et for seed
162     Float_t                        fMinJetEt;        //  Min Et of jet
163     Float_t                        fMinCellEt;       //  Min Et in one cell
164     Float_t                        fSamplingF;       //  Sampling Fraction
165     Bool_t                         fSmear;           //  Flag for momentum smearing
166     Bool_t                         fEffic;           //  Flag for efficiency simulation
167     Bool_t                         fK0N;             //  Flag for efficiency simulation
168     Int_t                          fNjets;           //! Number of Jetsp
169     Float_t                        fDeta;            //! eta cell size 
170     Float_t                        fDphi;            //! phi cell size
171     Int_t                          fNcell;           //! number of cells
172     Int_t                          fNtot;            //! total number of cells
173     Int_t                          fNbinEta;         //! number of cells in eta
174     Int_t                          fNbinPhi;         //! number of cells in phi
175     Float_t                        fEtaMin;          //! minimum eta  
176     Float_t                        fEtaMax;          //! maximum eta
177     Float_t                        fPhiMin;          //! minimun phi
178     Float_t                        fPhiMax;          //! maximum phi
179     Float_t                        fEtCell[30000];   //! Cell Energy
180     Float_t                        fEtaCell[30000];  //! Cell eta
181     Float_t                        fPhiCell[30000];  //! Cell phi
182     Int_t                          fNt;              //! number of tracks
183     Int_t                          fNChTpc;          //! number of ch.part in TPC
184
185     Int_t                          fNtS;             //! number of tracks selected
186     Int_t*                         fTrackList;       //! List of selected tracks
187     Float_t*                       fPtT;             //! Pt   of tracks 
188     Float_t*                       fEtaT;            //! Eta  of tracks
189     Float_t*                       fPhiT;            //! Phi  of tracks
190     Int_t*                         fPdgT;            //! PDG code of tracks
191  
192     Int_t                          fNtB;             //! number of tracks in Bg
193     Int_t*                         fTrackListB;      //! List of selected tracks in Bg
194     Float_t*                       fPtB;             //! Pt   of tracks in Bg
195     Float_t*                       fEtaB;            //! Eta  of tracks in Bg
196     Float_t*                       fPhiB;            //! Phi  of tracks in Bg
197     Int_t*                         fPdgB;            //! PDG  of tracks in Bg
198
199     // parameter for jet_finder_ua1
200     Int_t                          fMode;            // key for BG subtraction
201     Float_t                        fMinMove;         // min cone move 
202     Float_t                        fMaxMove;         // max cone move
203     Float_t                        fPrecBg;          // max value of change for BG (in %)
204     Int_t                          fError;           // error variables 
205
206     const char*                    fOutFileName;     //! Output file name
207     TFile*                         fOutFile;         //! Output file
208     TFile*                         fInFile;          //! Output file
209     Int_t                          fEvent;           //! Processed event
210  private:
211     virtual void BookLego();
212     Float_t WeightedJetEnergy(Float_t eta, Float_t phi);
213     Float_t EMCALConeEnergy(Float_t eta, Float_t phi);
214     Float_t TrackConeEnergy(Float_t eta, Float_t phi);
215     virtual void DumpLego();
216     virtual void ResetMap();
217     virtual void RearrangeParticlesMemory(Int_t npart);
218  public:
219     virtual Float_t PropagatePhi(Float_t pt, Float_t charge, Bool_t& curls);
220
221     ClassDef(AliEMCALJetFinder,5)                    // JetFinder for EMCAL
222 }
223 ;
224 #endif // ALIEMCALJetFinder_H