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