Modified Terminate method for D+ task
[u/mrichter/AliRoot.git] / MFT / AliMuonForwardTrackAnalysis.cxx
CommitLineData
e806e863 1//====================================================================================================================================================
2//
3// Class for the analysis of the ALICE muon forward tracks (MUON + MFT)
4//
5// Contact author: antonio.uras@cern.ch
6//
7//====================================================================================================================================================
8
9#include "TObject.h"
10#include "TClonesArray.h"
11#include "AliMuonForwardTrack.h"
12#include "AliMuonForwardTrackPair.h"
13#include "TMatrixD.h"
14#include "TTree.h"
15#include "TH1D.h"
16#include "AliLog.h"
17#include "TFile.h"
18#include "TParticle.h"
19#include "AliMUONTrackParam.h"
20#include "AliMUONTrackExtrap.h"
21#include "TGeoManager.h"
22#include "TRandom.h"
23#include "TLorentzVector.h"
24#include "TDatabasePDG.h"
b5ab1ac4 25#include "TGraph.h"
e806e863 26#include "AliMuonForwardTrackAnalysis.h"
6240bf36 27#include "TSystem.h"
e806e863 28
29ClassImp(AliMuonForwardTrackAnalysis)
30
31//====================================================================================================================================================
32
33AliMuonForwardTrackAnalysis::AliMuonForwardTrackAnalysis():
34 TObject(),
35 fInputDir(0),
36 fOutputDir(0),
7e3dd1af 37 fInputTreeWithBranson(0x0),
38 fInputTreeWithoutBranson(0x0),
39 fMuonForwardTracksWithBranson(0),
6240bf36 40 fMuonForwardTracksWithBransonMix(0),
7e3dd1af 41 fMuonForwardTrackPairsWithBranson(0),
42 fMuonForwardTracksWithoutBranson(0),
6240bf36 43 fMuonForwardTracksWithoutBransonMix(0),
7e3dd1af 44 fMuonForwardTrackPairsWithoutBranson(0),
45 fMFTTrackWithBranson(0),
46 fMFTTrackWithoutBranson(0),
e806e863 47 fMFTTrack(0),
7e3dd1af 48 fMFTTrackPairWithBranson(0),
49 fMFTTrackPairWithoutBranson(0),
e806e863 50 fMFTTrackPair(0),
51 fMCRefTrack(0),
52 fEv(0),
53 fFirstEvent(-1),
54 fLastEvent(-1),
55 fNTracksOfEvent(0),
56 fNTracksAnalyzedOfEvent(0),
57 fNTracksAnalyzed(0),
58 fNPairsOfEvent(0),
59 fNPairsAnalyzedOfEvent(0),
d8c2cc3e 60 fNTracksAnalyzedOfEventAfterCut(0),
61 fNPairsAnalyzedOfEventAfterCut(0),
6240bf36 62 fHistXOffsetSingleMuonsVsP(0x0),
63 fHistYOffsetSingleMuonsVsP(0x0),
64 fHistOffsetSingleMuonsVsP(0x0),
65 fHistWOffsetSingleMuonsVsP(0x0),
66 fHistXOffsetSingleMuonsVsPt(0x0),
67 fHistYOffsetSingleMuonsVsPt(0x0),
68 fHistOffsetSingleMuonsVsPt(0x0),
69 fHistWOffsetSingleMuonsVsPt(0x0),
70 fHistXErrorSingleMuonsVsP(0x0),
71 fHistYErrorSingleMuonsVsP(0x0),
72 fHistXErrorSingleMuonsVsPt(0x0),
73 fHistYErrorSingleMuonsVsPt(0x0),
d8c2cc3e 74 fHistZOriginSingleMuonsMC(0x0),
cabfe25b 75 fHistZROriginSingleMuonsMC(0x0),
76 fHistSingleMuonsPtRapidity(0x0),
b5ab1ac4 77 fHistSingleMuonsOffsetChi2(0x0),
cabfe25b 78 fHistMassMuonPairsMCVsPt(0x0),
cabfe25b 79 fHistDimuonVtxResolutionXVsPt(0x0),
80 fHistDimuonVtxResolutionYVsPt(0x0),
81 fHistDimuonVtxResolutionZVsPt(0x0),
82 fTrueMass(0.),
e806e863 83 fMassMin(0),
cabfe25b 84 fMassMax(9999),
e806e863 85 fSingleMuonAnalysis(1),
86 fMuonPairAnalysis(1),
e806e863 87 fOption(0),
cabfe25b 88 fTriggerLevel(0),
b5ab1ac4 89 fXVertResMC(50.e-4),
90 fYVertResMC(50.e-4),
91 fZVertResMC(50.e-4),
7e3dd1af 92 fPrimaryVtxX(0.),
93 fPrimaryVtxY(0.),
94 fPrimaryVtxZ(0.),
e806e863 95 fMaxNWrongClustersMC(999),
6240bf36 96 fMinPtSingleMuons(0),
7e3dd1af 97 fUseBransonForCut(kFALSE),
98 fUseBransonForKinematics(kFALSE),
cabfe25b 99 fCorrelateCutOnOffsetChi2(kFALSE),
100 fMaxChi2SingleMuons(1.e9),
101 fMaxOffsetSingleMuons(1.e9),
102 fMaxWOffsetMuonPairsAtPrimaryVtx(1.e9),
103 fMaxWOffsetMuonPairsAtPCA(1.e9),
104 fMaxDistancePrimaryVtxPCA(1.e9),
6240bf36 105 fMinPCAQuality(0.),
106 fMixing(kFALSE),
107 fNEventsToMix(10)
e806e863 108{
109
110 // default constructor
111
6240bf36 112 for (Int_t i=0; i<2; i++) {
113 fHistRapidityPtMuonPairs[i] = 0;
114 fHistMassMuonPairsVsPt[i] = 0;
115 fHistMassMuonPairsWithoutMFTVsPt[i] = 0;
116 fHistMassMuonPairsVsPtLSp[i] = 0;
117 fHistMassMuonPairsWithoutMFTVsPtLSp[i] = 0;
118 fHistMassMuonPairsVsPtLSm[i] = 0;
119 fHistMassMuonPairsWithoutMFTVsPtLSm[i] = 0;
120 fHistWOffsetMuonPairsAtPrimaryVtxVsPt[i] = 0;
121 fHistWOffsetMuonPairsAtPCAVsPt[i] = 0;
122 fHistDistancePrimaryVtxPCAVsPt[i] = 0;
123 fHistPCAQualityVsPt[i] = 0;
124 fHistPseudoProperDecayLengthVsPt[i] = 0;
125 }
126
e806e863 127}
128
129//====================================================================================================================================================
130
131Bool_t AliMuonForwardTrackAnalysis::Init(Char_t *inputFileName) {
132
133 BookHistos();
6240bf36 134
e806e863 135 TFile *inputFile = new TFile(Form("%s/%s",fInputDir.Data(),inputFileName));
136 if (!inputFile || !inputFile->IsOpen()) {
137 AliError(Form("Error opening file %s", inputFileName));
138 return kFALSE;
139 }
6240bf36 140
141 fInputTreeWithBranson = (TTree*) inputFile->Get("AliMuonForwardTracksWithBranson");
7e3dd1af 142 if (!fInputTreeWithBranson) {
143 AliError("Error reading input tree");
144 return kFALSE;
145 }
6240bf36 146
147 fInputTreeWithoutBranson = (TTree*) inputFile->Get("AliMuonForwardTracksWithoutBranson");
7e3dd1af 148 if (!fInputTreeWithoutBranson) {
e806e863 149 AliError("Error reading input tree");
150 return kFALSE;
151 }
6240bf36 152
3b0abc02 153 if (fFirstEvent>=fInputTreeWithBranson->GetEntriesFast()) return kFALSE;
154 else if (fFirstEvent<0 || fLastEvent<0 || fFirstEvent>fLastEvent || fFirstEvent>=fInputTreeWithBranson->GetEntriesFast()) {
e806e863 155 fFirstEvent = 0;
789c2e43 156 fLastEvent = fInputTreeWithBranson->GetEntriesFast()-1;
e806e863 157 }
158 else {
789c2e43 159 fLastEvent = TMath::Min(fLastEvent, Int_t(fInputTreeWithBranson->GetEntriesFast()-1));
e806e863 160 }
6240bf36 161
e806e863 162 AliInfo(Form("Analysing events %d to %d", fFirstEvent, fLastEvent));
6240bf36 163
789c2e43 164 fMuonForwardTracksWithBranson = new TClonesArray("AliMuonForwardTrack",30);
7e3dd1af 165 fInputTreeWithBranson->SetBranchAddress("tracks", &fMuonForwardTracksWithBranson);
6240bf36 166
789c2e43 167 fMuonForwardTracksWithoutBranson = new TClonesArray("AliMuonForwardTrack",30);
7e3dd1af 168 fInputTreeWithoutBranson->SetBranchAddress("tracks", &fMuonForwardTracksWithoutBranson);
6240bf36 169
e806e863 170 TGeoManager::Import(Form("%s/geometry.root",fInputDir.Data()));
6240bf36 171
e806e863 172 AliMUONTrackExtrap::SetField();
6240bf36 173
789c2e43 174 fMuonForwardTrackPairsWithBranson = new TClonesArray("AliMuonForwardTrackPair",10);
175 fMuonForwardTrackPairsWithoutBranson = new TClonesArray("AliMuonForwardTrackPair",10);
cabfe25b 176 fMuonForwardTrackPairsWithBranson -> SetOwner(kTRUE);
177 fMuonForwardTrackPairsWithoutBranson -> SetOwner(kTRUE);
178
e806e863 179 return kTRUE;
6240bf36 180
e806e863 181}
6240bf36 182
e806e863 183//====================================================================================================================================================
184
185Bool_t AliMuonForwardTrackAnalysis::LoadNextEvent() {
186
187 if (fEv>fLastEvent) return kFALSE;
188 if (fEv<fFirstEvent) { fEv++; return kTRUE; }
6240bf36 189
190 fMuonForwardTracksWithBranson -> Clear("C");
191 fMuonForwardTracksWithoutBranson -> Clear("C");
192 fMuonForwardTracksWithBranson -> Delete();
193 fMuonForwardTracksWithoutBranson -> Delete();
194 fInputTreeWithBranson -> GetEvent(fEv);
195 fInputTreeWithoutBranson -> GetEvent(fEv);
196
789c2e43 197 AliDebug(2,Form("**** analyzing event # %4d (%3d tracks) ****", fEv, fMuonForwardTracksWithBranson->GetEntriesFast()));
7e3dd1af 198
cabfe25b 199 AliInfo(Form("**** analyzing event # %6d of %6d ****", fEv, fLastEvent));
200
7e3dd1af 201 fPrimaryVtxX = gRandom->Gaus(0., fXVertResMC);
202 fPrimaryVtxY = gRandom->Gaus(0., fYVertResMC);
203 fPrimaryVtxZ = gRandom->Gaus(0., fZVertResMC);
e806e863 204
205 if (fSingleMuonAnalysis) {
206 fNTracksAnalyzedOfEvent = 0;
d8c2cc3e 207 fNTracksAnalyzedOfEventAfterCut = 0;
789c2e43 208 fNTracksOfEvent = fMuonForwardTracksWithBranson->GetEntriesFast();
e806e863 209 while (AnalyzeSingleMuon()) continue;
210 }
211
212 if (fMuonPairAnalysis) {
6240bf36 213 if (fMuonForwardTrackPairsWithBranson || fMuonForwardTrackPairsWithoutBranson) {
214 fMuonForwardTrackPairsWithBranson -> Clear("C");
215 fMuonForwardTrackPairsWithoutBranson -> Clear("C");
216 fMuonForwardTrackPairsWithBranson -> Delete();
217 fMuonForwardTrackPairsWithoutBranson -> Delete();
e806e863 218 }
219 BuildMuonPairs();
220 fNPairsAnalyzedOfEvent = 0;
d8c2cc3e 221 fNPairsAnalyzedOfEventAfterCut = 0;
cabfe25b 222 fNPairsOfEvent = fMuonForwardTrackPairsWithBranson->GetEntriesFast();
6240bf36 223 while (AnalyzeMuonPair(kSingleEvent)) continue;
e806e863 224 }
225
789c2e43 226 AliDebug(2,Form("**** analyzed event # %4d (%3d tracks and %3d pairs analyzed) ****", fEv, fNTracksAnalyzedOfEventAfterCut, fNPairsAnalyzedOfEventAfterCut));
6240bf36 227
228 if (fMuonPairAnalysis && fMixing) {
229 for (fEvMix=fEv+1; fEvMix<=fEv+fNEventsToMix; fEvMix++) {
230 if (fEvMix<=fLastEvent) {
231
232 if (fMuonForwardTracksWithBransonMix || fMuonForwardTracksWithoutBransonMix) {
233 fMuonForwardTracksWithBransonMix -> Delete();
234 fMuonForwardTracksWithoutBransonMix -> Delete();
235 delete fMuonForwardTracksWithBransonMix;
236 delete fMuonForwardTracksWithoutBransonMix;
237 }
238
239 fMuonForwardTracksWithBranson -> Clear("C");
240 fMuonForwardTracksWithoutBranson -> Clear("C");
241 fMuonForwardTracksWithBranson -> Delete();
242 fMuonForwardTracksWithoutBranson -> Delete();
243 fInputTreeWithBranson -> GetEvent(fEvMix);
244 fInputTreeWithoutBranson -> GetEvent(fEvMix);
245
246 fMuonForwardTracksWithBransonMix = new TClonesArray(*fMuonForwardTracksWithBranson);
247 fMuonForwardTracksWithoutBransonMix = new TClonesArray(*fMuonForwardTracksWithoutBranson);
248
249 fMuonForwardTracksWithBranson -> Clear("C");
250 fMuonForwardTracksWithoutBranson -> Clear("C");
251 fMuonForwardTracksWithBranson -> Delete();
252 fMuonForwardTracksWithoutBranson -> Delete();
253 fInputTreeWithBranson -> GetEvent(fEv);
254 fInputTreeWithoutBranson -> GetEvent(fEv);
255
256 AliDebug(2,Form("**** mixing event # %4d (%3d tracks) with event # %4d (%3d tracks) ****",
257 fEv, fMuonForwardTracksWithBranson->GetEntriesFast(),
258 fEvMix, fMuonForwardTracksWithBransonMix ->GetEntriesFast()));
259 if (fMuonForwardTrackPairsWithBranson || fMuonForwardTrackPairsWithoutBranson) {
260 fMuonForwardTrackPairsWithBranson -> Clear("C");
261 fMuonForwardTrackPairsWithoutBranson -> Clear("C");
262 fMuonForwardTrackPairsWithBranson -> Delete();
263 fMuonForwardTrackPairsWithoutBranson -> Delete();
264 }
265 BuildMuonPairsMix();
266 fNPairsAnalyzedOfEvent = 0;
267 fNPairsAnalyzedOfEventAfterCut = 0;
268 fNPairsOfEvent = fMuonForwardTrackPairsWithBranson->GetEntriesFast();
269 while (AnalyzeMuonPair(kMixedEvent)) continue;
270 AliDebug(2,Form("**** analyzed mixed event pair (%4d ; %4d) : %3d pairs analyzed ****", fEv, fEvMix, fNPairsAnalyzedOfEventAfterCut));
271
272 // delete fMuonForwardTracksWithBransonMix;
273 // delete fMuonForwardTracksWithoutBransonMix;
274
275 }
276 }
277 }
278
e806e863 279 fEv++;
280
281 return kTRUE;
282
283}
284
285//====================================================================================================================================================
286
287Bool_t AliMuonForwardTrackAnalysis::AnalyzeSingleMuon() {
288
289 if (fNTracksAnalyzedOfEvent>=fNTracksOfEvent) return kFALSE;
290
7e3dd1af 291 fMFTTrackWithBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithBranson->At(fNTracksAnalyzedOfEvent);
292 fMFTTrackWithoutBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithoutBranson->At(fNTracksAnalyzedOfEvent);
293
e806e863 294 fNTracksAnalyzedOfEvent++;
7e3dd1af 295
296 Bool_t passedCut = kFALSE;
297 if (fUseBransonForCut) passedCut = PassedCutSingleMuon(fMFTTrackWithBranson);
298 else passedCut = PassedCutSingleMuon(fMFTTrackWithoutBranson);
299 if (!passedCut) return kTRUE;
300
301 if (fUseBransonForKinematics) fMFTTrack = fMFTTrackWithBranson;
302 else fMFTTrack = fMFTTrackWithoutBranson;
cabfe25b 303 if (fMFTTrack->GetMatchTrigger() < fTriggerLevel) return kTRUE;
e806e863 304 fMCRefTrack = fMFTTrack->GetMCTrackRef();
305
cabfe25b 306 if (fMaxNWrongClustersMC<6) {
307 if (!fMCRefTrack) return kTRUE;
308 if (fMFTTrack->GetNWrongClustersMC()>fMaxNWrongClustersMC) return kTRUE;
309 }
d8c2cc3e 310
311 if (fMCRefTrack) {
312 fHistZOriginSingleMuonsMC -> Fill(-1.*fMCRefTrack->Vz());
313 fHistZROriginSingleMuonsMC -> Fill(-1.*fMCRefTrack->Vz(), TMath::Sqrt(fMCRefTrack->Vx()*fMCRefTrack->Vx()+fMCRefTrack->Vy()*fMCRefTrack->Vy()));
314 }
e806e863 315
e806e863 316 AliMUONTrackParam *param = fMFTTrack->GetTrackParamAtMFTCluster(0);
7e3dd1af 317 AliMUONTrackExtrap::ExtrapToZCov(param, fPrimaryVtxZ);
e806e863 318
319 TLorentzVector pMu;
320 Double_t mMu = TDatabasePDG::Instance()->GetParticle("mu-")->Mass();
321 Double_t energy = TMath::Sqrt(param->P()*param->P() + mMu*mMu);
322 pMu.SetPxPyPzE(param->Px(), param->Py(), param->Pz(), energy);
323
e806e863 324 TMatrixD cov(5,5);
325 cov = param->GetCovariances();
326
6240bf36 327 fHistXErrorSingleMuonsVsP -> Fill(1.e4*TMath::Sqrt(cov(0,0)), pMu.P());
328 fHistYErrorSingleMuonsVsP -> Fill(1.e4*TMath::Sqrt(cov(2,2)), pMu.P());
329 fHistXErrorSingleMuonsVsPt -> Fill(1.e4*TMath::Sqrt(cov(0,0)), pMu.Pt());
330 fHistYErrorSingleMuonsVsPt -> Fill(1.e4*TMath::Sqrt(cov(2,2)), pMu.Pt());
e806e863 331
7e3dd1af 332 Double_t dX = fMFTTrack->GetOffsetX(fPrimaryVtxX, fPrimaryVtxZ);
333 Double_t dY = fMFTTrack->GetOffsetY(fPrimaryVtxY, fPrimaryVtxZ);
e806e863 334
7e3dd1af 335 Double_t offset = fMFTTrack->GetOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ);
336 Double_t weightedOffset = fMFTTrack->GetWeightedOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ);
e806e863 337
338 // AliDebug(2, Form("pdg code = %d\n", fMCRefTrack->GetPdgCode()));
339
6240bf36 340 fHistXOffsetSingleMuonsVsP -> Fill(1.e4*dX, pMu.P());
341 fHistYOffsetSingleMuonsVsP -> Fill(1.e4*dY, pMu.P());
342 fHistOffsetSingleMuonsVsP -> Fill(1.e4*offset, pMu.P());
343 fHistWOffsetSingleMuonsVsP -> Fill(weightedOffset, pMu.P());
344 fHistXOffsetSingleMuonsVsPt -> Fill(1.e4*dX, pMu.Pt());
345 fHistYOffsetSingleMuonsVsPt -> Fill(1.e4*dY, pMu.Pt());
346 fHistOffsetSingleMuonsVsPt -> Fill(1.e4*offset, pMu.Pt());
347 fHistWOffsetSingleMuonsVsPt -> Fill(weightedOffset, pMu.Pt());
cd2f51d2 348
cabfe25b 349 fHistSingleMuonsPtRapidity -> Fill(pMu.Rapidity(), pMu.Pt());
b5ab1ac4 350 Double_t chi2OverNdf = fMFTTrack->GetGlobalChi2()/Double_t(fMFTTrack->GetNMFTClusters()+fMFTTrack->GetNMUONClusters());
351 fHistSingleMuonsOffsetChi2 -> Fill(1.e4*offset, chi2OverNdf);
e806e863 352
353 fNTracksAnalyzed++;
d8c2cc3e 354 fNTracksAnalyzedOfEventAfterCut++;
e806e863 355
356 return kTRUE;
357
358}
359
360//====================================================================================================================================================
361
6240bf36 362Bool_t AliMuonForwardTrackAnalysis::AnalyzeMuonPair(Int_t opt) {
e806e863 363
364 if (fNPairsAnalyzedOfEvent>=fNPairsOfEvent) return kFALSE;
365
7e3dd1af 366 fMFTTrackPairWithBranson = (AliMuonForwardTrackPair*) fMuonForwardTrackPairsWithBranson->At(fNPairsAnalyzedOfEvent);
367 fMFTTrackPairWithoutBranson = (AliMuonForwardTrackPair*) fMuonForwardTrackPairsWithoutBranson->At(fNPairsAnalyzedOfEvent);
e806e863 368
7e3dd1af 369 fNPairsAnalyzedOfEvent++;
370
7e3dd1af 371 if (fUseBransonForKinematics) fMFTTrackPair = fMFTTrackPairWithBranson;
372 else fMFTTrackPair = fMFTTrackPairWithoutBranson;
e806e863 373
7e3dd1af 374 if ( fMFTTrackPair->GetTrack(0)->GetNWrongClustersMC()>fMaxNWrongClustersMC ||
375 fMFTTrackPair->GetTrack(1)->GetNWrongClustersMC()>fMaxNWrongClustersMC ) return kTRUE;
e806e863 376
cabfe25b 377 if (fOption==kResonanceOnly && !fMFTTrackPair->IsResonance()) return kTRUE;
789c2e43 378 if (fOption==kResonanceOnly && fMFTTrackPair->GetCharge() != 0) return kTRUE;
379
380 Double_t pca[3] = {0};
381 fMFTTrackPair -> GetPointOfClosestApproach(pca);
382 Double_t distancePrimaryVtxPCA = TMath::Sqrt(TMath::Power(fPrimaryVtxX-pca[0],2)+
383 TMath::Power(fPrimaryVtxY-pca[1],2)+
384 TMath::Power(fPrimaryVtxZ-pca[2],2));
385
d8c2cc3e 386 fMFTTrackPair -> SetKinem(fPrimaryVtxZ);
387
cabfe25b 388 Bool_t passedCut = kFALSE;
389 if (fUseBransonForCut) passedCut = PassedCutMuonPair(fMFTTrackPairWithBranson);
390 else passedCut = PassedCutMuonPair(fMFTTrackPairWithoutBranson);
391
392 if (!passedCut) return kTRUE;
cd2f51d2 393
cabfe25b 394 // --------------- Filling dimuon histograms --------------------------------
cd2f51d2 395
789c2e43 396 if (fMFTTrackPair->GetCharge() == 0) {
6240bf36 397 if (fOption==kResonanceOnly && opt==kSingleEvent) fHistMassMuonPairsMCVsPt -> Fill(fMFTTrackPair->GetMassMC(), fMFTTrackPair->GetPt());
398 fHistMassMuonPairsVsPt[opt] -> Fill(fMFTTrackPair->GetMass(), fMFTTrackPair->GetPt());
399 fHistMassMuonPairsWithoutMFTVsPt[opt] -> Fill(fMFTTrackPair->GetMassWithoutMFT(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ), fMFTTrackPair->GetPt());
400 fHistWOffsetMuonPairsAtPrimaryVtxVsPt[opt] -> Fill(fMFTTrackPair->GetWeightedOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ), fMFTTrackPair->GetPt());
401 fHistWOffsetMuonPairsAtPCAVsPt[opt] -> Fill(fMFTTrackPair->GetWeightedOffsetAtPCA(), fMFTTrackPair->GetPt());
402 fHistDistancePrimaryVtxPCAVsPt[opt] -> Fill(distancePrimaryVtxPCA*1.e4, fMFTTrackPair->GetPt());
403 fHistPCAQualityVsPt[opt] -> Fill(fMFTTrackPair->GetPCAQuality(), fMFTTrackPair->GetPt());
404 fHistPseudoProperDecayLengthVsPt[opt] -> Fill(GetPseudoProperDecayLength(fMFTTrackPair, fTrueMass), fMFTTrackPair->GetPt());
405 if (fEvalDimuonVtxResolution && opt==kSingleEvent) {
cabfe25b 406 fHistDimuonVtxResolutionXVsPt->Fill(pca[0]*1.e4, fMFTTrackPair->GetPt());
407 fHistDimuonVtxResolutionYVsPt->Fill(pca[1]*1.e4, fMFTTrackPair->GetPt());
408 fHistDimuonVtxResolutionZVsPt->Fill(pca[2]*1.e4, fMFTTrackPair->GetPt());
409 }
6240bf36 410 fHistRapidityPtMuonPairs[opt] -> Fill(fMFTTrackPair->GetRapidity(), fMFTTrackPair->GetPt());
789c2e43 411 }
412 else if (fMFTTrackPair->GetCharge() == -2) {
6240bf36 413 fHistMassMuonPairsVsPtLSm[opt] -> Fill(fMFTTrackPair->GetMass(), fMFTTrackPair->GetPt());
414 fHistMassMuonPairsWithoutMFTVsPtLSm[opt] -> Fill(fMFTTrackPair->GetMassWithoutMFT(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ), fMFTTrackPair->GetPt());
789c2e43 415 }
416 else if (fMFTTrackPair->GetCharge() == 2) {
6240bf36 417 fHistMassMuonPairsVsPtLSp[opt] -> Fill(fMFTTrackPair->GetMass(), fMFTTrackPair->GetPt());
418 fHistMassMuonPairsWithoutMFTVsPtLSp[opt] -> Fill(fMFTTrackPair->GetMassWithoutMFT(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ), fMFTTrackPair->GetPt());
789c2e43 419 }
420
d8c2cc3e 421 AliDebug(1, Form("mass = %f MC = %f", fMFTTrackPair->GetMass(), fMFTTrackPair->GetMassMC()));
422
423 fNPairsAnalyzedOfEventAfterCut++;
e806e863 424
425 return kTRUE;
426
427}
428
429//====================================================================================================================================================
430
431void AliMuonForwardTrackAnalysis::BuildMuonPairs() {
432
789c2e43 433 Int_t nMuonPairs = 0;
434
435 for (Int_t iTrack=0; iTrack<fMuonForwardTracksWithBranson->GetEntriesFast(); iTrack++) {
e806e863 436 for (Int_t jTrack=0; jTrack<iTrack; jTrack++) {
789c2e43 437
7e3dd1af 438 AliMuonForwardTrack *track0_WithBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithBranson->At(iTrack);
439 AliMuonForwardTrack *track1_WithBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithBranson->At(jTrack);
789c2e43 440
7e3dd1af 441 AliMuonForwardTrack *track0_WithoutBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithoutBranson->At(iTrack);
442 AliMuonForwardTrack *track1_WithoutBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithoutBranson->At(jTrack);
e806e863 443
cabfe25b 444 if (track0_WithBranson->GetMatchTrigger()<fTriggerLevel || track1_WithBranson->GetMatchTrigger()<fTriggerLevel) continue;
e806e863 445
6240bf36 446 // Resonance = both mu from the same resonance
447 // Open Charm = both mu from charmed mesons
448 // Open Beauty = both mu from beauty mesons
449 // Background1mu = at least one mu from background
450 // Background2mu = both mu from background
451
452 AliMuonForwardTrackPair *trackPairWithBranson = new AliMuonForwardTrackPair(track0_WithBranson, track1_WithBranson);
453
454 if (fOption==kResonanceOnly && !trackPairWithBranson->IsResonance()) { delete trackPairWithBranson; continue; }
455 if (fOption==kNoResonances && trackPairWithBranson->IsResonance()) { delete trackPairWithBranson; continue; }
456
457 if (fOption==kCharmOnly && (!track0_WithBranson->IsFromCharm() || !track1_WithBranson->IsFromCharm())) { delete trackPairWithBranson; continue; }
458
459 if (fOption==kBeautyOnly && (!track0_WithBranson->IsFromBeauty() || !track1_WithBranson->IsFromBeauty())) { delete trackPairWithBranson; continue; }
460
461 if (fOption==kBackground1mu && (!track0_WithBranson->IsFromBackground() && !track1_WithBranson->IsFromBackground())) { delete trackPairWithBranson; continue; }
462 if (fOption==kBackground2mu && (!track0_WithBranson->IsFromBackground() || !track1_WithBranson->IsFromBackground())) { delete trackPairWithBranson; continue; }
463
464 delete trackPairWithBranson;
465
789c2e43 466 new ((*fMuonForwardTrackPairsWithBranson)[nMuonPairs]) AliMuonForwardTrackPair(track0_WithBranson, track1_WithBranson);
467 new ((*fMuonForwardTrackPairsWithoutBranson)[nMuonPairs]) AliMuonForwardTrackPair(track0_WithoutBranson, track1_WithoutBranson);
6240bf36 468
469 nMuonPairs++;
789c2e43 470
6240bf36 471 }
472 }
473
474}
475
476//====================================================================================================================================================
477
478void AliMuonForwardTrackAnalysis::BuildMuonPairsMix() {
479
480 Int_t nMuonPairs = 0;
481
482 for (Int_t iTrack=0; iTrack<fMuonForwardTracksWithBranson->GetEntriesFast(); iTrack++) {
483 for (Int_t jTrack=0; jTrack<fMuonForwardTracksWithBransonMix->GetEntriesFast(); jTrack++) {
484
485 AliMuonForwardTrack *track0_WithBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithBranson -> At(iTrack);
486 AliMuonForwardTrack *track1_WithBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithBransonMix -> At(jTrack);
487
488 AliMuonForwardTrack *track0_WithoutBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithoutBranson -> At(iTrack);
489 AliMuonForwardTrack *track1_WithoutBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithoutBransonMix -> At(jTrack);
490
491 if (track0_WithBranson->GetMatchTrigger()<fTriggerLevel || track1_WithBranson->GetMatchTrigger()<fTriggerLevel) continue;
492
493 // Resonance = both mu from the same resonance
494 // Open Charm = both mu from charmed mesons
495 // Open Beauty = both mu from beauty mesons
496 // Background1mu = at least one mu from background
497 // Background2mu = both mu from background
498
499 AliMuonForwardTrackPair *trackPairWithBranson = new AliMuonForwardTrackPair(track0_WithBranson, track1_WithBranson);
500
501 if (fOption==kResonanceOnly && !trackPairWithBranson->IsResonance()) { delete trackPairWithBranson; continue; }
502 if (fOption==kNoResonances && trackPairWithBranson->IsResonance()) { delete trackPairWithBranson; continue; }
503
504 if (fOption==kCharmOnly && (!track0_WithBranson->IsFromCharm() || !track1_WithBranson->IsFromCharm())) { delete trackPairWithBranson; continue; }
505
506 if (fOption==kBeautyOnly && (!track0_WithBranson->IsFromBeauty() || !track1_WithBranson->IsFromBeauty())) { delete trackPairWithBranson; continue; }
507
508 if (fOption==kBackground1mu && (!track0_WithBranson->IsFromBackground() && !track1_WithBranson->IsFromBackground())) { delete trackPairWithBranson; continue; }
509 if (fOption==kBackground2mu && (!track0_WithBranson->IsFromBackground() || !track1_WithBranson->IsFromBackground())) { delete trackPairWithBranson; continue; }
510
511 delete trackPairWithBranson;
512
513 new ((*fMuonForwardTrackPairsWithBranson)[nMuonPairs]) AliMuonForwardTrackPair(track0_WithBranson, track1_WithBranson);
514 new ((*fMuonForwardTrackPairsWithoutBranson)[nMuonPairs]) AliMuonForwardTrackPair(track0_WithoutBranson, track1_WithoutBranson);
515
516 nMuonPairs++;
789c2e43 517
e806e863 518 }
519 }
520
521}
522
523//====================================================================================================================================================
524
7e3dd1af 525Bool_t AliMuonForwardTrackAnalysis::PassedCutSingleMuon(AliMuonForwardTrack *track) {
526
527 AliMUONTrackParam *param = track->GetTrackParamAtMFTCluster(0);
528 AliMUONTrackExtrap::ExtrapToZCov(param, fPrimaryVtxZ);
529
6240bf36 530 if (track->Pt()<fMinPtSingleMuons) return kFALSE;
7e3dd1af 531
cabfe25b 532 Double_t offset = 1.e4*track->GetOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ);
533 Double_t chi2OverNdf = track->GetGlobalChi2() / Double_t(track->GetNMFTClusters()+track->GetNMUONClusters());
534 offset /= fMaxOffsetSingleMuons;
535 chi2OverNdf /= fMaxChi2SingleMuons;
536
537 if (fCorrelateCutOnOffsetChi2) {
538 if (TMath::Sqrt(offset*offset + chi2OverNdf*chi2OverNdf) > 1) return kFALSE;
539 }
540 else {
541 if (offset>1 || chi2OverNdf>1) return kFALSE;
7e3dd1af 542 }
543
544 return kTRUE;
545
546}
547
548//====================================================================================================================================================
549
550Bool_t AliMuonForwardTrackAnalysis::PassedCutMuonPair(AliMuonForwardTrackPair *pair) {
551
cabfe25b 552 if (!PassedCutSingleMuon(pair->GetTrack(0)) || !PassedCutSingleMuon(pair->GetTrack(1))) return kFALSE;
553
554 if (pair->GetMass()>fMassMax || pair->GetMass()<fMassMin) return kFALSE;
7e3dd1af 555
cabfe25b 556 if (pair->GetWeightedOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ) > fMaxWOffsetMuonPairsAtPrimaryVtx) return kFALSE;
557 if (pair->GetWeightedOffsetAtPCA() > fMaxWOffsetMuonPairsAtPCA) return kFALSE;
558
559 Double_t pca[3] = {0};
560 pair -> GetPointOfClosestApproach(pca);
561 Double_t distancePrimaryVtxPCA = TMath::Sqrt(TMath::Power(fPrimaryVtxX-pca[0],2)+
562 TMath::Power(fPrimaryVtxY-pca[1],2)+
563 TMath::Power(fPrimaryVtxZ-pca[2],2));
564
565 if (distancePrimaryVtxPCA > fMaxDistancePrimaryVtxPCA) return kFALSE;
566 if (pair->GetPCAQuality() < fMinPCAQuality) return kFALSE;
567
568 return kTRUE;
569
570}
571
572//====================================================================================================================================================
573
574Double_t AliMuonForwardTrackAnalysis::GetPseudoProperDecayLength(AliMuonForwardTrackPair *pair, Double_t trueMass) {
575
576 Double_t pca[3] = {0};
577 pair -> GetPointOfClosestApproach(pca);
578
579 TVector2 vecVertexPCA(pca[0]-fPrimaryVtxX, pca[1]-fPrimaryVtxY);
580 TVector2 dimuonPt(pair->GetPx(), pair->GetPy());
6240bf36 581 TVector2 dimuonPtUnit = dimuonPt.Unit();
cabfe25b 582
6240bf36 583 Double_t l_xy = vecVertexPCA*dimuonPtUnit;
cabfe25b 584 Double_t pseudoProperDecayLength = (l_xy * trueMass / pair->GetPt()) * 1.e4 ; // in micron
585
586 return pseudoProperDecayLength;
587
7e3dd1af 588}
589
590//====================================================================================================================================================
591
e806e863 592void AliMuonForwardTrackAnalysis::Terminate(Char_t *outputFileName) {
593
e806e863 594 TFile *fileOut = new TFile(Form("%s/%s",fOutputDir.Data(),outputFileName), "recreate");
595
596 printf("Writing output objects to file %s\n", fileOut->GetName());
597
6240bf36 598 // single muons
599
600 fHistXOffsetSingleMuonsVsP -> Write();
601 fHistYOffsetSingleMuonsVsP -> Write();
602 fHistXOffsetSingleMuonsVsPt -> Write();
603 fHistYOffsetSingleMuonsVsPt -> Write();
604
605 fHistXErrorSingleMuonsVsP -> Write();
606 fHistYErrorSingleMuonsVsP -> Write();
607 fHistXErrorSingleMuonsVsPt -> Write();
608 fHistYErrorSingleMuonsVsPt -> Write();
609
610 fHistOffsetSingleMuonsVsP -> Write();
611 fHistOffsetSingleMuonsVsPt -> Write();
612 fHistWOffsetSingleMuonsVsP -> Write();
613 fHistWOffsetSingleMuonsVsPt -> Write();
614
615 fHistSingleMuonsPtRapidity -> Write();
616 fHistSingleMuonsOffsetChi2 -> Write();
617 fHistZOriginSingleMuonsMC -> Write();
618 fHistZROriginSingleMuonsMC -> Write();
619
620 // dimuons
621
622 fHistMassMuonPairsVsPt[kSingleEvent] -> Write();
623 fHistMassMuonPairsWithoutMFTVsPt[kSingleEvent] -> Write();
624 fHistMassMuonPairsVsPtLSp[kSingleEvent] -> Write();
625 fHistMassMuonPairsWithoutMFTVsPtLSp[kSingleEvent] -> Write();
626 fHistMassMuonPairsVsPtLSm[kSingleEvent] -> Write();
627 fHistMassMuonPairsWithoutMFTVsPtLSm[kSingleEvent] -> Write();
628 fHistWOffsetMuonPairsAtPrimaryVtxVsPt[kSingleEvent] -> Write();
629 fHistWOffsetMuonPairsAtPCAVsPt[kSingleEvent] -> Write();
630 fHistDistancePrimaryVtxPCAVsPt[kSingleEvent] -> Write();
631 fHistPCAQualityVsPt[kSingleEvent] -> Write();
632 fHistPseudoProperDecayLengthVsPt[kSingleEvent] -> Write();
633 fHistRapidityPtMuonPairs[kSingleEvent] -> Write();
634 fHistMassMuonPairsMCVsPt -> Write();
cabfe25b 635 if (fEvalDimuonVtxResolution) {
636 fHistDimuonVtxResolutionXVsPt -> Write();
637 fHistDimuonVtxResolutionYVsPt -> Write();
638 fHistDimuonVtxResolutionZVsPt -> Write();
cd2f51d2 639 }
6240bf36 640
641 if (fMixing) {
642 fHistMassMuonPairsVsPt[kMixedEvent] -> Write();
643 fHistMassMuonPairsWithoutMFTVsPt[kMixedEvent] -> Write();
644 fHistMassMuonPairsVsPtLSp[kMixedEvent] -> Write();
645 fHistMassMuonPairsWithoutMFTVsPtLSp[kMixedEvent] -> Write();
646 fHistMassMuonPairsVsPtLSm[kMixedEvent] -> Write();
647 fHistMassMuonPairsWithoutMFTVsPtLSm[kMixedEvent] -> Write();
648 fHistWOffsetMuonPairsAtPrimaryVtxVsPt[kMixedEvent] -> Write();
649 fHistWOffsetMuonPairsAtPCAVsPt[kMixedEvent] -> Write();
650 fHistDistancePrimaryVtxPCAVsPt[kMixedEvent] -> Write();
651 fHistPCAQualityVsPt[kMixedEvent] -> Write();
652 fHistPseudoProperDecayLengthVsPt[kMixedEvent] -> Write();
653 fHistRapidityPtMuonPairs[kMixedEvent] -> Write();
654 }
e806e863 655
656 fileOut -> Close();
657
658}
659
660//====================================================================================================================================================
661
662void AliMuonForwardTrackAnalysis::BookHistos() {
663
cabfe25b 664 // -------------------- single muons
665
6240bf36 666 fHistXOffsetSingleMuonsVsP = new TH2D("fHistXOffsetSingleMuonsVsP", "Offset for single muons along X vs P", 200, -1000, 1000, 100, 0, 100);
667 fHistYOffsetSingleMuonsVsP = new TH2D("fHistYOffsetSingleMuonsVsP", "Offset for single muons along Y vs P", 200, -1000, 1000, 100, 0, 100);
668 fHistXOffsetSingleMuonsVsPt = new TH2D("fHistXOffsetSingleMuonsVsPt", "Offset for single muons along X vs p_{T}", 200, -1000, 1000, 100, 0, 10);
669 fHistYOffsetSingleMuonsVsPt = new TH2D("fHistYOffsetSingleMuonsVsPt", "Offset for single muons along Y vs p_{T}", 200, -1000, 1000, 100, 0, 10);
670
671 fHistXErrorSingleMuonsVsP = new TH2D("fHistXErrorSingleMuonsVsP", "Coordinate Error for single muons along X vs P", 200, 0, 1000, 100, 0, 100);
672 fHistYErrorSingleMuonsVsP = new TH2D("fHistYErrorSingleMuonsVsP", "Coordinate Error for single muons along Y vs P", 200, 0, 1000, 100, 0, 100);
673 fHistXErrorSingleMuonsVsPt = new TH2D("fHistXErrorSingleMuonsVsPt", "Coordinate Error for single muons along X vs p_{T}", 200, 0, 1000, 100, 0, 10);
674 fHistYErrorSingleMuonsVsPt = new TH2D("fHistYErrorSingleMuonsVsPt", "Coordinate Error for single muons along Y vs p_{T}", 200, 0, 1000, 100, 0, 10);
675
676 fHistOffsetSingleMuonsVsP = new TH2D("fHistOffsetSingleMuonsVsP", "Offset for single muons vs P", 200, 0, 2000, 100, 0, 100);
677 fHistOffsetSingleMuonsVsPt = new TH2D("fHistOffsetSingleMuonsVsPt", "Offset for single muons vs p_{T}", 200, 0, 2000, 100, 0, 10);
678 fHistWOffsetSingleMuonsVsP = new TH2D("fHistWOffsetSingleMuonsVsP", "Weighted Offset for single muons vs P", 300, 0, 15, 100, 0, 100);
679 fHistWOffsetSingleMuonsVsPt = new TH2D("fHistWOffsetSingleMuonsVsPt", "Weighted Offset for single muons vs p_{T}", 300, 0, 15, 100, 0, 10);
e806e863 680
cabfe25b 681 fHistSingleMuonsPtRapidity = new TH2D("fHistSingleMuonsPtRapidity", "Phase Space for single muons", 100, -4.5, -2., 100, 0., 10.);
789c2e43 682 fHistSingleMuonsOffsetChi2 = new TH2D("fHistSingleMuonsOffsetChi2", "Offset vs #chi^{2}/ndf for single muons", 400, 0, 4000, 200, 0, 10);
d8c2cc3e 683 fHistZOriginSingleMuonsMC = new TH1D("fHistZOriginSingleMuonsMC", "Z origin for single muons (from MC)", 1000, 0., 500.);
684 fHistZROriginSingleMuonsMC = new TH2D("fHistZROriginSingleMuonsMC", "Z-R origin for single muons (from MC)", 1000, 0., 500., 1000, 0., 100.);
e806e863 685
6240bf36 686 //
687
688 fHistXOffsetSingleMuonsVsP -> SetXTitle("Offset(X) [#mum]");
689 fHistYOffsetSingleMuonsVsP -> SetXTitle("Offset(Y) [#mum]");
690 fHistXOffsetSingleMuonsVsPt -> SetXTitle("Offset(X) [#mum]");
691 fHistYOffsetSingleMuonsVsPt -> SetXTitle("Offset(Y) [#mum]");
692
693 fHistXErrorSingleMuonsVsP -> SetXTitle("Err. on track position at z_{vtx} (X) [#mum]");
694 fHistYErrorSingleMuonsVsP -> SetXTitle("Err. on track position at z_{vtx} (Y) [#mum]");
695 fHistXErrorSingleMuonsVsPt -> SetXTitle("Err. on track position at z_{vtx} (X) [#mum]");
696 fHistYErrorSingleMuonsVsPt -> SetXTitle("Err. on track position at z_{vtx} (Y) [#mum]");
697
698 fHistOffsetSingleMuonsVsP -> SetXTitle("Offset [#mum]");
699 fHistOffsetSingleMuonsVsPt -> SetXTitle("Offset [#mum]");
700 fHistWOffsetSingleMuonsVsP -> SetXTitle("Weighted Offset");
701 fHistWOffsetSingleMuonsVsPt -> SetXTitle("Weighted Offset");
702
703 fHistXOffsetSingleMuonsVsP -> SetYTitle("P [GeV/c]");
704 fHistYOffsetSingleMuonsVsP -> SetYTitle("P [GeV/c]");
705 fHistXOffsetSingleMuonsVsPt -> SetYTitle("p_{T} [GeV/c]");
706 fHistYOffsetSingleMuonsVsPt -> SetYTitle("p_{T} [GeV/c]");
707
708 fHistXErrorSingleMuonsVsP -> SetYTitle("P [GeV/c]");
709 fHistYErrorSingleMuonsVsP -> SetYTitle("P [GeV/c]");
710 fHistXErrorSingleMuonsVsPt -> SetYTitle("p_{T} [GeV/c]");
711 fHistYErrorSingleMuonsVsPt -> SetYTitle("p_{T} [GeV/c]");
712
713 fHistOffsetSingleMuonsVsP -> SetYTitle("P [GeV/c]");
714 fHistOffsetSingleMuonsVsPt -> SetYTitle("p_{T} [GeV/c]");
715 fHistWOffsetSingleMuonsVsP -> SetYTitle("P [GeV/c]");
716 fHistWOffsetSingleMuonsVsPt -> SetYTitle("p_{T} [GeV/c]");
e806e863 717
cabfe25b 718 fHistSingleMuonsPtRapidity -> SetXTitle("y^{#mu}");
719 fHistSingleMuonsPtRapidity -> SetYTitle("p_{T}^{#mu} [GeV/c]");
b5ab1ac4 720 fHistSingleMuonsOffsetChi2 -> SetXTitle("Offset [#mum]");
721 fHistSingleMuonsOffsetChi2 -> SetYTitle("#chi^{2}/ndf");
d8c2cc3e 722
723 fHistZOriginSingleMuonsMC -> SetXTitle("Z [cm]");
724 fHistZROriginSingleMuonsMC -> SetXTitle("Z [cm]");
725 fHistZROriginSingleMuonsMC -> SetXTitle("R [cm]");
e806e863 726
6240bf36 727 //
728
729 fHistXOffsetSingleMuonsVsP -> Sumw2();
730 fHistYOffsetSingleMuonsVsP -> Sumw2();
731 fHistXOffsetSingleMuonsVsPt -> Sumw2();
732 fHistYOffsetSingleMuonsVsPt -> Sumw2();
733
734 fHistXErrorSingleMuonsVsP -> Sumw2();
735 fHistYErrorSingleMuonsVsP -> Sumw2();
736 fHistXErrorSingleMuonsVsPt -> Sumw2();
737 fHistYErrorSingleMuonsVsPt -> Sumw2();
e806e863 738
6240bf36 739 fHistOffsetSingleMuonsVsP -> Sumw2();
740 fHistOffsetSingleMuonsVsPt -> Sumw2();
741 fHistWOffsetSingleMuonsVsP -> Sumw2();
742 fHistWOffsetSingleMuonsVsPt -> Sumw2();
743
744 fHistSingleMuonsPtRapidity -> Sumw2();
745 fHistSingleMuonsOffsetChi2 -> Sumw2();
746 fHistZOriginSingleMuonsMC -> Sumw2();
747 fHistZROriginSingleMuonsMC -> Sumw2();
d8c2cc3e 748
cabfe25b 749 // -------------------- muon pairs
750
751 Int_t nBinsPt = 20; Double_t ptMin = 0., ptMax = 10.; // dimuon pt
752
6240bf36 753 fHistMassMuonPairsVsPt[kSingleEvent] = new TH2D("fHistMassMuonPairsVsPt", "Dimuon Mass (MUON+MFT) vs p_{T}^{#mu#mu}", 1000, 0, 10, nBinsPt, ptMin, ptMax);
754 fHistMassMuonPairsWithoutMFTVsPt[kSingleEvent] = new TH2D("fHistMassMuonPairsWithoutMFTVsPt", "Dimuon Mass (MUON only) vs p_{T}^{#mu#mu}", 1000, 0, 10, nBinsPt, ptMin, ptMax);
755 fHistMassMuonPairsVsPtLSp[kSingleEvent] = new TH2D("fHistMassMuonPairsVsPtLSp", "Dimuon Mass (MUON+MFT) vs p_{T}^{#mu#mu} Like-Sign ++", 1000, 0, 10, nBinsPt, ptMin, ptMax);
756 fHistMassMuonPairsWithoutMFTVsPtLSp[kSingleEvent] = new TH2D("fHistMassMuonPairsWithoutMFTVsPtLSp", "Dimuon Mass (MUON only) vs p_{T}^{#mu#mu} Like-Sign ++", 1000, 0, 10, nBinsPt, ptMin, ptMax);
757 fHistMassMuonPairsVsPtLSm[kSingleEvent] = new TH2D("fHistMassMuonPairsVsPtLSm", "Dimuon Mass (MUON+MFT) vs p_{T}^{#mu#mu} Like-Sign --", 1000, 0, 10, nBinsPt, ptMin, ptMax);
758 fHistMassMuonPairsWithoutMFTVsPtLSm[kSingleEvent] = new TH2D("fHistMassMuonPairsWithoutMFTVsPtLSm", "Dimuon Mass (MUON only) vs p_{T}^{#mu#mu} Like-Sign --", 1000, 0, 10, nBinsPt, ptMin, ptMax);
759 fHistWOffsetMuonPairsAtPrimaryVtxVsPt[kSingleEvent] = new TH2D("fHistWOffsetMuonPairsAtPrimaryVtxVsPt", "Weighted Offset for Muon Pairs at Primary Vertex vs p_{T}^{#mu#mu}", 300, 0, 60, nBinsPt, ptMin, ptMax);
760 fHistWOffsetMuonPairsAtPCAVsPt[kSingleEvent] = new TH2D("fHistWOffsetMuonPairsAtPCAVsPt", "Weighted Offset for Muon Pairs at PCA vs p_{T}^{#mu#mu}", 300, 0, 60, nBinsPt, ptMin, ptMax);
761 fHistDistancePrimaryVtxPCAVsPt[kSingleEvent] = new TH2D("fHistDistancePrimaryVtxPCAVsPt", "Distance between PCA and primary vertex vs p_{T}^{#mu#mu}", 1000, 0, 50000, nBinsPt, ptMin, ptMax);
762 fHistPCAQualityVsPt[kSingleEvent] = new TH2D("fHistPCAQualityVsPt", "PCA Quality vs p_{T}^{#mu#mu}", 200, 0, 1, nBinsPt, ptMin, ptMax);
763 fHistPseudoProperDecayLengthVsPt[kSingleEvent] = new TH2D("fHistPseudoProperDecayLengthVsPt", "Pseudo proper decay length vs p_{T}^{#mu#mu}", 1000, -5000, 5000, nBinsPt, ptMin, ptMax);
764
765 fHistMassMuonPairsVsPt[kMixedEvent] = new TH2D("fHistMassMuonPairsVsPtMix", "Dimuon Mass Mix (MUON+MFT) vs p_{T}^{#mu#mu}", 1000, 0, 10, nBinsPt, ptMin, ptMax);
766 fHistMassMuonPairsWithoutMFTVsPt[kMixedEvent] = new TH2D("fHistMassMuonPairsWithoutMFTVsPtMix", "Dimuon Mass Mix (MUON only) vs p_{T}^{#mu#mu}", 1000, 0, 10, nBinsPt, ptMin, ptMax);
767 fHistMassMuonPairsVsPtLSp[kMixedEvent] = new TH2D("fHistMassMuonPairsVsPtLSpMix", "Dimuon Mass Mix (MUON+MFT) vs p_{T}^{#mu#mu} Like-Sign ++", 1000, 0, 10, nBinsPt, ptMin, ptMax);
768 fHistMassMuonPairsWithoutMFTVsPtLSp[kMixedEvent] = new TH2D("fHistMassMuonPairsWithoutMFTVsPtLSpMix", "Dimuon Mass Mix (MUON only) vs p_{T}^{#mu#mu} Like-Sign ++", 1000, 0, 10, nBinsPt, ptMin, ptMax);
769 fHistMassMuonPairsVsPtLSm[kMixedEvent] = new TH2D("fHistMassMuonPairsVsPtLSmMix", "Dimuon Mass Mix (MUON+MFT) vs p_{T}^{#mu#mu} Like-Sign --", 1000, 0, 10, nBinsPt, ptMin, ptMax);
770 fHistMassMuonPairsWithoutMFTVsPtLSm[kMixedEvent] = new TH2D("fHistMassMuonPairsWithoutMFTVsPtLSmMix", "Dimuon Mass Mix (MUON only) vs p_{T}^{#mu#mu} Like-Sign --", 1000, 0, 10, nBinsPt, ptMin, ptMax);
771 fHistWOffsetMuonPairsAtPrimaryVtxVsPt[kMixedEvent] = new TH2D("fHistWOffsetMuonPairsAtPrimaryVtxVsPtMix", "Weighted Offset for Muon Pairs Mix at Primary Vertex vs p_{T}^{#mu#mu}", 300, 0, 60, nBinsPt, ptMin, ptMax);
772 fHistWOffsetMuonPairsAtPCAVsPt[kMixedEvent] = new TH2D("fHistWOffsetMuonPairsAtPCAVsPtMix", "Weighted Offset for Muon Pairs Mix at PCA vs p_{T}^{#mu#mu}", 300, 0, 60, nBinsPt, ptMin, ptMax);
773 fHistDistancePrimaryVtxPCAVsPt[kMixedEvent] = new TH2D("fHistDistancePrimaryVtxPCAVsPtMix", "Distance between PCA and primary vertex Mix vs p_{T}^{#mu#mu}", 1000, 0, 50000, nBinsPt, ptMin, ptMax);
774 fHistPCAQualityVsPt[kMixedEvent] = new TH2D("fHistPCAQualityVsPtMix", "PCA Quality Mix vs p_{T}^{#mu#mu}", 200, 0, 1, nBinsPt, ptMin, ptMax);
775 fHistPseudoProperDecayLengthVsPt[kMixedEvent] = new TH2D("fHistPseudoProperDecayLengthVsPtMix", "Pseudo proper decay length Mix vs p_{T}^{#mu#mu}", 1000, -5000, 5000, nBinsPt, ptMin, ptMax);
776
777 fHistMassMuonPairsMCVsPt = new TH2D("fHistMassMuonPairsMCVsPt", "Dimuon Mass (MC) vs p_{T}^{#mu#mu}", 1000, 0, 10, nBinsPt, ptMin, ptMax);
cabfe25b 778 fHistDimuonVtxResolutionXVsPt = new TH2D("fHistDimuonVtxResolutionXVsPt", "Dimuon Vtx offset along X w.r.t. true Vtx vs p_{T}^{#mu#mu}", 2000, -1000, 1000, nBinsPt, ptMin, ptMax);
779 fHistDimuonVtxResolutionYVsPt = new TH2D("fHistDimuonVtxResolutionYVsPt", "Dimuon Vtx offset along Y w.r.t. true Vtx vs p_{T}^{#mu#mu}", 2000, -1000, 1000, nBinsPt, ptMin, ptMax);
780 fHistDimuonVtxResolutionZVsPt = new TH2D("fHistDimuonVtxResolutionZVsPt", "Dimuon Vtx offset along Z w.r.t. true Vtx vs p_{T}^{#mu#mu}", 2000, -1000, 1000, nBinsPt, ptMin, ptMax);
cd2f51d2 781
6240bf36 782 for (Int_t i=0; i<2; i++) {
783 fHistMassMuonPairsVsPt[i] -> SetXTitle("Mass [GeV/c^{2}]");
784 fHistMassMuonPairsWithoutMFTVsPt[i] -> SetXTitle("Mass [GeV/c^{2}]");
785 fHistMassMuonPairsVsPtLSp[i] -> SetXTitle("Mass [GeV/c^{2}]");
786 fHistMassMuonPairsWithoutMFTVsPtLSp[i] -> SetXTitle("Mass [GeV/c^{2}]");
787 fHistMassMuonPairsVsPtLSm[i] -> SetXTitle("Mass [GeV/c^{2}]");
788 fHistMassMuonPairsWithoutMFTVsPtLSm[i] -> SetXTitle("Mass [GeV/c^{2}]");
789 fHistWOffsetMuonPairsAtPrimaryVtxVsPt[i] -> SetXTitle("Weighted Offset at Primary Vtx");
790 fHistWOffsetMuonPairsAtPCAVsPt[i] -> SetXTitle("Weighted Offset at PCA");
791 fHistDistancePrimaryVtxPCAVsPt[i] -> SetXTitle("PCA - Primary Vtx [#mum]");
792 fHistPCAQualityVsPt[i] -> SetXTitle("PCA Quality");
793 fHistPseudoProperDecayLengthVsPt[i] -> SetXTitle("l_{xy} [#mum]");
794 }
cabfe25b 795 fHistMassMuonPairsMCVsPt -> SetXTitle("Mass [GeV/c^{2}]");
cabfe25b 796 fHistDimuonVtxResolutionXVsPt -> SetXTitle("Offset [#mum]");
797 fHistDimuonVtxResolutionYVsPt -> SetXTitle("Offset [#mum]");
798 fHistDimuonVtxResolutionZVsPt -> SetXTitle("Offset [#mum]");
799
6240bf36 800 for (Int_t i=0; i<2; i++) {
801 fHistMassMuonPairsVsPt[i] -> SetYTitle("p_{T} [GeV/c]");
802 fHistMassMuonPairsWithoutMFTVsPt[i] -> SetYTitle("p_{T} [GeV/c]");
803 fHistMassMuonPairsVsPtLSp[i] -> SetYTitle("p_{T} [GeV/c]");
804 fHistMassMuonPairsWithoutMFTVsPtLSp[i] -> SetYTitle("p_{T} [GeV/c]");
805 fHistMassMuonPairsVsPtLSm[i] -> SetYTitle("p_{T} [GeV/c]");
806 fHistMassMuonPairsWithoutMFTVsPtLSm[i] -> SetYTitle("p_{T} [GeV/c]");
807 fHistWOffsetMuonPairsAtPrimaryVtxVsPt[i] -> SetYTitle("p_{T} [GeV/c]");
808 fHistWOffsetMuonPairsAtPCAVsPt[i] -> SetYTitle("p_{T} [GeV/c]");
809 fHistDistancePrimaryVtxPCAVsPt[i] -> SetYTitle("p_{T} [GeV/c]");
810 fHistPCAQualityVsPt[i] -> SetYTitle("p_{T} [GeV/c]");
811 fHistPseudoProperDecayLengthVsPt[i] -> SetYTitle("p_{T} [GeV/c]");
812 }
cabfe25b 813 fHistMassMuonPairsMCVsPt -> SetYTitle("p_{T} [GeV/c]");
cabfe25b 814 fHistDimuonVtxResolutionXVsPt -> SetYTitle("p_{T} [GeV/c]");
815 fHistDimuonVtxResolutionYVsPt -> SetYTitle("p_{T} [GeV/c]");
816 fHistDimuonVtxResolutionZVsPt -> SetYTitle("p_{T} [GeV/c]");
817
6240bf36 818 for (Int_t i=0; i<2; i++) {
819 fHistMassMuonPairsVsPt[i] -> Sumw2();
820 fHistMassMuonPairsWithoutMFTVsPt[i] -> Sumw2();
821 fHistMassMuonPairsVsPtLSp[i] -> Sumw2();
822 fHistMassMuonPairsWithoutMFTVsPtLSp[i] -> Sumw2();
823 fHistMassMuonPairsVsPtLSm[i] -> Sumw2();
824 fHistMassMuonPairsWithoutMFTVsPtLSm[i] -> Sumw2();
825 fHistWOffsetMuonPairsAtPrimaryVtxVsPt[i] -> Sumw2();
826 fHistWOffsetMuonPairsAtPCAVsPt[i] -> Sumw2();
827 fHistDistancePrimaryVtxPCAVsPt[i] -> Sumw2();
828 fHistPCAQualityVsPt[i] -> Sumw2();
829 fHistPseudoProperDecayLengthVsPt[i] -> Sumw2();
830 }
cabfe25b 831 fHistMassMuonPairsMCVsPt -> Sumw2();
cabfe25b 832 fHistDimuonVtxResolutionXVsPt -> Sumw2();
833 fHistDimuonVtxResolutionYVsPt -> Sumw2();
834 fHistDimuonVtxResolutionZVsPt -> Sumw2();
835
6240bf36 836 fHistRapidityPtMuonPairs[kSingleEvent] = new TH2D("fHistRapidityPtMuonPairs", "Dimuon Phase Space (rec)", 20, -4.5, -2., 20, 0., 10.);
837 fHistRapidityPtMuonPairs[kSingleEvent] -> SetXTitle("Rapidity");
838 fHistRapidityPtMuonPairs[kSingleEvent] -> SetYTitle("p_{T} [GeV/c]");
839 fHistRapidityPtMuonPairs[kSingleEvent] -> Sumw2();
840
841 fHistRapidityPtMuonPairs[kMixedEvent] = new TH2D("fHistRapidityPtMuonPairsMix", "Dimuon Phase Space (rec)", 20, -4.5, -2., 20, 0., 10.);
842 fHistRapidityPtMuonPairs[kMixedEvent] -> SetXTitle("Rapidity");
843 fHistRapidityPtMuonPairs[kMixedEvent] -> SetYTitle("p_{T} [GeV/c]");
844 fHistRapidityPtMuonPairs[kMixedEvent] -> Sumw2();
e806e863 845
846}
847
848//====================================================================================================================================================
849