boundaries for grid creation corrected
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALHistoUtilities.h
CommitLineData
0fc11500 1#ifndef ALIEMCALHISTOUTILITIES_H
2#define ALIEMCALHISTOUTILITIES_H
3/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
315d1c64 4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8//_________________________________________________________________________
14ce0a6e 9// This is a set of histogram
10// utilities for the EMCAL
11// to make some common
12// functions easier
315d1c64 13//
14//*-- Authors: J.L. Klay (LLNL) & Aleksei Pavlinov (WSU)
15
16#include <TNamed.h>
af303720 17
315d1c64 18class TList;
0fc11500 19class TString;
c2d4c7af 20class TH1;
0fc11500 21class TGraph;
22class TGraphErrors;
af303720 23class TF1;
24class TLatex;
25class TChain;
26class TLorentzVector;
c0e92bad 27class TArrayF;
af303720 28
29class AliESDCaloCluster;
30class AliEMCALRecPoint;
0fc11500 31class AliRunLoader;
315d1c64 32
33class AliEMCALHistoUtilities: public TNamed {
0fc11500 34 public: AliEMCALHistoUtilities(const char *name="emcalUtilitiesRoutines",
d434833b 35 const char *tit="EMCAL utility routines");
315d1c64 36 AliEMCALHistoUtilities(const AliEMCALHistoUtilities &) : TNamed("", ""){
37 Fatal("cpy ctor", "not implemented") ; }
38 virtual ~AliEMCALHistoUtilities();
39
315d1c64 40 // service routine
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.);
43 static void FillH2(TList *l=0, Int_t ind=0, Double_t x=-99999., Double_t y=-99999., Double_t w=1.);
4800667c 44 static int SaveListOfHists(TList *mylist=0, const char* name="test", Bool_t kSingleKey=kFALSE,
315d1c64 45 const char* opt="RECREATE");
c2d4c7af 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);
0fc11500 48 static void ResetListOfHists(TList *l);
49
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} ",
a6e0ebfe 57 const char* yTit="", Int_t ifun=0, const char *optFit="W+", const char *fun="");
af303720 58 // TChain
59 static void InitChain(TChain *chain=0, const char* nameListOfFiles=0, Int_t nFileMax=0);
0fc11500 60 static AliRunLoader* InitKinematics(const Int_t nev=0, const char* galiceName="galice.root");
c0e92bad 61 static AliRunLoader* GetRunLoader(const Int_t nev, const Char_t* galiceName,
62 const Char_t* eventFolderName, AliRunLoader* rlOld);
0fc11500 63 //
64 static Double_t GetMomentum(const char* nameListOfFiles);
d434833b 65 static int ParseString(const TString &topt, TObjArray &Opt);
af303720 66 // Analysis utilites
67 static Bool_t GetLorentzVectorFromESDCluster(TLorentzVector &v, const AliESDCaloCluster *cl);
68 static Bool_t GetLorentzVectorFromRecPoint(TLorentzVector &v, const AliEMCALRecPoint *rp);
69 // Drawing
70 static void DrawHist(TH1* hid=0,int lineWidth=1,int lineColor=1,const char* opt="",int lineStyle=1);
71 // Fitting:
72 static TF1* Gausi(const char *addName, double xmi, double xma, double N, double mean, double sig,
73 double width);
74 static TF1* Gausi(const char *addName, double xmi, double xma, TH1 *h);
75
76 static TF1* GausiPol2(const char *addName, double xmi, double xma, TF1 *g, TF1* bg);
77 //
78 static Double_t Gi(Double_t *x, Double_t *par);
79 static Double_t GiPol2(Double_t *x, Double_t *par);
0fc11500 80 // Calibration stuff
b217491f 81 static Double_t GetCorrectionCoefficientForGamma1(const Double_t eRec);
82 static Double_t GetCorrectedEnergyForGamma1(const Double_t eRec);
0fc11500 83 static TF1* GetResolutionFunction(const char *opt, TString &latexName);
c0e92bad 84 //
85 // Analysis
86 //
87 // Trigger
f544eec5 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);
c0e92bad 90 // Jet(s) kinematics
91 static TList* GetJetsListOfHists(Int_t njet=2, Bool_t toBrowser=kFALSE);
92 static void FillJetKineListOfHists(TList *l, AliRunLoader* rl, TLorentzVector &goodJet);
315d1c64 93
94 AliEMCALHistoUtilities & operator = (const AliEMCALHistoUtilities &) {
95 Fatal("operator =", "not implemented") ; return *this ; }
96
d434833b 97 ClassDef(AliEMCALHistoUtilities,1) // EMCAL utility routines
315d1c64 98};
99
0fc11500 100#endif // ALIEMCALHISTOUTILITIES_H