]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/Calib/AliEMCALPi0Calibration.h
Bug coreected in PTM gain array indexes
[u/mrichter/AliRoot.git] / EMCAL / Calib / AliEMCALPi0Calibration.h
1 #ifndef ALIEMCALPI0CALIBRATION_H
2 #define ALIEMCALPI0CALIBRATION_H
3 /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice     */
5
6 /* $Id: AliEMCALPi0Calibration.h 21465 2007-10-16 14:38:13Z pavlinov $ */
7  
8 //*--  Authors: Aleksei Pavlinov (WSU)
9 //  Pi0 calibration
10 //  Tuning parameters of coordinate calculations 
11 //  May 2008 - move to AliAnalysisTaskSE
12
13 #include "AliAnalysisTaskSE.h"
14
15 #include <TObjArray.h>
16
17 class AliEMCALGeometry;
18 class AliEMCALFolder;
19 class AliRunLoader;
20 class AliEMCALRecPoint;
21 class AliEMCALCellInfo;
22 class AliEMCALCellIndexes;
23
24 class TList;
25 class TCanvas;
26 class TH1F;
27 class TH2F;
28 class TBrowser;
29 class TChain;
30 class TFolder;
31 class TArrayI;
32
33 class AliEMCALPi0Calibration :  public AliAnalysisTaskSE {
34   public:
35     AliEMCALPi0Calibration();
36     AliEMCALPi0Calibration(const char* name);
37     //AliEMCALPi0Calibration(const AliAnalysisTaskSE& obj);
38     //AliEMCALPi0Calibration& operator=(const AliAnalysisTaskSE& other);
39
40     virtual ~AliEMCALPi0Calibration();
41
42     virtual void UserExec(const Option_t* opt);
43   //
44   void InitStructure(Int_t it);
45   static TList *DefineHistsOfRP(const char *name="RP",  Double_t p=110.0, Int_t keyOpt=0);
46   static TList *DefineHistsOfKineVsRP(const char *name="KineVsRP",  Double_t p=110.0, Int_t keyOpt=0);
47   static TList *DefineHistsForShowerProfile(const char *name="ProfY", Double_t p=1.);
48   static void   FillHistsOfKineVsRP(TList *l, AliRunLoader* RL, TClonesArray &lvM);
49   static void   FillHistsForShowerProfile(TList *l, AliEMCALRecPoint *rp, AliEMCALCellInfo* t);
50   static void   EvalLocalPhiPosition(const Double_t wlog, const AliEMCALRecPoint *rp, const AliEMCALCellInfo* t, Double_t &xcog, Int_t &phiSize, AliEMCALCellIndexes &rMax); 
51   //
52   TList *GetListKineVsRP()      {return fLKineVsRP;}
53   TList *GetListShowerProfile() {return fLShowerProfile;}
54   //  static TList *DefineHistsOfTowers(const char *name="towers");
55   // 
56   void FitEffMassHist(); // *MENU*  
57   void PrintInfo();      // *MENU*
58   //
59   void    SetChain(TChain *chain)  {fChain = chain;}
60   TChain* GetChain()               {return fChain;}
61   void    SetMomentum(Double_t p);
62   Double_t GetMomentum() const {return fPmom;}
63
64   AliEMCALFolder* CreateEmcalFolder(const Int_t it);
65   void SetEmcalFolder(AliEMCALFolder* folder); 
66   void SetEmcalOldFolder(AliEMCALFolder* folder); 
67   AliEMCALFolder* GetEmcalOldFolder(const Int_t nsm);
68   AliEMCALCellInfo* GetCellsInfo() {return fCellsInfo;}
69   //
70   void      SetStringOfRunOpts(const char *st) {fRunOpts = st;}
71   TObjArray GetOptsArray() const {return fArrOpts;}
72   Int_t     GetKeyOptsValue(Int_t key);  // *MENU*
73   void      CheckRunOpts();
74   //
75   virtual void Browse(TBrowser* b);
76   virtual Bool_t  IsFolder() const;
77   //
78   void    Save(Int_t ver=0, const char *optIO="NEW");   // *MENU*
79   static  AliEMCALPi0Calibration* ReadSelector(const char* nf = "/home/pavlinov/ALICE/SHISHKEBAB/RF/CALIB/PROF/PROFILE_0.root");
80   
81
82   //
83   //// Pictures staf - Jun 26, 2007
84   //
85   void ReadAllEmcalFolders();
86   void PictVsIterNumber(const Int_t ind=0, const Int_t nsm=0);
87   // Gamma
88   TH1F* FitHistOfRecPointEnergy(const char *opt="CLONE");
89   static TCanvas *Linearity(TList *l, Int_t ifun=3);
90   static TCanvas *DrawKineVsRP(TList *l);
91   // Profile
92   static TCanvas *DrawMeanVsLog(TH2F *h2);
93   // Geometry staff
94   TCanvas *DrawPhiEtaAnglesDistribution(const char *gn="SHISH_TRD1_CURRENT_2X2"); // *MENU*
95   // Geometry constants 
96   TCanvas *DrawDeffVsEnergy();  // *MENU*
97   TCanvas *DrawDeffVsEnergy2(const char *opt="fit1"); // *MENU*
98   void     ReadParsDeffAndW0(const char *dirName="/data/r22b/ALICE/CALIB/FIT/",
99            double *deff=0, double *edeff=0, double *w0=0, double *ew0=0, const Int_t pri=0);
100   TCanvas *DrawSpaceResolution();
101   // 
102   static AliEMCALFolder* GetEmcalFolder() {return fgEMCAL;}
103   static AliEMCALFolder* GetEmcalOldFolder() {return fgEMCALOld;}
104   static void SetFitParameters(Double_t deff, Double_t w0, Double_t slope) 
105   {
106     fgDistEff = deff; fgW0 = w0; fgSlopePhiShift = slope;
107   }
108   static void GetFitParameters(Double_t &deff, Double_t &w0, Double_t &slope)
109   {
110     deff = fgDistEff; w0 = fgW0; slope = fgSlopePhiShift;
111   } 
112   void ResetAllListOfHists();
113   void ReloadChain(Long64_t entry=0);
114   void GetInitialParsForFit(const Int_t var, Double_t &deff, Double_t &w0, Double_t &phislope, const int phiCase=0);
115
116  protected:
117   static AliEMCALFolder*  fgEMCAL;      // current  EMCAL object
118   static AliEMCALFolder*  fgEMCALOld;   // previous EMCAL object
119   //
120   static Double_t fgDistEff;  // effective depth of electromagnetic shower
121   static Double_t fgW0;       // parameter of log. methods 
122   static Double_t fgSlopePhiShift; // phi shift of cluster = fSlopePhiShift * phi
123
124   Double_t fPmom; // positive if defined
125   //
126   TChain* fChain; //! chain if ESD files
127   TList* fLofHistsPC; // list of histograms of pseudo clusters 
128   TList* fLofHistsRP; // list of histograms of rec.points 
129   TList* fLKineVsRP;  // list of histograms kinematics vs rec.points 
130   TList* fLShowerProfile;  // list of histograms for shower profile business
131   //
132   AliEMCALCellInfo *fCellsInfo; // pointer to current cell
133   TFolder*         fEmcalPool;  // folder of EMCAL objects
134   //
135   // Options - Jul 10, 2007
136   //
137   TString   fRunOpts;        // String of running options
138   TObjArray fArrOpts;        // Array of options 
139   // Options keys
140   TArrayI  *fKeyOpts;        // optins key; 0-disable, 1-enable
141   // Static parameters
142  private:
143   AliEMCALPi0Calibration(const AliEMCALPi0Calibration&);
144   AliEMCALPi0Calibration& operator=(const AliEMCALPi0Calibration&);
145   //
146   static AliEMCALGeometry* fgEmcalGeo; //! pointer to EMCAL geometry
147   static Int_t fgNmaxCell;  //! max number of cells
148   static const Char_t **fgAnaOpt; //! aray of options
149   static Int_t fgNanaOpt;   //! number of options
150
151   ClassDef(AliEMCALPi0Calibration, 1);
152 };
153 #endif