]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALHistoUtilities.h
cast histogram content to int to avoid compilation warning
[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;
7ec8695a 26//class TLorentzVector;
c0e92bad 27class TArrayF;
af303720 28
7ec8695a 29//class AliESDCaloCluster;
0bc916ec 30//class AliEMCALRecPoint;
31//class 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
d974d40f 41 static TList *MoveHistsToList(const char* name="ListOfHists", Bool_t putToBrowser=kTRUE, Bool_t setOwner=kFALSE);
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.);
45dce799 44 static void FillHProf(TList *l=0, Int_t ind=0, Double_t x=-99999., Double_t y=-99999., Double_t w=1.);
36b2d850 45 static void FillHnSparse(TList *l=0, Int_t ind=0, Double_t* x=0, Double_t w=1.);
4800667c 46 static int SaveListOfHists(TList *mylist=0, const char* name="test", Bool_t kSingleKey=kFALSE,
315d1c64 47 const char* opt="RECREATE");
36b2d850 48 static void AddToNameAndTitle(TNamed *h=0, const char *name=0, const char *title=0);
c2d4c7af 49 static void AddToNameAndTitleToList(TList *l=0, const char *name=0, const char *title=0);
0fc11500 50 static void ResetListOfHists(TList *l);
01359dd9 51 static void Titles(TH1 *hid=0, const char *titx="",const char *tity="");
a2aaed49 52 static TList* CreateProjectionsX(TList *l=0, const Int_t ind=2, const Char_t* name="prox");
0fc11500 53
54 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);
55 static TGraph *DrawGraph(Int_t n=4, Double_t *x=0, Double_t *y=0, Int_t markerColor=4,
56 Int_t markerStyle=4, const char* opt="", const char* tit="", const char* xTit=" jet E_{t} ",
57 const char* yTit="", Int_t ifun=0, const char *optFit="W+", const char *fun="");
58 static TGraphErrors *DrawGraphErrors(const Int_t n=4,Double_t *x=0,Double_t *y=0,Double_t *ex=0,
59 Double_t *ey=0, Int_t markerColor=4,Int_t markerStyle=4, const char* opt="",
60 const char* tit="", const char* xTit=" jet E_{t} ",
a6e0ebfe 61 const char* yTit="", Int_t ifun=0, const char *optFit="W+", const char *fun="");
af303720 62 // TChain
63 static void InitChain(TChain *chain=0, const char* nameListOfFiles=0, Int_t nFileMax=0);
0bc916ec 64 //static AliRunLoader* InitKinematics(const Int_t nev=0, const char* galiceName="galice.root");
65 //static AliRunLoader* GetRunLoader(const Int_t nev, const Char_t* galiceName,
66 // const Char_t* eventFolderName, AliRunLoader* rlOld);
0fc11500 67 //
68 static Double_t GetMomentum(const char* nameListOfFiles);
d434833b 69 static int ParseString(const TString &topt, TObjArray &Opt);
af303720 70 // Analysis utilites
7ec8695a 71 //static Bool_t GetLorentzVectorFromESDCluster(TLorentzVector &v, const AliESDCaloCluster *cl);
0bc916ec 72 //static Bool_t GetLorentzVectorFromRecPoint(TLorentzVector &v, const AliEMCALRecPoint *rp);
af303720 73 // Drawing
74 static void DrawHist(TH1* hid=0,int lineWidth=1,int lineColor=1,const char* opt="",int lineStyle=1);
75 // Fitting:
76 static TF1* Gausi(const char *addName, double xmi, double xma, double N, double mean, double sig,
77 double width);
78 static TF1* Gausi(const char *addName, double xmi, double xma, TH1 *h);
79
80 static TF1* GausiPol2(const char *addName, double xmi, double xma, TF1 *g, TF1* bg);
81 //
82 static Double_t Gi(Double_t *x, Double_t *par);
83 static Double_t GiPol2(Double_t *x, Double_t *par);
0fc11500 84 // Calibration stuff
b217491f 85 static Double_t GetCorrectionCoefficientForGamma1(const Double_t eRec);
86 static Double_t GetCorrectedEnergyForGamma1(const Double_t eRec);
0fc11500 87 static TF1* GetResolutionFunction(const char *opt, TString &latexName);
c0e92bad 88 //
89 // Analysis
90 //
91 // Trigger
f544eec5 92 static TList* GetTriggersListOfHists(const Int_t scale=0, const Int_t nTrig=5, const Bool_t toBrowser=kFALSE);
93 static void FillTriggersListOfHists(TList *l=0, TArrayF *triggerPosition=0, TArrayF *triggerAmplitudes=0);
c0e92bad 94 // Jet(s) kinematics
95 static TList* GetJetsListOfHists(Int_t njet=2, Bool_t toBrowser=kFALSE);
0bc916ec 96 //static void FillJetKineListOfHists(TList *l, AliRunLoader* rl, TLorentzVector &goodJet);
315d1c64 97
98 AliEMCALHistoUtilities & operator = (const AliEMCALHistoUtilities &) {
99 Fatal("operator =", "not implemented") ; return *this ; }
100
d434833b 101 ClassDef(AliEMCALHistoUtilities,1) // EMCAL utility routines
315d1c64 102};
103
0fc11500 104#endif // ALIEMCALHISTOUTILITIES_H