PAR: includes from previously enabled PARfiles
[u/mrichter/AliRoot.git] / MFT / AliMuonForwardTrackAnalysis.h
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"
15 #include "AliMuonForwardTrackPair.h"
16 #include "TMatrixD.h"
17 #include "TTree.h"
18 #include "TH1D.h"
19 #include "TH2D.h"
20 #include "TH3D.h"
21 #include "AliLog.h"
22 #include "TFile.h"
23 #include "TParticle.h"
24 #include "AliMUONTrackParam.h"
25 #include "AliMUONTrackExtrap.h"
26 #include "TDatabasePDG.h"
27 #include "TGraph.h"
28 #include "TAxis.h"
29
30 //====================================================================================================================================================
31
32 class AliMuonForwardTrackAnalysis : public TObject {
33
34 public:
35
36   enum {kNoOption, kResonanceOnly, kCharmOnly, kBeautyOnly, kBackground1mu, kBackground2mu, kNoResonances};
37   enum {kSingleEvent, kMixedEvent};
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
54   void SetMassRange(Double_t min, Double_t max) { fMassMin=min; fMassMax=max; }
55   void SetTrueMass(Double_t mass) { fTrueMass = mass; }
56   void SetSingleMuonAnalysis(Bool_t singleMuonAnalysis) { fSingleMuonAnalysis = singleMuonAnalysis; }
57   void SetMuonPairAnalysis(Bool_t muonPairAnalysis) { fMuonPairAnalysis = muonPairAnalysis; }
58   void SetMatchTrigger(Int_t triggerLevel) { fTriggerLevel = triggerLevel; }
59
60   Bool_t AnalyzeSingleMuon();
61   Bool_t AnalyzeMuonPair(Int_t opt);
62   void BuildMuonPairs();
63   void BuildMuonPairsMix();
64
65   void EvalDimuonVtxResolution(Bool_t eval) { fEvalDimuonVtxResolution = eval; }
66
67   Bool_t PassedCutSingleMuon(AliMuonForwardTrack *track);
68   Bool_t PassedCutMuonPair(AliMuonForwardTrackPair *pair);
69
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; }
73
74   void SetMaxNWrongClustersMC(Int_t nClusters) { fMaxNWrongClustersMC = nClusters; }
75   void SetMinPtSingleMuons(Double_t ptMin) { fMinPtSingleMuons = ptMin; }
76   void SetEtaRangeSingleMuons(Double_t min, Double_t max) { fMinEtaSingleMuons=min; fMaxEtaSingleMuons=max; }
77   void SetMaxChi2SingleMuons(Double_t chi2Max) { fMaxChi2SingleMuons = chi2Max; }
78   void SetMaxOffsetSingleMuons(Double_t offsetMax) { fMaxOffsetSingleMuons = offsetMax; }
79   void CorrelateCutOnOffsetChi2(Bool_t option) { fCorrelateCutOnOffsetChi2 = option; }
80
81   void SetMaxWOffsetMuonPairsAtPrimaryVtx(Double_t wOffsetMax) { fMaxWOffsetMuonPairsAtPrimaryVtx = wOffsetMax; }
82   void SetMaxWOffsetMuonPairsAtPCA(Double_t wOffsetMax) { fMaxWOffsetMuonPairsAtPCA = wOffsetMax; }
83   void SetMaxDistancePrimaryVtxPCA(Double_t distanceMax) { fMaxDistancePrimaryVtxPCA = distanceMax; }
84   void SetMinPCAQuality(Double_t minQuality) { fMinPCAQuality = minQuality; }
85
86   void ReadEvents(Int_t firstEv, Int_t lastEv) { fFirstEvent = firstEv; fLastEvent = lastEv; }
87   Int_t GetFirstEvent() { return fFirstEvent; }
88   Int_t GetLastEvent()  { return fLastEvent; }
89
90   void UseBransonForCut(Bool_t useBranson) { fUseBransonForCut = useBranson; }
91   void UseBransonForKinematics(Bool_t useBranson) { fUseBransonForKinematics = useBranson; }
92
93   Double_t GetPseudoProperDecayLength(AliMuonForwardTrackPair *pair, Double_t trueMass);
94
95   void SetNEventsToMix(Int_t nEvents) { fNEventsToMix = nEvents; if (0<fNEventsToMix && fNEventsToMix<100) fMixing = kTRUE; }
96
97 private:
98
99   TString fInputDir, fOutputDir;
100
101   TTree *fInputTreeWithBranson, *fInputTreeWithoutBranson;   //!
102
103   TClonesArray *fMuonForwardTracksWithBranson,    *fMuonForwardTracksWithBransonMix,    *fMuonForwardTrackPairsWithBranson;                //!
104   TClonesArray *fMuonForwardTracksWithoutBranson, *fMuonForwardTracksWithoutBransonMix, *fMuonForwardTrackPairsWithoutBranson;             //!
105   AliMuonForwardTrack *fMFTTrackWithBranson, *fMFTTrackWithoutBranson, *fMFTTrack;                   //!
106   AliMuonForwardTrackPair *fMFTTrackPairWithBranson, *fMFTTrackPairWithoutBranson, *fMFTTrackPair;   //!
107   TParticle *fMCRefTrack;                                                                            //!
108
109   Int_t fEv, fEvMix, fFirstEvent, fLastEvent, fNTracksOfEvent, fNTracksAnalyzedOfEvent, fNTracksAnalyzed, fNPairsOfEvent, fNPairsAnalyzedOfEvent;
110   Int_t fNTracksAnalyzedOfEventAfterCut, fNPairsAnalyzedOfEventAfterCut;
111   
112   TH3D *fHistXOffsetSingleMuonsVsEtaVsP,  *fHistYOffsetSingleMuonsVsEtaVsP,  *fHistOffsetSingleMuonsVsEtaVsP,  *fHistWOffsetSingleMuonsVsEtaVsP;      //!
113   TH3D *fHistXOffsetSingleMuonsVsEtaVsPt, *fHistYOffsetSingleMuonsVsEtaVsPt, *fHistOffsetSingleMuonsVsEtaVsPt, *fHistWOffsetSingleMuonsVsEtaVsPt;     //!
114   TH3D *fHistXErrorSingleMuonsVsEtaVsP,   *fHistYErrorSingleMuonsVsEtaVsP;                                                                  //!
115   TH3D *fHistXErrorSingleMuonsVsEtaVsPt,  *fHistYErrorSingleMuonsVsEtaVsPt;                                                                 //!
116   TH1D *fHistZOriginSingleMuonsMC;
117   
118   TH2D *fHistZROriginSingleMuonsMC, *fHistSingleMuonsPtRapidity, *fHistSingleMuonsOffsetChi2;   //!
119
120   TH2D *fHistMassMuonPairsMCVsPt;         //!
121   TH2D *fHistDimuonVtxResolutionXVsPt;    //!
122   TH2D *fHistDimuonVtxResolutionYVsPt;    //!
123   TH2D *fHistDimuonVtxResolutionZVsPt;    //!
124
125   TH2D *fHistRapidityPtMuonPairs[2];              //!
126   TH2D *fHistMassMuonPairsVsPt[2];                //!
127   TH2D *fHistMassMuonPairsWithoutMFTVsPt[2];      //!
128   TH2D *fHistMassMuonPairsVsPtLSp[2];             //!
129   TH2D *fHistMassMuonPairsWithoutMFTVsPtLSp[2];   //!
130   TH2D *fHistMassMuonPairsVsPtLSm[2];             //!
131   TH2D *fHistMassMuonPairsWithoutMFTVsPtLSm[2];   //!
132
133   TH2D *fHistWOffsetMuonPairsAtPrimaryVtxVsPt[2];    //!
134   TH2D *fHistWOffsetMuonPairsAtPCAVsPt[2];           //!
135   TH2D *fHistDistancePrimaryVtxPCAVsPt[2];           //!
136   TH2D *fHistPCAQualityVsPt[2];                      //!
137   TH2D *fHistPseudoProperDecayLengthVsPt[2];         //!
138
139   Bool_t fEvalDimuonVtxResolution;
140
141   Double_t fTrueMass, fMassMin, fMassMax;
142
143   Bool_t fSingleMuonAnalysis, fMuonPairAnalysis;
144   Int_t fOption, fTriggerLevel;
145
146   Double_t fXVertResMC, fYVertResMC, fZVertResMC;
147   Double_t fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ;
148   Int_t fMaxNWrongClustersMC;
149   Double_t fMinPtSingleMuons, fMinEtaSingleMuons, fMaxEtaSingleMuons;
150
151   Bool_t fUseBransonForCut, fUseBransonForKinematics, fCorrelateCutOnOffsetChi2;
152
153   Double_t fMaxChi2SingleMuons, fMaxOffsetSingleMuons;
154   Double_t fMaxWOffsetMuonPairsAtPrimaryVtx, fMaxWOffsetMuonPairsAtPCA, fMaxDistancePrimaryVtxPCA, fMinPCAQuality;
155
156   Bool_t fMixing;
157   Int_t fNEventsToMix;
158
159   ClassDef(AliMuonForwardTrackAnalysis, 1)
160
161 };
162
163 //====================================================================================================================================================
164         
165 #endif
166