31 #include "TGraphErrors.h"
32 #include "TGraphAsymmErrors.h"
34 #include "TObjArray.h"
37 #include "TMCProcess.h"
38 #include "TGeoGlobalMagField.h"
39 #include "TGeoManager.h"
42 #include "AliMCEvent.h"
43 #include "AliMCParticle.h"
44 #include "AliMCEventHandler.h"
45 #include "AliESDEvent.h"
46 #include "AliESDMuonTrack.h"
47 #include "AliCDBManager.h"
48 #include "AliGeomManager.h"
51 #include "AliAnalysisManager.h"
52 #include "AliAnalysisDataSlot.h"
53 #include "AliAnalysisDataContainer.h"
54 #include "AliCentrality.h"
57 #include "AliCFContainer.h"
58 #include "AliCFGridSparse.h"
59 #include "AliCFEffGrid.h"
62 #include "AliMUONConstants.h"
63 #include "AliMUONTrack.h"
64 #include "AliMUONTriggerTrack.h"
65 #include "AliMUONLocalTrigger.h"
66 #include "AliMUONVTrackStore.h"
67 #include "AliMUONVTriggerTrackStore.h"
68 #include "AliMUONESDInterface.h"
69 #include "AliMUONRecoParam.h"
70 #include "AliMUONCDB.h"
71 #include "AliMUONTrackExtrap.h"
72 #include "AliMUONTrackParam.h"
73 #include "AliMUONRecoCheck.h"
74 #include "AliMUONVCluster.h"
75 #include "AliMUONVTrackReconstructor.h"
78 #include "AliMpSegmentation.h"
79 #include "AliMpDEIterator.h"
98 fRecoParamOCDBpath(""),
100 fCorrectForSystematics(kFALSE),
101 fFitResiduals(kFALSE),
102 fEnforceTrkCriteria(kFALSE),
103 fUseMCKinematics(kFALSE),
104 fMCTrigLevelFromMatchTrk(kFALSE),
105 fRequestedStationMask(0),
106 fRequest2ChInSameSt45(0),
110 fEfficiencyList(0x0),
114 fSlopeAtVtxList(0x0),
118 fSlopeAt1stClList(0x0),
127 fClusterMaxRes[0] = 0.;
128 fClusterMaxRes[1] = 0.;
129 for (Int_t i = 0; i < 1100; i++) fDEIndices[i] = 0;
130 for (Int_t i = 0; i < 200; i++) fDEIds[i] = 0;
136 AliAnalysisTaskSE(name),
137 fDefaultStorage(
"raw://"),
139 fRecoParamOCDBpath(
""),
141 fCorrectForSystematics(kFALSE),
142 fFitResiduals(kFALSE),
143 fEnforceTrkCriteria(kFALSE),
144 fUseMCKinematics(kFALSE),
145 fMCTrigLevelFromMatchTrk(kFALSE),
146 fRequestedStationMask(0),
147 fRequest2ChInSameSt45(0),
151 fEfficiencyList(0x0),
155 fSlopeAtVtxList(0x0),
159 fSlopeAt1stClList(0x0),
170 for (Int_t i = 0; i < 1100; i++)
fDEIndices[i] = 0;
171 for (Int_t i = 0; i < 200; i++)
fDEIds[i] = 0;
173 DefineOutput(1, AliCFContainer::Class());
174 DefineOutput(2, TObjArray::Class());
175 DefineOutput(3, TObjArray::Class());
176 DefineOutput(4, TObjArray::Class());
177 DefineOutput(5, TObjArray::Class());
178 DefineOutput(6, TObjArray::Class());
179 DefineOutput(7, TObjArray::Class());
180 DefineOutput(8, TObjArray::Class());
181 DefineOutput(9, TObjArray::Class());
182 DefineOutput(10, TObjArray::Class());
183 DefineOutput(11, TObjArray::Class());
184 DefineOutput(12, TObjArray::Class());
194 if (!AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {
223 AliCDBManager* cdbm = AliCDBManager::Instance();
224 if (cdbm->IsDefaultStorageSet()) printf(
"PerformanceTask: CDB default storage already set!\n");
230 if (cdbm->GetRun() > -1) printf(
"PerformanceTask: run number already set!\n");
231 else cdbm->SetRun(fCurrentRunNumber);
234 if (!TGeoGlobalMagField::Instance()->GetField()) {
235 if (!AliMUONCDB::LoadField())
return;
239 if (!AliMpSegmentation::Instance(kFALSE)) {
240 if (!AliMUONCDB::LoadMapping(kTRUE))
return;
244 if (!AliGeomManager::GetGeometry()) {
245 AliGeomManager::LoadGeometry();
246 if (!AliGeomManager::GetGeometry())
return;
247 if (!AliGeomManager::ApplyAlignObjsFromCDB(
"MUON"))
return;
251 const AliMUONRecoParam* recoParam = (AliMUONESDInterface::GetTracker())
252 ? AliMUONESDInterface::GetTracker()->GetRecoParam()
253 : AliMUONCDB::LoadRecoParam();
259 AliError(
"--> skip this run");
273 if (!AliMUONESDInterface::GetTracker()) AliMUONESDInterface::ResetTracker(recoParam);
275 for (Int_t i = 0; i < AliMUONConstants::NTrackingCh(); i++) {
284 while (!it.IsDone()) {
312 TString ptTitle(
"p_{t}"), ptUnits(
"GeV/c");
315 Double_t etaMin = -4., etaMax = -2.5;
316 TString etaTitle(
"#eta"), etaUnits(
"a.u.");
319 Double_t phiMin = 0.; Double_t phiMax = 2.*TMath::Pi();
320 TString phiTitle(
"#phi"), phiUnits(
"rad");
322 Int_t nThetaAbsEndBins = 4;
323 Double_t thetaAbsEndMin = -0.5, thetaAbsEndMax = 3.5;
324 TString thetaAbsEndTitle(
"#theta_{abs}"), thetaAbsEndUnits(
"a.u.");
326 Int_t nChargeBins = 2;
327 Double_t chargeMin = -2, chargeMax = 2.;
328 TString chargeTitle(
"charge"), chargeUnits(
"e");
330 Int_t nHasTrackerBins = 2;
331 Double_t hasTrackerMin = -0.5, hasTrackerMax = (Double_t)nHasTrackerBins - 0.5;
332 TString hasTrackerTitle(
"Has tracker"), hasTrackerUnits(
"");
335 Double_t triggerMin = -0.5, triggerMax = (Double_t)nTriggerBins - 0.5;
336 TString triggerTitle(
"Trigger match"), triggerUnits(
"");
339 Double_t motherTypeMin = -0.5, motherTypeMax = (Double_t)
kNtrackSources - 0.5;
340 TString motherTypeTitle(
"motherType"), motherTypeUnits(
"");
343 Double_t matchMCMin = -0.5, matchMCMax = (Double_t)
kNMatchMC - 0.5;
344 TString matchMCTitle(
"MatchMC"), matchMCUnits(
"");
347 Double_t mcTriggerMin = -0.5, mcTriggerMax = (Double_t)nMCTriggerBins - 0.5;
348 TString mcTriggerTitle(
"MC Trigger match"), mcTriggerUnits(
"");
350 Int_t nCentBins = 22;
352 TString centTitle(
"centrality"), centUnits(
"%");
354 Int_t nDupliTrgBins = 2;
355 Double_t dupliTrgMin = -0.5, dupliTrgMax = 1.5;
356 TString dupliTrgTitle(
"duplicate trigger"), dupliTrgUnits(
"");
358 Int_t nbins[
kNvars] = {nPtBins, nEtaBins, nPhiBins, nThetaAbsEndBins, nChargeBins, nHasTrackerBins, nTriggerBins, nMotherTypeBins, nMatchMCBins, nMCTriggerBins, nCentBins, nDupliTrgBins};
359 Double_t xmin[
kNvars] = {
ptMin, etaMin, phiMin, thetaAbsEndMin, chargeMin, hasTrackerMin, triggerMin, motherTypeMin, matchMCMin, mcTriggerMin,
centMin, dupliTrgMin};
360 Double_t xmax[
kNvars] = {
ptMax, etaMax, phiMax, thetaAbsEndMax, chargeMax, hasTrackerMax, triggerMax, motherTypeMax, matchMCMax, mcTriggerMax,
centMax, dupliTrgMax};
361 TString axisTitle[
kNvars] = {ptTitle, etaTitle, phiTitle, thetaAbsEndTitle, chargeTitle, hasTrackerTitle, triggerTitle, motherTypeTitle, matchMCTitle, mcTriggerTitle, centTitle, dupliTrgTitle};
362 TString axisUnits[
kNvars] = {ptUnits, etaUnits, phiUnits, thetaAbsEndUnits, chargeUnits, hasTrackerUnits, triggerUnits, motherTypeUnits, matchMCUnits, mcTriggerUnits, centUnits, dupliTrgUnits};
365 fCFContainer =
new AliCFContainer(GetOutputSlot(1)->GetContainer()->GetName(),
"container for tracks",
kNsteps,
kNvars,nbins);
368 for ( Int_t idim = 0; idim<
kNvars; idim++) {
369 TString histoTitle = Form(
"%s (%s)", axisTitle[idim].Data(), axisUnits[idim].Data());
370 histoTitle.ReplaceAll(
"()",
"");
372 fCFContainer->SetBinLimits(idim, xmin[idim], xmax[idim]);
376 TString stepTitle[
kNsteps] = {
"reconstructed",
"generated"};
402 for (Int_t istep=0; istep<
kNsteps; istep++) {
405 fCFContainer->SetStepTitle(istep, stepTitle[istep].Data());
406 AliCFGridSparse* gridSparse =
fCFContainer->GetGrid(istep);
409 TAxis* triggerAxis = gridSparse->GetAxis(
kVarTrigger);
410 for ( Int_t ibin=0; ibin<
kNtrigCuts; ibin++ ) {
411 triggerAxis->SetBinLabel(ibin+1,trigName[ibin]);
417 motherTypeAxis->SetBinLabel(ibin+1,srcName[ibin]);
421 TAxis* matchMCAxis = gridSparse->GetAxis(
kVarMatchMC);
422 for ( Int_t ibin=0; ibin<
kNMatchMC; ibin++ ) {
423 matchMCAxis->SetBinLabel(ibin+1,mMCName[ibin]);
428 for ( Int_t ibin=0; ibin<
kNtrigCuts; ibin++ ) {
429 mcTriggerAxis->SetBinLabel(ibin+1,trigName[ibin]);
439 TH1F* h1 =
new TH1F(
"hResTrigX11",
"Residual X11;X11_{reco} - X11_{MC} (cm)", 100, -10., 10.);
441 h1 =
new TH1F(
"hResTrigY11",
"Residual Y11;Y11_{reco} - Y11_{MC} (cm)", 100, -10., 10.);
443 h1 =
new TH1F(
"hResTrigSlopeY",
"Residual slope y;ySlope_{reco} - ySlope_{MC} (rad)", 100, -0.1, 0.1);
452 const Int_t deltaPAtVtxNBins = 250;
453 Double_t deltaPAtVtxEdges[2];
454 deltaPAtVtxEdges[0] = -20. - 0.05 *
fPRange[1];
455 deltaPAtVtxEdges[1] = 5. + 0.05 *
fPRange[1];
457 h1 =
new TH1F(
"hResPAtVtx",
" delta P at vertex;#Delta_{p} (GeV/c)",deltaPAtVtxNBins,deltaPAtVtxEdges[0],deltaPAtVtxEdges[1]);
459 TH2F *h2 =
new TH2F(
"hResPAtVtxVsP",
"#Delta_{p} at vertex versus p;p (GeV/c);#Delta_{p} (GeV/c)",2*
fNPBins,
fPRange[0],
fPRange[1],deltaPAtVtxNBins,deltaPAtVtxEdges[0],deltaPAtVtxEdges[1]);
461 h2 =
new TH2F(
"hResPAtVtxVsPIn23deg",
"#Delta_{p} at vertex versus p for tracks between 2 and 3 degrees at absorber end;p (GeV/c);#Delta_{p} (GeV/c)",2*
fNPBins,
fPRange[0],
fPRange[1],deltaPAtVtxNBins,deltaPAtVtxEdges[0],deltaPAtVtxEdges[1]);
463 h2 =
new TH2F(
"hResPAtVtxVsPIn310deg",
"#Delta_{p} at vertex versus p for tracks between 3 and 10 degrees at absorber end;p (GeV/c);#Delta_{p} (GeV/c)",2*
fNPBins,
fPRange[0],
fPRange[1],deltaPAtVtxNBins,deltaPAtVtxEdges[0],deltaPAtVtxEdges[1]);
465 h2 =
new TH2F(
"hResPAtVtxVsPIn02degMC",
"#Delta_{p} at vertex versus p for tracks with MC angle below 2 degrees;p (GeV/c);#Delta_{p} (GeV/c)",2*
fNPBins,
fPRange[0],
fPRange[1],deltaPAtVtxNBins/10,deltaPAtVtxEdges[0],deltaPAtVtxEdges[1]);
467 h2 =
new TH2F(
"hResPAtVtxVsPosAbsEndIn02degMC",
"#Delta_{p} at vertex versus track position at absorber end for tracks with MC angle < 2 degrees;position (cm);#Delta_{p} (GeV/c)",1000,0.,100.,deltaPAtVtxNBins,deltaPAtVtxEdges[0],deltaPAtVtxEdges[1]);
469 h2 =
new TH2F(
"hResPAtVtxVsPosAbsEndIn23degMC",
"#Delta_{p} at vertex versus track position at absorber end for tracks with MC angle in [2,3[ degrees;position (cm);#Delta_{p} (GeV/c)",1000,0.,100.,deltaPAtVtxNBins,deltaPAtVtxEdges[0],deltaPAtVtxEdges[1]);
471 h2 =
new TH2F(
"hResPAtVtxVsPosAbsEndIn310degMC",
"#Delta_{p} at vertex versus track position at absorber end for tracks with MC angle in [3,10[ degrees;position (cm);#Delta_{p} (GeV/c)",1000,0.,100.,deltaPAtVtxNBins,deltaPAtVtxEdges[0],deltaPAtVtxEdges[1]);
473 h2 =
new TH2F(
"hResPAtVtxVsAngleAtAbsEnd",
"#Delta_{p} at vertex versus track position at absorber end converted to degrees;angle (Deg);#Delta_{p} (GeV/c)",10,0.,10.,deltaPAtVtxNBins,deltaPAtVtxEdges[0],deltaPAtVtxEdges[1]);
475 h2 =
new TH2F(
"hResPAtVtxVsMCAngle",
"#Delta_{p} at vertex versus MC angle;MC angle (Deg);#Delta_{p} (GeV/c)",10,0.,10.,deltaPAtVtxNBins,deltaPAtVtxEdges[0],deltaPAtVtxEdges[1]);
477 TH3F *h3 =
new TH3F(
"hResPAtVtxVsAngleAtAbsEndVsP",
"#Delta_{p} at vertex versus track position at absorber end converted to degrees versus momentum;p (GeV/c);angle (Deg);#Delta_{p} (GeV/c)",2*
fNPBins,
fPRange[0],
fPRange[1],100,0.,10.,deltaPAtVtxNBins,deltaPAtVtxEdges[0],deltaPAtVtxEdges[1]);
481 h2 =
new TH2F(
"hResPtAtVtxVsPt",
"#Delta_{p_{t}} at vertex versus p_{t};p_{t} (GeV/c);#Delta_{p_{t}} (GeV/c)",2*
fNPBins,
fPRange[0]/10.,
fPRange[1]/10.,deltaPAtVtxNBins,deltaPAtVtxEdges[0]/10.,deltaPAtVtxEdges[1]/10.);
485 const Int_t deltaPAtFirstClNBins = 500;
486 Double_t deltaPAtFirstClEdges[2];
487 deltaPAtFirstClEdges[0] = -5. - 0.05 *
fPRange[1];
488 deltaPAtFirstClEdges[1] = 5. + 0.05 *
fPRange[1];
490 h1 =
new TH1F(
"hResPAt1stCl",
" delta P at first cluster;#Delta_{p} (GeV/c)",deltaPAtFirstClNBins,deltaPAtFirstClEdges[0],deltaPAtFirstClEdges[1]);
492 h2 =
new TH2F(
"hResPAt1stClVsP",
"#Delta_{p} at first cluster versus p;p (GeV/c);#Delta_{p} (GeV/c)",2*
fNPBins,
fPRange[0],
fPRange[1],deltaPAtFirstClNBins,deltaPAtFirstClEdges[0],deltaPAtFirstClEdges[1]);
496 h2 =
new TH2F(
"hResPtAt1stClVsPt",
"#Delta_{p_{t}} at first cluster versus p_{t};p_{t} (GeV/c);#Delta_{p_{t}} (GeV/c)",2*
fNPBins,
fPRange[0]/10.,
fPRange[1]/10.,deltaPAtFirstClNBins,deltaPAtFirstClEdges[0]/10.,deltaPAtFirstClEdges[1]/10.);
500 const Int_t deltaSlopeAtVtxNBins = 500;
501 const Double_t deltaSlopeAtVtxEdges[2] = {-0.05, 0.05};
503 h1 =
new TH1F(
"hResSlopeXAtVtx",
"#Delta_{slope_{X}} at vertex;#Delta_{slope_{X}}", deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
505 h1 =
new TH1F(
"hResSlopeYAtVtx",
"#Delta_{slope_{Y}} at vertex;#Delta_{slope_{Y}}", deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
507 h2 =
new TH2F(
"hResSlopeXAtVtxVsP",
"#Delta_{slope_{X}} at vertex versus p;p (GeV/c);#Delta_{slope_{X}}",2*
fNPBins,
fPRange[0],
fPRange[1], deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
509 h2 =
new TH2F(
"hResSlopeYAtVtxVsP",
"#Delta_{slope_{Y}} at vertex versus p;p (GeV/c);#Delta_{slope_{Y}}",2*
fNPBins,
fPRange[0],
fPRange[1], deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
511 h2 =
new TH2F(
"hResSlopeXAtVtxVsPosAbsEndIn02degMC",
"#Delta_{slope_{X}} at vertex versus track position at absorber end for tracks with MC angle < 2 degrees;position (cm);#Delta_{slope_{X}}",1000,0.,100.,deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
513 h2 =
new TH2F(
"hResSlopeYAtVtxVsPosAbsEndIn02degMC",
"#Delta_{slope_{Y}} at vertex versus track position at absorber end for tracks with MC angle < 2 degrees;position (cm);#Delta_{slope_{Y}}",1000,0.,100.,deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
515 h2 =
new TH2F(
"hResSlopeXAtVtxVsPosAbsEndIn23degMC",
"#Delta_{slope_{X}} at vertex versus track position at absorber end for tracks with MC angle in [2,3[ degrees;position (cm);#Delta_{slope_{X}}",1000,0.,100.,deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
517 h2 =
new TH2F(
"hResSlopeYAtVtxVsPosAbsEndIn23degMC",
"#Delta_{slope_{Y}} at vertex versus track position at absorber end for tracks with MC angle in [2,3[ degrees;position (cm);#Delta_{slope_{Y}}",1000,0.,100.,deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
519 h2 =
new TH2F(
"hResSlopeXAtVtxVsPosAbsEndIn310degMC",
"#Delta_{slope_{X}} at vertex versus track position at absorber end for tracks with MC angle in [3,10[ degrees;position (cm);#Delta_{slope_{X}}",1000,0.,100.,deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
521 h2 =
new TH2F(
"hResSlopeYAtVtxVsPosAbsEndIn310degMC",
"#Delta_{slope_{Y}} at vertex versus track position at absorber end for tracks with MC angle in [3,10[ degrees;position (cm);#Delta_{slope_{Y}}",1000,0.,100.,deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
523 h2 =
new TH2F(
"hResSlopeXAtVtxVsAngleAtAbsEnd",
"#Delta_{slope_{X}} at vertex versus track position at absorber end converted to degrees;angle (Deg);#Delta_{slope_{X}}",10,0.,10.,deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
525 h2 =
new TH2F(
"hResSlopeYAtVtxVsAngleAtAbsEnd",
"#Delta_{slope_{Y}} at vertex versus track position at absorber end converted to degrees;angle (Deg);#Delta_{slope_{Y}}",10,0.,10.,deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
527 h2 =
new TH2F(
"hResSlopeXAtVtxVsMCAngle",
"#Delta_{slope_{X}} at vertex versus MC angle;MC angle (Deg);#Delta_{slope_{X}}",10,0.,10.,deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
529 h2 =
new TH2F(
"hResSlopeYAtVtxVsMCAngle",
"#Delta_{slope_{Y}} at vertex versus MC angle;MC angle (Deg);#Delta_{slope_{Y}}",10,0.,10.,deltaSlopeAtVtxNBins, deltaSlopeAtVtxEdges[0], deltaSlopeAtVtxEdges[1]);
533 const Int_t deltaSlopeAtFirstClNBins = 500;
534 const Double_t deltaSlopeAtFirstClEdges[2] = {-0.01, 0.01};
536 h1 =
new TH1F(
"hResSlopeXAt1stCl",
"#Delta_{slope_{X}} at first cluster;#Delta_{slope_{X}}", deltaSlopeAtFirstClNBins, deltaSlopeAtFirstClEdges[0], deltaSlopeAtFirstClEdges[1]);
538 h1 =
new TH1F(
"hResSlopeYAt1stCl",
"#Delta_{slope_{Y}} at first cluster;#Delta_{slope_{Y}}", deltaSlopeAtFirstClNBins, deltaSlopeAtFirstClEdges[0], deltaSlopeAtFirstClEdges[1]);
540 h2 =
new TH2F(
"hResSlopeXAt1stClVsP",
"#Delta_{slope_{X}} at first cluster versus p;p (GeV/c);#Delta_{slope_{X}}",2*
fNPBins,
fPRange[0],
fPRange[1], deltaSlopeAtFirstClNBins, deltaSlopeAtFirstClEdges[0], deltaSlopeAtFirstClEdges[1]);
542 h2 =
new TH2F(
"hResSlopeYAt1stClVsP",
"#Delta_{slope_{Y}} at first cluster versus p;p (GeV/c);#Delta_{slope_{Y}}",2*
fNPBins,
fPRange[0],
fPRange[1], deltaSlopeAtFirstClNBins, deltaSlopeAtFirstClEdges[0], deltaSlopeAtFirstClEdges[1]);
546 const Int_t deltaEtaAtVtxNBins = 500;
547 const Double_t deltaEtaAtVtxEdges[2] = {-0.5, 0.5};
549 h1 =
new TH1F(
"hResEtaAtVtx",
"#Delta_{eta} at vertex;#Delta_{eta}", deltaEtaAtVtxNBins, deltaEtaAtVtxEdges[0], deltaEtaAtVtxEdges[1]);
551 h2 =
new TH2F(
"hResEtaAtVtxVsP",
"#Delta_{eta} at vertex versus p;p (GeV/c);#Delta_{eta}",2*
fNPBins,
fPRange[0],
fPRange[1], deltaEtaAtVtxNBins, deltaEtaAtVtxEdges[0], deltaEtaAtVtxEdges[1]);
553 h2 =
new TH2F(
"hResEtaAtVtxVsPosAbsEndIn02degMC",
"#Delta_{eta} at vertex versus track position at absorber end for tracks with MC angle < 2 degrees;position (cm);#Delta_{eta}",1000,0.,100.,deltaEtaAtVtxNBins, deltaEtaAtVtxEdges[0], deltaEtaAtVtxEdges[1]);
555 h2 =
new TH2F(
"hResEtaAtVtxVsPosAbsEndIn23degMC",
"#Delta_{eta} at vertex versus track position at absorber end for tracks with MC angle in [2,3[ degrees;position (cm);#Delta_{eta}",1000,0.,100.,deltaEtaAtVtxNBins, deltaEtaAtVtxEdges[0], deltaEtaAtVtxEdges[1]);
557 h2 =
new TH2F(
"hResEtaAtVtxVsPosAbsEndIn310degMC",
"#Delta_{eta} at vertex versus track position at absorber end for tracks with MC angle in [3,10[ degrees;position (cm);#Delta_{eta}",1000,0.,100.,deltaEtaAtVtxNBins, deltaEtaAtVtxEdges[0], deltaEtaAtVtxEdges[1]);
559 h2 =
new TH2F(
"hResEtaAtVtxVsAngleAtAbsEnd",
"#Delta_{eta} at vertex versus track position at absorber end converted to degrees;angle (Deg);#Delta_{eta}",10,0.,10.,deltaEtaAtVtxNBins, deltaEtaAtVtxEdges[0], deltaEtaAtVtxEdges[1]);
561 h2 =
new TH2F(
"hResEtaAtVtxVsMCAngle",
"#Delta_{eta} at vertex versus MC angle;MC angle (Deg);#Delta_{eta}",10,0.,10.,deltaEtaAtVtxNBins, deltaEtaAtVtxEdges[0], deltaEtaAtVtxEdges[1]);
565 const Int_t deltaPhiAtVtxNBins = 500;
566 const Double_t deltaPhiAtVtxEdges[2] = {-0.5, 0.5};
568 h1 =
new TH1F(
"hResPhiAtVtx",
"#Delta_{phi} at vertex;#Delta_{phi}", deltaPhiAtVtxNBins, deltaPhiAtVtxEdges[0], deltaPhiAtVtxEdges[1]);
570 h2 =
new TH2F(
"hResPhiAtVtxVsP",
"#Delta_{phi} at vertex versus p;p (GeV/c);#Delta_{phi}",2*
fNPBins,
fPRange[0],
fPRange[1], deltaPhiAtVtxNBins, deltaPhiAtVtxEdges[0], deltaPhiAtVtxEdges[1]);
572 h2 =
new TH2F(
"hResPhiAtVtxVsPosAbsEndIn02degMC",
"#Delta_{phi} at vertex versus track position at absorber end for tracks with MC angle < 2 degrees;position (cm);#Delta_{phi}",1000,0.,100.,deltaPhiAtVtxNBins, deltaPhiAtVtxEdges[0], deltaPhiAtVtxEdges[1]);
574 h2 =
new TH2F(
"hResPhiAtVtxVsPosAbsEndIn23degMC",
"#Delta_{phi} at vertex versus track position at absorber end for tracks with MC angle in [2,3[ degrees;position (cm);#Delta_{phi}",1000,0.,100.,deltaPhiAtVtxNBins, deltaPhiAtVtxEdges[0], deltaPhiAtVtxEdges[1]);
576 h2 =
new TH2F(
"hResPhiAtVtxVsPosAbsEndIn310degMC",
"#Delta_{phi} at vertex versus track position at absorber end for tracks with MC angle in [3,10[ degrees;position (cm);#Delta_{phi}",1000,0.,100.,deltaPhiAtVtxNBins, deltaPhiAtVtxEdges[0], deltaPhiAtVtxEdges[1]);
578 h2 =
new TH2F(
"hResPhiAtVtxVsAngleAtAbsEnd",
"#Delta_{phi} at vertex versus track position at absorber end converted to degrees;angle (Deg);#Delta_{phi}",10,0.,10.,deltaPhiAtVtxNBins, deltaPhiAtVtxEdges[0], deltaPhiAtVtxEdges[1]);
580 h2 =
new TH2F(
"hResPhiAtVtxVsMCAngle",
"#Delta_{phi} at vertex versus MC angle;MC angle (Deg);#Delta_{phi}",10,0.,10.,deltaPhiAtVtxNBins, deltaPhiAtVtxEdges[0], deltaPhiAtVtxEdges[1]);
584 const Int_t deltaPDCANBins = 500;
585 const Double_t deltaPDCAEdges[2] = {0., 1000.};
586 const Double_t deltaPMCSAngEdges[2] = {-1.5, 1.5};
588 h1 =
new TH1F(
"hPDCA",
"p #times DCA at vertex;p #times DCA (GeV #times cm)", deltaPDCANBins, deltaPDCAEdges[0], deltaPDCAEdges[1]);
590 h2 =
new TH2F(
"hPDCAVsPIn23deg",
"p #times DCA versus p for tracks within [2,3[ degrees at absorber end;p (GeV/c);p #times DCA (GeV #times cm)",2*
fNPBins,
fPRange[0],
fPRange[1], deltaPDCANBins, deltaPDCAEdges[0], deltaPDCAEdges[1]);
592 h2 =
new TH2F(
"hPDCAVsPIn310deg",
"p #times DCA versus p for tracks within [3,10[ degrees at absorber end;p (GeV/c);p #times DCA (GeV #times cm)",2*
fNPBins,
fPRange[0],
fPRange[1], deltaPDCANBins, deltaPDCAEdges[0], deltaPDCAEdges[1]);
594 h2 =
new TH2F(
"hPDCAVsPosAbsEndIn02degMC",
"p #times DCA versus track position at absorber end for tracks with MC angle < 2 degrees;position (cm);p #times DCA (GeV #times cm)",1000,0.,100.,deltaPDCANBins, deltaPDCAEdges[0], deltaPDCAEdges[1]);
596 h2 =
new TH2F(
"hPDCAVsPosAbsEndIn23degMC",
"p #times DCA}versus track position at absorber end for tracks with MC angle in [2,3[ degrees;position (cm);p #times DCA (GeV #times cm)",1000,0.,100.,deltaPDCANBins, deltaPDCAEdges[0], deltaPDCAEdges[1]);
598 h2 =
new TH2F(
"hPDCAVsPosAbsEndIn310degMC",
"p #times DCA versus track position at absorber end for tracks with MC angle in [3,10[ degrees;position (cm);p #times DCA (GeV #times cm)",1000,0.,100.,deltaPDCANBins, deltaPDCAEdges[0], deltaPDCAEdges[1]);
600 h2 =
new TH2F(
"hPDCAVsAngleAtAbsEnd",
"p #times DCA versus track position at absorber end converted to degrees;angle (Deg);p #times DCA (GeV #times cm)",10,0.,10.,deltaPDCANBins, deltaPDCAEdges[0], deltaPDCAEdges[1]);
602 h2 =
new TH2F(
"hPDCAVsMCAngle",
"p #times DCA versus MC angle;MC angle (Deg);p #times DCA (GeV #times cm)",10,0.,10.,deltaPDCANBins, deltaPDCAEdges[0], deltaPDCAEdges[1]);
606 h2 =
new TH2F(
"hPMCSAngVsPIn23deg",
"p #times #Delta#theta_{MCS} versus p for tracks within [2,3[ degrees at absorber end;p (GeV/c);p #times #Delta#theta_{MCS} (GeV)",2*
fNPBins,
fPRange[0],
fPRange[1], deltaPDCANBins, deltaPMCSAngEdges[0], deltaPMCSAngEdges[1]);
608 h2 =
new TH2F(
"hPMCSAngVsPIn310deg",
"p #times #Delta#theta_{MCS} versus p for tracks within [2,3[ degrees at absorber end;p (GeV/c);p #times #Delta#theta_{MCS} (GeV)",2*
fNPBins,
fPRange[0],
fPRange[1], deltaPDCANBins, deltaPMCSAngEdges[0], deltaPMCSAngEdges[1]);
612 Int_t nCh = AliMUONConstants::NTrackingCh();
613 const Int_t clusterResNBins = 5000;
617 h2 =
new TH2F(
"hResClXVsCh",
"cluster-track residual-X distribution per chamber;chamber ID;#Delta_{X} (cm)", nCh, 0.5, nCh+0.5, clusterResNBins, -clusterResMaxX, clusterResMaxX);
619 h2 =
new TH2F(
"hResClYVsCh",
"cluster-track residual-Y distribution per chamber;chamber ID;#Delta_{Y} (cm)", nCh, 0.5, nCh+0.5, clusterResNBins, -clusterResMaxY, clusterResMaxY);
621 h2 =
new TH2F(
"hResClXVsDE",
"cluster-track residual-X distribution per DE;DE ID;#Delta_{X} (cm)",
fNDE, 0.5,
fNDE+0.5, clusterResNBins, -clusterResMaxX, clusterResMaxX);
622 for (Int_t i = 1; i <=
fNDE; i++) h2->GetXaxis()->SetBinLabel(i, Form(
"%d",
fDEIds[i]));
624 h2 =
new TH2F(
"hResClYVsDE",
"cluster-track residual-Y distribution per DE;DE ID;#Delta_{Y} (cm)",
fNDE, 0.5,
fNDE+0.5, clusterResNBins, -clusterResMaxY, clusterResMaxY);
625 for (Int_t i = 1; i <=
fNDE; i++) h2->GetXaxis()->SetBinLabel(i, Form(
"%d",
fDEIds[i]));
629 AliLog::SetClassDebugLevel(
"AliMCEvent",-1);
648 AliESDEvent* esd =
dynamic_cast<AliESDEvent*
>(InputEvent());
650 AliError (
"ESD event not found. Nothing done!");
655 AliMCEventHandler* mcH =
static_cast<AliMCEventHandler*
>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
657 AliError (
"MCH event handler not found. Nothing done!");
662 Double_t centrality = esd->GetCentrality()->GetCentralityPercentileUnchecked(
"V0M");
665 AliMUONRecoCheck rc(esd,mcH);
666 AliMUONVTriggerTrackStore* triggerTrackRefStore = rc.TriggerableTracks(-1);
667 AliMUONVTrackStore* trackRefStore = rc.TrackRefs(-1);
670 Double_t containerInput[
kNvars];
671 containerInput[
kVarCent] = centrality;
672 AliMUONTrackParam *trackParam;
673 Double_t x1,y1,z1,slopex1,slopey1,pX1,pY1,pZ1,p1,pT1,eta1,phi1;
674 Double_t x2,y2,z2,slopex2,slopey2,pX2,pY2,pZ2,p2,pT2,eta2,phi2;
676 Double_t xAbs,yAbs,dAbs,aAbs,aMCS,aMC;
677 Double_t xDCA,yDCA,dca,pU;
680 AliESDMuonTrack *esdTrack = 0x0;
681 Int_t nMuTracks = esd->GetNumberOfMuonTracks();
682 Int_t *loCircuit =
new Int_t[nMuTracks];
683 Int_t nTrgTracks = 0;
684 for (Int_t iMuTrack = 0; iMuTrack < nMuTracks; ++iMuTrack) {
686 esdTrack = esd->GetMuonTrack(iMuTrack);
689 AliMUONTrack* matchedTrackRef = 0x0;
691 Bool_t isValid = kFALSE;
692 if (esdTrack->ContainTrackerData()) {
695 AliMUONTrack muonTrack;
696 AliMUONESDInterface::ESDToMUON(*esdTrack, muonTrack, kFALSE);
702 Int_t mcLabel = esdTrack->GetLabel();
703 if (mcLabel >= 0 && !esdTrack->TestBit(BIT(22)))
704 matchedTrackRef = static_cast<AliMUONTrack*>(trackRefStore->FindObject(mcLabel));
708 if (matchedTrackRef && !esdTrack->TestBit(BIT(23))) {
711 trackParam = matchedTrackRef->GetTrackParamAtVertex();
712 x1 = trackParam->GetNonBendingCoor();
713 y1 = trackParam->GetBendingCoor();
714 z1 = trackParam->GetZ();
715 slopex1 = trackParam->GetNonBendingSlope();
716 slopey1 = trackParam->GetBendingSlope();
717 pX1 = trackParam->Px();
718 pY1 = trackParam->Py();
719 pZ1 = trackParam->Pz();
720 p1 = trackParam->P();
721 pT1 = TMath::Sqrt(pX1*pX1 + pY1*pY1);
722 aMC = TMath::ATan(-pT1/pZ1) * TMath::RadToDeg();
723 eta1 = TMath::Log(TMath::Tan(0.5*TMath::ATan(-pT1/pZ1)));
724 phi1 = TMath::Pi()+TMath::ATan2(-pY1, -pX1);
727 AliMUONTrackParam trackParamAtAbsEnd(*((AliMUONTrackParam*)muonTrack.GetTrackParamAtCluster()->First()));
728 AliMUONTrackExtrap::ExtrapToZ(&trackParamAtAbsEnd, AliMUONConstants::AbsZEnd());
729 xAbs = trackParamAtAbsEnd.GetNonBendingCoor();
730 yAbs = trackParamAtAbsEnd.GetBendingCoor();
731 dAbs = TMath::Sqrt(xAbs*xAbs + yAbs*yAbs);
732 aAbs = TMath::ATan(-dAbs/AliMUONConstants::AbsZEnd()) * TMath::RadToDeg();
733 pX2 = trackParamAtAbsEnd.Px();
734 pY2 = trackParamAtAbsEnd.Py();
735 pZ2 = trackParamAtAbsEnd.Pz();
736 pT2 = TMath::Sqrt(pX2*pX2 + pY2*pY2);
737 aMCS = TMath::ATan(-pT2/pZ2) * TMath::RadToDeg();
740 trackParam = muonTrack.GetTrackParamAtVertex();
741 x2 = trackParam->GetNonBendingCoor();
742 y2 = trackParam->GetBendingCoor();
743 z2 = trackParam->GetZ();
744 slopex2 = trackParam->GetNonBendingSlope();
745 slopey2 = trackParam->GetBendingSlope();
746 pX2 = trackParam->Px();
747 pY2 = trackParam->Py();
748 pZ2 = trackParam->Pz();
749 p2 = trackParam->P();
750 pT2 = TMath::Sqrt(pX2*pX2 + pY2*pY2);
751 eta2 = TMath::Log(TMath::Tan(0.5*TMath::ATan(-pT2/pZ2)));
752 phi2 = TMath::Pi()+TMath::ATan2(-pY2, -pX2);
755 AliMUONTrackParam trackParamAtDCA(*((AliMUONTrackParam*) muonTrack.GetTrackParamAtCluster()->First()));
756 pU = trackParamAtDCA.P();
757 AliMUONTrackExtrap::ExtrapToVertexWithoutBranson(&trackParamAtDCA, z2);
758 xDCA = trackParamAtDCA.GetNonBendingCoor();
759 yDCA = trackParamAtDCA.GetBendingCoor();
760 dca = TMath::Sqrt(xDCA*xDCA + yDCA*yDCA);
763 if (dPhi < -TMath::Pi()) dPhi += 2.*TMath::Pi();
764 else if (dPhi > TMath::Pi()) dPhi -= 2.*TMath::Pi();
797 if (aAbs > 2. && aAbs < 3.) {
803 }
else if (aAbs >= 3. && aAbs < 10.) {
821 }
else if (aMC >= 2. && aMC < 3) {
830 }
else if (aMC >= 3. && aMC < 10.) {
842 trackParam = (AliMUONTrackParam*) matchedTrackRef->GetTrackParamAtCluster()->First();
843 x1 = trackParam->GetNonBendingCoor();
844 y1 = trackParam->GetBendingCoor();
845 z1 = trackParam->GetZ();
846 slopex1 = trackParam->GetNonBendingSlope();
847 slopey1 = trackParam->GetBendingSlope();
848 pX1 = trackParam->Px();
849 pY1 = trackParam->Py();
850 pZ1 = trackParam->Pz();
851 p1 = trackParam->P();
852 pT1 = TMath::Sqrt(pX1*pX1 + pY1*pY1);
855 trackParam = (AliMUONTrackParam*) muonTrack.GetTrackParamAtCluster()->First();
856 x2 = trackParam->GetNonBendingCoor();
857 y2 = trackParam->GetBendingCoor();
858 z2 = trackParam->GetZ();
859 slopex2 = trackParam->GetNonBendingSlope();
860 slopey2 = trackParam->GetBendingSlope();
861 pX2 = trackParam->Px();
862 pY2 = trackParam->Py();
863 pZ2 = trackParam->Pz();
864 p2 = trackParam->P();
865 pT2 = TMath::Sqrt(pX2*pX2 + pY2*pY2);
877 for (Int_t iCl1 = 0; iCl1 < muonTrack.GetNClusters(); iCl1++) {
879 AliMUONVCluster* cluster1 =
static_cast<AliMUONTrackParam*
>(muonTrack.GetTrackParamAtCluster()->UncheckedAt(iCl1))->GetClusterPtr();
880 Int_t chId = cluster1->GetChamberId();
881 Int_t deId = cluster1->GetDetElemId();
883 for (Int_t iCl2 = 0; iCl2 < matchedTrackRef->GetNClusters(); iCl2++) {
885 AliMUONVCluster* cluster2 =
static_cast<AliMUONTrackParam*
>(matchedTrackRef->GetTrackParamAtCluster()->UncheckedAt(iCl2))->GetClusterPtr();
887 if (cluster2->GetDetElemId() == deId) {
908 AliMUONTriggerTrack* triggerTrackRef = (isValid && matchedTrackRef)
909 ? static_cast<AliMUONTriggerTrack*>(triggerTrackRefStore->FindObject(matchedTrackRef->GetUniqueID()))
913 AliMUONTriggerTrack* matchedTrigTrackRef = 0x0;
915 if (esdTrack->ContainTriggerData()) {
918 Bool_t trackExist = kFALSE;
919 for (Int_t i=0; i<nTrgTracks; i++)
if (esdTrack->LoCircuit() == loCircuit[i]) trackExist = kTRUE;
921 else loCircuit[nTrgTracks++] = esdTrack->LoCircuit();
924 AliMUONLocalTrigger locTrg;
925 AliMUONESDInterface::ESDToMUON(*esdTrack, locTrg);
926 AliMUONTriggerTrack trigTrack;
927 rc.TriggerToTrack(locTrg, trigTrack);
930 if (triggerTrackRef && trigTrack.Match(*triggerTrackRef,
fSigmaCutTrig)) matchedTrigTrackRef = triggerTrackRef;
933 matchedTrigTrackRef = rc.FindCompatibleTrack(trigTrack, *triggerTrackRefStore,
fSigmaCutTrig);
934 if (matchedTrigTrackRef) {
935 if (isValid && matchedTrackRef) {
940 triggerTrackRef = matchedTrigTrackRef;
946 if (matchedTrigTrackRef) {
955 if (triggerTrackRef) {
957 else if (triggerTrackRef->GetPtCutLevel() == 1) containerInput[
kVarMCTrigger] = static_cast<Double_t>(
kAllPtTrig);
958 else if (triggerTrackRef->GetPtCutLevel() == 2) containerInput[
kVarMCTrigger] = static_cast<Double_t>(
kLowPtTrig);
964 if (isValid && matchedTrackRef) mcID =
static_cast<Int_t
>(matchedTrackRef->GetUniqueID());
965 else if (matchedTrigTrackRef) mcID =
static_cast<Int_t
>(matchedTrigTrackRef->GetUniqueID());
978 AliMUONTrack* trackRef = 0x0;
979 TIter next(reconstructibleStore->CreateIterator());
980 while ((trackRef = static_cast<AliMUONTrack*>(next()))) {
983 UInt_t mcID = trackRef->GetUniqueID();
984 AliMUONTriggerTrack* trigTrackRef =
static_cast<AliMUONTriggerTrack*
>(triggerTrackRefStore->FindObject(mcID));
987 FillContainerInfoMC(containerInput, static_cast<AliMCParticle*>(fMCEvent->GetTrack(static_cast<Int_t>(mcID))));
990 if (trigTrackRef->GetPtCutLevel() == 0) containerInput[
kVarTrigger] = static_cast<Double_t>(
kOtherTrig);
991 else if (trigTrackRef->GetPtCutLevel() == 1) containerInput[
kVarTrigger] = static_cast<Double_t>(
kAllPtTrig);
992 else if (trigTrackRef->GetPtCutLevel() == 2) containerInput[
kVarTrigger] = static_cast<Double_t>(
kLowPtTrig);
993 else if (trigTrackRef->GetPtCutLevel() == 3) containerInput[
kVarTrigger] = static_cast<Double_t>(
kHighPtTrig);
1002 AliMUONTriggerTrack* trigTrackRef = 0x0;
1003 TIter nextTrig(triggerTrackRefStore->CreateIterator());
1004 while ((trigTrackRef = static_cast<AliMUONTriggerTrack*>(nextTrig()))) {
1007 UInt_t mcID = trigTrackRef->GetUniqueID();
1008 if (reconstructibleStore->FindObject(mcID))
continue;
1011 FillContainerInfoMC(containerInput, static_cast<AliMCParticle*>(fMCEvent->GetTrack(static_cast<Int_t>(mcID))));
1013 if (trigTrackRef->GetPtCutLevel() == 0) containerInput[
kVarTrigger] = static_cast<Double_t>(
kOtherTrig);
1014 else if (trigTrackRef->GetPtCutLevel() == 1) containerInput[
kVarTrigger] = static_cast<Double_t>(
kAllPtTrig);
1015 else if (trigTrackRef->GetPtCutLevel() == 2) containerInput[
kVarTrigger] = static_cast<Double_t>(
kLowPtTrig);
1016 else if (trigTrackRef->GetPtCutLevel() == 3) containerInput[
kVarTrigger] = static_cast<Double_t>(
kHighPtTrig);
1040 fCFContainer =
dynamic_cast<AliCFContainer*
>(GetOutputData(1));
1041 fTriggerList =
dynamic_cast<TObjArray*
>(GetOutputData(2));
1042 fTrackerList =
dynamic_cast<TObjArray*
>(GetOutputData(3));
1044 AliWarning(
"Output containers not found: summary histograms are not created");
1052 TObjArray* effAnyPt =
new TObjArray(100);
1053 effAnyPt->SetName(
"effAnyPt");
1054 effAnyPt->SetOwner();
1057 TObjArray* effAllPt =
new TObjArray(100);
1058 effAllPt->SetName(
"effAllPt");
1059 effAllPt->SetOwner();
1062 TObjArray* effLowPt =
new TObjArray(100);
1063 effLowPt->SetName(
"effLowPt");
1064 effLowPt->SetOwner();
1067 TObjArray* effHighPt =
new TObjArray(100);
1068 effHighPt->SetName(
"effHighPt");
1069 effHighPt->SetOwner();
1072 TObjArray* notTrgable =
new TObjArray(100);
1073 notTrgable->SetName(
"notTrgable");
1074 notTrgable->SetOwner();
1077 TObjArray* trgableNoPtOnly =
new TObjArray(100);
1078 trgableNoPtOnly->SetName(
"trgableNoPtOnly");
1079 trgableNoPtOnly->SetOwner();
1082 TObjArray* trgableAPtOnly =
new TObjArray(100);
1083 trgableAPtOnly->SetName(
"trgableAPtOnly");
1084 trgableAPtOnly->SetOwner();
1087 TObjArray* trgableLPtOnly =
new TObjArray(100);
1088 trgableLPtOnly->SetName(
"trgableLPtOnly");
1089 trgableLPtOnly->SetOwner();
1092 TObjArray* trgableHPtOnly =
new TObjArray(100);
1093 trgableHPtOnly->SetName(
"trgableHPtOnly");
1094 trgableHPtOnly->SetOwner();
1097 AliCFEffGrid* efficiency =
new AliCFEffGrid(
"eff",
"",*
fCFContainer);
1099 Double_t totalEff = 0., totalEffErr = 0.;
1100 Int_t sumEffBin = 0;
1103 TH1D* effSummary =
new TH1D(
"effSummary",
"Efficiency summary", 1, 0., 0.);
1104 effSummary->GetYaxis()->SetTitle(
"Efficiency");
1112 efficiency->GetNum()->GetAxis(
kVarTrigger)->SetRange();
1113 efficiency->GetDen()->GetAxis(
kVarTrigger)->SetRange();
1114 efficiency->GetNum()->GetAxis(
kVarMatchMC)->SetRange();
1118 effSummary->Fill(
"Tracker_all", totalEff);
1119 effSummary->SetBinError(++sumEffBin, totalEffErr);
1120 printf(
"Tracker efficiency using all reconstructed tracks = %f +- %f\n", totalEff, totalEffErr);
1126 effSummary->Fill(
"Tracker_MCId", totalEff);
1127 effSummary->SetBinError(++sumEffBin, totalEffErr);
1128 printf(
"Tracker efficiency using reconstructed tracks matching MC = %f +- %f\n", totalEff, totalEffErr);
1135 efficiency->GetNum()->GetAxis(
kVarMatchMC)->SetRange();
1138 effSummary->Fill(
"Matched_all", totalEff);
1139 effSummary->SetBinError(++sumEffBin, totalEffErr);
1140 printf(
"Matched efficiency using all reconstructed tracks = %f +- %f\n", totalEff, totalEffErr);
1144 FillEffHistos(efficiency,
"matchedTracksMatchMC", effAnyPt);
1146 effSummary->Fill(
"Matched_MCId", totalEff);
1147 effSummary->SetBinError(++sumEffBin, totalEffErr);
1148 printf(
"Matched efficiency using reconstructed tracks matching MC = %f +- %f\n", totalEff, totalEffErr);
1152 FillEffHistos(efficiency,
"matchedTracksMatchMCAnypt", effAnyPt);
1154 effSummary->Fill(
"Matched_MCIdAnypt", totalEff);
1155 effSummary->SetBinError(++sumEffBin, totalEffErr);
1156 printf(
"Matched efficiency using reconstructed tracks matching MC-anyPt = %f +- %f\n", totalEff, totalEffErr);
1160 FillEffHistos(efficiency,
"matchedTracksMatchMCNoTrig", effAnyPt);
1162 effSummary->Fill(
"Matched_MCIdNoTrig", totalEff);
1163 effSummary->SetBinError(++sumEffBin, totalEffErr);
1164 printf(
"Matched efficiency using reconstructed tracks matching MC-noTrig = %f +- %f\n", totalEff, totalEffErr);
1169 FillEffHistos(efficiency,
"matchedTracksMatchSameMC", effAnyPt);
1171 effSummary->Fill(
"Matched_SameMCId", totalEff);
1172 effSummary->SetBinError(++sumEffBin, totalEffErr);
1173 printf(
"Matched efficiency using reconstructed tracks matching same MC = %f +- %f\n", totalEff, totalEffErr);
1177 FillEffHistos(efficiency,
"matchedTracksMatchDiffMC", effAnyPt);
1179 effSummary->Fill(
"Matched_DiffMCId", totalEff);
1180 effSummary->SetBinError(++sumEffBin, totalEffErr);
1181 printf(
"Matched efficiency using reconstructed tracks matching different MC = %f +- %f\n", totalEff, totalEffErr);
1185 FillEffHistos(efficiency,
"matchedTracksMatchTrkMC", effAnyPt);
1187 effSummary->Fill(
"Matched_TrkMCId", totalEff);
1188 effSummary->SetBinError(++sumEffBin, totalEffErr);
1189 printf(
"Matched efficiency using reconstructed tracks matching tracker MC = %f +- %f\n", totalEff, totalEffErr);
1195 efficiency->GetNum()->GetAxis(
kVarMatchMC)->SetRange();
1198 printf(
"Matched Apt efficiency using all reconstructed tracks = %f +- %f\n", totalEff, totalEffErr);
1202 FillEffHistos(efficiency,
"matchedTracksMatchMC", effAllPt);
1204 printf(
"Matched Apt efficiency using reconstructed tracks matching MC = %f +- %f\n", totalEff, totalEffErr);
1208 FillEffHistos(efficiency,
"matchedTracksMatchMCApt", effAllPt);
1210 printf(
"Matched Apt efficiency using reconstructed tracks matching MC-Apt = %f +- %f\n", totalEff, totalEffErr);
1214 FillEffHistos(efficiency,
"matchedTracksMatchMCOther", effAllPt);
1216 printf(
"Matched Apt efficiency using reconstructed tracks matching MC-other = %f +- %f\n", totalEff, totalEffErr);
1220 FillEffHistos(efficiency,
"matchedTracksMatchMCNoTrig", effAllPt);
1222 printf(
"Matched Apt efficiency using reconstructed tracks matching MC-noTrig = %f +- %f\n", totalEff, totalEffErr);
1227 FillEffHistos(efficiency,
"matchedTracksMatchSameMCApt", effAllPt);
1231 FillEffHistos(efficiency,
"matchedTracksMatchSameMCOther", effAllPt);
1236 FillEffHistos(efficiency,
"matchedTracksMatchDiffMCApt", effAllPt);
1240 FillEffHistos(efficiency,
"matchedTracksMatchDiffMCOther", effAllPt);
1245 FillEffHistos(efficiency,
"matchedTracksMatchTrkMCApt", effAllPt);
1249 FillEffHistos(efficiency,
"matchedTracksMatchTrkMCOther", effAllPt);
1256 efficiency->GetNum()->GetAxis(
kVarMatchMC)->SetRange();
1260 printf(
"Matched Lpt efficiency using all reconstructed tracks = %f +- %f\n", totalEff, totalEffErr);
1264 FillEffHistos(efficiency,
"matchedTracksMatchMC", effLowPt);
1266 printf(
"Matched Lpt efficiency using reconstructed tracks matching MC = %f +- %f\n", totalEff, totalEffErr);
1270 FillEffHistos(efficiency,
"matchedTracksMatchMCLpt", effLowPt);
1272 printf(
"Matched Lpt efficiency using reconstructed tracks matching MC-Lpt = %f +- %f\n", totalEff, totalEffErr);
1276 FillEffHistos(efficiency,
"matchedTracksMatchMCOther", effLowPt);
1278 printf(
"Matched Lpt efficiency using reconstructed tracks matching MC-other = %f +- %f\n", totalEff, totalEffErr);
1282 FillEffHistos(efficiency,
"matchedTracksMatchMCNoTrig", effLowPt);
1284 printf(
"Matched Lpt efficiency using reconstructed tracks matching MC-noTrig = %f +- %f\n", totalEff, totalEffErr);
1289 FillEffHistos(efficiency,
"matchedTracksMatchSameMCLpt", effLowPt);
1293 FillEffHistos(efficiency,
"matchedTracksMatchSameMCOther", effLowPt);
1298 FillEffHistos(efficiency,
"matchedTracksMatchDiffMCLpt", effLowPt);
1302 FillEffHistos(efficiency,
"matchedTracksMatchDiffMCOther", effLowPt);
1307 FillEffHistos(efficiency,
"matchedTracksMatchTrkMCLpt", effLowPt);
1311 FillEffHistos(efficiency,
"matchedTracksMatchTrkMCOther", effLowPt);
1318 efficiency->GetNum()->GetAxis(
kVarMatchMC)->SetRange();
1322 printf(
"Matched Hpt efficiency using all reconstructed tracks = %f +- %f\n", totalEff, totalEffErr);
1326 FillEffHistos(efficiency,
"matchedTracksMatchMC", effHighPt);
1328 printf(
"Matched Hpt efficiency using reconstructed tracks matching MC = %f +- %f\n", totalEff, totalEffErr);
1332 FillEffHistos(efficiency,
"matchedTracksMatchMCHpt", effHighPt);
1334 printf(
"Matched Hpt efficiency using reconstructed tracks matching MC-Hpt = %f +- %f\n", totalEff, totalEffErr);
1338 FillEffHistos(efficiency,
"matchedTracksMatchMCOther", effHighPt);
1340 printf(
"Matched Hpt efficiency using reconstructed tracks matching MC-other = %f +- %f\n", totalEff, totalEffErr);
1344 FillEffHistos(efficiency,
"matchedTracksMatchMCNoTrig", effHighPt);
1346 printf(
"Matched Hpt efficiency using reconstructed tracks matching MC-noTrig = %f +- %f\n", totalEff, totalEffErr);
1351 FillEffHistos(efficiency,
"matchedTracksMatchSameMCHpt", effHighPt);
1355 FillEffHistos(efficiency,
"matchedTracksMatchSameMCOther", effHighPt);
1360 FillEffHistos(efficiency,
"matchedTracksMatchDiffMCHpt", effHighPt);
1364 FillEffHistos(efficiency,
"matchedTracksMatchDiffMCOther", effHighPt);
1369 FillEffHistos(efficiency,
"matchedTracksMatchTrkMCHpt", effHighPt);
1373 FillEffHistos(efficiency,
"matchedTracksMatchTrkMCOther", effHighPt);
1382 efficiency->GetNum()->GetAxis(
kVarMatchMC)->SetRange();
1384 efficiency->GetNum()->SetRangeUser(
kVarDupliTrg, 0., 0.);
1387 effSummary->Fill(
"Trigger_all", totalEff);
1388 effSummary->SetBinError(++sumEffBin, totalEffErr);
1389 printf(
"Trigger efficiency using all reconstructed tracks = %f +- %f\n", totalEff, totalEffErr);
1393 FillEffHistos(efficiency,
"triggerTracksMatchMC", effAnyPt);
1395 effSummary->Fill(
"Trigger_MCId", totalEff);
1396 effSummary->SetBinError(++sumEffBin, totalEffErr);
1397 printf(
"Trigger efficiency using reconstructed tracks matching MC = %f +- %f\n", totalEff, totalEffErr);
1403 efficiency->GetNum()->GetAxis(
kVarMatchMC)->SetRange();
1409 FillEffHistos(efficiency,
"triggerTracksMatchMCApt", effAllPt);
1413 FillEffHistos(efficiency,
"triggerTracksMatchMCOther", effAllPt);
1420 efficiency->GetNum()->GetAxis(
kVarMatchMC)->SetRange();
1427 FillEffHistos(efficiency,
"triggerTracksMatchMCLpt", effLowPt);
1431 FillEffHistos(efficiency,
"triggerTracksMatchMCOther", effLowPt);
1438 efficiency->GetNum()->GetAxis(
kVarMatchMC)->SetRange();
1445 FillEffHistos(efficiency,
"triggerTracksMatchMCHpt", effHighPt);
1449 FillEffHistos(efficiency,
"triggerTracksMatchMCOther", effHighPt);
1456 efficiency->GetNum()->GetAxis(
kVarTrigger)->SetRange();
1460 efficiency->GetNum()->GetAxis(
kVarDupliTrg)->SetRange();
1482 efficiency->GetNum()->GetAxis(
kVarTrigger)->SetRange();
1506 efficiency->GetNum()->GetAxis(
kVarTrigger)->SetRange();
1530 efficiency->GetNum()->GetAxis(
kVarTrigger)->SetRange();
1554 efficiency->GetNum()->GetAxis(
kVarTrigger)->SetRange();
1578 efficiency->GetNum()->GetAxis(
kVarTrigger)->SetRange();
1579 efficiency->GetDen()->GetAxis(
kVarTrigger)->SetRange();
1580 efficiency->GetNum()->GetAxis(
kVarMatchMC)->SetRange();
1582 efficiency->GetNum()->GetAxis(
kVarDupliTrg)->SetRange();
1587 TCanvas* cEffSummary =
new TCanvas(
"cEffSummary",
"Efficiency summary",20,20,310,310);
1588 cEffSummary->SetFillColor(10); cEffSummary->SetHighLightColor(10);
1589 cEffSummary->SetLeftMargin(0.15); cEffSummary->SetBottomMargin(0.15);
1590 effSummary->DrawCopy(
"etext");
1593 TCanvas* cTriggerResolution =
new TCanvas(
"cTriggerResolution",
"Trigger resolution",10,10,310,310);
1594 cTriggerResolution->SetFillColor(10); cTriggerResolution->SetHighLightColor(10);
1595 cTriggerResolution->SetLeftMargin(0.15); cTriggerResolution->SetBottomMargin(0.15);
1596 cTriggerResolution->Divide(2,2);
1597 cTriggerResolution->cd(1);
1599 cTriggerResolution->cd(2);
1601 cTriggerResolution->cd(3);
1609 TGraphAsymmErrors* gMeanResPAtVtxVsP =
new TGraphAsymmErrors(
fNPBins);
1610 gMeanResPAtVtxVsP->SetName(
"gMeanResPAtVtxVsP");
1611 gMeanResPAtVtxVsP->SetTitle(
"<#Delta_{p}> at vertex versus p;p (GeV/c);<#Delta_{p}> (GeV/c)");
1613 TGraphAsymmErrors* gMostProbResPAtVtxVsP =
new TGraphAsymmErrors(
fNPBins);
1614 gMostProbResPAtVtxVsP->SetName(
"gMostProbResPAtVtxVsP");
1615 gMostProbResPAtVtxVsP->SetTitle(
"Most probable #Delta_{p} at vertex versus p;p (GeV/c);Most prob. #Delta_{p} (GeV/c)");
1617 TGraphAsymmErrors* gSigmaResPAtVtxVsP =
new TGraphAsymmErrors(
fNPBins);
1618 gSigmaResPAtVtxVsP->SetName(
"gSigmaResPAtVtxVsP");
1619 gSigmaResPAtVtxVsP->SetTitle(
"#sigma_{p}/p at vertex versus p;p (GeV/c);#sigma_{p}/p (%)");
1624 FitLandauGausResVsP(h,
"momentum residuals at vertex", gMeanResPAtVtxVsP, gMostProbResPAtVtxVsP, gSigmaResPAtVtxVsP);
1627 Int_t rebinFactorX = TMath::Max(h->GetNbinsX()/
fNPBins, 1);
1628 for (Int_t i = rebinFactorX; i <= h->GetNbinsX(); i+=rebinFactorX) {
1630 gSigmaResPAtVtxVsP->GetPoint(i/rebinFactorX-1, x, y);
1631 gSigmaResPAtVtxVsP->SetPoint(i/rebinFactorX-1, x, 100.*y/x);
1632 gSigmaResPAtVtxVsP->SetPointEYlow(i/rebinFactorX-1, 100.*gSigmaResPAtVtxVsP->GetErrorYlow(i/rebinFactorX-1)/x);
1633 gSigmaResPAtVtxVsP->SetPointEYhigh(i/rebinFactorX-1, 100.*gSigmaResPAtVtxVsP->GetErrorYhigh(i/rebinFactorX-1)/x);
1641 TGraphAsymmErrors* gMeanResPAt1stClVsP =
new TGraphAsymmErrors(
fNPBins);
1642 gMeanResPAt1stClVsP->SetName(
"gMeanResPAt1stClVsP");
1643 gMeanResPAt1stClVsP->SetTitle(
"<#Delta_{p}> at first cluster versus p;p (GeV/c);<#Delta_{p}> (GeV/c)");
1645 TGraphAsymmErrors* gSigmaResPAt1stClVsP =
new TGraphAsymmErrors(
fNPBins);
1646 gSigmaResPAt1stClVsP->SetName(
"gSigmaResPAt1stClVsP");
1647 gSigmaResPAt1stClVsP->SetTitle(
"#sigma_{p}/p at first cluster versus p;p (GeV/c);#sigma_{p}/p (%)");
1652 FitGausResVsMom(h, 0., 1.,
"momentum residuals at first cluster", gMeanResPAt1stClVsP, gSigmaResPAt1stClVsP);
1655 rebinFactorX = TMath::Max(h->GetNbinsX()/
fNPBins, 1);
1656 for (Int_t i = rebinFactorX; i <= h->GetNbinsX(); i+=rebinFactorX) {
1658 gSigmaResPAt1stClVsP->GetPoint(i/rebinFactorX-1, x, y);
1659 gSigmaResPAt1stClVsP->SetPoint(i/rebinFactorX-1, x, 100.*y/x);
1660 gSigmaResPAt1stClVsP->SetPointEYlow(i/rebinFactorX-1, 100.*gSigmaResPAt1stClVsP->GetErrorYlow(i/rebinFactorX-1)/x);
1661 gSigmaResPAt1stClVsP->SetPointEYhigh(i/rebinFactorX-1, 100.*gSigmaResPAt1stClVsP->GetErrorYhigh(i/rebinFactorX-1)/x);
1669 TGraphAsymmErrors* gMeanResSlopeXAtVtxVsP =
new TGraphAsymmErrors(
fNPBins);
1670 gMeanResSlopeXAtVtxVsP->SetName(
"gMeanResSlopeXAtVtxVsP");
1671 gMeanResSlopeXAtVtxVsP->SetTitle(
"<#Delta_{slope_{X}}> at vertex versus p;p (GeV/c);<#Delta_{slope_{X}}>");
1673 TGraphAsymmErrors* gMeanResSlopeYAtVtxVsP =
new TGraphAsymmErrors(
fNPBins);
1674 gMeanResSlopeYAtVtxVsP->SetName(
"gMeanResSlopeYAtVtxVsP");
1675 gMeanResSlopeYAtVtxVsP->SetTitle(
"<#Delta_{slope_{Y}}> at vertex versus p;p (GeV/c);<#Delta_{slope_{Y}}>");
1677 TGraphAsymmErrors* gSigmaResSlopeXAtVtxVsP =
new TGraphAsymmErrors(
fNPBins);
1678 gSigmaResSlopeXAtVtxVsP->SetName(
"gSigmaResSlopeXAtVtxVsP");
1679 gSigmaResSlopeXAtVtxVsP->SetTitle(
"#sigma_{slope_{X}} at vertex versus p;p (GeV/c);#sigma_{slope_{X}}");
1681 TGraphAsymmErrors* gSigmaResSlopeYAtVtxVsP =
new TGraphAsymmErrors(
fNPBins);
1682 gSigmaResSlopeYAtVtxVsP->SetName(
"gSigmaResSlopeYAtVtxVsP");
1683 gSigmaResSlopeYAtVtxVsP->SetTitle(
"#sigma_{slope_{Y}} at vertex versus p;p (GeV/c);#sigma_{slope_{Y}}");
1688 "slopeX residuals at vertex", gMeanResSlopeXAtVtxVsP, gSigmaResSlopeXAtVtxVsP);
1690 "slopeY residuals at vertex", gMeanResSlopeYAtVtxVsP, gSigmaResSlopeYAtVtxVsP);
1697 TGraphAsymmErrors* gMeanResSlopeXAt1stClVsP =
new TGraphAsymmErrors(
fNPBins);
1698 gMeanResSlopeXAt1stClVsP->SetName(
"gMeanResSlopeXAt1stClVsP");
1699 gMeanResSlopeXAt1stClVsP->SetTitle(
"<#Delta_{slope_{X}}> at first cluster versus p;p (GeV/c);<#Delta_{slope_{X}}>");
1701 TGraphAsymmErrors* gMeanResSlopeYAt1stClVsP =
new TGraphAsymmErrors(
fNPBins);
1702 gMeanResSlopeYAt1stClVsP->SetName(
"gMeanResSlopeYAt1stClVsP");
1703 gMeanResSlopeYAt1stClVsP->SetTitle(
"<#Delta_{slope_{Y}}> at first cluster versus p;p (GeV/c);<#Delta_{slope_{Y}}>");
1705 TGraphAsymmErrors* gSigmaResSlopeXAt1stClVsP =
new TGraphAsymmErrors(
fNPBins);
1706 gSigmaResSlopeXAt1stClVsP->SetName(
"gSigmaResSlopeXAt1stClVsP");
1707 gSigmaResSlopeXAt1stClVsP->SetTitle(
"#sigma_{slope_{X}} at first cluster versus p;p (GeV/c);#sigma_{slope_{X}}");
1709 TGraphAsymmErrors* gSigmaResSlopeYAt1stClVsP =
new TGraphAsymmErrors(
fNPBins);
1710 gSigmaResSlopeYAt1stClVsP->SetName(
"gSigmaResSlopeYAt1stClVsP");
1711 gSigmaResSlopeYAt1stClVsP->SetTitle(
"#sigma_{slope_{Y}} at first cluster versus p;p (GeV/c);#sigma_{slope_{Y}}");
1716 "slopeX residuals at first cluster", gMeanResSlopeXAt1stClVsP, gSigmaResSlopeXAt1stClVsP);
1718 "slopeY residuals at first cluster", gMeanResSlopeYAt1stClVsP, gSigmaResSlopeYAt1stClVsP);
1725 TGraphAsymmErrors* gMeanResEtaAtVtxVsP =
new TGraphAsymmErrors(
fNPBins);
1726 gMeanResEtaAtVtxVsP->SetName(
"gMeanResEtaAtVtxVsP");
1727 gMeanResEtaAtVtxVsP->SetTitle(
"<#Delta_{eta}> at vertex versus p;p (GeV/c);<#Delta_{eta}>");
1729 TGraphAsymmErrors* gSigmaResEtaAtVtxVsP =
new TGraphAsymmErrors(
fNPBins);
1730 gSigmaResEtaAtVtxVsP->SetName(
"gSigmaResEtaAtVtxVsP");
1731 gSigmaResEtaAtVtxVsP->SetTitle(
"#sigma_{eta} at vertex versus p;p (GeV/c);#sigma_{eta}");
1736 "eta residuals at vertex", gMeanResEtaAtVtxVsP, gSigmaResEtaAtVtxVsP);
1743 TGraphAsymmErrors* gMeanResPhiAtVtxVsP =
new TGraphAsymmErrors(
fNPBins);
1744 gMeanResPhiAtVtxVsP->SetName(
"gMeanResPhiAtVtxVsP");
1745 gMeanResPhiAtVtxVsP->SetTitle(
"<#Delta_{phi}> at vertex versus p;p (GeV/c);<#Delta_{phi}>");
1747 TGraphAsymmErrors* gSigmaResPhiAtVtxVsP =
new TGraphAsymmErrors(
fNPBins);
1748 gSigmaResPhiAtVtxVsP->SetName(
"gSigmaResPhiAtVtxVsP");
1749 gSigmaResPhiAtVtxVsP->SetTitle(
"#sigma_{phi} at vertex versus p;p (GeV/c);#sigma_{phi}");
1754 "phi residuals at vertex", gMeanResPhiAtVtxVsP, gSigmaResPhiAtVtxVsP);
1761 TGraphAsymmErrors* gMeanPDCAVsPIn23deg =
new TGraphAsymmErrors(
fNPBins);
1762 gMeanPDCAVsPIn23deg->SetName(
"gMeanPDCAVsPIn23deg");
1763 gMeanPDCAVsPIn23deg->SetTitle(
"<p #times DCA> versus p for tracks within [2,3[ degrees at absorber end;p (GeV/c);<p #times DCA> (GeV #times cm)");
1765 TGraphAsymmErrors* gSigmaPDCAVsPIn23deg =
new TGraphAsymmErrors(
fNPBins);
1766 gSigmaPDCAVsPIn23deg->SetName(
"gSigmaPDCAVsPIn23deg");
1767 gSigmaPDCAVsPIn23deg->SetTitle(
"#sigma_{p #times DCA} versus p for tracks within [2,3[ degrees at absorber end;p (GeV/c);#sigma_{p #times DCA} (GeV #times cm)");
1769 TGraphAsymmErrors* gMeanPDCAVsPIn310deg =
new TGraphAsymmErrors(
fNPBins);
1770 gMeanPDCAVsPIn310deg->SetName(
"gMeanPDCAVsPIn310deg");
1771 gMeanPDCAVsPIn310deg->SetTitle(
"<p #times DCA> versus p for tracks within [3,10[ degrees at absorber end;p (GeV/c);<p #times DCA> (GeV #times cm)");
1773 TGraphAsymmErrors* gSigmaPDCAVsPIn310deg =
new TGraphAsymmErrors(
fNPBins);
1774 gSigmaPDCAVsPIn310deg->SetName(
"gSigmaPDCAVsPIn310deg");
1775 gSigmaPDCAVsPIn310deg->SetTitle(
"#sigma_{p #times DCA} versus p for tracks within [3,10[ degrees at absorber end;p (GeV/c);#sigma_{p #times DCA} (GeV #times cm)");
1778 TGraphAsymmErrors* gMeanPMCSAngVsPIn23deg =
new TGraphAsymmErrors(
fNPBins);
1779 gMeanPMCSAngVsPIn23deg->SetName(
"gMeanPMCSAngVsPIn23deg");
1780 gMeanPMCSAngVsPIn23deg->SetTitle(
"<p #times #Delta#theta_{MCS}> versus p for tracks within [2,3[ degrees at absorber end;p (GeV/c);<p #times #Delta#theta_{MCS}> (GeV)");
1782 TGraphAsymmErrors* gSigmaPMCSAngVsPIn23deg =
new TGraphAsymmErrors(
fNPBins);
1783 gSigmaPMCSAngVsPIn23deg->SetName(
"gSigmaPMCSAngVsPIn23deg");
1784 gSigmaPMCSAngVsPIn23deg->SetTitle(
"#sigma_{p #times #Delta#theta_{MCS}} versus p for tracks within [2,3[ degrees at absorber end;p (GeV/c);#sigma_{p #times #Delta#theta_{MCS}} (GeV)");
1786 TGraphAsymmErrors* gMeanPMCSAngVsPIn310deg =
new TGraphAsymmErrors(
fNPBins);
1787 gMeanPMCSAngVsPIn310deg->SetName(
"gMeanPMCSAngVsPIn310deg");
1788 gMeanPMCSAngVsPIn310deg->SetTitle(
"<p #times #Delta#theta_{MCS}> versus p for tracks within [3,10[ degrees at absorber end;p (GeV/c);<p #times #Delta#theta_{MCS}> (GeV)");
1790 TGraphAsymmErrors* gSigmaPMCSAngVsPIn310deg =
new TGraphAsymmErrors(
fNPBins);
1791 gSigmaPMCSAngVsPIn310deg->SetName(
"gSigmaPMCSAngVsPIn310deg");
1792 gSigmaPMCSAngVsPIn310deg->SetTitle(
"#sigma_{p #times #Delta#theta_{MCS}} versus p for tracks within [3,10[ degrees at absorber end;p (GeV/c);#sigma_{p #times #Delta#theta_{MCS}} (GeV)");
1797 "p*DCA (tracks in [2,3] deg.)", gMeanPDCAVsPIn23deg, gSigmaPDCAVsPIn23deg);
1799 "p*DCA (tracks in [3,10] deg.)", gMeanPDCAVsPIn310deg, gSigmaPDCAVsPIn310deg);
1801 "p*MCSAngle (tracks in [2,3] deg.)", gMeanPMCSAngVsPIn23deg, gSigmaPMCSAngVsPIn23deg);
1803 "p*MCSAngle (tracks in [3,10] deg.)", gMeanPMCSAngVsPIn310deg, gSigmaPMCSAngVsPIn310deg);
1810 TGraphErrors* gMeanResClXVsCh =
new TGraphErrors(AliMUONConstants::NTrackingCh());
1811 gMeanResClXVsCh->SetName(
"gMeanResClXVsCh");
1812 gMeanResClXVsCh->SetTitle(
"cluster-trackRef residual-X per Ch: mean;chamber ID;<#Delta_{X}> (cm)");
1813 gMeanResClXVsCh->SetMarkerStyle(kFullDotLarge);
1815 TGraphErrors* gMeanResClYVsCh =
new TGraphErrors(AliMUONConstants::NTrackingCh());
1816 gMeanResClYVsCh->SetName(
"gMeanResClYVsCh");
1817 gMeanResClYVsCh->SetTitle(
"cluster-trackRef residual-Y per Ch: mean;chamber ID;<#Delta_{Y}> (cm)");
1818 gMeanResClYVsCh->SetMarkerStyle(kFullDotLarge);
1820 TGraphErrors* gSigmaResClXVsCh =
new TGraphErrors(AliMUONConstants::NTrackingCh());
1821 gSigmaResClXVsCh->SetName(
"gSigmaResClXVsCh");
1822 gSigmaResClXVsCh->SetTitle(
"cluster-trackRef residual-X per Ch: sigma;chamber ID;#sigma_{X} (cm)");
1823 gSigmaResClXVsCh->SetMarkerStyle(kFullDotLarge);
1825 TGraphErrors* gSigmaResClYVsCh =
new TGraphErrors(AliMUONConstants::NTrackingCh());
1826 gSigmaResClYVsCh->SetName(
"gSigmaResClYVsCh");
1827 gSigmaResClYVsCh->SetTitle(
"cluster-trackRef residual-Y per Ch: sigma;chamber ID;#sigma_{Y} (cm)");
1828 gSigmaResClYVsCh->SetMarkerStyle(kFullDotLarge);
1832 TGraphErrors* gMeanResClXVsDE =
new TGraphErrors(
fNDE);
1833 gMeanResClXVsDE->SetName(
"gMeanResClXVsDE");
1834 gMeanResClXVsDE->SetTitle(
"cluster-trackRef residual-X per DE: mean;DE ID;<#Delta_{X}> (cm)");
1835 gMeanResClXVsDE->SetMarkerStyle(kFullDotLarge);
1837 TGraphErrors* gMeanResClYVsDE =
new TGraphErrors(
fNDE);
1838 gMeanResClYVsDE->SetName(
"gMeanResClYVsDE");
1839 gMeanResClYVsDE->SetTitle(
"cluster-trackRef residual-Y per dE: mean;DE ID;<#Delta_{Y}> (cm)");
1840 gMeanResClYVsDE->SetMarkerStyle(kFullDotLarge);
1842 TGraphErrors* gSigmaResClXVsDE =
new TGraphErrors(
fNDE);
1843 gSigmaResClXVsDE->SetName(
"gSigmaResClXVsDE");
1844 gSigmaResClXVsDE->SetTitle(
"cluster-trackRef residual-X per DE: sigma;DE ID;#sigma_{X} (cm)");
1845 gSigmaResClXVsDE->SetMarkerStyle(kFullDotLarge);
1847 TGraphErrors* gSigmaResClYVsDE =
new TGraphErrors(
fNDE);
1848 gSigmaResClYVsDE->SetName(
"gSigmaResClYVsDE");
1849 gSigmaResClYVsDE->SetTitle(
"cluster-trackRef residual-Y per DE: sigma;DE ID;#sigma_{Y} (cm)");
1850 gSigmaResClYVsDE->SetMarkerStyle(kFullDotLarge);
1854 Double_t clusterResPerCh[10][2];
1855 for (Int_t i = 0; i < AliMUONConstants::NTrackingCh(); i++) {
1857 FitClusterResidual(tmp, i, clusterResPerCh[i][0], gMeanResClXVsCh, gSigmaResClXVsCh);
1860 FitClusterResidual(tmp, i, clusterResPerCh[i][1], gMeanResClYVsCh, gSigmaResClYVsCh);
1865 Double_t clusterResPerDE[200][2];
1866 for (Int_t i = 0; i <
fNDE; i++) {
1868 FitClusterResidual(tmp, i, clusterResPerDE[i][0], gMeanResClXVsDE, gSigmaResClXVsDE);
1871 FitClusterResidual(tmp, i, clusterResPerDE[i][1], gMeanResClYVsDE, gSigmaResClYVsDE);
1877 gMeanResClXVsDE->GetXaxis()->Set(fNDE, 0.5, fNDE+0.5);
1878 gMeanResClYVsDE->GetXaxis()->Set(fNDE, 0.5, fNDE+0.5);
1879 gSigmaResClXVsDE->GetXaxis()->Set(fNDE, 0.5, fNDE+0.5);
1880 gSigmaResClYVsDE->GetXaxis()->Set(fNDE, 0.5, fNDE+0.5);
1881 for (Int_t i = 1; i <=
fNDE; i++) {
1882 const char* label = xAxis->GetBinLabel(i);
1883 gMeanResClXVsDE->GetXaxis()->SetBinLabel(i, label);
1884 gMeanResClYVsDE->GetXaxis()->SetBinLabel(i, label);
1885 gSigmaResClXVsDE->GetXaxis()->SetBinLabel(i, label);
1886 gSigmaResClYVsDE->GetXaxis()->SetBinLabel(i, label);
1890 TCanvas* cResPAtVtx =
DrawVsAng(
"cResPAtVtx",
"momentum residual at vertex in 3 angular regions",
1894 TCanvas* cResPAtVtxMC =
DrawVsAng(
"cResPAtVtxMC",
"momentum residual at vertex in 3 MC angular regions",
1898 TCanvas* cResPAtVtxVsPosAbsEndMC =
DrawVsPos(
"cResPAtVtxVsPosAbsEndMC",
"momentum residual at vertex versus position at absorber end in 3 MC angular regions",
1903 TCanvas* cResPAtVtxVsPIn23deg =
DrawFitLandauGausResPVsP(
"cResPAtVtxVsPIn23deg",
"momentum residual for tracks between 2 and 3 degrees",
1905 10,
"momentum residuals at vertex (tracks in [2,3] deg.)");
1907 TCanvas* cResPAtVtxVsPIn310deg =
DrawFitLandauGausResPVsP(
"cResPAtVtxVsPIn310deg",
"momentum residual for tracks between 3 and 10 degrees",
1909 10,
"momentum residuals at vertex (tracks in [3,10] deg.)");
1911 TCanvas* cResPAtVtxVsPIn02degMC =
DrawResPVsP(
"cResPAtVtxVsPIn02degMC",
"momentum residuals for tracks with MC angle < 2 degrees",
1916 TCanvas* cResSlopeXAtVtx =
DrawVsAng(
"cResSlopeXAtVtx",
"slope_{X} residual at vertex in 3 angular regions",
1920 TCanvas* cResSlopeYAtVtx =
DrawVsAng(
"cResSlopeYAtVtx",
"slope_{Y} residual at vertex in 3 angular regions",
1924 TCanvas* cResSlopeXAtVtxMC =
DrawVsAng(
"cResSlopeXAtVtxMC",
"slope_{X} residual at vertex in 3 MC angular regions",
1928 TCanvas* cResSlopeYAtVtxMC =
DrawVsAng(
"cResSlopeYAtVtxMC",
"slope_{Y} residual at vertex in 3 MC angular regions",
1932 TCanvas* cResSlopeXAtVtxVsPosAbsEndMC =
DrawVsPos(
"cResSlopeXAtVtxVsPosAbsEndMC",
"slope_{X} residual at vertex versus position at absorber end in 3 MC angular regions",
1937 TCanvas* cResSlopeYAtVtxVsPosAbsEndMC =
DrawVsPos(
"cResSlopeYAtVtxVsPosAbsEndMC",
"slope_{Y} residual at vertex versus position at absorber end in 3 MC angular regions",
1944 TCanvas* cResEtaAtVtx =
DrawVsAng(
"cResEtaAtVtx",
"eta residual at vertex in 3 angular regions",
1948 TCanvas* cResEtaAtVtxMC =
DrawVsAng(
"cResEtaAtVtxMC",
"eta residual at vertex in 3 MC angular regions",
1952 TCanvas* cResEtaAtVtxVsPosAbsEndMC =
DrawVsPos(
"cResEtaAtVtxVsPosAbsEndMC",
"eta residual at vertex versus position at absorber end in 3 MC angular regions",
1959 TCanvas* cResPhiAtVtx =
DrawVsAng(
"cResPhiAtVtx",
"phi residual at vertex in 3 angular regions",
1963 TCanvas* cResPhiAtVtxMC =
DrawVsAng(
"cResPhiAtVtxMC",
"phi residual at vertex in 3 MC angular regions",
1967 TCanvas* cResPhiAtVtxVsPosAbsEndMC =
DrawVsPos(
"cResPhiAtVtxVsPosAbsEndMC",
"phi residual at vertex versus position at absorber end in 3 MC angular regions",
1974 TCanvas* cPDCA =
DrawVsAng(
"cPDCA",
"p #times DCA in 3 angular regions",
1978 TCanvas* cPDCAMC =
DrawVsAng(
"cPDCAMC",
"p #times DCA in 3 MC angular regions",
1982 TCanvas* cPDCAVsPosAbsEndMC =
DrawVsPos(
"cPDCAVsPosAbsEndMC",
"p #times DCA versus position at absorber end in 3 MC angular regions",
2008 Bool_t isGood = kTRUE;
2011 Double_t sum[2] = {0., 0.};
2012 for ( Int_t ihisto=0; ihisto<2; ihisto++ ) {
2013 histo = ( ihisto==0 ) ? efficiency->GetNum()->Project(
kVarCharge) : efficiency->GetDen()->Project(
kVarCharge);
2014 sum[ihisto] = histo->Integral();
2018 if ( sum[1] == 0. ) isGood = kFALSE;
2020 calcEff = ( isGood ) ? sum[0]/sum[1] : 0.;
2021 if ( calcEff > 1. ) isGood = kFALSE;
2023 calcEffErr = ( isGood ) ? TMath::Sqrt(calcEff*(1-calcEff)/sum[1]) : 0.;
2038 Int_t recoPdg = mcParticle->PdgCode();
2041 if ( TMath::Abs(recoPdg) != 13 )
return kRecoHadron;
2043 Int_t imother = mcParticle->GetMother();
2045 Bool_t isFirstMotherHF = kFALSE;
2049 while ( imother >= 0 ) {
2050 TParticle* part =
static_cast<AliMCParticle*
>(fMCEvent->GetTrack(imother))->Particle();
2053 if ( part->GetUniqueID() == kPHadronic )
2056 Int_t absPdg = TMath::Abs(part->GetPdgCode());
2060 isFirstMotherHF = ( ( absPdg >= 400 && absPdg < 600 ) ||
2061 ( absPdg >= 4000 && absPdg < 6000 ) );
2066 if ( isFirstMotherHF) {
2069 else if ( absPdg == 5 )
2073 imother = part->GetFirstMother();
2086 Float_t thetaDeg = ( isTheta ) ? RAtAbsEnd : TMath::ATan( RAtAbsEnd / 505. );
2087 thetaDeg *= TMath::RadToDeg();
2088 if ( thetaDeg < 2. )
2090 else if ( thetaDeg < 3. )
2092 else if ( thetaDeg < 10. )
2100 Bool_t isValid, Int_t mcID)
2106 AliMCParticle* mcPart = (mcID >= 0) ? static_cast<AliMCParticle*>(fMCEvent->GetTrack(mcID)) : 0x0;
2109 containerInput[
kVarPt] = mcPart->Pt();
2110 containerInput[
kVarEta] = mcPart->Eta();
2111 containerInput[
kVarPhi] = mcPart->Phi();
2113 containerInput[
kVarPt] = esdTrack->Pt();
2114 containerInput[
kVarEta] = esdTrack->Eta();
2115 containerInput[
kVarPhi] = esdTrack->Phi();
2118 containerInput[
kVarCharge] =
static_cast<Double_t
>(esdTrack->Charge());
2119 containerInput[
kVarHasTracker] =
static_cast<Double_t
>(esdTrack->ContainTrackerData() && isValid);
2121 else if (esdTrack->GetMatchTrigger() == 1) containerInput[
kVarTrigger] = static_cast<Double_t>(
kAllPtTrig);
2122 else if (esdTrack->GetMatchTrigger() == 2) containerInput[
kVarTrigger] = static_cast<Double_t>(
kLowPtTrig);
2123 else if (esdTrack->GetMatchTrigger() == 3) containerInput[
kVarTrigger] = static_cast<Double_t>(
kHighPtTrig);
2135 containerInput[
kVarPt] = mcPart->Pt();
2136 containerInput[
kVarEta] = mcPart->Eta();
2137 containerInput[
kVarPhi] = mcPart->Phi();
2139 containerInput[
kVarCharge] =
static_cast<Double_t
>(mcPart->Charge())/3.;
2159 Double_t invsq2pi = 0.3989422804014;
2160 Double_t mpshift = -0.22278298;
2163 Double_t mpc = par[1] - mpshift * par[0];
2166 Double_t xlow = x[0] - 5. * par[3];
2167 Double_t xupp = x[0] + 5. * par[3];
2168 Double_t step = TMath::Min(0.2*par[0],0.1*par[3]);
2171 Double_t xx = xlow + 0.5 * step;
2174 sum += TMath::Landau(-xx,mpc,par[0]) * TMath::Gaus(x[0],xx,par[3]);
2178 return (par[2] * step * sum * invsq2pi / par[3] / par[0]);
2184 TGraphAsymmErrors* gMostProb, TGraphAsymmErrors* gSigma)
2188 static TF1 *fGaus2 = 0x0;
2189 if (!fGaus2) fGaus2 =
new TF1(
"fGaus2",
"gaus");
2190 static TF1* fLandauGaus = 0x0;
2192 fLandauGaus =
new TF1(
"fLandauGaus",
langaufun,h->GetYaxis()->GetBinLowEdge(1),h->GetYaxis()->GetBinLowEdge(h->GetNbinsY()+1),4);
2193 fLandauGaus->SetNpx(10000);
2196 Int_t rebinFactorX = TMath::Max(h->GetNbinsX()/
fNPBins, 1);
2197 for (Int_t i = rebinFactorX; i <= h->GetNbinsX(); i+=rebinFactorX) {
2199 cout<<Form(
"\rFitting %s... %d/%d",fitting,i/rebinFactorX,
fNPBins)<<flush;
2201 TH1D *tmp = h->ProjectionY(
"tmp",i-rebinFactorX+1,i,
"e");
2204 fGaus2->SetParameters((Double_t)tmp->GetEntries(), 0., 1.);
2205 tmp->Fit(
"fGaus2",
"WWNQ");
2208 Double_t sigma = fGaus2->GetParameter(2);
2209 Int_t rebin =
static_cast<Int_t
>(TMath::Min(0.1*tmp->GetNbinsX(),TMath::Max(0.5*sigma/tmp->GetBinWidth(1),1.)));
2210 while (tmp->GetNbinsX()%rebin!=0) rebin--;
2214 Double_t mean = fGaus2->GetParameter(1);
2215 fLandauGaus->SetParameters(0.25*sigma*TMath::Sqrt(8.*log(2.)), mean, tmp->GetEntries()*tmp->GetXaxis()->GetBinWidth(1), 0.5*sigma);
2216 fLandauGaus->SetParLimits(0, 0.0025*sigma*TMath::Sqrt(8.*log(2.)), 1000.);
2217 fLandauGaus->SetParLimits(3, 0., 2.*sigma);
2218 Double_t xMin = TMath::Max(mean-50.*sigma, tmp->GetXaxis()->GetXmin());
2219 Double_t xMax = TMath::Min(mean+10.*sigma, tmp->GetXaxis()->GetXmax());
2220 if (xMin < tmp->GetXaxis()->GetXmax() && xMax > tmp->GetXaxis()->GetXmin()) fLandauGaus->SetRange(xMin, xMax);
2221 tmp->Fit(
"fLandauGaus",
"RNQ");
2224 Double_t fwhm = 4.*fLandauGaus->GetParameter(0);
2225 sigma = fLandauGaus->GetParameter(3);
2226 Double_t sigmaP = TMath::Sqrt(sigma*sigma + fwhm*fwhm/(8.*log(2.)));
2227 Double_t fwhmErr = fLandauGaus->GetParError(0);
2228 Double_t sigmaErr = fLandauGaus->GetParError(3);
2229 Double_t sigmaPErr = TMath::Sqrt(sigma*sigma*sigmaErr*sigmaErr + fwhm*fwhm*fwhmErr*fwhmErr/(64.*log(2.)*log(2.))) / sigmaP;
2230 h->GetXaxis()->SetRange(i-rebinFactorX+1,i);
2231 Double_t p = (tmp->GetEntries() > 0) ? h->GetMean() : 0.5 * (h->GetXaxis()->GetBinLowEdge(i-rebinFactorX+1) + h->GetXaxis()->GetBinLowEdge(i+1));
2232 h->GetXaxis()->SetRange();
2233 Double_t pErr[2] = {p-h->GetXaxis()->GetBinLowEdge(i-rebinFactorX+1), h->GetXaxis()->GetBinLowEdge(i+1)-p};
2234 gMean->SetPoint(i/rebinFactorX-1, p, tmp->GetMean());
2235 gMean->SetPointError(i/rebinFactorX-1, pErr[0], pErr[1], tmp->GetMeanError(), tmp->GetMeanError());
2236 gMostProb->SetPoint(i/rebinFactorX-1, p, -fLandauGaus->GetParameter(1));
2237 gMostProb->SetPointError(i/rebinFactorX-1, pErr[0], pErr[1], fLandauGaus->GetParError(1), fLandauGaus->GetParError(1));
2238 gSigma->SetPoint(i/rebinFactorX-1, p, sigmaP);
2239 gSigma->SetPointError(i/rebinFactorX-1, pErr[0], pErr[1], sigmaPErr, sigmaPErr);
2245 cout<<Form(
"\rFitting %s... %d/%d",fitting,
fNPBins,
fNPBins)<<endl;
2251 const Double_t sigma0,
const char* fitting,
2252 TGraphAsymmErrors* gMean, TGraphAsymmErrors* gSigma)
2256 static TF1* fGaus = 0x0;
2257 if (!fGaus) fGaus =
new TF1(
"fGaus",
"gaus");
2259 Int_t rebinFactorX = TMath::Max(h->GetNbinsX()/
fNPBins, 1);
2260 for (Int_t i = rebinFactorX; i <= h->GetNbinsX(); i+=rebinFactorX) {
2262 cout<<Form(
"\rFitting %s... %d/%d",fitting,i/rebinFactorX,
fNPBins)<<flush;
2264 TH1D *tmp = h->ProjectionY(
"tmp",i-rebinFactorX+1,i,
"e");
2267 fGaus->SetParameters(tmp->GetEntries(), mean0, sigma0);
2268 tmp->Fit(
"fGaus",
"WWNQ");
2271 Int_t rebin =
static_cast<Int_t
>(TMath::Min(0.1*tmp->GetNbinsX(),TMath::Max(0.5*fGaus->GetParameter(2)/tmp->GetBinWidth(1),1.)));
2272 while (tmp->GetNbinsX()%rebin!=0) rebin--;
2276 tmp->Fit(
"fGaus",
"NQ");
2279 h->GetXaxis()->SetRange(i-rebinFactorX+1,i);
2280 Double_t p = (tmp->GetEntries() > 0) ? h->GetMean() : 0.5 * (h->GetXaxis()->GetBinLowEdge(i-rebinFactorX+1) + h->GetXaxis()->GetBinLowEdge(i+1));
2281 h->GetXaxis()->SetRange();
2282 Double_t pErr[2] = {p-h->GetXaxis()->GetBinLowEdge(i-rebinFactorX+1), h->GetXaxis()->GetBinLowEdge(i+1)-p};
2283 gMean->SetPoint(i/rebinFactorX-1, p, fGaus->GetParameter(1));
2284 gMean->SetPointError(i/rebinFactorX-1, pErr[0], pErr[1], fGaus->GetParError(1), fGaus->GetParError(1));
2285 gSigma->SetPoint(i/rebinFactorX-1, p, fGaus->GetParameter(2));
2286 gSigma->SetPointError(i/rebinFactorX-1, pErr[0], pErr[1], fGaus->GetParError(2), fGaus->GetParError(2));
2292 cout<<Form(
"\rFitting %s... %d/%d",fitting,
fNPBins,
fNPBins)<<endl;
2298 TGraphAsymmErrors* gMean, TGraphAsymmErrors* gSigma)
2302 static TF1* fPGaus = 0x0;
2303 if (!fPGaus) fPGaus =
new TF1(
"fPGaus",
"x*gaus");
2305 Int_t rebinFactorX = TMath::Max(h->GetNbinsX()/
fNPBins, 1);
2306 for (Int_t i = rebinFactorX; i <= h->GetNbinsX(); i+=rebinFactorX) {
2308 cout<<Form(
"\rFitting %s... %d/%d",fitting,i/rebinFactorX,
fNPBins)<<flush;
2310 TH1D *tmp = h->ProjectionY(
"tmp",i-rebinFactorX+1,i,
"e");
2313 Int_t rebin =
static_cast<Int_t
>(25*(tmp->GetNbinsX()/(tmp->GetBinLowEdge(tmp->GetNbinsX()+1)-tmp->GetBinLowEdge(1))));
2314 while (tmp->GetNbinsX()%rebin!=0) rebin--;
2318 fPGaus->SetParameters(1.,0.,80.);
2319 tmp->Fit(
"fPGaus",
"NQ");
2322 h->GetXaxis()->SetRange(i-rebinFactorX+1,i);
2323 Double_t p = (tmp->GetEntries() > 0) ? h->GetMean() : 0.5 * (h->GetXaxis()->GetBinLowEdge(i-rebinFactorX+1) + h->GetXaxis()->GetBinLowEdge(i+1));
2324 h->GetXaxis()->SetRange();
2325 Double_t pErr[2] = {p-h->GetXaxis()->GetBinLowEdge(i-rebinFactorX+1), h->GetXaxis()->GetBinLowEdge(i+1)-p};
2326 gMean->SetPoint(i/rebinFactorX-1, p, fPGaus->GetParameter(1));
2327 gMean->SetPointError(i/rebinFactorX-1, pErr[0], pErr[1], fPGaus->GetParError(1), fPGaus->GetParError(1));
2328 gSigma->SetPoint(i/rebinFactorX-1, p, fPGaus->GetParameter(2));
2329 gSigma->SetPointError(i/rebinFactorX-1, pErr[0], pErr[1], fPGaus->GetParError(2), fPGaus->GetParError(2));
2335 cout<<Form(
"\rFitting %s... %d/%d",fitting,
fNPBins,
fNPBins)<<endl;
2341 TGraphErrors* gMean, TGraphErrors* gSigma)
2345 static TF1* fRGaus = 0x0;
2346 Double_t mean, meanErr, sigmaErr;
2350 if (!fRGaus) fRGaus =
new TF1(
"fRGaus",
"gaus");
2353 Double_t xMin = h->GetXaxis()->GetXmin();
2354 Double_t xMax = h->GetXaxis()->GetXmax();
2355 fRGaus->SetRange(xMin, xMax);
2356 fRGaus->SetParameters(h->GetEntries(), 0., 0.1);
2357 fRGaus->SetParLimits(1, xMin, xMax);
2358 h->Fit(
"fRGaus",
"WWNQ");
2361 Int_t rebin =
static_cast<Int_t
>(TMath::Min(0.1*h->GetNbinsX(),TMath::Max(0.3*fRGaus->GetParameter(2)/h->GetBinWidth(1),1.)));
2362 while (h->GetNbinsX()%rebin!=0) rebin--;
2366 xMin = TMath::Max(fRGaus->GetParameter(1)-10.*fRGaus->GetParameter(2), h->GetXaxis()->GetXmin());
2367 xMax = TMath::Min(fRGaus->GetParameter(1)+10.*fRGaus->GetParameter(2), h->GetXaxis()->GetXmax());
2368 fRGaus->SetRange(xMin, xMax);
2369 fRGaus->SetParLimits(1, xMin, xMax);
2370 h->Fit(
"fRGaus",
"NQR");
2372 mean = fRGaus->GetParameter(1);
2373 meanErr = fRGaus->GetParError(1);
2374 sigma = fRGaus->GetParameter(2);
2375 sigmaErr = fRGaus->GetParError(2);
2380 mean = h->GetMean();
2381 meanErr = h->GetMeanError();
2382 sigma = h->GetRMS();
2383 sigmaErr = h->GetRMSError();
2384 h->GetXaxis()->SetRange(0,0);
2388 gMean->SetPoint(i, i+1, mean);
2389 gMean->SetPointError(i, 0., meanErr);
2392 Double_t s = TMath::Sqrt(mean*mean + sigma*sigma);
2393 sigmaErr = (s>0.) ? TMath::Sqrt(sigma*sigma*sigmaErr*sigmaErr + mean*mean*meanErr*meanErr) / s : 0.;
2397 gSigma->SetPoint(i, i+1, sigma);
2398 gSigma->SetPointError(i, 0., sigmaErr);
2406 TCanvas* c =
new TCanvas(name, title);
2409 TH1D *proj1 = h2->ProjectionY(Form(
"%s_proj_0_2",h2->GetName()),1,2);
2410 proj1->SetLineColor(2);
2411 proj1->Draw(
"sames");
2412 TH1D *proj2 = h2->ProjectionY(Form(
"%s_proj_2_3",h2->GetName()),3,3);
2413 proj2->SetLineColor(4);
2414 proj2->Draw(
"sames");
2415 TH1D *proj3 = h2->ProjectionY(Form(
"%s__proj_3_10",h2->GetName()),4,10);
2416 proj3->SetLineColor(3);
2417 proj3->Draw(
"sames");
2425 TCanvas* c =
new TCanvas(name, title);
2427 h1->SetMarkerColor(2);
2429 h2->SetMarkerColor(4);
2430 h2->DrawCopy(
"sames");
2431 h3->SetMarkerColor(3);
2432 h3->DrawCopy(
"sames");
2438 TH2* h,
const Int_t nBins,
const char* fitting)
2442 static TF1 *fGaus3 = 0x0;
2443 if (!fGaus3) fGaus3 =
new TF1(
"fGaus3",
"gaus");
2444 static TF1* fLandauGaus2 = 0x0;
2445 if (!fLandauGaus2) {
2446 fLandauGaus2 =
new TF1(
"fLandauGaus2",
langaufun,h->GetYaxis()->GetBinLowEdge(1),h->GetYaxis()->GetBinLowEdge(h->GetNbinsY()+1),4);
2447 fLandauGaus2->SetNpx(10000);
2450 TLegend* l =
new TLegend(0.15,0.25,0.3,0.85);
2451 TCanvas* c =
new TCanvas(name, title);
2456 Int_t rebinFactorX = TMath::Max(h->GetNbinsX()/nBins, 1);
2457 for (Int_t i = rebinFactorX; i <= h->GetNbinsX(); i+=rebinFactorX) {
2459 cout<<Form(
"\rFitting %s... %d/%d",fitting,i/rebinFactorX,nBins)<<flush;
2462 TH1D* proj = h->ProjectionY(Form(
"%s_%d",h->GetName(),i/rebinFactorX),i-rebinFactorX+1,i);
2463 if (proj->GetEntries() > 0) proj->Scale(1./proj->GetEntries());
2464 proj->Draw((i==rebinFactorX)?
"hist":
"histsames");
2465 proj->SetLineColor(i/rebinFactorX);
2467 if (proj->GetEntries() > 10) {
2470 fGaus3->SetParameters(1., 0., 1.);
2471 proj->Fit(
"fGaus3",
"WWNQ");
2474 Double_t sigma = fGaus3->GetParameter(2);
2475 Int_t rebin =
static_cast<Int_t
>(TMath::Min(0.1*proj->GetNbinsX(),TMath::Max(0.5*sigma/proj->GetBinWidth(1),1.)));
2476 while (proj->GetNbinsX()%rebin!=0) rebin--;
2478 proj->Scale(1./rebin);
2481 Double_t mean = fGaus3->GetParameter(1);
2482 fLandauGaus2->SetParameters(0.25*sigma*TMath::Sqrt(8.*log(2.)), mean, proj->GetXaxis()->GetBinWidth(1), 0.5*sigma);
2483 fLandauGaus2->SetParLimits(0, 0.0025*sigma*TMath::Sqrt(8.*log(2.)), 1000.);
2484 fLandauGaus2->SetParLimits(3, 0., 2.*sigma);
2485 Double_t xMin = TMath::Max(mean-50.*sigma, proj->GetXaxis()->GetXmin());
2486 Double_t xMax = TMath::Min(mean+10.*sigma, proj->GetXaxis()->GetXmax());
2487 if (xMin < proj->GetXaxis()->GetXmax() && xMax > proj->GetXaxis()->GetXmin()) fLandauGaus2->SetRange(xMin, xMax);
2488 fLandauGaus2->SetLineColor(i/rebinFactorX);
2489 proj->Fit(
"fLandauGaus2",
"RQ",
"sames");
2494 Double_t p = 0.5 * (h->GetXaxis()->GetBinLowEdge(i-rebinFactorX+1) + h->GetXaxis()->GetBinLowEdge(i+1));
2495 l->AddEntry(proj,Form(
"%5.1f GeV",p));
2499 cout<<Form(
"\rFitting %s... %d/%d",fitting,nBins,nBins)<<endl;
2512 TLegend* l =
new TLegend(0.15,0.25,0.3,0.85);
2513 TCanvas* c =
new TCanvas(name, title);
2518 Int_t rebinFactorX = TMath::Max(h->GetNbinsX()/nBins, 1);
2519 for (Int_t i = rebinFactorX; i <= h->GetNbinsX(); i+=rebinFactorX) {
2522 TH1D* proj = h->ProjectionY(Form(
"%s_%d",h->GetName(),i/rebinFactorX),i-rebinFactorX+1,i);
2523 if (proj->GetEntries() > 0) proj->Scale(1./proj->GetEntries());
2524 proj->Draw((i==rebinFactorX)?
"hist":
"histsames");
2525 proj->SetLineColor(i/rebinFactorX);
2526 proj->SetLineWidth(2);
2529 Double_t p = 0.5 * (h->GetXaxis()->GetBinLowEdge(i-rebinFactorX+1) + h->GetXaxis()->GetBinLowEdge(i+1));
2530 l->AddEntry(proj,Form(
"%5.1f GeV",p));
2544 Double_t maxEventsCut = fractionCut * h->GetEntries();
2545 Int_t nBins = h->GetNbinsX();
2549 Double_t eventsCut = 0.;
2550 for (minBin = 1; minBin <= nBins; minBin++) {
2551 eventsCut += h->GetBinContent(minBin);
2552 if (eventsCut > maxEventsCut)
break;
2558 for (maxBin = nBins; maxBin >= 1; maxBin--) {
2559 eventsCut += h->GetBinContent(maxBin);
2560 if (eventsCut > maxEventsCut)
break;
2564 h->GetXaxis()->SetRange(--minBin, ++maxBin);
2572 TH1* auxHisto = efficiency->Project(
kVarPt);
2573 auxHisto->SetName(Form(
"effVsPt_%s",suffix));
2574 list->AddLast(auxHisto);
2576 auxHisto = efficiency->Project(
kVarEta);
2577 auxHisto->SetName(Form(
"effVsEta_%s",suffix));
2578 list->AddLast(auxHisto);
2580 auxHisto = efficiency->Project(
kVarPhi);
2581 auxHisto->SetName(Form(
"effVsPhi_%s",suffix));
2582 list->AddLast(auxHisto);
2584 auxHisto = efficiency->Project(
kVarCent);
2585 auxHisto->SetName(Form(
"effVsCent_%s",suffix));
2586 list->AddLast(auxHisto);
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates