Possibility of setting on/off cluster unfolding in SSD (E. Fragiacomo)
[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;
27
28class AliESDCaloCluster;
29class AliEMCALRecPoint;
0fc11500 30class AliRunLoader;
315d1c64 31
32class AliEMCALHistoUtilities: public TNamed {
0fc11500 33 public: AliEMCALHistoUtilities(const char *name="emcalUtilitiesRoutines",
d434833b 34 const char *tit="EMCAL utility routines");
315d1c64 35 AliEMCALHistoUtilities(const AliEMCALHistoUtilities &) : TNamed("", ""){
36 Fatal("cpy ctor", "not implemented") ; }
37 virtual ~AliEMCALHistoUtilities();
38
315d1c64 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.);
4800667c 43 static int SaveListOfHists(TList *mylist=0, const char* name="test", Bool_t kSingleKey=kFALSE,
315d1c64 44 const char* opt="RECREATE");
c2d4c7af 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);
0fc11500 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="");
af303720 57 // TChain
58 static void InitChain(TChain *chain=0, const char* nameListOfFiles=0, Int_t nFileMax=0);
0fc11500 59 static AliRunLoader* InitKinematics(const Int_t nev=0, const char* galiceName="galice.root");
60 //
61 static Double_t GetMomentum(const char* nameListOfFiles);
d434833b 62 static int ParseString(const TString &topt, TObjArray &Opt);
af303720 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);
0fc11500 77 // Calibration stuff
b217491f 78 static Double_t GetCorrectionCoefficientForGamma1(const Double_t eRec);
79 static Double_t GetCorrectedEnergyForGamma1(const Double_t eRec);
0fc11500 80 static TF1* GetResolutionFunction(const char *opt, TString &latexName);
315d1c64 81
82 AliEMCALHistoUtilities & operator = (const AliEMCALHistoUtilities &) {
83 Fatal("operator =", "not implemented") ; return *this ; }
84
d434833b 85 ClassDef(AliEMCALHistoUtilities,1) // EMCAL utility routines
315d1c64 86};
87
0fc11500 88#endif // ALIEMCALHISTOUTILITIES_H