Transition PWG0 -> PWGUD
[u/mrichter/AliRoot.git] / PWGUD / dNdPt / AlidNdPtHelper.h
CommitLineData
0aaa8b91 1#ifndef ALIDNDPTHELPER_H
2#define ALIDNDPTHELPER_H
3
4//
bad4ba69 5// static dNdPt helper functions
6//
7// Origin: Jan Fiete Grosse-Oetringhaus
8// Modified and Extended: Jacek Otwinowski 19/11/2009
0aaa8b91 9//
10
11#include <TObject.h>
f2dec884 12#include <THnSparse.h>
13#include "AliTriggerAnalysis.h"
0aaa8b91 14
8606be51 15class TF1;
cf6f87ea 16class TH1;
17class TH2;
e9f7cb15 18class THnSparse;
f2dec884 19class TParticle;
0aaa8b91 20class AliHeader;
21class AliGenEventHeader;
22class AliStack;
23class AliESD;
24class AliESDEvent;
25class AliESDtrack;
26class AliMCEvent;
27class AliESDVertex;
28class AliESDtrackCuts;
29class AlidNdPtAcceptanceCuts;
30class AlidNdPtEventCuts;
f2dec884 31class AliPWG0Helper;
0aaa8b91 32
f2dec884 33class AliGenDPMjetEventHeader;
34class AliGenCocktailEventHeader;
35class AliGenPythiaEventHeader;
36class AliVertexerTracks;
37class AliLog;
38class AliHeader;
bad4ba69 39
0aaa8b91 40class AlidNdPtHelper : public TObject
41{
42 public:
695facdf 43 enum AnalysisMode { kInvalid = -1, kSPD = 0, kTPC, kTPCITS, kTPCSPDvtx, kTPCSPDvtxUpdate, kTPCTrackSPDvtx, kTPCTrackSPDvtxUpdate, kTPCITSHybrid, kTPCITSHybridTrackSPDvtx, kTPCITSHybridTrackSPDvtxDCArPt, kITSStandAloneTrackSPDvtx,kITSStandAloneTPCTrackSPDvtx, kMCRec };
de93884d 44
695facdf 45 enum ParticleMode { kAllPart = 0, kMCPion, kMCKaon, kMCProton, kPlus, kMinus, kCosmic, kBackgroundTrack, kMCRest, kVZEROCase1, kVZEROCase2};
774986ef 46
dffe2c06 47 enum OutputObject { kInvalidObject = -1, kCutAnalysis = 0, kAnalysis, kAnalysisPbPb, kCorrection, kSystematics, kCutAnalysisPbPb };
de93884d 48
774986ef 49 enum TrackObject { kInvalidTrackObject = -1, kAllTracks = 0, kAccTracks, kRecTracks, kMCTracks };
50 enum EventObject { kInvalidEventObject = -1, kAllEvents = 0, kTriggeredEvents, kAccEvents, kRecEvents, kMCEvents };
51 enum CutSteps { kCutSteps = 3 };
847e74b2 52
e9f7cb15 53 static const AliESDVertex* GetVertex(AliESDEvent* const aEsd, const AlidNdPtEventCuts *const evtCuts,const AlidNdPtAcceptanceCuts *const accCuts,const AliESDtrackCuts *const trackCuts, AnalysisMode analysisMethod, Bool_t debug = kFALSE,Bool_t bRedoTPC = kFALSE, Bool_t bUseMeanVertex = kFALSE);
0aaa8b91 54
e9f7cb15 55 static const AliESDVertex* GetTPCVertexZ(const AliESDEvent* const aEsd, const AlidNdPtEventCuts *const evtCuts, const AlidNdPtAcceptanceCuts *const accCuts, const AliESDtrackCuts *const trackCuts, Float_t fraction=0.8, Int_t ntracksMin=2);
0aaa8b91 56
b950b434 57 static Bool_t TestRecVertex(const AliESDVertex* vertex, const AliESDVertex* vertexSPD, AnalysisMode analysisMode, Bool_t debug = kFALSE);
0aaa8b91 58
f2dec884 59 static Bool_t IsPrimaryParticle(AliStack *const stack, Int_t idx, ParticleMode particleMode);
f2dec884 60 static Bool_t IsCosmicTrack(AliESDtrack *const track1, AliESDtrack *const track2);
e9f7cb15 61 static Bool_t IsGoodImpPar(const AliESDtrack *const track);
62 static Int_t ConvertPdgToPid(const TParticle *const particle);
0aaa8b91 63
55468faf 64 static Bool_t SelectEvent(const AliESDEvent* const aEsd, AliESDtrackCuts* const esdTrackCuts);
65 static Bool_t SelectMCEvent(AliMCEvent* const mcEvent);
66
f2dec884 67 static TObjArray *GetAllChargedTracks(AliESDEvent *const esdEvent, AnalysisMode analysisMode);
0aaa8b91 68
f2dec884 69 static TH1F* MakeResol(TH2F * const his, Int_t integ, Bool_t type, Bool_t drawBins, Int_t minHistEntries);
70 static TH1F* CreateResHisto(TH2F* const hRes2, TH1F **phMean, Int_t integ, Bool_t drawBinFits, Int_t minHistEntries);
0aaa8b91 71
e9f7cb15 72 static Int_t GetTPCMBTrackMult(const AliESDEvent* const esdEvent, const AlidNdPtEventCuts *const evtCuts,const AlidNdPtAcceptanceCuts *const accCuts, const AliESDtrackCuts *const trackCuts);
73 static Int_t GetTPCMBPrimTrackMult(const AliESDEvent* const esdEvent, AliStack * const stack,const AlidNdPtEventCuts *const evtCuts, const AlidNdPtAcceptanceCuts *const accCuts, const AliESDtrackCuts *const trackCuts);
0aaa8b91 74
e9f7cb15 75 static Int_t GetSPDMBTrackMult(const AliESDEvent* const esdEvent, Float_t deltaThetaCut =0.025, Float_t deltaPhiCut = 0.08);
76 static Int_t GetSPDMBPrimTrackMult(const AliESDEvent* const esdEvent, AliStack *const stack, Float_t deltaThetaCut =0.025, Float_t deltaPhiCut = 0.08);
f2dec884 77 static Int_t GetMCTrueTrackMult(AliMCEvent *const mcEvent, AlidNdPtEventCuts *const evtCuts, AlidNdPtAcceptanceCuts *const accCuts);
0aaa8b91 78
e9f7cb15 79 static AliESDtrack* GetTPCOnlyTrackSPDvtx(const AliESDEvent* const esdEvent, Int_t iTrack, Bool_t bUpdate);
80 static AliESDtrack* GetTPCOnlyTrackTrackSPDvtx(const AliESDEvent* const esdEvent, Int_t iTrack, Bool_t bUpdate);
81 static AliESDtrack* GetTrackSPDvtx(const AliESDEvent* const esdEvent, Int_t iTrack, Bool_t bUpdate);
82 static AliESDtrack* GetTrackTrackSPDvtx(const AliESDEvent* const esdEvent, Int_t iTrack, Bool_t bUpdate);
847e74b2 83
774986ef 84 static void PrintConf(AnalysisMode analysisMode, AliTriggerAnalysis::Trigger trigger);
f2dec884 85 static void PrintMCInfo(AliStack *const pStack, Int_t label);
0aaa8b91 86
f2dec884 87 static TH1* ScaleByBinWidth(TH1 *const hist=0);
88 static TH1* GetContCorrHisto(TH1 *const hist=0);
e9f7cb15 89 static TH1* CalcRelativeDifference(const TH1 *const hist1=0, const TH1 *const hist2=0);
90 static TH1* CalcRelativeDifferenceFun(const TH1 *const hist=0, TF1 *const fun=0);
91 static TH1* NormalizeToEvent(const TH2 *const hist1=0, const TH1 *const hist2=0);
0aaa8b91 92
e9f7cb15 93 //static THnSparse* GenerateCorrMatrix(THnSparse *const hist1, const THnSparse *const hist2, char *const name);
a9b12ce1 94 //static TH2* GenerateCorrMatrix(TH2 *const hist1, TH2 *const hist2, char *const name);
95 //static TH1* GenerateCorrMatrix(TH1 *const hist1, TH1 *const hist2, char *const name);
0aaa8b91 96
a9b12ce1 97 //static THnSparse* GenerateContCorrMatrix(THnSparse *const hist1, THnSparse *const hist2, char *const name);
98 //static TH2* GenerateContCorrMatrix(TH2 *const hist1, TH2 *const hist2, char *const name);
99 //static TH1* GenerateContCorrMatrix(TH1 *const hist1, TH1 *const hist2, char *const name);
100
e9f7cb15 101 static THnSparse* GenerateCorrMatrix(THnSparse *const hist1, const THnSparse *const hist2, const char * name);
a9b12ce1 102 static TH2* GenerateCorrMatrix(TH2 *const hist1, TH2 *const hist2, const char* name);
103 static TH1* GenerateCorrMatrix(TH1 *const hist1, TH1 *const hist2, const char* name);
104
e9f7cb15 105 static THnSparse* GenerateContCorrMatrix(THnSparse *const hist1, const THnSparse *const hist2, const char* name);
a9b12ce1 106 static TH2* GenerateContCorrMatrix(TH2 *const hist1, TH2 *const hist2, const char* name);
107 static TH1* GenerateContCorrMatrix(TH1 *const hist1, TH1 *const hist2, const char* name);
0aaa8b91 108
791aaf54 109 static Double_t GetStrangenessCorrFactor(const Double_t pt);
d4640855 110 static Double_t GetStrangenessCorrFactorPbPb(const Double_t pt);
791aaf54 111 static Double_t GetLinearInterpolationValue(const Double_t x1, const Double_t y1, const Double_t x2, const Double_t y2, const Double_t pt);
112
fc98fbb5 113 // function to rebin THnSparse, the content of hist1 will be rebinned, hist2 serves as a protoype for the binning
114 static THnSparse* RebinTHnSparse(const THnSparse* hist1, THnSparse* hist2, const Char_t* newname = "", Option_t* option = "");
115
dffe2c06 116 ClassDef(AlidNdPtHelper, 1);
0aaa8b91 117
118 private:
119 AlidNdPtHelper(const AlidNdPtHelper&);
120 AlidNdPtHelper& operator=(const AlidNdPtHelper&);
121};
122
123#endif
124