Updated treatment of TOF PID in QA task (Francesco+Pietro)
[u/mrichter/AliRoot.git] / MFT / AliMuonForwardTrackAnalysis.h
CommitLineData
e806e863 1#ifndef AliMuonForwardTrackAnalysis_H
2#define AliMuonForwardTrackAnalysis_H
3
4//====================================================================================================================================================
5//
6// Class for the analysis of the ALICE muon forward tracks (MUON + MFT)
7//
8// Contact author: antonio.uras@cern.ch
9//
10//====================================================================================================================================================
11
12#include "TObject.h"
13#include "TClonesArray.h"
14#include "AliMuonForwardTrack.h"
6240bf36 15#include "AliMuonForwardTrackPair.h"
e806e863 16#include "TMatrixD.h"
17#include "TTree.h"
18#include "TH1D.h"
19#include "TH2D.h"
6c24c9fd 20#include "TH3D.h"
e806e863 21#include "AliLog.h"
22#include "TFile.h"
23#include "TParticle.h"
24#include "AliMUONTrackParam.h"
25#include "AliMUONTrackExtrap.h"
26#include "TDatabasePDG.h"
b5ab1ac4 27#include "TGraph.h"
cd2f51d2 28#include "TAxis.h"
e806e863 29
30//====================================================================================================================================================
31
32class AliMuonForwardTrackAnalysis : public TObject {
33
34public:
35
6240bf36 36 enum {kNoOption, kResonanceOnly, kCharmOnly, kBeautyOnly, kBackground1mu, kBackground2mu, kNoResonances};
37 enum {kSingleEvent, kMixedEvent};
e806e863 38
39 AliMuonForwardTrackAnalysis();
40
41 virtual ~AliMuonForwardTrackAnalysis() {}; // destructor
42
43 Bool_t Init(Char_t *inputFileName);
44 Bool_t LoadNextEvent();
45 void Terminate(Char_t *outputFileName);
46
47 void BookHistos();
48
49 void SetInputDir(Char_t *inputDir) { fInputDir = inputDir; }
50 void SetOutputDir(Char_t *outputDir) { fOutputDir = outputDir; }
51
52 Int_t GetNTracksAnalyzed() { return fNTracksAnalyzed; }
53
cabfe25b 54 void SetMassRange(Double_t min, Double_t max) { fMassMin=min; fMassMax=max; }
55 void SetTrueMass(Double_t mass) { fTrueMass = mass; }
e806e863 56 void SetSingleMuonAnalysis(Bool_t singleMuonAnalysis) { fSingleMuonAnalysis = singleMuonAnalysis; }
57 void SetMuonPairAnalysis(Bool_t muonPairAnalysis) { fMuonPairAnalysis = muonPairAnalysis; }
cabfe25b 58 void SetMatchTrigger(Int_t triggerLevel) { fTriggerLevel = triggerLevel; }
e806e863 59
60 Bool_t AnalyzeSingleMuon();
6240bf36 61 Bool_t AnalyzeMuonPair(Int_t opt);
e806e863 62 void BuildMuonPairs();
6240bf36 63 void BuildMuonPairsMix();
e806e863 64
789c2e43 65 void EvalDimuonVtxResolution(Bool_t eval) { fEvalDimuonVtxResolution = eval; }
66
7e3dd1af 67 Bool_t PassedCutSingleMuon(AliMuonForwardTrack *track);
68 Bool_t PassedCutMuonPair(AliMuonForwardTrackPair *pair);
69
e806e863 70 void SetVertResMC(Double_t xRes, Double_t yRes, Double_t zRes) { fXVertResMC=xRes; fYVertResMC=yRes; fZVertResMC=zRes; }
71
72 void SetOption(Int_t option) { fOption = option; }
cabfe25b 73
e806e863 74 void SetMaxNWrongClustersMC(Int_t nClusters) { fMaxNWrongClustersMC = nClusters; }
6240bf36 75 void SetMinPtSingleMuons(Double_t ptMin) { fMinPtSingleMuons = ptMin; }
cabfe25b 76 void SetMaxChi2SingleMuons(Double_t chi2Max) { fMaxChi2SingleMuons = chi2Max; }
77 void SetMaxOffsetSingleMuons(Double_t offsetMax) { fMaxOffsetSingleMuons = offsetMax; }
78 void CorrelateCutOnOffsetChi2(Bool_t option) { fCorrelateCutOnOffsetChi2 = option; }
79
80 void SetMaxWOffsetMuonPairsAtPrimaryVtx(Double_t wOffsetMax) { fMaxWOffsetMuonPairsAtPrimaryVtx = wOffsetMax; }
81 void SetMaxWOffsetMuonPairsAtPCA(Double_t wOffsetMax) { fMaxWOffsetMuonPairsAtPCA = wOffsetMax; }
82 void SetMaxDistancePrimaryVtxPCA(Double_t distanceMax) { fMaxDistancePrimaryVtxPCA = distanceMax; }
83 void SetMinPCAQuality(Double_t minQuality) { fMinPCAQuality = minQuality; }
e806e863 84
85 void ReadEvents(Int_t firstEv, Int_t lastEv) { fFirstEvent = firstEv; fLastEvent = lastEv; }
86 Int_t GetFirstEvent() { return fFirstEvent; }
87 Int_t GetLastEvent() { return fLastEvent; }
88
7e3dd1af 89 void UseBransonForCut(Bool_t useBranson) { fUseBransonForCut = useBranson; }
90 void UseBransonForKinematics(Bool_t useBranson) { fUseBransonForKinematics = useBranson; }
7e3dd1af 91
cabfe25b 92 Double_t GetPseudoProperDecayLength(AliMuonForwardTrackPair *pair, Double_t trueMass);
e806e863 93
6240bf36 94 void SetNEventsToMix(Int_t nEvents) { fNEventsToMix = nEvents; if (0<fNEventsToMix && fNEventsToMix<100) fMixing = kTRUE; }
95
cabfe25b 96private:
e806e863 97
98 TString fInputDir, fOutputDir;
99
6240bf36 100 TTree *fInputTreeWithBranson, *fInputTreeWithoutBranson; //!
e806e863 101
6240bf36 102 TClonesArray *fMuonForwardTracksWithBranson, *fMuonForwardTracksWithBransonMix, *fMuonForwardTrackPairsWithBranson; //!
103 TClonesArray *fMuonForwardTracksWithoutBranson, *fMuonForwardTracksWithoutBransonMix, *fMuonForwardTrackPairsWithoutBranson; //!
7e3dd1af 104 AliMuonForwardTrack *fMFTTrackWithBranson, *fMFTTrackWithoutBranson, *fMFTTrack; //!
105 AliMuonForwardTrackPair *fMFTTrackPairWithBranson, *fMFTTrackPairWithoutBranson, *fMFTTrackPair; //!
106 TParticle *fMCRefTrack; //!
e806e863 107
6240bf36 108 Int_t fEv, fEvMix, fFirstEvent, fLastEvent, fNTracksOfEvent, fNTracksAnalyzedOfEvent, fNTracksAnalyzed, fNPairsOfEvent, fNPairsAnalyzedOfEvent;
d8c2cc3e 109 Int_t fNTracksAnalyzedOfEventAfterCut, fNPairsAnalyzedOfEventAfterCut;
e806e863 110
6c24c9fd 111 TH3D *fHistXOffsetSingleMuonsVsEtaVsP, *fHistYOffsetSingleMuonsVsEtaVsP, *fHistOffsetSingleMuonsVsEtaVsP, *fHistWOffsetSingleMuonsVsEtaVsP; //!
112 TH3D *fHistXOffsetSingleMuonsVsEtaVsPt, *fHistYOffsetSingleMuonsVsEtaVsPt, *fHistOffsetSingleMuonsVsEtaVsPt, *fHistWOffsetSingleMuonsVsEtaVsPt; //!
113 TH3D *fHistXErrorSingleMuonsVsEtaVsP, *fHistYErrorSingleMuonsVsEtaVsP; //!
114 TH3D *fHistXErrorSingleMuonsVsEtaVsPt, *fHistYErrorSingleMuonsVsEtaVsPt; //!
d8c2cc3e 115 TH1D *fHistZOriginSingleMuonsMC;
116
cabfe25b 117 TH2D *fHistZROriginSingleMuonsMC, *fHistSingleMuonsPtRapidity, *fHistSingleMuonsOffsetChi2; //!
118
6240bf36 119 TH2D *fHistMassMuonPairsMCVsPt; //!
120 TH2D *fHistDimuonVtxResolutionXVsPt; //!
121 TH2D *fHistDimuonVtxResolutionYVsPt; //!
122 TH2D *fHistDimuonVtxResolutionZVsPt; //!
123
124 TH2D *fHistRapidityPtMuonPairs[2]; //!
6c24c9fd 125 TH2D *fHistMassMuonPairsVsPt[2]; //!
6240bf36 126 TH2D *fHistMassMuonPairsWithoutMFTVsPt[2]; //!
127 TH2D *fHistMassMuonPairsVsPtLSp[2]; //!
128 TH2D *fHistMassMuonPairsWithoutMFTVsPtLSp[2]; //!
129 TH2D *fHistMassMuonPairsVsPtLSm[2]; //!
130 TH2D *fHistMassMuonPairsWithoutMFTVsPtLSm[2]; //!
131
132 TH2D *fHistWOffsetMuonPairsAtPrimaryVtxVsPt[2]; //!
133 TH2D *fHistWOffsetMuonPairsAtPCAVsPt[2]; //!
134 TH2D *fHistDistancePrimaryVtxPCAVsPt[2]; //!
135 TH2D *fHistPCAQualityVsPt[2]; //!
136 TH2D *fHistPseudoProperDecayLengthVsPt[2]; //!
137
789c2e43 138 Bool_t fEvalDimuonVtxResolution;
139
cabfe25b 140 Double_t fTrueMass, fMassMin, fMassMax;
e806e863 141
cabfe25b 142 Bool_t fSingleMuonAnalysis, fMuonPairAnalysis;
143 Int_t fOption, fTriggerLevel;
e806e863 144
145 Double_t fXVertResMC, fYVertResMC, fZVertResMC;
7e3dd1af 146 Double_t fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ;
e806e863 147 Int_t fMaxNWrongClustersMC;
6240bf36 148 Double_t fMinPtSingleMuons;
e806e863 149
cabfe25b 150 Bool_t fUseBransonForCut, fUseBransonForKinematics, fCorrelateCutOnOffsetChi2;
7e3dd1af 151
cabfe25b 152 Double_t fMaxChi2SingleMuons, fMaxOffsetSingleMuons;
153 Double_t fMaxWOffsetMuonPairsAtPrimaryVtx, fMaxWOffsetMuonPairsAtPCA, fMaxDistancePrimaryVtxPCA, fMinPCAQuality;
7e3dd1af 154
6240bf36 155 Bool_t fMixing;
156 Int_t fNEventsToMix;
157
e806e863 158 ClassDef(AliMuonForwardTrackAnalysis, 1)
159
160};
161
162//====================================================================================================================================================
163
164#endif
165