Fix for run number for QA train (Mikolaj).
[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"
27
28ClassImp(AliMuonForwardTrackAnalysis)
29
30//====================================================================================================================================================
31
32AliMuonForwardTrackAnalysis::AliMuonForwardTrackAnalysis():
33 TObject(),
34 fInputDir(0),
35 fOutputDir(0),
7e3dd1af 36 fInputTreeWithBranson(0x0),
37 fInputTreeWithoutBranson(0x0),
38 fMuonForwardTracksWithBranson(0),
39 fMuonForwardTrackPairsWithBranson(0),
40 fMuonForwardTracksWithoutBranson(0),
41 fMuonForwardTrackPairsWithoutBranson(0),
42 fMFTTrackWithBranson(0),
43 fMFTTrackWithoutBranson(0),
e806e863 44 fMFTTrack(0),
7e3dd1af 45 fMFTTrackPairWithBranson(0),
46 fMFTTrackPairWithoutBranson(0),
e806e863 47 fMFTTrackPair(0),
48 fMCRefTrack(0),
49 fEv(0),
50 fFirstEvent(-1),
51 fLastEvent(-1),
52 fNTracksOfEvent(0),
53 fNTracksAnalyzedOfEvent(0),
54 fNTracksAnalyzed(0),
55 fNPairsOfEvent(0),
56 fNPairsAnalyzedOfEvent(0),
57 fHistOffsetSingleMuonsX(0x0),
58 fHistOffsetSingleMuonsY(0x0),
59 fHistOffsetSingleMuons(0x0),
60 fHistWOffsetSingleMuons(0x0),
61 fHistErrorSingleMuonsX(0x0),
62 fHistErrorSingleMuonsY(0x0),
e806e863 63 fHistSingleMuonsPtRapidity(0x0),
b5ab1ac4 64 fHistSingleMuonsOffsetChi2(0x0),
b5ab1ac4 65 fGraphSingleMuonsOffsetChi2(0x0),
cd2f51d2 66 fHistRapidityPtMuonPairsMC(0x0),
67 fNMassBins(10),
68 fNPtDimuBins(1000),
e806e863 69 fMassMin(0),
70 fMassMax(10),
cd2f51d2 71 fPtDimuMin(0),
72 fPtDimuMax(5),
73 fPtAxisDimuons(0),
e806e863 74 fSingleMuonAnalysis(1),
75 fMuonPairAnalysis(1),
76 fMatchTrigger(0),
77 fOption(0),
b5ab1ac4 78 fXVertResMC(50.e-4),
79 fYVertResMC(50.e-4),
80 fZVertResMC(50.e-4),
7e3dd1af 81 fPrimaryVtxX(0.),
82 fPrimaryVtxY(0.),
83 fPrimaryVtxZ(0.),
e806e863 84 fMaxNWrongClustersMC(999),
7e3dd1af 85 fPtMinSingleMuons(0),
86 fUseBransonForCut(kFALSE),
87 fUseBransonForKinematics(kFALSE),
88 fCutOnOffsetChi2(kFALSE),
89 fCenterOffset(0.),
53b30119 90 fCenterChi2(0.),
7e3dd1af 91 fScaleOffset(250.),
53b30119 92 fScaleChi2(9.0),
7e3dd1af 93 fRadiusCut(1.)
e806e863 94{
95
96 // default constructor
97
cd2f51d2 98 for (Int_t iPtBin=0; iPtBin<fNMaxPtBinsDimuons+1; iPtBin++) {
99 fHistWOffsetMuonPairs[iPtBin] = NULL;
100 fHistMassMuonPairs[iPtBin] = NULL;
101 fHistMassMuonPairsWithoutMFT[iPtBin] = NULL;
102 fHistMassMuonPairsMC[iPtBin] = NULL;
e806e863 103 }
104
105}
106
107//====================================================================================================================================================
108
109Bool_t AliMuonForwardTrackAnalysis::Init(Char_t *inputFileName) {
110
cd2f51d2 111 fPtAxisDimuons = new TAxis(fNPtDimuBins, fPtDimuMin, fPtDimuMax);
112
e806e863 113 BookHistos();
114
115 TFile *inputFile = new TFile(Form("%s/%s",fInputDir.Data(),inputFileName));
116 if (!inputFile || !inputFile->IsOpen()) {
117 AliError(Form("Error opening file %s", inputFileName));
118 return kFALSE;
119 }
7e3dd1af 120 fInputTreeWithBranson = (TTree*) inputFile->Get("AliMuonForwardTracksWithBranson");
121 if (!fInputTreeWithBranson) {
122 AliError("Error reading input tree");
123 return kFALSE;
124 }
125 fInputTreeWithoutBranson = (TTree*) inputFile->Get("AliMuonForwardTracksWithoutBranson");
126 if (!fInputTreeWithoutBranson) {
e806e863 127 AliError("Error reading input tree");
128 return kFALSE;
129 }
130
7e3dd1af 131 if (fFirstEvent<0 || fLastEvent<0 || fFirstEvent>fLastEvent || fFirstEvent>=fInputTreeWithBranson->GetEntries()) {
e806e863 132 fFirstEvent = 0;
7e3dd1af 133 fLastEvent = fInputTreeWithBranson->GetEntries()-1;
e806e863 134 }
135 else {
7e3dd1af 136 fLastEvent = TMath::Min(fLastEvent, Int_t(fInputTreeWithBranson->GetEntries()-1));
e806e863 137 }
138
139 AliInfo(Form("Analysing events %d to %d", fFirstEvent, fLastEvent));
140
7e3dd1af 141 fMuonForwardTracksWithBranson = new TClonesArray("AliMuonForwardTrack");
142 fInputTreeWithBranson->SetBranchAddress("tracks", &fMuonForwardTracksWithBranson);
143
144 fMuonForwardTracksWithoutBranson = new TClonesArray("AliMuonForwardTrack");
145 fInputTreeWithoutBranson->SetBranchAddress("tracks", &fMuonForwardTracksWithoutBranson);
e806e863 146
147 TGeoManager::Import(Form("%s/geometry.root",fInputDir.Data()));
148
149 AliMUONTrackExtrap::SetField();
150
7e3dd1af 151 fMuonForwardTrackPairsWithBranson = new TClonesArray("AliMuonForwardTrackPair");
152 fMuonForwardTrackPairsWithoutBranson = new TClonesArray("AliMuonForwardTrackPair");
e806e863 153
154 return kTRUE;
155
156}
157
158//====================================================================================================================================================
159
160Bool_t AliMuonForwardTrackAnalysis::LoadNextEvent() {
161
162 if (fEv>fLastEvent) return kFALSE;
163 if (fEv<fFirstEvent) { fEv++; return kTRUE; }
7e3dd1af 164 fMuonForwardTracksWithBranson -> Delete();
165 fMuonForwardTracksWithoutBranson -> Delete();
166 fInputTreeWithBranson->GetEvent(fEv);
167 fInputTreeWithoutBranson->GetEvent(fEv);
168 AliInfo(Form("**** analyzing event # %4d (%3d tracks) ****", fEv, fMuonForwardTracksWithBranson->GetEntries()));
169
170 fPrimaryVtxX = gRandom->Gaus(0., fXVertResMC);
171 fPrimaryVtxY = gRandom->Gaus(0., fYVertResMC);
172 fPrimaryVtxZ = gRandom->Gaus(0., fZVertResMC);
e806e863 173
174 if (fSingleMuonAnalysis) {
175 fNTracksAnalyzedOfEvent = 0;
7e3dd1af 176 fNTracksOfEvent = fMuonForwardTracksWithBranson->GetEntries();
e806e863 177 while (AnalyzeSingleMuon()) continue;
178 }
179
180 if (fMuonPairAnalysis) {
7e3dd1af 181 if (fMuonForwardTrackPairsWithBranson) {
182 fMuonForwardTrackPairsWithBranson->Delete();
183 fMuonForwardTrackPairsWithoutBranson->Delete();
e806e863 184 }
185 BuildMuonPairs();
186 fNPairsAnalyzedOfEvent = 0;
7e3dd1af 187 fNPairsOfEvent = fMuonForwardTrackPairsWithBranson->GetEntries();
e806e863 188 while (AnalyzeMuonPair()) continue;
189 }
190
191 fEv++;
192
193 return kTRUE;
194
195}
196
197//====================================================================================================================================================
198
199Bool_t AliMuonForwardTrackAnalysis::AnalyzeSingleMuon() {
200
201 if (fNTracksAnalyzedOfEvent>=fNTracksOfEvent) return kFALSE;
202
7e3dd1af 203 fMFTTrackWithBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithBranson->At(fNTracksAnalyzedOfEvent);
204 fMFTTrackWithoutBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithoutBranson->At(fNTracksAnalyzedOfEvent);
205
e806e863 206 fNTracksAnalyzedOfEvent++;
7e3dd1af 207
208 Bool_t passedCut = kFALSE;
209 if (fUseBransonForCut) passedCut = PassedCutSingleMuon(fMFTTrackWithBranson);
210 else passedCut = PassedCutSingleMuon(fMFTTrackWithoutBranson);
211 if (!passedCut) return kTRUE;
212
213 if (fUseBransonForKinematics) fMFTTrack = fMFTTrackWithBranson;
214 else fMFTTrack = fMFTTrackWithoutBranson;
e806e863 215 if (fMatchTrigger && !fMFTTrack->GetMatchTrigger()) return kTRUE;
216 fMCRefTrack = fMFTTrack->GetMCTrackRef();
217
218 if (!fMCRefTrack) return kTRUE;
219 if (fMFTTrack->GetNWrongClustersMC()>fMaxNWrongClustersMC) return kTRUE;
220
e806e863 221 AliMUONTrackParam *param = fMFTTrack->GetTrackParamAtMFTCluster(0);
7e3dd1af 222 AliMUONTrackExtrap::ExtrapToZCov(param, fPrimaryVtxZ);
e806e863 223
224 TLorentzVector pMu;
225 Double_t mMu = TDatabasePDG::Instance()->GetParticle("mu-")->Mass();
226 Double_t energy = TMath::Sqrt(param->P()*param->P() + mMu*mMu);
227 pMu.SetPxPyPzE(param->Px(), param->Py(), param->Pz(), energy);
228
e806e863 229 TMatrixD cov(5,5);
230 cov = param->GetCovariances();
231
232 fHistErrorSingleMuonsX -> Fill(1.e4*TMath::Sqrt(cov(0,0)));
233 fHistErrorSingleMuonsY -> Fill(1.e4*TMath::Sqrt(cov(2,2)));
234
7e3dd1af 235 Double_t dX = fMFTTrack->GetOffsetX(fPrimaryVtxX, fPrimaryVtxZ);
236 Double_t dY = fMFTTrack->GetOffsetY(fPrimaryVtxY, fPrimaryVtxZ);
e806e863 237
7e3dd1af 238 Double_t offset = fMFTTrack->GetOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ);
239 Double_t weightedOffset = fMFTTrack->GetWeightedOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ);
e806e863 240
241 // AliDebug(2, Form("pdg code = %d\n", fMCRefTrack->GetPdgCode()));
242
243 fHistOffsetSingleMuonsX -> Fill(1.e4*dX);
244 fHistOffsetSingleMuonsY -> Fill(1.e4*dY);
cd2f51d2 245
b5ab1ac4 246 fHistSingleMuonsPtRapidity -> Fill(pMu.Rapidity(), pMu.Pt());
247 fHistOffsetSingleMuons -> Fill(1.e4*offset);
248 fHistWOffsetSingleMuons -> Fill(weightedOffset);
249 Double_t chi2OverNdf = fMFTTrack->GetGlobalChi2()/Double_t(fMFTTrack->GetNMFTClusters()+fMFTTrack->GetNMUONClusters());
250 fHistSingleMuonsOffsetChi2 -> Fill(1.e4*offset, chi2OverNdf);
251 fGraphSingleMuonsOffsetChi2 -> SetPoint(fGraphSingleMuonsOffsetChi2->GetN(),1.e4*offset, chi2OverNdf);
e806e863 252
253 fNTracksAnalyzed++;
254
255 return kTRUE;
256
257}
258
259//====================================================================================================================================================
260
261Bool_t AliMuonForwardTrackAnalysis::AnalyzeMuonPair() {
262
263 if (fNPairsAnalyzedOfEvent>=fNPairsOfEvent) return kFALSE;
264
7e3dd1af 265 fMFTTrackPairWithBranson = (AliMuonForwardTrackPair*) fMuonForwardTrackPairsWithBranson->At(fNPairsAnalyzedOfEvent);
266 fMFTTrackPairWithoutBranson = (AliMuonForwardTrackPair*) fMuonForwardTrackPairsWithoutBranson->At(fNPairsAnalyzedOfEvent);
e806e863 267
7e3dd1af 268 fNPairsAnalyzedOfEvent++;
269
270 Bool_t passedCut = kFALSE;
271 if (fUseBransonForCut) passedCut = PassedCutMuonPair(fMFTTrackPairWithBranson);
272 else passedCut = PassedCutMuonPair(fMFTTrackPairWithoutBranson);
273
274 if (!passedCut) return kTRUE;
275
276 if (fUseBransonForKinematics) fMFTTrackPair = fMFTTrackPairWithBranson;
277 else fMFTTrackPair = fMFTTrackPairWithoutBranson;
e806e863 278
7e3dd1af 279 if ( fMFTTrackPair->GetTrack(0)->GetNWrongClustersMC()>fMaxNWrongClustersMC ||
280 fMFTTrackPair->GetTrack(1)->GetNWrongClustersMC()>fMaxNWrongClustersMC ) return kTRUE;
e806e863 281
7e3dd1af 282 if (fOption==kResonanceOnly && !fMFTTrackPair->IsResonance()) return kTRUE;
283
cd2f51d2 284 Int_t ptBin = fPtAxisDimuons->FindBin(fMFTTrackPair->GetPtMC());
285
286 if (1<=ptBin && ptBin<=fNPtDimuBins) {
287 fHistMassMuonPairs[ptBin] -> Fill(fMFTTrackPair->GetMass(fPrimaryVtxZ));
288 fHistWOffsetMuonPairs[ptBin] -> Fill(fMFTTrackPair->GetWeightedOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ));
289 fHistMassMuonPairsWithoutMFT[ptBin] -> Fill(fMFTTrackPair->GetMassWithoutMFT(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ));
290 fHistMassMuonPairsMC[ptBin] -> Fill(fMFTTrackPair->GetMassMC());
291 }
292 fHistMassMuonPairs[0] -> Fill(fMFTTrackPair->GetMass(fPrimaryVtxZ));
293 fHistWOffsetMuonPairs[0] -> Fill(fMFTTrackPair->GetWeightedOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ));
294 fHistMassMuonPairsWithoutMFT[0] -> Fill(fMFTTrackPair->GetMassWithoutMFT(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ));
295 fHistMassMuonPairsMC[0] -> Fill(fMFTTrackPair->GetMassMC());
296
297 fHistRapidityPtMuonPairsMC -> Fill(fMFTTrackPair->GetRapidityMC(), fMFTTrackPair->GetPtMC());
e806e863 298
7e3dd1af 299 AliDebug(1, Form("mass = %f MC = %f", fMFTTrackPair->GetMass(fPrimaryVtxZ), fMFTTrackPair->GetMassMC()));
e806e863 300
301 return kTRUE;
302
303}
304
305//====================================================================================================================================================
306
307void AliMuonForwardTrackAnalysis::BuildMuonPairs() {
308
7e3dd1af 309 for (Int_t iTrack=0; iTrack<fMuonForwardTracksWithBranson->GetEntries(); iTrack++) {
e806e863 310 for (Int_t jTrack=0; jTrack<iTrack; jTrack++) {
311
7e3dd1af 312 AliMuonForwardTrack *track0_WithBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithBranson->At(iTrack);
313 AliMuonForwardTrack *track1_WithBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithBranson->At(jTrack);
314
315 AliMuonForwardTrack *track0_WithoutBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithoutBranson->At(iTrack);
316 AliMuonForwardTrack *track1_WithoutBranson = (AliMuonForwardTrack*) fMuonForwardTracksWithoutBranson->At(jTrack);
e806e863 317
7e3dd1af 318 if (fMatchTrigger) if (!track0_WithBranson->GetMatchTrigger() || !track1_WithBranson->GetMatchTrigger()) continue;
319 if (!track0_WithBranson->GetMCTrackRef() || !track1_WithBranson->GetMCTrackRef()) continue;
e806e863 320
7e3dd1af 321 AliMuonForwardTrackPair *trackPairWithBranson = new AliMuonForwardTrackPair(track0_WithBranson, track1_WithBranson);
322 AliMuonForwardTrackPair *trackPairWithoutBranson = new AliMuonForwardTrackPair(track0_WithoutBranson, track1_WithoutBranson);
323 if (fOption==kResonanceOnly && !trackPairWithBranson->IsResonance()) {
324 delete trackPairWithBranson;
325 delete trackPairWithoutBranson;
e806e863 326 continue;
327 }
7e3dd1af 328 new ((*fMuonForwardTrackPairsWithBranson)[fMuonForwardTrackPairsWithBranson->GetEntries()]) AliMuonForwardTrackPair(*trackPairWithBranson);
329 new ((*fMuonForwardTrackPairsWithoutBranson)[fMuonForwardTrackPairsWithoutBranson->GetEntries()]) AliMuonForwardTrackPair(*trackPairWithoutBranson);
e806e863 330 }
331 }
332
333}
334
335//====================================================================================================================================================
336
7e3dd1af 337Bool_t AliMuonForwardTrackAnalysis::PassedCutSingleMuon(AliMuonForwardTrack *track) {
338
339 AliMUONTrackParam *param = track->GetTrackParamAtMFTCluster(0);
340 AliMUONTrackExtrap::ExtrapToZCov(param, fPrimaryVtxZ);
341
342 if (track->Pt()<fPtMinSingleMuons) return kFALSE;
343
344 if (fCutOnOffsetChi2) {
345 Double_t offset = 1.e4*track->GetOffset(fPrimaryVtxX, fPrimaryVtxY, fPrimaryVtxZ);
346 Double_t chi2OverNdf = track->GetGlobalChi2() / Double_t(track->GetNMFTClusters()+track->GetNMUONClusters());
347 offset /= fScaleOffset;
348 chi2OverNdf /= fScaleChi2;
349 offset -= fCenterOffset;
350 chi2OverNdf -= fCenterChi2;
351 // printf("cut on offset and chi2: returning %d\n", TMath::Sqrt(offset*offset + chi2OverNdf*chi2OverNdf)>fRadiusCut);
352 if (TMath::Sqrt(offset*offset + chi2OverNdf*chi2OverNdf) > fRadiusCut) return kFALSE;
353 }
354
355 return kTRUE;
356
357}
358
359//====================================================================================================================================================
360
361Bool_t AliMuonForwardTrackAnalysis::PassedCutMuonPair(AliMuonForwardTrackPair *pair) {
362
363 return PassedCutSingleMuon(pair->GetTrack(0)) && PassedCutSingleMuon(pair->GetTrack(1));
364
365}
366
367//====================================================================================================================================================
368
e806e863 369void AliMuonForwardTrackAnalysis::Terminate(Char_t *outputFileName) {
370
e806e863 371 TFile *fileOut = new TFile(Form("%s/%s",fOutputDir.Data(),outputFileName), "recreate");
372
373 printf("Writing output objects to file %s\n", fileOut->GetName());
374
375 fHistOffsetSingleMuonsX -> Write();
376 fHistOffsetSingleMuonsY -> Write();
377 fHistOffsetSingleMuons -> Write();
378 fHistWOffsetSingleMuons -> Write();
379 fHistErrorSingleMuonsX -> Write();
380 fHistErrorSingleMuonsY -> Write();
381
e806e863 382 fHistSingleMuonsPtRapidity -> Write();
b5ab1ac4 383 fHistSingleMuonsOffsetChi2 -> Write();
384
385 fGraphSingleMuonsOffsetChi2 -> Write();
e806e863 386
cd2f51d2 387 for (Int_t iPtBin=0; iPtBin<fNPtDimuBins+1; iPtBin++) {
388 fHistWOffsetMuonPairs[iPtBin] -> Write();
389 fHistMassMuonPairs[iPtBin] -> Write();
390 fHistMassMuonPairsWithoutMFT[iPtBin] -> Write();
391 fHistMassMuonPairsMC[iPtBin] -> Write();
392 }
393
394 fHistRapidityPtMuonPairsMC -> Write();
e806e863 395
396 fileOut -> Close();
397
398}
399
400//====================================================================================================================================================
401
402void AliMuonForwardTrackAnalysis::BookHistos() {
403
404 fHistOffsetSingleMuonsX = new TH1D("fHistOffsetSingleMuonsX", "Offset for single muons along X", 200, -1000, 1000);
405 fHistOffsetSingleMuonsY = new TH1D("fHistOffsetSingleMuonsY", "Offset for single muons along Y", 200, -1000, 1000);
406 fHistErrorSingleMuonsX = new TH1D("fHistErrorSingleMuonsX", "Coordinate Error for single muons along X", 200, 0, 1000);
407 fHistErrorSingleMuonsY = new TH1D("fHistErrorSingleMuonsY", "Coordinate Error for single muons along Y", 200, 0, 1000);
b5ab1ac4 408 fHistOffsetSingleMuons = new TH1D("fHistOffsetSingleMuons", "Offset for single muons", 200, 0, 2000);
e806e863 409 fHistWOffsetSingleMuons = new TH1D("fHistWOffsetSingleMuons", "Weighted Offset for single muons", 300, 0, 15);
410
53b30119 411 fHistSingleMuonsPtRapidity = new TH2D("fHistSingleMuonsPtRapidity", "Phase Space for single muons", 100, -4.5, -2., 100, 0., 10.);
b5ab1ac4 412 fHistSingleMuonsOffsetChi2 = new TH2D("fHistSingleMuonsOffsetChi2", "Offset vs #chi^{2}/ndf for single muons", 400, 0, 4000, 100, 0, 20);
e806e863 413
414 fHistOffsetSingleMuonsX -> SetXTitle("Offset(X) [#mum]");
415 fHistOffsetSingleMuonsY -> SetXTitle("Offset(Y) [#mum]");
416 fHistErrorSingleMuonsX -> SetXTitle("Err. on track position at z_{vtx} (X) [#mum]");
417 fHistErrorSingleMuonsY -> SetXTitle("Err. on track position at z_{vtx} (Y) [#mum]");
418 fHistOffsetSingleMuons -> SetXTitle("Offset [#mum]");
419 fHistWOffsetSingleMuons -> SetXTitle("Weighted Offset");
420
e806e863 421 fHistSingleMuonsPtRapidity -> SetXTitle("y^{#mu}");
422 fHistSingleMuonsPtRapidity -> SetYTitle("p_{T}^{#mu} [GeV/c]");
b5ab1ac4 423 fHistSingleMuonsOffsetChi2 -> SetXTitle("Offset [#mum]");
424 fHistSingleMuonsOffsetChi2 -> SetYTitle("#chi^{2}/ndf");
e806e863 425
426 fHistOffsetSingleMuonsX -> Sumw2();
427 fHistOffsetSingleMuonsY -> Sumw2();
428 fHistErrorSingleMuonsX -> Sumw2();
429 fHistErrorSingleMuonsY -> Sumw2();
430 fHistOffsetSingleMuons -> Sumw2();
431 fHistWOffsetSingleMuons -> Sumw2();
432
cd2f51d2 433 fHistSingleMuonsPtRapidity -> Sumw2();
434 fHistSingleMuonsOffsetChi2 -> Sumw2();
e806e863 435
436 //--------------------------------------------
437
7e3dd1af 438 fGraphSingleMuonsOffsetChi2 = new TGraph();
b5ab1ac4 439 fGraphSingleMuonsOffsetChi2 -> SetName("fGraphSingleMuonsOffsetChi2");
7e3dd1af 440 fGraphSingleMuonsOffsetChi2 -> SetTitle("fGraphSingleMuonsOffsetChi2");
b5ab1ac4 441
442 //--------------------------------------------
443
cd2f51d2 444 for (Int_t iPtBin=0; iPtBin<=fNPtDimuBins+1; iPtBin++) {
445
446 if (!iPtBin) {
447 fHistWOffsetMuonPairs[iPtBin] = new TH1D(Form("fHistWOffsetMuonPairs_%d",iPtBin),
448 "Weighted Offset for Muon Pairs (All p_{T}^{#mu#mu})",
449 300, 0, 60);
450 fHistMassMuonPairs[iPtBin] = new TH1D(Form("fHistMassMuonPairs_%d",iPtBin),
451 "Dimuon Mass (MUON+MFT) (All p_{T}^{#mu#mu})",
452 fNMassBins, fMassMin, fMassMax);
453 fHistMassMuonPairsWithoutMFT[iPtBin] = new TH1D(Form("fHistMassMuonPairsWithoutMFT_%d",iPtBin),
454 "Dimuon Mass (MUON only) (All p_{T}^{#mu#mu})",
455 fNMassBins, fMassMin, fMassMax);
456 fHistMassMuonPairsMC[iPtBin] = new TH1D(Form("fHistMassMuonPairsMC_%d",iPtBin),
457 "Dimuon Mass (MC) (All p_{T}^{#mu#mu})",
458 fNMassBins, fMassMin, fMassMax);
459 }
e806e863 460
cd2f51d2 461 else {
462 Double_t ptMin = fPtAxisDimuons->GetBinLowEdge(iPtBin);
463 Double_t ptMax = fPtAxisDimuons->GetBinUpEdge(iPtBin);
464 fHistWOffsetMuonPairs[iPtBin] = new TH1D(Form("fHistWOffsetMuonPairs_%d",iPtBin),
465 Form("Weighted Offset for Muon Pairs ( %3.1f < p_{T}^{#mu#mu} < %3.1f GeV/c)",ptMin,ptMax),
466 300, 0, 60);
467 fHistMassMuonPairs[iPtBin] = new TH1D(Form("fHistMassMuonPairs_%d",iPtBin),
468 Form("Dimuon Mass (MUON+MFT) (%3.1f < p_{T}^{#mu#mu} < %3.1f GeV/c)",ptMin,ptMax),
469 fNMassBins, fMassMin, fMassMax);
470 fHistMassMuonPairsWithoutMFT[iPtBin] = new TH1D(Form("fHistMassMuonPairsWithoutMFT_%d",iPtBin),
471 Form("Dimuon Mass (MUON only) (%3.1f < p_{T}^{#mu#mu} < %3.1f GeV/c)",ptMin,ptMax),
472 fNMassBins, fMassMin, fMassMax);
473 fHistMassMuonPairsMC[iPtBin] = new TH1D(Form("fHistMassMuonPairsMC_%d",iPtBin),
474 Form("Dimuon Mass (MC) (%3.1f < p_{T}^{#mu#mu} < %3.1f GeV/c)",ptMin,ptMax),
475 fNMassBins, fMassMin, fMassMax);
476 }
477
478 fHistWOffsetMuonPairs[iPtBin] -> SetXTitle("Weighted Offset");
479 fHistMassMuonPairs[iPtBin] -> SetXTitle("Mass [GeV/c^{2}]");
480 fHistMassMuonPairsWithoutMFT[iPtBin] -> SetXTitle("Mass [GeV/c^{2}]");
481 fHistMassMuonPairsMC[iPtBin] -> SetXTitle("Mass [GeV/c^{2}]");
482
483 fHistWOffsetMuonPairs[iPtBin] -> Sumw2();
484 fHistMassMuonPairs[iPtBin] -> Sumw2();
485 fHistMassMuonPairsWithoutMFT[iPtBin] -> Sumw2();
486 fHistMassMuonPairsMC[iPtBin] -> Sumw2();
487
488 }
489
490 fHistRapidityPtMuonPairsMC = new TH2D("fHistRapidityPtMuonPairsMC", "Dimuon Phase Space (MC)", 100, -4.5, -2., 100, 0., 10.);
e806e863 491 fHistRapidityPtMuonPairsMC -> SetXTitle("Rapidity");
492 fHistRapidityPtMuonPairsMC -> SetYTitle("p_{T} [GeV/c]");
e806e863 493 fHistRapidityPtMuonPairsMC -> Sumw2();
494
495}
496
497//====================================================================================================================================================
498