]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALIEMCALHISTOUTILITIES_H | |
2 | #define ALIEMCALHISTOUTILITIES_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 | // This is a set of histogram | |
10 | // utilities for the EMCAL | |
11 | // to make some common | |
12 | // functions easier | |
13 | // | |
14 | //*-- Authors: J.L. Klay (LLNL) & Aleksei Pavlinov (WSU) | |
15 | ||
16 | #include <TNamed.h> | |
17 | ||
18 | class TList; | |
19 | class TString; | |
20 | class TH1; | |
21 | class TGraph; | |
22 | class TGraphErrors; | |
23 | class TF1; | |
24 | class TLatex; | |
25 | class TChain; | |
26 | class TLorentzVector; | |
27 | ||
28 | class AliESDCaloCluster; | |
29 | class AliEMCALRecPoint; | |
30 | class AliRunLoader; | |
31 | ||
32 | class AliEMCALHistoUtilities: public TNamed { | |
33 | public: AliEMCALHistoUtilities(const char *name="emcalUtilitiesRoutines", | |
34 | const char *tit="EMCAL utility routines"); | |
35 | AliEMCALHistoUtilities(const AliEMCALHistoUtilities &) : TNamed("", ""){ | |
36 | Fatal("cpy ctor", "not implemented") ; } | |
37 | virtual ~AliEMCALHistoUtilities(); | |
38 | ||
39 | // service routine | |
40 | static TList *MoveHistsToList(const char* name="ListOfHists", Bool_t putToBrowser=kTRUE); | |
41 | static void FillH1(TList *l=0, Int_t ind=0, Double_t x=-99999., Double_t w=1.); | |
42 | static void FillH2(TList *l=0, Int_t ind=0, Double_t x=-99999., Double_t y=-99999., Double_t w=1.); | |
43 | static int SaveListOfHists(TList *mylist=0, const char* name="test", Bool_t kSingleKey=kFALSE, | |
44 | const char* opt="RECREATE"); | |
45 | static void AddToNameAndTitle(TH1 *h=0, const char *name=0, const char *title=0); | |
46 | static void AddToNameAndTitleToList(TList *l=0, const char *name=0, const char *title=0); | |
47 | static void ResetListOfHists(TList *l); | |
48 | ||
49 | static TLatex *Lat(const char *text="", Float_t x=0.0,Float_t y=0.0, Int_t align=12, Float_t tsize=0.05, short tcolor = 1); | |
50 | static TGraph *DrawGraph(Int_t n=4, Double_t *x=0, Double_t *y=0, Int_t markerColor=4, | |
51 | Int_t markerStyle=4, const char* opt="", const char* tit="", const char* xTit=" jet E_{t} ", | |
52 | const char* yTit="", Int_t ifun=0, const char *optFit="W+", const char *fun=""); | |
53 | static TGraphErrors *DrawGraphErrors(const Int_t n=4,Double_t *x=0,Double_t *y=0,Double_t *ex=0, | |
54 | Double_t *ey=0, Int_t markerColor=4,Int_t markerStyle=4, const char* opt="", | |
55 | const char* tit="", const char* xTit=" jet E_{t} ", | |
56 | char* yTit="", Int_t ifun=0, const char *optFit="W+", const char *fun=""); | |
57 | // TChain | |
58 | static void InitChain(TChain *chain=0, const char* nameListOfFiles=0, Int_t nFileMax=0); | |
59 | static AliRunLoader* InitKinematics(const Int_t nev=0, const char* galiceName="galice.root"); | |
60 | // | |
61 | static Double_t GetMomentum(const char* nameListOfFiles); | |
62 | static int ParseString(const TString &topt, TObjArray &Opt); | |
63 | // Analysis utilites | |
64 | static Bool_t GetLorentzVectorFromESDCluster(TLorentzVector &v, const AliESDCaloCluster *cl); | |
65 | static Bool_t GetLorentzVectorFromRecPoint(TLorentzVector &v, const AliEMCALRecPoint *rp); | |
66 | // Drawing | |
67 | static void DrawHist(TH1* hid=0,int lineWidth=1,int lineColor=1,const char* opt="",int lineStyle=1); | |
68 | // Fitting: | |
69 | static TF1* Gausi(const char *addName, double xmi, double xma, double N, double mean, double sig, | |
70 | double width); | |
71 | static TF1* Gausi(const char *addName, double xmi, double xma, TH1 *h); | |
72 | ||
73 | static TF1* GausiPol2(const char *addName, double xmi, double xma, TF1 *g, TF1* bg); | |
74 | // | |
75 | static Double_t Gi(Double_t *x, Double_t *par); | |
76 | static Double_t GiPol2(Double_t *x, Double_t *par); | |
77 | // Calibration stuff | |
78 | static Double_t GetCorrectionCoefficientForGamma1(const Double_t eRec); | |
79 | static Double_t GetCorrectedEnergyForGamma1(const Double_t eRec); | |
80 | static TF1* GetResolutionFunction(const char *opt, TString &latexName); | |
81 | ||
82 | AliEMCALHistoUtilities & operator = (const AliEMCALHistoUtilities &) { | |
83 | Fatal("operator =", "not implemented") ; return *this ; } | |
84 | ||
85 | ClassDef(AliEMCALHistoUtilities,1) // EMCAL utility routines | |
86 | }; | |
87 | ||
88 | #endif // ALIEMCALHISTOUTILITIES_H |