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