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 */
8 //_________________________________________________________________________
9 // This is a set of histogram
10 // utilities for the EMCAL
11 // to make some common
14 //*-- Authors: J.L. Klay (LLNL) & Aleksei Pavlinov (WSU)
29 class AliESDCaloCluster;
30 class AliEMCALRecPoint;
33 class AliEMCALHistoUtilities: public TNamed {
34 public: AliEMCALHistoUtilities(const char *name="emcalUtilitiesRoutines",
35 const char *tit="EMCAL utility routines");
36 AliEMCALHistoUtilities(const AliEMCALHistoUtilities &) : TNamed("", ""){
37 Fatal("cpy ctor", "not implemented") ; }
38 virtual ~AliEMCALHistoUtilities();
41 static TList *MoveHistsToList(const char* name="ListOfHists", Bool_t putToBrowser=kTRUE);
42 static void FillH1(TList *l=0, Int_t ind=0, Double_t x=-99999., Double_t w=1., Double_t error=0.);
43 static void FillH2(TList *l=0, Int_t ind=0, Double_t x=-99999., Double_t y=-99999., Double_t w=1.);
44 static int SaveListOfHists(TList *mylist=0, const char* name="test", Bool_t kSingleKey=kFALSE,
45 const char* opt="RECREATE");
46 static void AddToNameAndTitle(TH1 *h=0, const char *name=0, const char *title=0);
47 static void AddToNameAndTitleToList(TList *l=0, const char *name=0, const char *title=0);
48 static void ResetListOfHists(TList *l);
50 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);
51 static TGraph *DrawGraph(Int_t n=4, Double_t *x=0, Double_t *y=0, Int_t markerColor=4,
52 Int_t markerStyle=4, const char* opt="", const char* tit="", const char* xTit=" jet E_{t} ",
53 const char* yTit="", Int_t ifun=0, const char *optFit="W+", const char *fun="");
54 static TGraphErrors *DrawGraphErrors(const Int_t n=4,Double_t *x=0,Double_t *y=0,Double_t *ex=0,
55 Double_t *ey=0, Int_t markerColor=4,Int_t markerStyle=4, const char* opt="",
56 const char* tit="", const char* xTit=" jet E_{t} ",
57 const char* yTit="", Int_t ifun=0, const char *optFit="W+", const char *fun="");
59 static void InitChain(TChain *chain=0, const char* nameListOfFiles=0, Int_t nFileMax=0);
60 static AliRunLoader* InitKinematics(const Int_t nev=0, const char* galiceName="galice.root");
61 static AliRunLoader* GetRunLoader(const Int_t nev, const Char_t* galiceName,
62 const Char_t* eventFolderName, AliRunLoader* rlOld);
64 static Double_t GetMomentum(const char* nameListOfFiles);
65 static int ParseString(const TString &topt, TObjArray &Opt);
67 static Bool_t GetLorentzVectorFromESDCluster(TLorentzVector &v, const AliESDCaloCluster *cl);
68 static Bool_t GetLorentzVectorFromRecPoint(TLorentzVector &v, const AliEMCALRecPoint *rp);
70 static void DrawHist(TH1* hid=0,int lineWidth=1,int lineColor=1,const char* opt="",int lineStyle=1);
72 static TF1* Gausi(const char *addName, double xmi, double xma, double N, double mean, double sig,
74 static TF1* Gausi(const char *addName, double xmi, double xma, TH1 *h);
76 static TF1* GausiPol2(const char *addName, double xmi, double xma, TF1 *g, TF1* bg);
78 static Double_t Gi(Double_t *x, Double_t *par);
79 static Double_t GiPol2(Double_t *x, Double_t *par);
81 static Double_t GetCorrectionCoefficientForGamma1(const Double_t eRec);
82 static Double_t GetCorrectedEnergyForGamma1(const Double_t eRec);
83 static TF1* GetResolutionFunction(const char *opt, TString &latexName);
88 static TList* GetTriggersListOfHists(const Int_t scale=0, const Int_t nTrig=5, const Bool_t toBrowser=kFALSE);
89 static void FillTriggersListOfHists(TList *l=0, TArrayF *triggerPosition=0, TArrayF *triggerAmplitudes=0);
91 static TList* GetJetsListOfHists(Int_t njet=2, Bool_t toBrowser=kFALSE);
92 static void FillJetKineListOfHists(TList *l, AliRunLoader* rl, TLorentzVector &goodJet);
94 AliEMCALHistoUtilities & operator = (const AliEMCALHistoUtilities &) {
95 Fatal("operator =", "not implemented") ; return *this ; }
97 ClassDef(AliEMCALHistoUtilities,1) // EMCAL utility routines
100 #endif // ALIEMCALHISTOUTILITIES_H