]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALCalibCoefs.h
added pi0 calibration, linearity, shower profile
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALCalibCoefs.h
1 #ifndef ALIEMCALCALIBCOEFS_H
2 #define ALIEMCALCALIBCOEFS_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 //_________________________________________________________________________
9 //  Table of Calibration coefficients  
10 //  Should be extended.
11 //                  
12 //*-- Author: Aleksei Pavlinov (WSU, Detroit, USA) 
13
14 // --- ROOT system ---
15 #include <TNamed.h>
16 #include <TObjArray.h>
17
18 // unit is GeV
19 class calibCoef : public TObject {
20  public:
21   virtual const char* GetName() const {return Form("CC%5.5i",absId);}
22   calibCoef();
23   calibCoef(const Int_t id, const Double_t c, const Double_t ec);
24   virtual ~calibCoef() {};
25
26   Int_t    absId; // absolute id of cell 
27   Double_t cc;    // Calib. coef
28   Double_t eCc;   // Calib. coef. error
29   // 
30   ClassDef(calibCoef,1) // Cell calibration information 
31 };
32
33 class TH1F;
34 class AliEMCALCalibData;
35
36 class AliEMCALCalibCoefs : public TNamed {
37  public:
38   enum EEmcalCalibType {kMC, kEQUALIZATION, kMIP, kPI0}; // type of EMCAL calibrations 
39
40   AliEMCALCalibCoefs(); // default constractor
41   AliEMCALCalibCoefs(const char* name, const Int_t nrow);
42   virtual ~AliEMCALCalibCoefs();
43
44   AliEMCALCalibCoefs & operator = (const AliEMCALCalibCoefs  & /*rvalue*/) {
45     // assignement operator requested by coding convention but not needed
46     Fatal("operator =", "not implemented");
47     return *this;
48   };
49   void        AddAt(calibCoef* r);
50   calibCoef*  GetTable(Int_t i) const;
51   Int_t       GetSize()  const {return fTable->GetSize();}
52   Int_t       GetNRows() const {return fCurrentInd;}
53   void        Purge() {/* nothing */};
54
55   void  SetCalibMethod(Int_t var) {fCalibMethod=var;}
56   Int_t GetCalibMethod() {return fCalibMethod;}
57   calibCoef* GetRow(const int absId);
58   // Get initial Calib Data from DB
59   static AliEMCALCalibCoefs *GetCalibTableFromDb(const char *tn="CCIN", AliEMCALCalibData **calData=0);
60   //  const char* dbLocation="local:///data/r22b/ALICE/PROD/CALIBRATION_May_2007/PI0/PDSF/10GEV/DECALIB/DeCalibDB");
61   static TH1F *GetHistOfCalibTableFromDb(const char *tn="CCIN");
62   //const char* dbLocation="local:///data/r22b/ALICE/PROD/CALIBRATION_May_2007/PI0/PDSF/10GEV/DECALIB/DeCalibDB");
63   // Create DB calib table
64   static AliEMCALCalibData*  GetCalibTableForDb(const AliEMCALCalibCoefs *tab, 
65   const char* dbLocation="local://.", // current directory
66   const char* coment="pi0 calibration, MC, Jun 2007");
67   // Menu
68   void PrintTable();                 // *MENU*
69   void PrintTable(const Int_t i);    // *MENU*
70   void PrintRec(calibCoef *r);
71
72   //
73  protected:
74   TObjArray *fTable;
75   Int_t fCurrentInd;
76   Int_t fCalibMethod;  // method of calibration - EEmcalCalibType
77
78   ClassDef(AliEMCALCalibCoefs,2) // Table of Calibration coefficients  
79 };
80
81 #endif // ALIEMCALCalibCoefs_H