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
43 //____________________________________________________________________
44 AliFMDMCSharingFilter::AliFMDMCSharingFilter(const char* title)
45 : AliFMDSharingFilter(title),
58 // title Title of object - not significant
60 fFMD1i = new TH2D("FMD1i_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
61 fFMD2i = new TH2D("FMD2i_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
62 fFMD2o = new TH2D("FMD2o_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
63 fFMD3i = new TH2D("FMD3i_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
64 fFMD3o = new TH2D("FMD3o_corr", "Merged vs MC", 21, -.5, 20.5, 300, 0, 15);
65 fFMD1i->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
66 fFMD1i->SetXTitle("Hits (MC)");
67 fFMD2i->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
68 fFMD2i->SetXTitle("Hits (MC)");
69 fFMD2o->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
70 fFMD2o->SetXTitle("Hits (MC)");
71 fFMD3i->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
72 fFMD3i->SetXTitle("Hits (MC)");
73 fFMD3o->SetYTitle("#Delta E/#Delta_{mip} (ESD)");
74 fFMD3o->SetXTitle("Hits (MC)");
75 fFMD1i->SetDirectory(0);
76 fFMD2i->SetDirectory(0);
77 fFMD2o->SetDirectory(0);
78 fFMD3i->SetDirectory(0);
79 fFMD3o->SetDirectory(0);
81 fOper = new AliFMDFloatMap(0,0,0,0);
82 fOperComp = new TH2I("operComp", "Operation vs # track refs",
83 kMergedInto, kNone-.5, kMergedInto+.5,
85 fOperComp->SetXTitle("Operation");
86 fOperComp->SetYTitle("# of track refs in sector");
87 fOperComp->SetZTitle("Observations");
88 fOperComp->GetXaxis()->SetBinLabel(kNone, "None");
89 fOperComp->GetXaxis()->SetBinLabel(kCandidate, "Candidate");
90 fOperComp->GetXaxis()->SetBinLabel(kMergedWithOther, "Merged w/other");
91 fOperComp->GetXaxis()->SetBinLabel(kMergedInto, "Merged into");
92 fOperComp->SetDirectory(0);
95 //____________________________________________________________________
96 AliFMDMCSharingFilter::AliFMDMCSharingFilter(const AliFMDMCSharingFilter& o)
97 : AliFMDSharingFilter(o),
98 fTrackDensity(o.fTrackDensity),
104 fOperComp(o.fOperComp)
110 // o Object to copy from
114 //____________________________________________________________________
115 AliFMDMCSharingFilter::~AliFMDMCSharingFilter()
122 //____________________________________________________________________
123 AliFMDMCSharingFilter&
124 AliFMDMCSharingFilter::operator=(const AliFMDMCSharingFilter& o)
127 // Assignment operator
130 // o Object to assign from
135 AliFMDSharingFilter::operator=(o);
136 fTrackDensity = o.fTrackDensity;
141 //____________________________________________________________________
143 AliFMDMCSharingFilter::FilterMC(const AliESDFMD& input,
144 const AliMCEvent& event,
150 // Filter the input kinematics and track references, using
151 // some of the ESD information
154 // input Input ESD event
155 // event Input MC event
156 // vz Vertex position
157 // output Output ESD-like object
158 // primary Per-event histogram of primaries
161 // True on succes, false otherwise
166 fTrackDensity.Calculate(input, event, vz, output, primary);
171 //____________________________________________________________________
173 AliFMDMCSharingFilter::CompareResults(const AliESDFMD& esd,
177 // Compare the result of merging to the monte-carlo truth. This
178 // fills the correlation histograms
181 // esd ESD after sharing correction
185 // Copy eta values to output
186 for (UShort_t d = 1; d <= 3; d++) {
187 UShort_t nq = (d == 1 ? 1 : 2);
188 for (UShort_t q = 0; q < nq; q++) {
189 Char_t r = (q == 0 ? 'I' : 'O');
190 UShort_t ns = (q == 0 ? 20 : 40);
191 UShort_t nt = (q == 0 ? 512 : 256);
194 case 1: co = fFMD1i; break;
195 case 2: co = (q == 0 ? fFMD2i : fFMD2o); break;
196 case 3: co = (q == 0 ? fFMD3i : fFMD3o); break;
199 for (UShort_t s = 0; s < ns; s++) {
200 for (UShort_t t = 0; t < nt; t++) {
201 Float_t mEsd = esd.Multiplicity(d, r, s, t);
202 Float_t mMc = mc.Multiplicity(d, r, s, t);
211 //____________________________________________________________________
213 AliFMDMCSharingFilter::DefineOutput(TList* dir)
216 // Define the output histograms. These are put in a sub list of the
217 // passed list. The histograms are merged before the parent task calls
218 // AliAnalysisTaskSE::Terminate
221 // dir Directory to add to
223 AliFMDSharingFilter::DefineOutput(dir);
224 TList* d = static_cast<TList*>(dir->FindObject(GetName()));
225 TList* cd = new TList;
227 cd->SetName("esd_mc_comparion");
235 fTrackDensity.DefineOutput(d);
238 //____________________________________________________________________
240 AliFMDMCSharingFilter::ScaleHistograms(const TList* dir, Int_t nEvents)
243 // Scale the histograms to the total number of events
246 // dir Where the output is
247 // nEvents Number of events
249 AliFMDSharingFilter::ScaleHistograms(dir, nEvents);
252 //____________________________________________________________________
254 AliFMDMCSharingFilter::Print(Option_t* option) const
262 AliFMDSharingFilter::Print(option);
263 gROOT->IncreaseDirLevel();
264 fTrackDensity.Print(option);
265 gROOT->DecreaseDirLevel();
269 //____________________________________________________________________