AliPhysics  56f1704 (56f1704)
AliFMDMCTrackInspectorTask.cxx
Go to the documentation of this file.
3 #include "AliAODForwardMult.h"
4 #include <TROOT.h>
5 #include <TTree.h>
6 
7 //____________________________________________________________________
9  Bool_t useTree)
10  : AliBaseESDTask(name, "", &(AliForwardCorrectionManager::Instance())),
11  fEventInspector("event"),
12  fTrackInspector("fitter")
13 {
14  fCloneList = true;
16  if (useTree) DefineOutput(3, TTree::Class());
17 }
18 
19 //____________________________________________________________________
20 TAxis*
22 {
23  static TAxis* a = new TAxis(0, 0, 0);
24  return a;
25 }
26 //____________________________________________________________________
27 TAxis*
29 {
30  static TAxis* a = new TAxis(10, -10, 10);
31  return a;
32 }
33 
34 //____________________________________________________________________
35 Bool_t
37 {
38  DGUARD(fDebug,1,"Setting up the MC hit energy loss task");
40  return true;
41 }
42 
43 //____________________________________________________________________
44 Bool_t
46 {
47  DGUARD(fDebug,1,"Booking histograms for the MC hit energy loss task");
50 
52  return true;
53 }
54 
55 //____________________________________________________________________
56 Bool_t
57 AliFMDMCTrackInspectorTask::PreData(const TAxis& /*ipz*/, const TAxis& eta)
58 {
59  DGUARD(fDebug,2,"Final setup of the MC hit energy loss task");
62  PostData(3, fTrackInspector.GetTracker().GetTree());
63  return true;
64 }
65 //____________________________________________________________________
66 Bool_t
68 {
69  // --- Read in the data --------------------------------------------
70  LoadBranches();
71 
72  Bool_t lowFlux = kFALSE;
73  UInt_t triggers = 0;
74  UShort_t ivz = 0;
75  TVector3 ip;
76  Double_t cent = 0;
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;
86 
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;
92 
93  // We want only the events found by off-line
94  if (!(triggers & AliAODForwardMult::kOffline)) return false;
95 
96  // Perhaps we should also insist on MB only
97  // if (fOnlyMB && (!(triggers & AliAODForwardMult::kInel))) return false;
98 
99  AliMCEvent* mc = MCEvent();
100  if (!mc) return false;
101 
102  Bool_t ret = fTrackInspector.Event(esd, *mc, cent);
103 
105  PostData(3, fTrackInspector.GetTracker().GetTree());
106 
107  return ret;
108 }
109 #define PFB(N,FLAG) \
110  do { \
111  AliForwardUtil::PrintName(N); \
112  std::cout << std::boolalpha << (FLAG) << std::noboolalpha << std::endl; \
113  } while(false)
114 
115 //____________________________________________________________________
116 void
118 {
119  AliBaseESDTask::Print(option);
120  gROOT->IncreaseDirLevel();
121  fTrackInspector.Print(option);
122  gROOT->DecreaseDirLevel();
123 }
124 
125 //
126 // EOF
127 //
128 
129 
double Double_t
Definition: External.C:58
virtual void Print(Option_t *option="") const
virtual Bool_t Event(const AliESDEvent &esdInput, const AliMCEvent &mcInput, Double_t cent=-1)
void SetUseTree(Bool_t use=true)
UInt_t Process(const AliESDEvent *event, UInt_t &triggers, Bool_t &lowFlux, UShort_t &ivz, TVector3 &ip, Double_t &cent, UShort_t &nClusters)
Per-event per bin.
unsigned int UInt_t
Definition: External.C:33
AliFMDMCTrackInspector fTrackInspector
#define DGUARD(L, N, F,...)
UInt_t fExtraCorrections
void Print(Option_t *option="") const
Bool_t PreData(const TAxis &ipz, const TAxis &eta)
unsigned short UShort_t
Definition: External.C:28
AliFMDMCTrackELoss & GetTracker()
const char Option_t
Definition: External.C:48
UInt_t fNeededCorrections
bool Bool_t
Definition: External.C:53
void Print(Option_t *option="") const
TTree * GetTree() const
virtual void SetupForData(const TAxis &etaAxis, UShort_t sys=0)
virtual void CreateOutputObjects(TList *dir)