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