2 // Calculate the corrections in the forward regions
14 #include "AliForwardMCCorrectionsTask.h"
15 #include "AliTriggerAnalysis.h"
16 #include "AliPhysicsSelection.h"
18 #include "AliHeader.h"
19 #include "AliGenEventHeader.h"
20 #include "AliESDEvent.h"
21 #include "AliAODHandler.h"
22 #include "AliMultiplicity.h"
23 #include "AliInputEventHandler.h"
25 #include "AliMCEvent.h"
26 #include "AliFMDStripIndex.h"
29 #include <TDirectory.h>
32 //====================================================================
34 const char* GetEventName(Bool_t tr, Bool_t vtx)
36 return Form("nEvents%s%s", (tr ? "Tr" : ""), (vtx ? "Vtx" : ""));
38 const char* GetHitsName(UShort_t d, Char_t r)
40 return Form("hitsFMD%d%c", d, r);
42 const char* GetStripsName(UShort_t d, Char_t r)
44 return Form("stripsFMD%d%c", d, r);
46 const char* GetPrimaryName(Char_t r, Bool_t trVtx)
48 return Form("primaries%s%s",
49 ((r == 'I' || r == 'i') ? "Inner" : "Outer"),
50 (trVtx ? "TrVtx" : "All"));
54 //====================================================================
55 AliForwardMCCorrectionsTask::AliForwardMCCorrectionsTask()
56 : AliAnalysisTaskSE(),
64 fPrimaryInnerTrVtx(0),
65 fPrimaryOuterTrVtx(0),
88 //____________________________________________________________________
89 AliForwardMCCorrectionsTask::AliForwardMCCorrectionsTask(const char* name)
90 : AliAnalysisTaskSE(name),
98 fPrimaryInnerTrVtx(0),
99 fPrimaryOuterTrVtx(0),
120 DefineOutput(1, TList::Class());
123 //____________________________________________________________________
124 AliForwardMCCorrectionsTask::AliForwardMCCorrectionsTask(const AliForwardMCCorrectionsTask& o)
125 : AliAnalysisTaskSE(o),
126 fHEvents(o.fHEvents),
127 fHEventsTr(o.fHEventsTr),
128 fHEventsTrVtx(o.fHEventsTrVtx),
129 fHEventsVtx(o.fHEventsVtx),
130 fHTriggers(o.fHTriggers),
131 fPrimaryInnerAll(o.fPrimaryInnerAll),
132 fPrimaryOuterAll(o.fPrimaryOuterAll),
133 fPrimaryInnerTrVtx(o.fPrimaryInnerTrVtx),
134 fPrimaryOuterTrVtx(o.fPrimaryOuterTrVtx),
135 fHitsFMD1i(o.fHitsFMD1i),
136 fHitsFMD2i(o.fHitsFMD2i),
137 fHitsFMD2o(o.fHitsFMD2o),
138 fHitsFMD3i(o.fHitsFMD3i),
139 fHitsFMD3o(o.fHitsFMD3o),
140 fStripsFMD1i(o.fStripsFMD1i),
141 fStripsFMD2i(o.fStripsFMD2i),
142 fStripsFMD2o(o.fStripsFMD2o),
143 fStripsFMD3i(o.fStripsFMD3i),
144 fStripsFMD3o(o.fStripsFMD3o),
145 fVtxAxis(o.fVtxAxis.GetNbins(), o.fVtxAxis.GetXmin(), o.fVtxAxis.GetXmax()),
146 fEtaAxis(o.fEtaAxis.GetNbins(), o.fEtaAxis.GetXmin(), o.fEtaAxis.GetXmax()),
153 // o Object to copy from
157 //____________________________________________________________________
158 AliForwardMCCorrectionsTask&
159 AliForwardMCCorrectionsTask::operator=(const AliForwardMCCorrectionsTask& o)
162 // Assignment operator
165 // o Object to assign from
168 // Reference to this object
170 fHEventsTr = o.fHEventsTr;
171 fHEventsTrVtx = o.fHEventsTrVtx;
172 fHTriggers = o.fHTriggers;
173 SetVertexAxis(o.fVtxAxis);
174 SetEtaAxis(o.fEtaAxis);
179 //____________________________________________________________________
181 AliForwardMCCorrectionsTask::Init()
184 // Initialize the task
189 //____________________________________________________________________
191 AliForwardMCCorrectionsTask::SetVertexAxis(Int_t nBin, Double_t min,
195 // Set the vertex axis to use
198 // nBins Number of bins
199 // vzMin Least @f$z@f$ coordinate of interation point
200 // vzMax Largest @f$z@f$ coordinate of interation point
202 if (max < min) max = -min;
209 AliWarning(Form("Minimum vertex %f < -10, make sure you want this",min));
211 AliWarning(Form("Minimum vertex %f > +10, make sure you want this",max));
212 fVtxAxis.Set(nBin, min, max);
214 //____________________________________________________________________
216 AliForwardMCCorrectionsTask::SetVertexAxis(const TAxis& axis)
219 // Set the vertex axis to use
224 SetVertexAxis(axis.GetNbins(),axis.GetXmin(),axis.GetXmax());
227 //____________________________________________________________________
229 AliForwardMCCorrectionsTask::SetEtaAxis(Int_t nBin, Double_t min, Double_t max)
232 // Set the eta axis to use
235 // nBins Number of bins
236 // vzMin Least @f$\eta@f$
237 // vzMax Largest @f$\eta@f$
239 if (max < min) max = -min;
246 AliWarning(Form("Minimum eta %f < -4, make sure you want this",min));
248 AliWarning(Form("Minimum eta %f > +6, make sure you want this",max));
249 fVtxAxis.Set(nBin, min, max);
251 //____________________________________________________________________
253 AliForwardMCCorrectionsTask::SetEtaAxis(const TAxis& axis)
256 // Set the eta axis to use
261 SetEtaAxis(axis.GetNbins(),axis.GetXmin(),axis.GetXmax());
264 //____________________________________________________________________
266 AliForwardMCCorrectionsTask::Make3D(const char* name, const char* title,
270 // Make a 3D histogram
275 // nPhi Number of phi bins
280 TH3D* ret = new TH3D(name, title,
287 nPhi, 0, 2*TMath::Pi());
288 ret->SetXTitle("v_{z} [cm]");
289 ret->SetYTitle("#eta");
290 ret->SetZTitle("#varphi [radians]");
291 ret->SetDirectory(0);
297 //____________________________________________________________________
299 AliForwardMCCorrectionsTask::Make1D(const char* name, const char* title) const
311 TH1D* ret = new TH1D(name, title,
315 ret->SetXTitle("#eta");
316 ret->SetFillColor(kRed+1);
317 ret->SetFillStyle(3001);
318 ret->SetDirectory(0);
325 //____________________________________________________________________
327 AliForwardMCCorrectionsTask::UserCreateOutputObjects()
330 // Create output objects
334 fList->SetName(GetName());
336 fHEvents = new TH1I(GetEventName(false,false),
337 "Number of all events",
341 fHEvents->SetXTitle("v_{z} [cm]");
342 fHEvents->SetYTitle("# of events");
343 fHEvents->SetFillColor(kBlue+1);
344 fHEvents->SetFillStyle(3001);
345 fHEvents->SetDirectory(0);
346 fList->Add(fHEvents);
348 fHEventsTr = new TH1I(GetEventName(true, false),
349 "Number of triggered events",
353 fHEventsTr->SetXTitle("v_{z} [cm]");
354 fHEventsTr->SetYTitle("# of events");
355 fHEventsTr->SetFillColor(kRed+1);
356 fHEventsTr->SetFillStyle(3001);
357 fHEventsTr->SetDirectory(0);
358 fList->Add(fHEventsTr);
360 fHEventsTrVtx = new TH1I(GetEventName(true,true),
361 "Number of events w/trigger and vertex",
365 fHEventsTrVtx->SetXTitle("v_{z} [cm]");
366 fHEventsTrVtx->SetYTitle("# of events");
367 fHEventsTrVtx->SetFillColor(kBlue+1);
368 fHEventsTrVtx->SetFillStyle(3001);
369 fHEventsTrVtx->SetDirectory(0);
370 fList->Add(fHEventsTrVtx);
372 fHEventsVtx = new TH1I(GetEventName(false,true),
373 "Number of events w/vertex",
377 fHEventsVtx->SetXTitle("v_{z} [cm]");
378 fHEventsVtx->SetYTitle("# of events");
379 fHEventsVtx->SetFillColor(kBlue+1);
380 fHEventsVtx->SetFillStyle(3001);
381 fHEventsVtx->SetDirectory(0);
382 fList->Add(fHEventsVtx);
385 fHTriggers = new TH1I("triggers", "Triggers", 10, 0, 10);
386 fHTriggers->SetFillColor(kRed+1);
387 fHTriggers->SetFillStyle(3001);
388 fHTriggers->SetStats(0);
389 fHTriggers->SetDirectory(0);
390 fHTriggers->GetXaxis()->SetBinLabel(1,"INEL");
391 fHTriggers->GetXaxis()->SetBinLabel(2,"INEL>0");
392 fHTriggers->GetXaxis()->SetBinLabel(3,"NSD");
393 fHTriggers->GetXaxis()->SetBinLabel(4,"Empty");
394 fHTriggers->GetXaxis()->SetBinLabel(5,"A");
395 fHTriggers->GetXaxis()->SetBinLabel(6,"B");
396 fHTriggers->GetXaxis()->SetBinLabel(7,"C");
397 fHTriggers->GetXaxis()->SetBinLabel(8,"E");
398 fList->Add(fHTriggers);
400 fPrimaryInnerAll = Make3D(GetPrimaryName('I',false), "Primary particles, "
401 "20 #varphi bins, all events", 20);
402 fPrimaryOuterAll = Make3D(GetPrimaryName('O',false), "Primary particles, "
403 "40 #varphi bins, all events", 40);
404 fPrimaryInnerTrVtx = Make3D(GetPrimaryName('I',true), "Primary particles, "
405 "20 #varphi bins, Tr+Vtx events", 20);
406 fPrimaryOuterTrVtx = Make3D(GetPrimaryName('O',true), "Primary particles, "
407 "40 #varphi bins, Tr+Vtx events", 40);
408 TList* primaries = new TList;
409 primaries->SetName("primaries");
410 primaries->Add(fPrimaryInnerAll);
411 primaries->Add(fPrimaryOuterAll);
412 primaries->Add(fPrimaryInnerTrVtx);
413 primaries->Add(fPrimaryOuterTrVtx);
414 fList->Add(primaries);
417 fHitsFMD1i = Make3D(GetHitsName(1,'i'), "All hits in FMD1i, Tr+Vtx", 20);
418 fHitsFMD2i = Make3D(GetHitsName(2,'i'), "All hits in FMD2i, Tr+Vtx", 20);
419 fHitsFMD2o = Make3D(GetHitsName(2,'o'), "All hits in FMD2o, Tr+Vtx", 40);
420 fHitsFMD3i = Make3D(GetHitsName(3,'i'), "All hits in FMD3i, Tr+Vtx", 20);
421 fHitsFMD3o = Make3D(GetHitsName(3,'o'), "All hits in FMD3o, Tr+Vtx", 40);
422 TList* hits = new TList;
423 hits->SetName("hits");
424 hits->Add(fHitsFMD1i);
425 hits->Add(fHitsFMD2i);
426 hits->Add(fHitsFMD2o);
427 hits->Add(fHitsFMD3i);
428 hits->Add(fHitsFMD3o);
431 fStripsFMD1i = Make1D(GetStripsName(1,'i'), "# hit strips in FMD1i, Tr+Vtx");
432 fStripsFMD2i = Make1D(GetStripsName(2,'i'), "# hit strips in FMD2i, Tr+Vtx");
433 fStripsFMD2o = Make1D(GetStripsName(2,'o'), "# hit strips in FMD2o, Tr+Vtx");
434 fStripsFMD3i = Make1D(GetStripsName(3,'i'), "# hit strips in FMD3i, Tr+Vtx");
435 fStripsFMD3o = Make1D(GetStripsName(3,'o'), "# hit strips in FMD3o, Tr+Vtx");
436 TList* strips = new TList;
437 strips->SetName("strips");
438 strips->Add(fStripsFMD1i);
439 strips->Add(fStripsFMD2i);
440 strips->Add(fStripsFMD2o);
441 strips->Add(fStripsFMD3i);
442 strips->Add(fStripsFMD3o);
447 //____________________________________________________________________
449 AliForwardMCCorrectionsTask::UserExec(Option_t*)
452 // Process each event
458 // Get the input data - MC event
459 AliMCEvent* mcEvent = MCEvent();
461 AliWarning("No MC event found");
465 // Get the input data - ESD event
466 AliESDEvent* esd = dynamic_cast<AliESDEvent*>(InputEvent());
468 AliWarning("No ESD event found for input event");
472 // Get the particle stack
473 AliStack* stack = mcEvent->Stack();
475 // Get the event generate header
476 AliHeader* mcHeader = mcEvent->Header();
477 AliGenEventHeader* genHeader = mcHeader->GenEventHeader();
479 // Get the generator vertex
481 genHeader->PrimaryVertex(mcVertex);
482 Double_t mcVtxZ = mcVertex.At(2);
484 // Check the MC vertex is in range
485 Int_t mcVtxBin = fVtxAxis.FindBin(mcVtxZ);
486 if (mcVtxBin < 1 || mcVtxBin > fVtxAxis.GetNbins()) {
488 AliWarning(Form("MC v_z=%f is out of rante [%,%f]",
489 mcVtxBin, fVtxAxis.GetXmin(), fVtxAxis.GetXmax()));
500 // Use event inspector instead
503 Bool_t gotTriggers = AliForwardUtil::ReadTriggers(esd,triggers,fHTriggers);
504 Bool_t gotInel = triggers & AliAODForwardMult::kInel;
506 // Get the ESD vertex
507 Double_t vZ = -1000000;
508 Bool_t gotVertex = AliForwardUtil::ReadVertex(esd,vZ);
512 // Fill the event count histograms
513 if (gotInel) fHEventsTr->Fill(mcVtxZ);
514 if (gotInel && gotVertex) fHEventsTrVtx->Fill(mcVtxZ);
515 if (gotVertex) fHEventsVtx->Fill(mcVtxZ);
516 fHEvents->Fill(mcVtxZ);
519 AliFMDFloatMap hitsByStrip;
520 AliFMDFloatMap lastByStrip;
522 // Loop over all tracks
523 Int_t nTracks = mcEvent->GetNumberOfTracks();
524 for (Int_t iTr = 0; iTr < nTracks; iTr++) {
525 AliMCParticle* particle =
526 static_cast<AliMCParticle*>(mcEvent->GetTrack(iTr));
528 // Check the returned particle
529 if (!particle) continue;
531 // Check if this charged and a primary
532 Bool_t isCharged = particle->Charge() != 0;
533 Bool_t isPrimary = stack->IsPhysicalPrimary(iTr);
535 // Fill (eta,phi) of the particle into histograsm for b
536 Double_t eta = particle->Eta();
537 Double_t phi = particle->Phi();
539 if (isCharged && isPrimary)
540 FillPrimary(gotInel, gotVertex, mcVtxZ, eta, phi);
542 // For the rest, ignore non-collisions, and events out of vtx range
543 if (!gotInel || gotVertex) continue;
545 Int_t nTrRef = particle->GetNumberOfTrackReferences();
546 for (Int_t iTrRef = 0; iTrRef < nTrRef; iTrRef++) {
547 AliTrackReference* trackRef = particle->GetTrackReference(iTrRef);
550 if (!trackRef) continue;
552 // Check that we hit an FMD element
553 if (trackRef->DetectorId() != AliTrackReference::kFMD)
556 // Get the detector coordinates
559 AliFMDStripIndex::Unpack(trackRef->UserId(), d, r, s, t);
561 // Check if mother (?) is charged and that we haven't dealt with it
563 Int_t lastTrack = Int_t(lastByStrip(d,r,s,t));
564 if (!isCharged || iTr == lastTrack) continue;
566 // Increase counter of hits per strip
567 hitsByStrip(d,r,s,t) += 1;
569 // Double_t trRefEta = esd->GetFMDData()->Eta(d,r,s,t);
570 // Double_t trRefPhi = esd->GetFMDData()->Phi(d,r,s,t);
572 // Fill strip information into histograms
573 FillStrip(d, r, mcVtxZ, eta, phi, hitsByStrip(d,r,s,t) == 1);
575 // Set the last processed track number - marking it as done for
577 lastByStrip(d,r,s,t) = Float_t(iTr);
579 // Flag neighboring strips too
580 Int_t nStrip = (r == 'I' || r == 'i' ? 512 : 256);
581 if (t > 0) lastByStrip(d,r,s,t-1) = Float_t(iTr);
582 if (t < nStrip-1) lastByStrip(d,r,s,t+1) = Float_t(iTr);
587 //____________________________________________________________________
589 AliForwardMCCorrectionsTask::FillPrimary(Bool_t gotInel, Bool_t gotVtx,
590 Double_t vz, Double_t eta, Double_t phi)
593 // Fill in primary information
596 // gotInel Got INEL trigger from ESD
597 // gotVtx Got vertex Z from ESD
598 // vz @f$z@f$ coordinate of interation point
599 // eta Pseudo rapidity
600 // phi Azimuthal angle
602 if (gotInel && gotVtx) {
603 // This takes the place of hPrimary_FMD_<r>_vtx<v> and
604 // Analysed_FMD<r>_vtx<v>
605 fPrimaryInnerTrVtx->Fill(vz,eta,phi);
606 fPrimaryOuterTrVtx->Fill(vz,eta,phi);
608 // This takes the place of Inel_FMD<r>_vtx<v> and
609 // Analysed_FMD<r>_vtx<v>
610 fPrimaryInnerAll->Fill(vz,eta,phi);
611 fPrimaryOuterAll->Fill(vz,eta,phi);
614 //____________________________________________________________________
616 AliForwardMCCorrectionsTask::FillStrip(UShort_t d, Char_t r,
617 Double_t vz, Double_t eta, Double_t phi,
621 // Fill in per-strip information
626 // vz @f$z@f$ coordinate of interation point
627 // eta Pseudo rapidity
628 // phi Azimuthal angle
629 // first First fill in this event
632 // Number of hit strips per eta bin
634 // All hits per ring, vertex in eta,phi bins. This takes the place
635 // of hHits_FMD<d><r>_vtx<v> and DoubleHits_FMD<d><r> (the later
636 // being just the 2D projection over the X bins)
641 strips = fStripsFMD1i;
644 hits = (r == 'I' || r == 'i' ? fHitsFMD2i : fHitsFMD2o);
645 strips = (r == 'I' || r == 'i' ? fStripsFMD2i : fStripsFMD2o);
648 hits = (r == 'I' || r == 'i' ? fHitsFMD3i : fHitsFMD3o);
649 strips = (r == 'I' || r == 'i' ? fStripsFMD3i : fStripsFMD3o);
652 if (!hits || !strips) return;
654 if (first) strips->Fill(eta);
656 hits->Fill(vz, eta, phi);
659 //____________________________________________________________________
661 AliForwardMCCorrectionsTask::GetVertexProj(Int_t v, TH3D* src) const
664 // Get vertex project
668 // src Source 3D histogram
671 // 2D projection of the V'th bin
673 Int_t nX = src->GetNbinsX();
674 if (v > nX || v < 1) return 0;
676 src->GetXaxis()->SetRange(v,v+1);
678 TH2D* ret = static_cast<TH2D*>(src->Project3D("zy"));
679 ret->SetName(Form("%s_vtx%02d", src->GetName(), v));
680 ret->SetDirectory(0);
682 src->GetXaxis()->SetRange(0,nX+1);
688 //____________________________________________________________________
690 AliForwardMCCorrectionsTask::Terminate(Option_t*)
699 TList* list = dynamic_cast<TList*>(GetOutputData(1));
701 AliError("No output list defined");
705 TList* primaries = static_cast<TList*>(list->FindObject("primaries"));
706 TList* hits = static_cast<TList*>(list->FindObject("hits"));
707 TList* strips = static_cast<TList*>(list->FindObject("strips"));
708 if (!primaries || !hits || !strips) {
709 AliError(Form("Could not find all sub-lists in %s (p=%p,h=%p,s=%p)",
710 list->GetName(), primaries, hits, strips));
715 static_cast<TH1I*>(list->FindObject(GetEventName(false,false)));
717 static_cast<TH1I*>(list->FindObject(GetEventName(true,false)));
719 static_cast<TH1I*>(list->FindObject(GetEventName(false,true)));
721 static_cast<TH1I*>(list->FindObject(GetEventName(true,true)));
722 if (!eventsAll || !eventsTr || !eventsVtx || !eventsTrVtx) {
723 AliError(Form("Could not find all event histograms in %s "
724 "(a=%p,t=%p,v=%p,tv=%p)", list->GetName(),
725 eventsAll, eventsTr, eventsVtx, eventsTrVtx));
730 static_cast<TH3D*>(primaries->FindObject(GetPrimaryName('I',false)));
732 static_cast<TH3D*>(primaries->FindObject(GetPrimaryName('O',false)));
734 static_cast<TH3D*>(primaries->FindObject(GetPrimaryName('I',true)));
736 static_cast<TH3D*>(primaries->FindObject(GetPrimaryName('O',true)));
737 if (!primIAll || !primOAll || !primITrVtx || !primOTrVtx) {
738 AliError(Form("Could not find all primary particle histograms in %s "
739 "(ai=%p,ao=%p,tvi=%p,tvo=%p)", list->GetName(),
740 primIAll, primOAll, primITrVtx, primOTrVtx));
744 TH3D* hits1i = static_cast<TH3D*>(hits->FindObject(GetHitsName(1,'i')));
745 TH3D* hits2i = static_cast<TH3D*>(hits->FindObject(GetHitsName(2,'i')));
746 TH3D* hits2o = static_cast<TH3D*>(hits->FindObject(GetHitsName(2,'o')));
747 TH3D* hits3i = static_cast<TH3D*>(hits->FindObject(GetHitsName(3,'i')));
748 TH3D* hits3o = static_cast<TH3D*>(hits->FindObject(GetHitsName(3,'o')));
749 if (!hits1i || !hits2i || !hits2o || hits3i || hits3o) {
750 AliError(Form("Could not find all ring hits histograms in %s "
751 "(1i=%p,2i=%p,2o=%p,3i=%p,3o=%p)", hits->GetName(),
752 hits1i, hits2i, hits2o, hits3i, hits3o));
756 TH1D* strips1i = static_cast<TH1D*>(strips->FindObject(GetStripsName(1,'i')));
757 TH1D* strips2i = static_cast<TH1D*>(strips->FindObject(GetStripsName(2,'i')));
758 TH1D* strips2o = static_cast<TH1D*>(strips->FindObject(GetStripsName(2,'o')));
759 TH1D* strips3i = static_cast<TH1D*>(strips->FindObject(GetStripsName(3,'i')));
760 TH1D* strips3o = static_cast<TH1D*>(strips->FindObject(GetStripsName(3,'o')));
761 if (!strips1i || !strips2i || !strips2o || strips3i || strips3o) {
762 AliError(Form("Could not find all ring strips histograms in %s "
763 "(1i=%p,2i=%p,2o=%p,3i=%p,3o=%p)", strips->GetName(),
764 strips1i, strips2i, strips2o, strips3i, strips3o));
768 // Calculate the over-all event selection efficiency
769 TH1D* selEff = new TH1D("selEff", "Event selection efficiency",
774 selEff->SetDirectory(0);
775 selEff->SetFillColor(kMagenta+1);
776 selEff->SetFillStyle(3001);
777 selEff->Add(eventsAll);
778 selEff->Divide(eventsTrVtx);
781 // Loop over vertex bins and do vertex dependendt stuff
782 for (Int_t v = 1; v <= fVtxAxis.GetNbins(); v++) {
783 // Make a sub-list in the output
784 TList* vl = new TList;
785 vl->SetName(Form("vtx%02d", v));
789 Int_t nEventsAll = eventsAll->GetBinContent(v);
790 Int_t nEventsTr = eventsTr->GetBinContent(v);
791 Int_t nEventsVtx = eventsVtx->GetBinContent(v);
792 Int_t nEventsTrVtx = eventsTrVtx->GetBinContent(v);
794 // Project event histograms, set names, and store
795 TH2D* primIAllV = GetVertexProj(v, primIAll);
796 TH2D* primOAllV = GetVertexProj(v, primOAll);
797 TH2D* primITrVtxV = GetVertexProj(v, primITrVtx);
798 TH2D* primOTrVtxV = GetVertexProj(v, primOTrVtx);
801 vl->Add(primITrVtxV);
802 vl->Add(primOTrVtxV);
804 primIAllV->Scale(1. / nEventsAll);
805 primOAllV->Scale(1. / nEventsAll);
806 primITrVtxV->Scale(1. / nEventsTr);
807 primOTrVtxV->Scale(1. / nEventsTr);
809 // Calculate the vertex bias on the d^2N/detadphi
811 static_cast<TH2D*>(primITrVtxV->Clone(Form("selBiasI%02d",v)));
813 static_cast<TH2D*>(primOTrVtxV->Clone(Form("selBiasO%02d",v)));
814 selBiasI->SetTitle(Form("Event selection bias in vertex bin %d", v));
815 selBiasO->SetTitle(Form("Event selection bias in vertex bin %d", v));
816 selBiasI->Divide(primIAllV);
817 selBiasO->Divide(primOAllV);
821 for (UShort_t d = 1; d <= 3; d++) {
822 UShort_t nQ = (d == 1 ? 1 : 2);
823 for (UShort_t q = 0; q < nQ; q++) {
824 Char_t r = (q == 0 ? 'I' : 'O');
826 TH2D* prim2D = (q == 0 ? primITrVtxV : primOTrVtxV);
828 case 1: hits3D = hits1i; break;
829 case 2: hits3D = (q == 0 ? hits2i : hits2o); break;
830 case 3: hits3D = (q == 0 ? hits3i : hits3o); break;
833 TH2D* sec = GetVertexProj(v, hits3D);
834 sec->SetName(Form("secondaryFMD%d%c_vtx%02d", d, r, v));
835 sec->SetTitle(Form("Secondary correction map for FMD%d%c "
836 "in vertex bin %d", d, r, v));
842 // Do the double hit correction (only done once per ring in
846 case 1: hStrips = strips1i; break;
847 case 2: hStrips = (q == 0 ? strips2i : strips2o); break;
848 case 3: hStrips = (q == 0 ? strips3i : strips3o); break;
851 TH2D* hits2D = GetVertexProj(v, hits3D);
852 TH1D* doubleHit = hits2D->ProjectionX(Form("doubleHitFMD%d%c",d,r));
853 doubleHit->SetTitle(Form("Double hit correction for FMD%d%c",d,r));
854 doubleHit->SetDirectory(0);
855 doubleHit->SetFillColor(kGreen+1);
856 doubleHit->SetFillStyle(3001);
858 doubleHit->Divide(hStrips);
859 list->Add(doubleHit);
865 //____________________________________________________________________
867 AliForwardMCCorrectionsTask::Print(Option_t*) const