AliPhysics  95775ff (95775ff)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliFMDMCSharingFilter.cxx
Go to the documentation of this file.
1 //
2 // Class to do the sharing correction for MC data.
3 //
4 // Input:
5 // - AliESDFMD object - from reconstruction
6 // - Kinematics
7 // - Track-References
8 //
9 // Output:
10 // - AliESDFMD object - copy of input, but with signals merged
11 //
12 // Corrections used:
13 // - ELoss fits
14 //
15 // Histograms:
16 // - For each ring (FMD1i, FMD2i, FMD2o, FMD3i, FMD3o) the distribution of
17 // signals before and after the filter.
18 // - For each ring (see above), an array of distributions of number of
19 // hit strips for each vertex bin (if enabled - see Init method)
20 //
21 #include "AliFMDMCSharingFilter.h"
22 #include <AliESDFMD.h>
23 #include <AliMCEvent.h>
24 #include <AliTrackReference.h>
25 #include <AliStack.h>
26 #include <TAxis.h>
27 #include <TList.h>
28 #include <TH1.h>
29 #include <TMath.h>
30 #include "AliFMDStripIndex.h"
31 #include "AliFMDFloatMap.h"
32 #include <AliLog.h>
33 #include <TROOT.h>
34 #include <iostream>
35 #include <iomanip>
36 
38 #if 0
39 ; // This is for Emacs
40 #endif
41 
42 //____________________________________________________________________
44  : AliFMDSharingFilter(title),
45  fTrackDensity(title),
46  fFMD1i(0),
47  fFMD2i(0),
48  fFMD2o(0),
49  fFMD3i(0),
50  fFMD3o(0)// , fOperComp(0)
51 {
52  //
53  // Constructor
54  //
55  // Parameters:
56  // title Title of object - not significant
57  //
58  fFMD1i = new TH2D("FMD1i_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
59  fFMD2i = new TH2D("FMD2i_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
60  fFMD2o = new TH2D("FMD2o_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
61  fFMD3i = new TH2D("FMD3i_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
62  fFMD3o = new TH2D("FMD3o_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
63  fFMD1i->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
64  fFMD1i->SetXTitle("Hits (MC)");
65  fFMD2i->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
66  fFMD2i->SetXTitle("Hits (MC)");
67  fFMD2o->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
68  fFMD2o->SetXTitle("Hits (MC)");
69  fFMD3i->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
70  fFMD3i->SetXTitle("Hits (MC)");
71  fFMD3o->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
72  fFMD3o->SetXTitle("Hits (MC)");
73  fFMD1i->SetDirectory(0);
74  fFMD2i->SetDirectory(0);
75  fFMD2o->SetDirectory(0);
76  fFMD3i->SetDirectory(0);
77  fFMD3o->SetDirectory(0);
78 
79 #if 0
80  fOper = new AliFMDFloatMap(0,0,0,0);
81  fOperComp = new TH2I("operComp", "Operation vs # track refs",
82  kMergedInto, kNone-.5, kMergedInto+.5,
83  20, -.5, 19.5);
84  fOperComp->SetXTitle("Operation");
85  fOperComp->SetYTitle("# of track refs in sector");
86  fOperComp->SetZTitle("Observations");
87  fOperComp->GetXaxis()->SetBinLabel(kNone, "None");
88  fOperComp->GetXaxis()->SetBinLabel(kCandidate, "Candidate");
89  fOperComp->GetXaxis()->SetBinLabel(kMergedWithOther, "Merged w/other");
90  fOperComp->GetXaxis()->SetBinLabel(kMergedInto, "Merged into");
91  fOperComp->SetDirectory(0);
92 #endif
93 }
94 
95 //____________________________________________________________________
97  : AliFMDSharingFilter(o),
98  fTrackDensity(o.fTrackDensity),
99  fFMD1i(o.fFMD1i),
100  fFMD2i(o.fFMD2i),
101  fFMD2o(o.fFMD2o),
102  fFMD3i(o.fFMD3i),
103  fFMD3o(o.fFMD3o) // , fOperComp(o.fOperComp)
104 {
105  //
106  // Copy constructor
107  //
108  // Parameters:
109  // o Object to copy from
110  //
111 }
112 
113 //____________________________________________________________________
115 {
116  //
117  // Destructor
118  //
119 }
120 
121 //____________________________________________________________________
124 {
125  //
126  // Assignment operator
127  //
128  // Parameters:
129  // o Object to assign from
130  //
131  // Return:
132  // Reference to this
133  //
136  return *this;
137 }
138 
139 
140 //____________________________________________________________________
141 Bool_t
143  const AliMCEvent& event,
144  const TVector3& ip,
145  AliESDFMD& output,
146  TH2D* primary)
147 {
148  //
149  // Filter the input kinematics and track references, using
150  // some of the ESD information
151  //
152  // Parameters:
153  // input Input ESD event
154  // event Input MC event
155  // vz Vertex position
156  // output Output ESD-like object
157  // primary Per-event histogram of primaries
158  //
159  // Return:
160  // True on succes, false otherwise
161  //
162  output.Clear();
163 
164 
165  fTrackDensity.Calculate(input, event, ip, output, primary);
166 
167  return kTRUE;
168 }
169 
170 //____________________________________________________________________
171 void
173  const AliESDFMD& mc)
174 {
175  //
176  // Compare the result of merging to the monte-carlo truth. This
177  // fills the correlation histograms
178  //
179  // Parameters:
180  // esd ESD after sharing correction
181  // mc MC ESD
182  //
183 
184  // Copy eta values to output
185  for (UShort_t d = 1; d <= 3; d++) {
186  UShort_t nq = (d == 1 ? 1 : 2);
187  for (UShort_t q = 0; q < nq; q++) {
188  Char_t r = (q == 0 ? 'I' : 'O');
189  UShort_t ns = (q == 0 ? 20 : 40);
190  UShort_t nt = (q == 0 ? 512 : 256);
191  TH2* co = 0;
192  switch (d) {
193  case 1: co = fFMD1i; break;
194  case 2: co = (q == 0 ? fFMD2i : fFMD2o); break;
195  case 3: co = (q == 0 ? fFMD3i : fFMD3o); break;
196  }
197 
198  for (UShort_t s = 0; s < ns; s++) {
199  for (UShort_t t = 0; t < nt; t++) {
200  Float_t mEsd = esd.Multiplicity(d, r, s, t);
201  Float_t mMc = mc.Multiplicity(d, r, s, t);
202 
203  co->Fill(mMc, mEsd);
204  }
205  }
206  }
207  }
208 }
209 
210 //____________________________________________________________________
211 void
213 {
214  //
215  // Define the output histograms. These are put in a sub list of the
216  // passed list. The histograms are merged before the parent task calls
217  // AliAnalysisTaskSE::Terminate
218  //
219  // Parameters:
220  // dir Directory to add to
221  //
223  TList* d = static_cast<TList*>(dir->FindObject(GetName()));
224  TList* cd = new TList;
225  cd->SetOwner();
226  cd->SetName("esd_mc_comparion");
227  d->Add(cd);
228  cd->Add(fFMD1i);
229  cd->Add(fFMD2i);
230  cd->Add(fFMD2o);
231  cd->Add(fFMD3i);
232  cd->Add(fFMD3o);
233  // cd->Add(fOperComp);
235 }
236 
237 //____________________________________________________________________
238 void
240 {
241  //
242  // Scale the histograms to the total number of events
243  //
244  // Parameters:
245  // dir Where the output is
246  // nEvents Number of events
247  //
248  AliFMDSharingFilter::Terminate(dir, output, nEvents);
249 }
250 
251 //____________________________________________________________________
252 void
254 {
256  fTrackDensity.SetDebug(dbg > 2);
257 }
258 
259 //____________________________________________________________________
260 void
262 {
263  //
264  // Print information
265  //
266  // Parameters:
267  // option Not used
268  //
270  gROOT->IncreaseDirLevel();
271  fTrackDensity.Print(option);
272  gROOT->DecreaseDirLevel();
273 
274 }
275 
276 //____________________________________________________________________
277 //
278 // EOF
279 //
Bool_t FilterMC(const AliESDFMD &input, const AliMCEvent &event, const TVector3 &ip, AliESDFMD &output, TH2D *primary)
void Print(Option_t *option="") const
const char * title
Definition: MakeQAPdf.C:26
AliFMDMCSharingFilter & operator=(const AliFMDMCSharingFilter &o)
char Char_t
Definition: External.C:18
AliFMDSharingFilter & operator=(const AliFMDSharingFilter &)
Bool_t Calculate(const AliESDFMD &esd, const AliMCEvent &event, const TVector3 &ip, AliESDFMD &output, TH2D *primary)
ClassImp(AliFMDMCSharingFilter) AliFMDMCSharingFilter
virtual void Terminate(const TList *dir, TList *output, Int_t nEvents)
void CreateOutputObjects(TList *list)
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
void SetDebug(Bool_t debug=true)
Definition: External.C:228
void Terminate(const TList *dir, TList *output, Int_t nEvents)
void Print(Option_t *option="") const
virtual void SetDebug(Int_t dbg=1)
virtual void CreateOutputObjects(TList *dir)
virtual void SetDebug(Int_t dbg=1)
Float_t nEvents[nProd]
Definition: External.C:220
virtual void Print(Option_t *option="") const
AliFMDMCTrackDensity fTrackDensity
unsigned short UShort_t
Definition: External.C:28
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53
void CreateOutputObjects(TList *dir)
void CompareResults(const AliESDFMD &esd, const AliESDFMD &mc)