]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG0/dNdPt/AlidNdPtHelper.h
new functionality and data memebers added
[u/mrichter/AliRoot.git] / PWG0 / 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;
0aaa8b91 16class TH1F;
17class TH2F;
f2dec884 18class TParticle;
0aaa8b91 19class AliHeader;
20class AliGenEventHeader;
21class AliStack;
22class AliESD;
23class AliESDEvent;
24class AliESDtrack;
25class AliMCEvent;
26class AliESDVertex;
27class AliESDtrackCuts;
28class AlidNdPtAcceptanceCuts;
29class AlidNdPtEventCuts;
f2dec884 30class AliPWG0Helper;
0aaa8b91 31
f2dec884 32class AliGenDPMjetEventHeader;
33class AliGenCocktailEventHeader;
34class AliGenPythiaEventHeader;
35class AliVertexerTracks;
36class AliLog;
37class AliHeader;
bad4ba69 38
0aaa8b91 39class AlidNdPtHelper : public TObject
40{
41 public:
774986ef 42 enum AnalysisMode { kInvalid = -1, kSPD = 0, kTPC, kTPCITS, kTPCSPDvtx, kTPCSPDvtxUpdate, kTPCITSHybrid, kMCRec };
43 enum ParticleMode { kAllPart = 0, kMCPion, kMCKaon, kMCProton, kPlus, kMinus, kCosmic, kBackgroundTrack };
44
45 enum OutputObject { kInvalidObject = -1, kCutAnalysis = 0, kAnalysis, kCorrection, kSystematics };
46 enum TrackObject { kInvalidTrackObject = -1, kAllTracks = 0, kAccTracks, kRecTracks, kMCTracks };
47 enum EventObject { kInvalidEventObject = -1, kAllEvents = 0, kTriggeredEvents, kAccEvents, kRecEvents, kMCEvents };
48 enum CutSteps { kCutSteps = 3 };
847e74b2 49
f2dec884 50 static const AliESDVertex* GetVertex(AliESDEvent* const aEsd, AlidNdPtEventCuts *const evtCuts, AlidNdPtAcceptanceCuts *const accCuts, AliESDtrackCuts *const trackCuts, AnalysisMode analysisMethod, Bool_t debug = kFALSE,Bool_t bRedoTPC = kFALSE, Bool_t bUseMeanVertex = kFALSE);
0aaa8b91 51
f2dec884 52 static const AliESDVertex* GetTPCVertexZ(AliESDEvent* const aEsd, AlidNdPtEventCuts *const evtCuts, AlidNdPtAcceptanceCuts *const accCuts, AliESDtrackCuts *const trackCuts, Float_t fraction=0.8, Int_t ntracksMin=2);
0aaa8b91 53
bad4ba69 54 static Bool_t TestRecVertex(const AliESDVertex* vertex, AnalysisMode analysisMode, Bool_t debug = kFALSE);
0aaa8b91 55
f2dec884 56 static Bool_t IsPrimaryParticle(AliStack *const stack, Int_t idx, ParticleMode particleMode);
f2dec884 57 static Bool_t IsCosmicTrack(AliESDtrack *const track1, AliESDtrack *const track2);
f2dec884 58 static Int_t ConvertPdgToPid(TParticle *const particle);
0aaa8b91 59
f2dec884 60 static TObjArray *GetAllChargedTracks(AliESDEvent *const esdEvent, AnalysisMode analysisMode);
0aaa8b91 61
f2dec884 62 static TH1F* MakeResol(TH2F * const his, Int_t integ, Bool_t type, Bool_t drawBins, Int_t minHistEntries);
63 static TH1F* CreateResHisto(TH2F* const hRes2, TH1F **phMean, Int_t integ, Bool_t drawBinFits, Int_t minHistEntries);
0aaa8b91 64
f2dec884 65 static Int_t GetTPCMBTrackMult(AliESDEvent* const esdEvent, AlidNdPtEventCuts *const evtCuts, AlidNdPtAcceptanceCuts *const accCuts, AliESDtrackCuts *const trackCuts);
66 static Int_t GetTPCMBPrimTrackMult(AliESDEvent* const esdEvent, AliStack * const stack,AlidNdPtEventCuts *const evtCuts, AlidNdPtAcceptanceCuts *const accCuts, AliESDtrackCuts *const trackCuts);
0aaa8b91 67
f2dec884 68 static Int_t GetSPDMBTrackMult(AliESDEvent* const esdEvent, Float_t deltaThetaCut =0.025, Float_t deltaPhiCut = 0.08);
69 static Int_t GetSPDMBPrimTrackMult(AliESDEvent* const esdEvent, AliStack *const stack, Float_t deltaThetaCut =0.025, Float_t deltaPhiCut = 0.08);
70 static Int_t GetMCTrueTrackMult(AliMCEvent *const mcEvent, AlidNdPtEventCuts *const evtCuts, AlidNdPtAcceptanceCuts *const accCuts);
0aaa8b91 71
f2dec884 72 static AliESDtrack* GetTPCOnlyTrackSPDvtx(AliESDEvent* const esdEvent, Int_t iTrack, Bool_t bUpdate);
774986ef 73 static AliESDtrack* GetTrackSPDvtx(AliESDEvent* const esdEvent, Int_t iTrack, Bool_t bUpdate);
847e74b2 74
774986ef 75 static void PrintConf(AnalysisMode analysisMode, AliTriggerAnalysis::Trigger trigger);
f2dec884 76 static void PrintMCInfo(AliStack *const pStack, Int_t label);
0aaa8b91 77
f2dec884 78 static TH1* ScaleByBinWidth(TH1 *const hist=0);
79 static TH1* GetContCorrHisto(TH1 *const hist=0);
80 static TH1* CalcRelativeDifference(TH1 *const hist1=0, TH1 *const hist2=0);
81 static TH1* CalcRelativeDifferenceFun(TH1 *const hist=0, TF1 *const fun=0);
82 static TH1* NormalizeToEvent(TH2 *const hist1=0, TH1 *const hist2=0);
0aaa8b91 83
f2dec884 84 static THnSparse* GenerateCorrMatrix(THnSparse *const hist1, THnSparse *const hist2, char *const name);
85 static TH2* GenerateCorrMatrix(TH2 *const hist1, TH2 *const hist2, char *const name);
86 static TH1* GenerateCorrMatrix(TH1 *const hist1, TH1 *const hist2, char *const name);
0aaa8b91 87
f2dec884 88 static THnSparse* GenerateContCorrMatrix(THnSparse *const hist1, THnSparse *const hist2, char *const name);
89 static TH2* GenerateContCorrMatrix(TH2 *const hist1, TH2 *const hist2, char *const name);
90 static TH1* GenerateContCorrMatrix(TH1 *const hist1, TH1 *const hist2, char *const name);
0aaa8b91 91
0aaa8b91 92 ClassDef(AlidNdPtHelper, 0);
93
94 private:
95 AlidNdPtHelper(const AlidNdPtHelper&);
96 AlidNdPtHelper& operator=(const AlidNdPtHelper&);
97};
98
99#endif
100