AliPhysics  608b256 (608b256)
AliFMDMCHitEnergyFitterTask.cxx
Go to the documentation of this file.
3 #include "AliAODForwardMult.h"
4 #include "AliMCAuxHandler.h"
5 #include <TROOT.h>
6 #include <TNtuple.h>
7 
8 //____________________________________________________________________
10  Bool_t useTuple)
11  : AliBaseESDTask(name, "", &(AliForwardCorrectionManager::Instance())),
12  fEventInspector("event"),
13  fEnergyFitter("fitter", useTuple),
14  fHitHandler(0)
15 {
16  fCloneList = true;
17  if (useTuple) DefineOutput(3, TNtuple::Class());
18 }
19 
20 //____________________________________________________________________
21 TAxis*
23 {
24  static TAxis* a = new TAxis(0, 0, 0);
25  return a;
26 }
27 //____________________________________________________________________
28 TAxis*
30 {
31  static TAxis* a = new TAxis(10, -10, 10);
32  return a;
33 }
34 
35 //____________________________________________________________________
36 Bool_t
38 {
39  DGUARD(fDebug,1,"Setting up the MC hit energy loss task");
41  return true;
42 }
43 
44 //____________________________________________________________________
45 Bool_t
47 {
48  DGUARD(fDebug,1,"Booking histograms for the MC hit energy loss task");
51 
53  // We have to add the handler here, since the subsiduary handlers of
54  // AliMCEventHandler are not streamed with the parent object - sigh!
55  // Hence, we add it at init time of the slaves.
56  fHitHandler = AliMCAuxHandler::Create("FMD", "AliFMDHit");
57  return true;
58 }
59 
60 //____________________________________________________________________
61 Bool_t
63 {
64  DGUARD(fDebug,2,"Final setup of the MC hit energy loss task");
66  if (fEnergyFitter.GetTuple())
67  PostData(3, fEnergyFitter.GetTuple());
68  return true;
69 }
70 //____________________________________________________________________
71 Bool_t
73 {
74  // --- Read in the data --------------------------------------------
75  LoadBranches();
76 
77  Bool_t lowFlux = kFALSE;
78  UInt_t triggers = 0;
79  UShort_t ivz = 0;
80  TVector3 ip;
81  Double_t cent = 0;
82  UShort_t nClusters = 0;
83  UInt_t found = fEventInspector.Process(&esd, triggers, lowFlux,
84  ivz, ip, cent, nClusters);
85  if (found & AliFMDEventInspector::kNoEvent) return false;
86  if (found & AliFMDEventInspector::kNoTriggers) return false;
87  if (found & AliFMDEventInspector::kNoSPD) return false;
88  if (found & AliFMDEventInspector::kNoFMD) return false;
89  if (found & AliFMDEventInspector::kNoVertex) return false;
90  if (found & AliFMDEventInspector::kBadVertex) return false;
91 
92  // do not process pile-up, A, C, and E events
93  if (triggers & AliAODForwardMult::kPileUp) return false;
94  if (triggers & AliAODForwardMult::kA) return false;
95  if (triggers & AliAODForwardMult::kC) return false;
96  if (triggers & AliAODForwardMult::kE) return false;
97 
98  // We want only the events found by off-line
99  if (!(triggers & AliAODForwardMult::kOffline)) return false;
100 
101  // Perhaps we should also insist on MB only
102  // if (fOnlyMB && (!(triggers & AliAODForwardMult::kInel))) return false;
103 
104  AliMCEvent* mc = MCEvent();
105  if (!mc) return false;
106 
107  Bool_t ret = fEnergyFitter.Event(esd, *mc, *fHitHandler);
108 
109  if (fEnergyFitter.GetTuple())
110  PostData(3, fEnergyFitter.GetTuple());
111 
112  return ret;
113 }
114 #define PFB(N,FLAG) \
115  do { \
116  AliForwardUtil::PrintName(N); \
117  std::cout << std::boolalpha << (FLAG) << std::noboolalpha << std::endl; \
118  } while(false)
119 
120 //____________________________________________________________________
121 void
123 {
124  AliBaseESDTask::Print(option);
125  gROOT->IncreaseDirLevel();
126  fEnergyFitter.Print(option);
127  gROOT->DecreaseDirLevel();
128 }
129 
130 //
131 // EOF
132 //
133 
134 
double Double_t
Definition: External.C:58
virtual void CreateOutputObjects(TList *dir)
virtual void Print(Option_t *option="") const
Bool_t PreData(const TAxis &ipz, const TAxis &eta)
UInt_t Process(const AliESDEvent *event, UInt_t &triggers, Bool_t &lowFlux, UShort_t &ivz, TVector3 &ip, Double_t &cent, UShort_t &nClusters)
void Print(Option_t *option="") const
Per-event per bin.
unsigned int UInt_t
Definition: External.C:33
#define DGUARD(L, N, F,...)
UInt_t fExtraCorrections
unsigned short UShort_t
Definition: External.C:28
const char Option_t
Definition: External.C:48
UInt_t fNeededCorrections
bool Bool_t
Definition: External.C:53
void Print(Option_t *option="") const
static AliMCAuxHandler * Create(const char *name="FMD", const char *what="Hits")
virtual void SetupForData(const TAxis &etaAxis, UShort_t sys=0)
virtual Bool_t Event(const AliESDEvent &esdInput, const AliMCEvent &mcInput, AliMCAuxHandler &handler)