2 // Class to do the sharing correction for MC data.
5 // - AliESDFMD object - from reconstruction
10 // - AliESDFMD object - copy of input, but with signals merged
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)
21 #include "AliFMDMCSharingFilter.h"
22 #include <AliESDFMD.h>
23 #include <AliMCEvent.h>
24 #include <AliTrackReference.h>
30 #include "AliFMDStripIndex.h"
31 #include "AliFMDFloatMap.h"
37 ClassImp(AliFMDMCSharingFilter)
39 ; // This is for Emacs
42 //____________________________________________________________________
43 AliFMDMCSharingFilter::AliFMDMCSharingFilter(const char* title)
44 : AliFMDSharingFilter(title),
57 // title Title of object - not significant
59 fFMD1i = new TH2D("FMD1i_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
60 fFMD2i = new TH2D("FMD2i_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
61 fFMD2o = new TH2D("FMD2o_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
62 fFMD3i = new TH2D("FMD3i_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
63 fFMD3o = new TH2D("FMD3o_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
64 fFMD1i->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
65 fFMD1i->SetXTitle("Hits (MC)");
66 fFMD2i->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
67 fFMD2i->SetXTitle("Hits (MC)");
68 fFMD2o->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
69 fFMD2o->SetXTitle("Hits (MC)");
70 fFMD3i->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
71 fFMD3i->SetXTitle("Hits (MC)");
72 fFMD3o->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
73 fFMD3o->SetXTitle("Hits (MC)");
74 fFMD1i->SetDirectory(0);
75 fFMD2i->SetDirectory(0);
76 fFMD2o->SetDirectory(0);
77 fFMD3i->SetDirectory(0);
78 fFMD3o->SetDirectory(0);
80 fOper = new AliFMDFloatMap(0,0,0,0);
81 fOperComp = new TH2I("operComp", "Operation vs # track refs",
82 kMergedInto, kNone-.5, kMergedInto+.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);
94 //____________________________________________________________________
95 AliFMDMCSharingFilter::AliFMDMCSharingFilter(const AliFMDMCSharingFilter& o)
96 : AliFMDSharingFilter(o),
97 fTrackDensity(o.fTrackDensity),
103 fOperComp(o.fOperComp)
109 // o Object to copy from
113 //____________________________________________________________________
114 AliFMDMCSharingFilter::~AliFMDMCSharingFilter()
121 //____________________________________________________________________
122 AliFMDMCSharingFilter&
123 AliFMDMCSharingFilter::operator=(const AliFMDMCSharingFilter& o)
126 // Assignment operator
129 // o Object to assign from
134 AliFMDSharingFilter::operator=(o);
135 fTrackDensity = o.fTrackDensity;
140 //____________________________________________________________________
142 AliFMDMCSharingFilter::FilterMC(const AliESDFMD& input,
143 const AliMCEvent& event,
149 // Filter the input kinematics and track references, using
150 // some of the ESD information
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
160 // True on succes, false otherwise
165 fTrackDensity.Calculate(input, event, vz, output, primary);
170 //____________________________________________________________________
172 AliFMDMCSharingFilter::CompareResults(const AliESDFMD& esd,
176 // Compare the result of merging to the monte-carlo truth. This
177 // fills the correlation histograms
180 // esd ESD after sharing correction
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);
193 case 1: co = fFMD1i; break;
194 case 2: co = (q == 0 ? fFMD2i : fFMD2o); break;
195 case 3: co = (q == 0 ? fFMD3i : fFMD3o); break;
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);
210 //____________________________________________________________________
212 AliFMDMCSharingFilter::DefineOutput(TList* dir)
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
220 // dir Directory to add to
222 AliFMDSharingFilter::DefineOutput(dir);
223 TList* d = static_cast<TList*>(dir->FindObject(GetName()));
224 TList* cd = new TList;
226 cd->SetName("esd_mc_comparion");
234 fTrackDensity.DefineOutput(d);
237 //____________________________________________________________________
239 AliFMDMCSharingFilter::ScaleHistograms(const TList* dir, Int_t nEvents)
242 // Scale the histograms to the total number of events
245 // dir Where the output is
246 // nEvents Number of events
248 AliFMDSharingFilter::ScaleHistograms(dir, nEvents);
251 //____________________________________________________________________
253 AliFMDMCSharingFilter::SetDebug(Int_t dbg)
255 AliFMDSharingFilter::SetDebug(dbg);
256 fTrackDensity.SetDebug(dbg > 2);
259 //____________________________________________________________________
261 AliFMDMCSharingFilter::Print(Option_t* option) const
269 AliFMDSharingFilter::Print(option);
270 gROOT->IncreaseDirLevel();
271 fTrackDensity.Print(option);
272 gROOT->DecreaseDirLevel();
276 //____________________________________________________________________