Move AliWarning and AliInfo to AliDebug to reduce prints during reconstruction
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALHistoUtilities.h
3/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
315d1c64 4 * See cxx source for full Copyright notice */
6/* $Id$ */
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)
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();
315d1c64 40 // service routine
41 static TList *MoveHistsToList(const char* name="ListOfHists", Bool_t putToBrowser=kTRUE);
5992186a 42 static void FillH1(TList *l=0, Int_t ind=0, Double_t x=-99999., Double_t w=1., Double_t error=0.);
315d1c64 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);
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);
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 ; }
d434833b 97 ClassDef(AliEMCALHistoUtilities,1) // EMCAL utility routines
315d1c64 98};
0fc11500 100#endif // ALIEMCALHISTOUTILITIES_H