1 #include "AliFMDMCTrackInspectorTask.h"
2 #include "AliForwardCorrectionManager.h"
3 #include "AliAODForwardMult.h"
7 //____________________________________________________________________
8 AliFMDMCTrackInspectorTask::AliFMDMCTrackInspectorTask(const char* name,
10 : AliBaseESDTask(name, "", &(AliForwardCorrectionManager::Instance())),
11 fEventInspector("event"),
12 fTrackInspector("fitter")
15 fTrackInspector.GetTracker().SetUseTree(useTree);
16 if (useTree) DefineOutput(3, TTree::Class());
19 //____________________________________________________________________
21 AliFMDMCTrackInspectorTask::DefaultEtaAxis() const
23 static TAxis* a = new TAxis(0, 0, 0);
26 //____________________________________________________________________
28 AliFMDMCTrackInspectorTask::DefaultVertexAxis() const
30 static TAxis* a = new TAxis(10, -10, 10);
34 //____________________________________________________________________
36 AliFMDMCTrackInspectorTask::Setup()
38 DGUARD(fDebug,1,"Setting up the MC hit energy loss task");
39 fTrackInspector.Init();
43 //____________________________________________________________________
45 AliFMDMCTrackInspectorTask::Book()
47 DGUARD(fDebug,1,"Booking histograms for the MC hit energy loss task");
48 fNeededCorrections = 0;
49 fExtraCorrections = 0;
51 fTrackInspector.CreateOutputObjects(fList);
55 //____________________________________________________________________
57 AliFMDMCTrackInspectorTask::PreData(const TAxis& /*ipz*/, const TAxis& eta)
59 DGUARD(fDebug,2,"Final setup of the MC hit energy loss task");
60 fTrackInspector.SetupForData(eta);
61 if (fTrackInspector.GetTracker().GetTree())
62 PostData(3, fTrackInspector.GetTracker().GetTree());
65 //____________________________________________________________________
67 AliFMDMCTrackInspectorTask::Event(AliESDEvent& esd)
69 // --- Read in the data --------------------------------------------
72 Bool_t lowFlux = kFALSE;
77 UShort_t nClusters = 0;
78 UInt_t found = fEventInspector.Process(&esd, triggers, lowFlux,
79 ivz, ip, cent, nClusters);
80 if (found & AliFMDEventInspector::kNoEvent) return false;
81 if (found & AliFMDEventInspector::kNoTriggers) return false;
82 if (found & AliFMDEventInspector::kNoSPD) return false;
83 if (found & AliFMDEventInspector::kNoFMD) return false;
84 if (found & AliFMDEventInspector::kNoVertex) return false;
85 if (found & AliFMDEventInspector::kBadVertex) return false;
87 // do not process pile-up, A, C, and E events
88 if (triggers & AliAODForwardMult::kPileUp) return false;
89 if (triggers & AliAODForwardMult::kA) return false;
90 if (triggers & AliAODForwardMult::kC) return false;
91 if (triggers & AliAODForwardMult::kE) return false;
93 // We want only the events found by off-line
94 if (!(triggers & AliAODForwardMult::kOffline)) return false;
96 // Perhaps we should also insist on MB only
97 // if (fOnlyMB && (!(triggers & AliAODForwardMult::kInel))) return false;
99 AliMCEvent* mc = MCEvent();
100 if (!mc) return false;
102 Bool_t ret = fTrackInspector.Event(esd, *mc, cent);
104 if (fTrackInspector.GetTracker().GetTree())
105 PostData(3, fTrackInspector.GetTracker().GetTree());
109 #define PFB(N,FLAG) \
111 AliForwardUtil::PrintName(N); \
112 std::cout << std::boolalpha << (FLAG) << std::noboolalpha << std::endl; \
115 //____________________________________________________________________
117 AliFMDMCTrackInspectorTask::Print(Option_t* option) const
119 AliBaseESDTask::Print(option);
120 gROOT->IncreaseDirLevel();
121 fTrackInspector.Print(option);
122 gROOT->DecreaseDirLevel();