added function Print
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackerQADataMakerRec.cxx
CommitLineData
ece56eb9 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16// $Id: AliMUONTrackerQADataMakerRec.cxx 35760 2009-10-21 21:45:42Z ivana $
17
18// --- MUON header files ---
19#include "AliMUONTrackerQADataMakerRec.h"
20
21#include "AliQAv1.h"
22#include "AliMUONConstants.h"
23#include "AliMUONDigitMaker.h"
24#include "AliMUONQAMappingCheck.h"
25#include "AliMUONTrackerDataMaker.h"
26#include "AliMUONVCluster.h"
27#include "AliMUONVClusterStore.h"
28#include "AliMUONVDigit.h"
29#include "AliMUONVDigitStore.h"
30#include "AliMUONVTrackerData.h"
31#include "AliMUONTrack.h"
32#include "AliMUONTrackParam.h"
33#include "AliMUONESDInterface.h"
34#include "AliMUONCalibrationData.h"
35#include "AliMpBusPatch.h"
36#include "AliMpConstants.h"
37#include "AliMpDDLStore.h"
38#include "AliMpDEIterator.h"
39#include "AliMpDEManager.h"
40#include "AliMpDetElement.h"
41
42// --- AliRoot header files ---
43#include "AliCDBManager.h"
44#include "AliESDEvent.h"
45#include "AliESDMuonTrack.h"
46#include "AliLog.h"
47#include "AliRawReader.h"
48#include "AliCodeTimer.h"
49#include "AliMUONVDigit.h"
50
51// --- ROOT system ---
52#include <TH1F.h>
53#include <TH1I.h>
54#include <TH2F.h>
55#include <Riostream.h>
56#include <TMath.h>
57
58//-----------------------------------------------------------------------------
59/// \class AliMUONTrackerQADataMakerRec
60///
61/// MUON base class for quality assurance data (histo) maker
62///
63/// \author C. Finck, D. Stocco, L. Aphecetche
64
65/// \cond CLASSIMP
66ClassImp(AliMUONTrackerQADataMakerRec)
67/// \endcond
68
69//____________________________________________________________________________
70AliMUONTrackerQADataMakerRec::AliMUONTrackerQADataMakerRec(AliQADataMakerRec* master) :
71AliMUONVQADataMakerRec(master),
72fDigitStore(AliMUONVDigitStore::Create("AliMUONDigitStoreV1")),
73fDigitMaker(new AliMUONDigitMaker(kTRUE)),
74fClusterStore(0x0),
75fTrackerDataMaker(0x0),
76fMappingCheckRecPoints(0x0),
77fCalibrationData(new AliMUONCalibrationData(AliCDBManager::Instance()->GetRun()))
78{
79 /// ctor
80}
81
82//__________________________________________________________________
83AliMUONTrackerQADataMakerRec::~AliMUONTrackerQADataMakerRec()
84{
85 /// dtor
86 delete fDigitStore;
87 delete fDigitMaker;
88 delete fClusterStore;
89 delete fTrackerDataMaker;
90 delete fCalibrationData;
91 delete fMappingCheckRecPoints;
92}
93
94//____________________________________________________________________________
95void AliMUONTrackerQADataMakerRec::InsertTrackerData(Int_t specie, TObjArray** list,
96 TObject* object, Int_t indexNumber,
97 Bool_t replace)
98{
99 /// Insert an object to a given list
100
101 TIter next(list[specie]);
102 TObject* o;
103 TObject* old(0x0);
104 Bool_t alreadyThere(kFALSE);
105 while ( ( o = next() ) && !alreadyThere )
106 {
107 TString classname(o->ClassName());
108 if ( classname.Contains("TrackerData") )
109 {
110 alreadyThere = kTRUE;
111 old = o;
112 }
113 }
114 if ( (!alreadyThere && object) || (alreadyThere && replace) )
115 {
116 delete old;
117 AliDebug(AliQAv1::GetQADebugLevel(), Form("Adding %s to the list of qa objects",object->GetName()));
118 TNamed* named = static_cast<TNamed*>(object);
119 named->SetName(Form("%s_%s",AliRecoParam::GetEventSpecieName(specie),object->GetName()));
120 object->SetBit(AliQAv1::GetExpertBit());
121 list[specie]->AddAt(object,indexNumber);
122 }
123}
124
125//____________________________________________________________________________
126void AliMUONTrackerQADataMakerRec::EndOfDetectorCycleESDs(Int_t, TObjArray**)
127{
128 /// Normalize ESD histograms
129
130 if (!GetESDsData(kESDnClustersPerTrack)) return;
131
132 Double_t nTracks = GetESDsData(kESDnClustersPerTrack)->GetEntries();
133 if (nTracks <= 0) return;
134
135 TH1* hESDnClustersPerCh = GetESDsData(kESDnClustersPerCh);
136 TH1* hESDnClustersPerDE = GetESDsData(kESDnClustersPerDE);
137 TH1* hESDClusterChargePerChMean = GetESDsData(kESDClusterChargePerChMean);
138 TH1* hESDClusterChargePerChSigma = GetESDsData(kESDClusterChargePerChSigma);
139 TH1* hESDClusterSizePerChMean = GetESDsData(kESDClusterSizePerChMean);
140 TH1* hESDClusterSizePerChSigma = GetESDsData(kESDClusterSizePerChSigma);
141 TH1* hESDResidualXPerChMean = GetESDsData(kESDResidualXPerChMean);
142 TH1* hESDResidualXPerChSigma = GetESDsData(kESDResidualXPerChSigma);
143 TH1* hESDResidualYPerChMean = GetESDsData(kESDResidualYPerChMean);
144 TH1* hESDResidualYPerChSigma = GetESDsData(kESDResidualYPerChSigma);
145 TH1* hESDLocalChi2XPerChMean = GetESDsData(kESDLocalChi2XPerChMean);
146 TH1* hESDLocalChi2YPerChMean = GetESDsData(kESDLocalChi2YPerChMean);
147 TH1* hESDLocalChi2PerChMean = GetESDsData(kESDLocalChi2PerChMean);
148 TH1* hESDClusterChargePerDE = GetESDsData(kESDClusterChargePerDE);
149 TH1* hESDClusterSizePerDE = GetESDsData(kESDClusterSizePerDE);
150 TH1* hESDResidualXPerDEMean = GetESDsData(kESDResidualXPerDEMean);
151 TH1* hESDResidualXPerDESigma = GetESDsData(kESDResidualXPerDESigma);
152 TH1* hESDResidualYPerDEMean = GetESDsData(kESDResidualYPerDEMean);
153 TH1* hESDResidualYPerDESigma = GetESDsData(kESDResidualYPerDESigma);
154 TH1* hESDLocalChi2XPerDEMean = GetESDsData(kESDLocalChi2XPerDEMean);
155 TH1* hESDLocalChi2YPerDEMean = GetESDsData(kESDLocalChi2YPerDEMean);
156 TH1* hESDLocalChi2PerDEMean = GetESDsData(kESDLocalChi2PerDEMean);
157 TH1* hESDnTotClustersPerCh = GetESDsData(kESDnTotClustersPerCh);
158 TH1* hESDnTotClustersPerDE = GetESDsData(kESDnTotClustersPerDE);
159 TH1* hESDnTotFullClustersPerDE = GetESDsData(kESDnTotFullClustersPerDE);
160 TH1* hESDSumClusterChargePerDE = GetESDsData(kESDSumClusterChargePerDE);
161 TH1* hESDSumClusterSizePerDE = GetESDsData(kESDSumClusterSizePerDE);
162 TH1* hESDSumResidualXPerDE = GetESDsData(kESDSumResidualXPerDE);
163 TH1* hESDSumResidualYPerDE = GetESDsData(kESDSumResidualYPerDE);
164 TH1* hESDSumResidualX2PerDE = GetESDsData(kESDSumResidualX2PerDE);
165 TH1* hESDSumResidualY2PerDE = GetESDsData(kESDSumResidualY2PerDE);
166 TH1* hESDSumLocalChi2XPerDE = GetESDsData(kESDSumLocalChi2XPerDE);
167 TH1* hESDSumLocalChi2YPerDE = GetESDsData(kESDSumLocalChi2YPerDE);
168 TH1* hESDSumLocalChi2PerDE = GetESDsData(kESDSumLocalChi2PerDE);
169
170 hESDnClustersPerCh->Reset();
171 hESDnClustersPerDE->Reset();
172 hESDnClustersPerCh->Add(hESDnTotClustersPerCh, 1./nTracks);
173 hESDnClustersPerDE->Add(hESDnTotClustersPerDE, 1./nTracks);
174
175 // loop over chambers
176 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
177
178 TH1* hESDClusterChargeInCh = GetESDsData(kESDClusterChargeInCh+iCh);
179 Double_t sigmaCharge = hESDClusterChargeInCh->GetRMS();
180 hESDClusterChargePerChMean->SetBinContent(iCh+1, hESDClusterChargeInCh->GetMean());
181 hESDClusterChargePerChMean->SetBinError(iCh+1, hESDClusterChargeInCh->GetMeanError());
182 hESDClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
183 hESDClusterChargePerChSigma->SetBinError(iCh+1, hESDClusterChargeInCh->GetRMSError());
184
185 TH1* hESDClusterSizeInCh = GetESDsData(kESDClusterSizeInCh+iCh);
186 Double_t sigmaSize = hESDClusterSizeInCh->GetRMS();
187 hESDClusterSizePerChMean->SetBinContent(iCh+1, hESDClusterSizeInCh->GetMean());
188 hESDClusterSizePerChMean->SetBinError(iCh+1, hESDClusterSizeInCh->GetMeanError());
189 hESDClusterSizePerChSigma->SetBinContent(iCh+1, sigmaSize);
190 hESDClusterSizePerChSigma->SetBinError(iCh+1, hESDClusterSizeInCh->GetRMSError());
191
192 TH1* hESDResidualXInCh = GetESDsData(kESDResidualXInCh+iCh);
193 Double_t sigmaResidualX = hESDResidualXInCh->GetRMS();
194 hESDResidualXPerChMean->SetBinContent(iCh+1, hESDResidualXInCh->GetMean());
195 hESDResidualXPerChMean->SetBinError(iCh+1, hESDResidualXInCh->GetMeanError());
196 hESDResidualXPerChSigma->SetBinContent(iCh+1, sigmaResidualX);
197 hESDResidualXPerChSigma->SetBinError(iCh+1, hESDResidualXInCh->GetRMSError());
198
199 TH1* hESDResidualYInCh = GetESDsData(kESDResidualYInCh+iCh);
200 Double_t sigmaResidualY = hESDResidualYInCh->GetRMS();
201 hESDResidualYPerChMean->SetBinContent(iCh+1, hESDResidualYInCh->GetMean());
202 hESDResidualYPerChMean->SetBinError(iCh+1, hESDResidualYInCh->GetMeanError());
203 hESDResidualYPerChSigma->SetBinContent(iCh+1, sigmaResidualY);
204 hESDResidualYPerChSigma->SetBinError(iCh+1, hESDResidualYInCh->GetRMSError());
205
206 TH1* hESDLocalChi2XInCh = GetESDsData(kESDLocalChi2XInCh+iCh);
207 Double_t sigmaLocalChi2X = hESDLocalChi2XInCh->GetRMS();
208 hESDLocalChi2XPerChMean->SetBinContent(iCh+1, hESDLocalChi2XInCh->GetMean());
209 hESDLocalChi2XPerChMean->SetBinError(iCh+1, hESDLocalChi2XInCh->GetMeanError());
210
211 TH1* hESDLocalChi2YInCh = GetESDsData(kESDLocalChi2YInCh+iCh);
212 Double_t sigmaLocalChi2Y = hESDLocalChi2YInCh->GetRMS();
213 hESDLocalChi2YPerChMean->SetBinContent(iCh+1, hESDLocalChi2YInCh->GetMean());
214 hESDLocalChi2YPerChMean->SetBinError(iCh+1, hESDLocalChi2YInCh->GetMeanError());
215
216 TH1* hESDLocalChi2InCh = GetESDsData(kESDLocalChi2InCh+iCh);
217 Double_t sigmaLocalChi2 = hESDLocalChi2InCh->GetRMS();
218 hESDLocalChi2PerChMean->SetBinContent(iCh+1, hESDLocalChi2InCh->GetMean());
219 hESDLocalChi2PerChMean->SetBinError(iCh+1, hESDLocalChi2InCh->GetMeanError());
220
221 // loop over DE into chamber iCh
222 AliMpDEIterator it;
223 it.First(iCh);
224 while ( !it.IsDone()) {
225
226 Int_t iDE = it.CurrentDEId();
227
228 Double_t nClusters = hESDnTotClustersPerDE->GetBinContent(iDE+1);
229 if (nClusters > 1) {
230
231 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1)/nClusters);
232 hESDClusterChargePerDE->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
233
234 Double_t meanResX = hESDSumResidualXPerDE->GetBinContent(iDE+1)/nClusters;
235 hESDResidualXPerDEMean->SetBinContent(iDE+1, meanResX);
236 hESDResidualXPerDEMean->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(nClusters));
237 hESDResidualXPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualX2PerDE->GetBinContent(iDE+1)/nClusters - meanResX*meanResX));
238 hESDResidualXPerDESigma->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(2.*nClusters));
239
240 Double_t meanResY = hESDSumResidualYPerDE->GetBinContent(iDE+1)/nClusters;
241 hESDResidualYPerDEMean->SetBinContent(iDE+1, meanResY);
242 hESDResidualYPerDEMean->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(nClusters));
243 hESDResidualYPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualY2PerDE->GetBinContent(iDE+1)/nClusters - meanResY*meanResY));
244 hESDResidualYPerDESigma->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(2.*nClusters));
245
246 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)/nClusters);
247 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, sigmaLocalChi2X/TMath::Sqrt(nClusters));
248
249 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1)/nClusters);
250 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, sigmaLocalChi2Y/TMath::Sqrt(nClusters));
251
252 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1)/nClusters);
253 hESDLocalChi2PerDEMean->SetBinError(iDE+1, sigmaLocalChi2/TMath::Sqrt(nClusters));
254
255 } else {
256
257 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1));
258 hESDClusterChargePerDE->SetBinError(iDE+1, hESDClusterChargeInCh->GetXaxis()->GetXmax());
259
260 hESDResidualXPerDEMean->SetBinContent(iDE+1, hESDSumResidualXPerDE->GetBinContent(iDE+1));
261 hESDResidualXPerDEMean->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
262 hESDResidualXPerDESigma->SetBinContent(iDE+1, 0.);
263 hESDResidualXPerDESigma->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
264
265 hESDResidualYPerDEMean->SetBinContent(iDE+1, hESDSumResidualYPerDE->GetBinContent(iDE+1));
266 hESDResidualYPerDEMean->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
267 hESDResidualYPerDESigma->SetBinContent(iDE+1, 0.);
268 hESDResidualYPerDESigma->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
269
270 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1));
271 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, hESDLocalChi2XInCh->GetXaxis()->GetXmax());
272
273 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1));
274 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, hESDLocalChi2YInCh->GetXaxis()->GetXmax());
275
276 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1));
277 hESDLocalChi2PerDEMean->SetBinError(iDE+1, hESDLocalChi2InCh->GetXaxis()->GetXmax());
278
279 }
280
281 Double_t nFullClusters = hESDnTotFullClustersPerDE->GetBinContent(iDE+1);
282 if (nFullClusters > 1) {
283
284 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1)/nFullClusters);
285 hESDClusterSizePerDE->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nFullClusters));
286
287 } else {
288
289 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1));
290 hESDClusterSizePerDE->SetBinError(iDE+1, hESDClusterSizeInCh->GetXaxis()->GetXmax());
291
292 }
293
294 it.Next();
295 }
296
297 }
298
299}
300
301//____________________________________________________________________________
302void AliMUONTrackerQADataMakerRec::EndOfDetectorCycleRecPoints(Int_t specie, TObjArray** list)
303{
304 /// Normalize RecPoints histograms
305
306 if (!GetRecPointsData(kTrackerClusterChargePerChMean)) return;
307
308 TH1* hTrackerClusterChargePerChMean = GetRecPointsData(kTrackerClusterChargePerChMean);
309 TH1* hTrackerClusterChargePerChSigma = GetRecPointsData(kTrackerClusterChargePerChSigma);
310 TH1* hTrackerClusterMultiplicityPerChMean = GetRecPointsData(kTrackerClusterMultiplicityPerChMean);
311 TH1* hTrackerClusterMultiplicityPerChSigma = GetRecPointsData(kTrackerClusterMultiplicityPerChSigma);
312 TH1* hTrackerClusterChargePerDEMean = GetRecPointsData(kTrackerClusterChargePerDEMean);
313 TH1* hTrackerClusterMultiplicityPerDEMean = GetRecPointsData(kTrackerClusterMultiplicityPerDEMean);
314
315 // loop over chambers
316 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
317
318 TH1* hTrackerClusterChargePerChamber = GetRecPointsData(kTrackerClusterChargePerChamber+iCh);
319 Double_t sigmaCharge = hTrackerClusterChargePerChamber->GetRMS();
320 hTrackerClusterChargePerChMean->SetBinContent(iCh+1, hTrackerClusterChargePerChamber->GetMean());
321 hTrackerClusterChargePerChMean->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetMeanError());
322 hTrackerClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
323 hTrackerClusterChargePerChSigma->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetRMSError());
324
325 TH1* hTrackerClusterMultiplicityPerChamber = GetRecPointsData(kTrackerClusterMultiplicityPerChamber+iCh);
326 Double_t sigmaSize = hTrackerClusterMultiplicityPerChamber->GetRMS();
327 hTrackerClusterMultiplicityPerChMean->SetBinContent(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMean());
328 hTrackerClusterMultiplicityPerChMean->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMeanError());
329 hTrackerClusterMultiplicityPerChSigma->SetBinContent(iCh+1, sigmaSize);
330 hTrackerClusterMultiplicityPerChSigma->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetRMSError());
331
332 // loop over DE into chamber iCh
333 AliMpDEIterator it;
334 it.First(iCh);
335 while ( !it.IsDone()) {
336
337 Int_t iDE = it.CurrentDEId();
338
339 TH1* hTrackerClusterChargePerDE = GetRecPointsData(kTrackerClusterChargePerDE+iDE);
340 hTrackerClusterChargePerDEMean->SetBinContent(iDE+1, hTrackerClusterChargePerDE->GetMean());
341 Double_t nClusters = hTrackerClusterChargePerDE->GetEntries();
342 if (nClusters > 1) hTrackerClusterChargePerDEMean->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
343 else hTrackerClusterChargePerDEMean->SetBinError(iDE+1, hTrackerClusterChargePerChamber->GetXaxis()->GetXmax());
344
345 TH1* hTrackerClusterMultiplicityPerDE = GetRecPointsData(kTrackerClusterMultiplicityPerDE+iDE);
346 hTrackerClusterMultiplicityPerDEMean->SetBinContent(iDE+1, hTrackerClusterMultiplicityPerDE->GetMean());
347 nClusters = hTrackerClusterMultiplicityPerDE->GetEntries();
348 if (nClusters > 1) hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nClusters));
349 else hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, hTrackerClusterMultiplicityPerChamber->GetXaxis()->GetXmax());
350
351 it.Next();
352 }
353 }
354
355 if ( fMappingCheckRecPoints ) InsertTrackerData(specie,list,fMappingCheckRecPoints->CreateData("RecPoints"),kTrackerRecPoints,kTRUE);
356}
357
358
359//____________________________________________________________________________
360void AliMUONTrackerQADataMakerRec::EndOfDetectorCycleRaws(Int_t specie, TObjArray** list)
361{
362 /// create Raws histograms in Raws subdir
363
364 if ( !GetRawsData(kTrackerBusPatchOccupancy) ) return;
365
366 if ( fTrackerDataMaker )
367 {
368 InsertTrackerData(specie,list,fTrackerDataMaker->Data(),kTrackerData);
369
370 TH1* hbp = GetRawsData(kTrackerBusPatchOccupancy);
371 hbp->Reset();
372 TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator());
373 AliMpBusPatch* bp(0x0);
374 AliMUONVTrackerData* data = fTrackerDataMaker->Data();
375 Int_t occDim = 2;
376
377 while ( ( bp = static_cast<AliMpBusPatch*>(nextBP())) )
378 {
379 Int_t busPatchId = bp->GetId();
380 Int_t bin = hbp->FindBin(busPatchId);
381 hbp->SetBinContent(bin,data->BusPatch(busPatchId,occDim)*100.0); // occupancy, in percent
382 }
383 }
384}
385
386//____________________________________________________________________________
387void AliMUONTrackerQADataMakerRec::InitRaws()
388{
389 /// create Raws histograms in Raws subdir
390
391 AliCodeTimerAuto("",0);
392
393 const Bool_t expert = kTRUE ;
394 const Bool_t saveCorr = kTRUE ;
395 const Bool_t image = kTRUE ;
396
397 Int_t bpmin(999999);
398 Int_t bpmax(0);
399
400 TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
401 AliMpBusPatch* bp(0x0);
402 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
403 {
404 bpmin = TMath::Min(bpmin,bp->GetId());
405 bpmax = TMath::Max(bpmax,bp->GetId());
406 }
407
408 Double_t xmin = bpmin-0.5;
409 Double_t xmax = bpmax+0.5;
410 Int_t nbins = bpmax-bpmin+1;
411
412 TH1* hbp = new TH1F("hTrackerBusPatchOccupancy","Occupancy of bus patches",nbins,xmin,xmax);
413
414
415 TH1* hbpnpads = new TH1F("hTrackerBusPatchNofPads","Number of pads per bus patch",nbins,xmin,xmax);
416
417 TH1* hbpnmanus = new TH1F("hTrackerBusPatchNofManus","Number of manus per bus patch",nbins,xmin,xmax);
418
419 Add2RawsList(hbp,kTrackerBusPatchOccupancy, !expert, image, !saveCorr);
420 Add2RawsList(hbpnpads,kTrackerBusPatchNofPads, expert, !image, !saveCorr);
421 Add2RawsList(hbpnmanus,kTrackerBusPatchNofManus, expert, !image, !saveCorr);
422
423 const Bool_t histogram(kFALSE);
424
425 if(!fTrackerDataMaker)
426 {
427 fTrackerDataMaker = new AliMUONTrackerDataMaker(GetRecoParam(),
428 AliCDBManager::Instance()->GetRun(),
429 0x0,
430 "",
431 "NOGAIN",
432 histogram,
433 0.0,0.0);
434 }
435
436 fTrackerDataMaker->Data()->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level
437
438 fTrackerDataMaker->SetRunning(kTRUE);
439
440 next.Reset();
441
442 AliMUONVStore* config = fCalibrationData->Config();
443
444 TH1* hbpconfig(0x0);
445
446 if (config)
447 {
448 hbpconfig = new TH1F("hTrackerBusPatchConfig","Configuration of bus patches",nbins,xmin,xmax);
449 Add2RawsList(hbpconfig,kTrackerBusPatchConfig, expert, !image, !saveCorr);
450 }
451 else
452 {
453 AliWarning("Tracker configuration not found. Will not be able to cut on low occupancies");
454 }
455
456 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
457 {
458 Int_t n(0);
459 Bool_t inConfig(kTRUE);
460
461 for ( Int_t imanu = 0; imanu < bp->GetNofManus(); ++imanu )
462 {
463 Int_t manuId = bp->GetManuId(imanu);
464 AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(bp->GetDEId());
465 n += de->NofChannelsInManu(manuId);
466 if ( config && !config->FindObject(de->GetId(),manuId)) inConfig=kFALSE;
467 }
468 hbpnpads->Fill(bp->GetId(),n*1.0);
469 hbpnmanus->Fill(bp->GetId(),bp->GetNofManus()*1.0);
470 if ( hbpconfig && inConfig )
471 {
472 hbpconfig->Fill(bp->GetId());
473 }
474 }
475}
476
477//__________________________________________________________________
478void AliMUONTrackerQADataMakerRec::InitDigits()
479{
480 /// Initialized Digits spectra
481 const Bool_t expert = kTRUE ;
482 const Bool_t image = kTRUE ;
483
484 TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits;Detection element Id;Counts", 1400, 100, 1500);
485 Add2DigitsList(h0, 0, !expert, image);
486
487 TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits;ACD value;Counts", 4096, 0, 4095);
488 Add2DigitsList(h1, 1, !expert, image);
489}
490
491//____________________________________________________________________________
492void AliMUONTrackerQADataMakerRec::InitRecPoints()
493{
494 /// create Reconstructed Points histograms in RecPoints subdir for the
495 /// MUON tracker subsystem.
496 const Bool_t expert = kTRUE ;
497 const Bool_t image = kTRUE ;
498
499 AliCodeTimerAuto("",0);
500
501 TH1I *h1I;
502 TH1F *h1F;
503 TH2F *h2F;
504
505 // histograms per chamber
506 Int_t nCh = AliMpConstants::NofTrackingChambers();
507 for ( Int_t i = 0; i < nCh; ++i )
508 {
509 h1I = new TH1I(Form("hTrackerClusterMultiplicityForChamber%d",i+1), Form("cluster size distribution in chamber %d;size (n_{pads};Counts)",i+1), 100,0,100);
510 Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerChamber+i, expert, !image);
511
512 h1I = new TH1I(Form("hTrackerClusterChargeForChamber%d",i+1), Form("cluster charge distribution in chamber %d;charge (fC);Counts",i+1), 100,0,1000);
513 Add2RecPointsList(h1I,kTrackerClusterChargePerChamber+i, expert, !image);
514
515 Float_t rMax = AliMUONConstants::Rmax(i/2);
516 h2F = new TH2F(Form("hTrackerClusterHitMapForChamber%d",i+1), Form("cluster position distribution in chamber %d;X (cm);Y (cm)",i+1), 100, -rMax, rMax, 100, -rMax, rMax);
517 Add2RecPointsList(h2F, kTrackerClusterHitMapPerChamber+i, expert, !image);
518 }
519
520 // summary histograms per chamber
521 h1I = new TH1I("hTrackerNumberOfClustersPerChamber", "Number of clusters per chamber;chamber ID;n_{clusters}", nCh,-0.5,nCh-0.5);
522 Add2RecPointsList(h1I,kTrackerNumberOfClustersPerChamber, !expert, image);
523
524 h1F = new TH1F("hTrackerClusterMultiplicityPerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh,-0.5,nCh-0.5);
525 h1F->SetOption("P");
526 h1F->SetMarkerStyle(kFullDotMedium);
527 h1F->SetMarkerColor(kRed);
528 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChMean, !expert, image);
529
530 h1F = new TH1F("hTrackerClusterMultiplicityPerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh,-0.5,nCh-0.5);
531 h1F->SetOption("P");
532 h1F->SetMarkerStyle(kFullDotMedium);
533 h1F->SetMarkerColor(kRed);
534 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChSigma, !expert, image);
535
536 h1F = new TH1F("hTrackerClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (fC)", nCh,-0.5,nCh-0.5);
537 h1F->SetOption("P");
538 h1F->SetMarkerStyle(kFullDotMedium);
539 h1F->SetMarkerColor(kRed);
540 Add2RecPointsList(h1F, kTrackerClusterChargePerChMean, !expert, image);
541
542 h1F = new TH1F("hTrackerClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (fC)", nCh,-0.5,nCh-0.5);
543 h1F->SetOption("P");
544 h1F->SetMarkerStyle(kFullDotMedium);
545 h1F->SetMarkerColor(kRed);
546 Add2RecPointsList(h1F, kTrackerClusterChargePerChSigma, !expert, image);
547
548 // histograms per DE
549 Int_t ndes(0);
550 AliMpDEIterator it;
551 it.First();
552 while ( !it.IsDone())
553 {
554 Int_t detElemId = it.CurrentDEId();
555
556 if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
557 {
558 ndes = TMath::Max(ndes,detElemId);
559
560 h1I = new TH1I(Form("hTrackerClusterMultiplicityForDE%04d",detElemId), Form("cluster size distribution in detection element %d;size (n_{pads})",detElemId), 100,0,100);
561 Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerDE+detElemId, expert, !image);
562
563 h1I = new TH1I(Form("hTrackerClusterChargeForDE%04d",detElemId), Form("cluster charge distribution in detection element %d;charge (fC)",detElemId), 100,0,1000);
564 Add2RecPointsList(h1I,kTrackerClusterChargePerDE+detElemId, expert, !image);
565 }
566
567 it.Next();
568 }
569
570 // summary histograms per DE
571 h1I = new TH1I("hTrackerNumberOfClustersPerDE", "Number of clusters per detection element;DetElem ID;n_{clusters}", ndes+1,-0.5,ndes+0.5);
572 Add2RecPointsList(h1I, kTrackerNumberOfClustersPerDE, !expert, image);
573
574 h1F = new TH1F("hTrackerClusterMultiplicityPerDEMean", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", ndes+1,-0.5,ndes+0.5);
575 h1F->SetOption("P");
576 h1F->SetMarkerStyle(kFullDotMedium);
577 h1F->SetMarkerColor(kRed);
578 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerDEMean, !expert, image);
579
580 h1F = new TH1F("hTrackerClusterChargePerDEMean", "cluster mean charge per DE;DetElem ID;<charge> (fC)", ndes+1,-0.5,ndes+0.5);
581 h1F->SetOption("P");
582 h1F->SetMarkerStyle(kFullDotMedium);
583 h1F->SetMarkerColor(kRed);
584 Add2RecPointsList(h1F, kTrackerClusterChargePerDEMean, !expert, image);
585
586 if (!fMappingCheckRecPoints) fMappingCheckRecPoints = new AliMUONQAMappingCheck(RunNumber());
587}
588
589//____________________________________________________________________________
590void AliMUONTrackerQADataMakerRec::InitESDs()
591{
592 ///create ESDs histograms in ESDs subdir
593
594 const Bool_t expert = kTRUE ;
595 const Bool_t image = kTRUE ;
596
597 Int_t nCh = AliMUONConstants::NTrackingCh();
598 Int_t nDE = 1100;
599
600 // track info
601 TH1F* hESDnTracks = new TH1F("hESDnTracks", "number of tracks;n_{tracks}", 20, 0., 20.);
602 Add2ESDsList(hESDnTracks, kESDnTracks, !expert, image);
603
604 TH1F* hESDMatchTrig = new TH1F("hESDMatchTrig", "number of tracks matched with trigger;n_{tracks}", 20, 0., 20.);
605 Add2ESDsList(hESDMatchTrig, kESDMatchTrig, !expert, image);
606
607 TH1F* hESDMomentum = new TH1F("hESDMomentum", "momentum distribution;p (GeV/c)", 300, 0., 300);
608 Add2ESDsList(hESDMomentum, kESDMomentum, !expert, image);
609
610 TH1F* hESDPt = new TH1F("hESDPt", "transverse momentum distribution;p_{t} (GeV/c)", 200, 0., 50);
611 Add2ESDsList(hESDPt, kESDPt, !expert, image);
612
613 TH1F* hESDRapidity = new TH1F("hESDRapidity", "rapidity distribution;rapidity", 200, -4.5, -2.);
614 Add2ESDsList(hESDRapidity, kESDRapidity, !expert, image);
615
616 TH1F* hESDChi2 = new TH1F("hESDChi2", "normalized #chi^{2} distribution;#chi^{2} / ndf", 500, 0., 50.);
617 Add2ESDsList(hESDChi2, kESDChi2, !expert, image);
618
619 TH1F* hESDProbChi2 = new TH1F("hESDProbChi2", "distribution of probability of #chi^{2};prob(#chi^{2})", 100, 0., 1.);
620 Add2ESDsList(hESDProbChi2, kESDProbChi2, !expert, image);
621
622 TH1F* hESDThetaX = new TH1F("hESDThetaX", "#theta_{X} distribution;#theta_{X} (degree)", 360, -180., 180);
623 Add2ESDsList(hESDThetaX, kESDThetaX, !expert, image);
624
625 TH1F* hESDThetaY = new TH1F("hESDThetaY", "#theta_{Y} distribution;#theta_{Y} (degree)", 360, -180., 180);
626 Add2ESDsList(hESDThetaY, kESDThetaY, !expert, image);
627
628 // cluster info
629 for (Int_t i = 0; i < nCh; i++) {
630 Float_t rMax = AliMUONConstants::Rmax(i/2);
631 TH2F* hESDClusterHitMap = new TH2F(Form("hESDClusterHitMap%d",i+1), Form("cluster position distribution in chamber %d;X (cm);Y (cm)",i+1),
632 100, -rMax, rMax, 100, -rMax, rMax);
633 Add2ESDsList(hESDClusterHitMap, kESDClusterHitMap+i, expert, !image);
634 }
635
636 TH1F* hESDnClustersPerTrack = new TH1F("hESDnClustersPerTrack", "number of associated clusters per track;n_{clusters}", 20, 0., 20.);
637 Add2ESDsList(hESDnClustersPerTrack, kESDnClustersPerTrack, !expert, image);
638
639 TH1F* hESDnClustersPerCh = new TH1F("hESDnClustersPerCh", "averaged number of clusters per chamber per track;chamber ID;<n_{clusters}>", nCh, -0.5, nCh-0.5);
640 hESDnClustersPerCh->SetFillColor(kRed);
641 Add2ESDsList(hESDnClustersPerCh, kESDnClustersPerCh, !expert, image);
642
643 TH1F* hESDnClustersPerDE = new TH1F("hESDnClustersPerDE", "averaged number of clusters per DE per track;DetElem ID;<n_{clusters}>", nDE+1, -0.5, nDE+0.5);
644 hESDnClustersPerDE->SetFillColor(kRed);
645 Add2ESDsList(hESDnClustersPerDE, kESDnClustersPerDE, !expert, image);
646
647 for (Int_t i = 0; i < nCh; i++) {
648 TH1F* hESDClusterChargeInCh = new TH1F(Form("hESDClusterChargeInCh%d",i+1), Form("cluster charge distribution in chamber %d;charge (fC)",i+1), 100, 0., 1000.);
649 Add2ESDsList(hESDClusterChargeInCh, kESDClusterChargeInCh+i, expert, !image);
650 }
651
652 TH1F* hESDClusterChargePerChMean = new TH1F("hESDClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (fC)", nCh, -0.5, nCh-0.5);
653 hESDClusterChargePerChMean->SetOption("P");
654 hESDClusterChargePerChMean->SetMarkerStyle(kFullDotMedium);
655 hESDClusterChargePerChMean->SetMarkerColor(kRed);
656 Add2ESDsList(hESDClusterChargePerChMean, kESDClusterChargePerChMean, !expert, image);
657
658 TH1F* hESDClusterChargePerChSigma = new TH1F("hESDClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (fC)", nCh, -0.5, nCh-0.5);
659 hESDClusterChargePerChSigma->SetOption("P");
660 hESDClusterChargePerChSigma->SetMarkerStyle(kFullDotMedium);
661 hESDClusterChargePerChSigma->SetMarkerColor(kRed);
662 Add2ESDsList(hESDClusterChargePerChSigma, kESDClusterChargePerChSigma, !expert, image);
663
664 TH1F* hESDClusterChargePerDE = new TH1F("hESDClusterChargePerDE", "cluster mean charge per DE;DetElem ID;<charge> (fC)", nDE+1, -0.5, nDE+0.5);
665 hESDClusterChargePerDE->SetOption("P");
666 hESDClusterChargePerDE->SetMarkerStyle(kFullDotMedium);
667 hESDClusterChargePerDE->SetMarkerColor(kRed);
668 Add2ESDsList(hESDClusterChargePerDE, kESDClusterChargePerDE, !expert, image);
669
670 for (Int_t i = 0; i < nCh; i++) {
671 TH1F* hESDClusterSizeInCh = new TH1F(Form("hESDClusterSizeInCh%d",i+1), Form("cluster size distribution in chamber %d;size (n_{pads})",i+1), 200, 0., 200.);
672 Add2ESDsList(hESDClusterSizeInCh, kESDClusterSizeInCh+i, expert, !image);
673 }
674
675 TH1F* hESDClusterSizePerChMean = new TH1F("hESDClusterSizePerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh, -0.5, nCh-0.5);
676 hESDClusterSizePerChMean->SetOption("P");
677 hESDClusterSizePerChMean->SetMarkerStyle(kFullDotMedium);
678 hESDClusterSizePerChMean->SetMarkerColor(kRed);
679 Add2ESDsList(hESDClusterSizePerChMean, kESDClusterSizePerChMean, !expert, image);
680
681 TH1F* hESDClusterSizePerChSigma = new TH1F("hESDClusterSizePerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh, -0.5, nCh-0.5);
682 hESDClusterSizePerChSigma->SetOption("P");
683 hESDClusterSizePerChSigma->SetMarkerStyle(kFullDotMedium);
684 hESDClusterSizePerChSigma->SetMarkerColor(kRed);
685 Add2ESDsList(hESDClusterSizePerChSigma, kESDClusterSizePerChSigma, !expert, image);
686
687 TH1F* hESDClusterSizePerDE = new TH1F("hESDClusterSizePerDE", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", nDE+1, -0.5, nDE+0.5);
688 hESDClusterSizePerDE->SetOption("P");
689 hESDClusterSizePerDE->SetMarkerStyle(kFullDotMedium);
690 hESDClusterSizePerDE->SetMarkerColor(kRed);
691 Add2ESDsList(hESDClusterSizePerDE, kESDClusterSizePerDE, !expert, image);
692
693 // cluster - track info
694 for (Int_t i = 0; i < nCh; i++) {
695 TH1F* hESDResidualXInCh = new TH1F(Form("hESDResidualXInCh%d",i+1), Form("cluster-track residual-X distribution in chamber %d;#Delta_{X} (cm)",i+1), 1000, -5., 5.);
696 Add2ESDsList(hESDResidualXInCh, kESDResidualXInCh+i, expert, !image);
697
698 TH1F* hESDResidualYInCh = new TH1F(Form("hESDResidualYInCh%d",i+1), Form("cluster-track residual-Y distribution in chamber %d;#Delta_{Y} (cm)",i+1), 1000, -1., 1.);
699 Add2ESDsList(hESDResidualYInCh, kESDResidualYInCh+i, expert, !image);
700
701 TH1F* hESDLocalChi2XInCh = new TH1F(Form("hESDLocalChi2XInCh%d",i+1), Form("local chi2-X distribution in chamber %d;local #chi^{2}_{X}",i+1), 1000, 0., 25);
702 Add2ESDsList(hESDLocalChi2XInCh, kESDLocalChi2XInCh+i, expert, !image);
703
704 TH1F* hESDLocalChi2YInCh = new TH1F(Form("hESDLocalChi2YInCh%d",i+1), Form("local chi2-Y distribution in chamber %d;local #chi^{2}_{Y}",i+1), 1000, 0., 25);
705 Add2ESDsList(hESDLocalChi2YInCh, kESDLocalChi2YInCh+i, expert, !image);
706
707 TH1F* hESDLocalChi2InCh = new TH1F(Form("hESDLocalChi2InCh%d",i+1), Form("local chi2 (~0.5*(#chi^{2}_{X}+#chi^{2}_{Y})) distribution in chamber %d;local #chi^{2}",i+1), 1000, 0., 25);
708 Add2ESDsList(hESDLocalChi2InCh, kESDLocalChi2InCh+i, expert, !image);
709 }
710
711 TH1F* hESDResidualXPerChMean = new TH1F("hESDResidualXPerChMean", "cluster-track residual-X per Ch: mean;chamber ID;<#Delta_{X}> (cm)", nCh, -0.5, nCh-0.5);
712 hESDResidualXPerChMean->SetOption("P");
713 hESDResidualXPerChMean->SetMarkerStyle(kFullDotMedium);
714 hESDResidualXPerChMean->SetMarkerColor(kRed);
715 Add2ESDsList(hESDResidualXPerChMean, kESDResidualXPerChMean, !expert, image);
716
717 TH1F* hESDResidualYPerChMean = new TH1F("hESDResidualYPerChMean", "cluster-track residual-Y per Ch: mean;chamber ID;<#Delta_{Y}> (cm)", nCh, -0.5, nCh-0.5);
718 hESDResidualYPerChMean->SetOption("P");
719 hESDResidualYPerChMean->SetMarkerStyle(kFullDotMedium);
720 hESDResidualYPerChMean->SetMarkerColor(kRed);
721 Add2ESDsList(hESDResidualYPerChMean, kESDResidualYPerChMean, !expert, image);
722
723 TH1F* hESDResidualXPerChSigma = new TH1F("hESDResidualXPerChSigma", "cluster-track residual-X per Ch: sigma;chamber ID;#sigma_{X} (cm)", nCh, -0.5, nCh-0.5);
724 hESDResidualXPerChSigma->SetOption("P");
725 hESDResidualXPerChSigma->SetMarkerStyle(kFullDotMedium);
726 hESDResidualXPerChSigma->SetMarkerColor(kRed);
727 Add2ESDsList(hESDResidualXPerChSigma, kESDResidualXPerChSigma, !expert, image);
728
729 TH1F* hESDResidualYPerChSigma = new TH1F("hESDResidualYPerChSigma", "cluster-track residual-Y per Ch: sigma;chamber ID;#sigma_{Y} (cm)", nCh, -0.5, nCh-0.5);
730 hESDResidualYPerChSigma->SetOption("P");
731 hESDResidualYPerChSigma->SetMarkerStyle(kFullDotMedium);
732 hESDResidualYPerChSigma->SetMarkerColor(kRed);
733 Add2ESDsList(hESDResidualYPerChSigma, kESDResidualYPerChSigma, !expert, image);
734
735 TH1F* hESDLocalChi2XPerChMean = new TH1F("hESDLocalChi2XPerCh", "local chi2-X per Ch: mean;chamber ID;<local #chi^{2}_{X}>", nCh, -0.5, nCh-0.5);
736 hESDLocalChi2XPerChMean->SetOption("P");
737 hESDLocalChi2XPerChMean->SetMarkerStyle(kFullDotMedium);
738 hESDLocalChi2XPerChMean->SetMarkerColor(kRed);
739 Add2ESDsList(hESDLocalChi2XPerChMean, kESDLocalChi2XPerChMean, !expert, image);
740
741 TH1F* hESDLocalChi2YPerChMean = new TH1F("hESDLocalChi2YPerCh", "local chi2-Y per Ch: mean;chamber ID;<local #chi^{2}_{Y}>", nCh, -0.5, nCh-0.5);
742 hESDLocalChi2YPerChMean->SetOption("P");
743 hESDLocalChi2YPerChMean->SetMarkerStyle(kFullDotMedium);
744 hESDLocalChi2YPerChMean->SetMarkerColor(kRed);
745 Add2ESDsList(hESDLocalChi2YPerChMean, kESDLocalChi2YPerChMean, !expert, image);
746
747 TH1F* hESDLocalChi2PerChMean = new TH1F("hESDLocalChi2PerCh", "local chi2 (~0.5*(#chi^{2}_{X}+#chi^{2}_{Y})) per Ch: mean;chamber ID;<local #chi^{2}>", nCh, -0.5, nCh-0.5);
748 hESDLocalChi2PerChMean->SetOption("P");
749 hESDLocalChi2PerChMean->SetMarkerStyle(kFullDotMedium);
750 hESDLocalChi2PerChMean->SetMarkerColor(kRed);
751 Add2ESDsList(hESDLocalChi2PerChMean, kESDLocalChi2PerChMean, !expert, image);
752
753 TH1F* hESDResidualXPerDEMean = new TH1F("hESDResidualXPerDEMean", "cluster-track residual-X per DE: mean;DetElem ID;<#Delta_{X}> (cm)", nDE+1, -0.5, nDE+0.5);
754 hESDResidualXPerDEMean->SetOption("P");
755 hESDResidualXPerDEMean->SetMarkerStyle(kFullDotMedium);
756 hESDResidualXPerDEMean->SetMarkerColor(kRed);
757 Add2ESDsList(hESDResidualXPerDEMean, kESDResidualXPerDEMean, !expert, image);
758
759 TH1F* hESDResidualYPerDEMean = new TH1F("hESDResidualYPerDEMean", "cluster-track residual-Y per DE: mean;DetElem ID;<#Delta_{Y}> (cm)", nDE+1, -0.5, nDE+0.5);
760 hESDResidualYPerDEMean->SetOption("P");
761 hESDResidualYPerDEMean->SetMarkerStyle(kFullDotMedium);
762 hESDResidualYPerDEMean->SetMarkerColor(kRed);
763 Add2ESDsList(hESDResidualYPerDEMean, kESDResidualYPerDEMean, !expert, image);
764
765 TH1F* hESDResidualXPerDESigma = new TH1F("hESDResidualXPerDESigma", "cluster-track residual-X per DE: sigma;DetElem ID;#sigma_{X} (cm)", nDE+1, -0.5, nDE+0.5);
766 hESDResidualXPerDESigma->SetOption("P");
767 hESDResidualXPerDESigma->SetMarkerStyle(kFullDotMedium);
768 hESDResidualXPerDESigma->SetMarkerColor(kRed);
769 Add2ESDsList(hESDResidualXPerDESigma, kESDResidualXPerDESigma, !expert, image);
770
771 TH1F* hESDResidualYPerDESigma = new TH1F("hESDResidualYPerDESigma", "cluster-track residual-Y per DE: sigma;DetElem ID;#sigma_{Y} (cm)", nDE+1, -0.5, nDE+0.5);
772 hESDResidualYPerDESigma->SetOption("P");
773 hESDResidualYPerDESigma->SetMarkerStyle(kFullDotMedium);
774 hESDResidualYPerDESigma->SetMarkerColor(kRed);
775 Add2ESDsList(hESDResidualYPerDESigma, kESDResidualYPerDESigma, !expert, image);
776
777 TH1F* hESDLocalChi2XPerDEMean = new TH1F("hESDLocalChi2XPerDE", "local chi2-X per DE: mean;DetElem ID;<local #chi^{2}_{X}>", nDE+1, -0.5, nDE+0.5);
778 hESDLocalChi2XPerDEMean->SetOption("P");
779 hESDLocalChi2XPerDEMean->SetMarkerStyle(kFullDotMedium);
780 hESDLocalChi2XPerDEMean->SetMarkerColor(kRed);
781 Add2ESDsList(hESDLocalChi2XPerDEMean, kESDLocalChi2XPerDEMean, !expert, image);
782
783 TH1F* hESDLocalChi2YPerDEMean = new TH1F("hESDLocalChi2YPerDE", "local chi2-Y per DE: mean;DetElem ID;<local #chi^{2}_{Y}>", nDE+1, -0.5, nDE+0.5);
784 hESDLocalChi2YPerDEMean->SetOption("P");
785 hESDLocalChi2YPerDEMean->SetMarkerStyle(kFullDotMedium);
786 hESDLocalChi2YPerDEMean->SetMarkerColor(kRed);
787 Add2ESDsList(hESDLocalChi2YPerDEMean, kESDLocalChi2YPerDEMean, !expert, image);
788
789 TH1F* hESDLocalChi2PerDEMean = new TH1F("hESDLocalChi2PerDE", "local chi2 (~0.5*(#chi^{2}_{X}+#chi^{2}_{Y})) per DE: mean;DetElem ID;<local #chi^{2}>", nDE+1, -0.5, nDE+0.5);
790 hESDLocalChi2PerDEMean->SetOption("P");
791 hESDLocalChi2PerDEMean->SetMarkerStyle(kFullDotMedium);
792 hESDLocalChi2PerDEMean->SetMarkerColor(kRed);
793 Add2ESDsList(hESDLocalChi2PerDEMean, kESDLocalChi2PerDEMean, !expert, image);
794
795 // intermediate histograms
796 TH1F* hESDnTotClustersPerCh = new TH1F("hESDnTotClustersPerCh", "total number of associated clusters per chamber;chamber ID;#Sigma(n_{clusters})", nCh, -0.5, nCh-0.5);
797 Add2ESDsList(hESDnTotClustersPerCh, kESDnTotClustersPerCh, expert, !image);
798 TH1F* hESDnTotClustersPerDE = new TH1F("hESDnTotClustersPerDE", "total number of associated clusters per DE;DetElem ID;#Sigma(n_{clusters})", nDE+1, -0.5, nDE+0.5);
799 Add2ESDsList(hESDnTotClustersPerDE, kESDnTotClustersPerDE, expert, !image);
800 TH1F* hESDnTotFullClustersPerDE = new TH1F("hESDnTotFullClustersPerDE", "total number of associated clusters containing pad info per DE;DetElem ID;#Sigma(n_{full clusters})", nDE+1, -0.5, nDE+0.5);
801 Add2ESDsList(hESDnTotFullClustersPerDE, kESDnTotFullClustersPerDE, expert, !image);
802 TH1F* hESDSumClusterChargePerDE = new TH1F("hESDSumClusterChargePerDE", "sum of cluster charge per DE;DetElem ID;#Sigma(charge) (fC)", nDE+1, -0.5, nDE+0.5);
803 Add2ESDsList(hESDSumClusterChargePerDE, kESDSumClusterChargePerDE, expert, !image);
804 TH1F* hESDSumClusterSizePerDE = new TH1F("hESDSumClusterSizePerDE", "sum of cluster size per DE;DetElem ID;#Sigma(size) (n_{pads})", nDE+1, -0.5, nDE+0.5);
805 Add2ESDsList(hESDSumClusterSizePerDE, kESDSumClusterSizePerDE, expert, !image);
806 TH1F* hESDSumResidualXPerDE = new TH1F("hESDSumResidualXPerDE", "sum of cluster-track residual-X per DE;DetElem ID;#Sigma(#Delta_{X}) (cm)", nDE+1, -0.5, nDE+0.5);
807 Add2ESDsList(hESDSumResidualXPerDE, kESDSumResidualXPerDE, expert, !image);
808 TH1F* hESDSumResidualYPerDE = new TH1F("hESDSumResidualYPerDE", "sum of cluster-track residual-Y per DE;DetElem ID;#Sigma(#Delta_{Y}) (cm)", nDE+1, -0.5, nDE+0.5);
809 Add2ESDsList(hESDSumResidualYPerDE, kESDSumResidualYPerDE, expert, !image);
810 TH1F* hESDSumResidualX2PerDE = new TH1F("hESDSumResidualX2PerDE", "sum of cluster-track residual-X**2 per DE;DetElem ID;#Sigma(#Delta_{X}^{2}) (cm^{2})", nDE+1, -0.5, nDE+0.5);
811 Add2ESDsList(hESDSumResidualX2PerDE, kESDSumResidualX2PerDE, expert, !image);
812 TH1F* hESDSumResidualY2PerDE = new TH1F("hESDSumResidualY2PerDE", "sum of cluster-track residual-Y**2 per DE;DetElem ID;#Sigma(#Delta_{Y}^{2}) (cm^{2})", nDE+1, -0.5, nDE+0.5);
813 Add2ESDsList(hESDSumResidualY2PerDE, kESDSumResidualY2PerDE, expert, !image);
814 TH1F* hESDSumLocalChi2XPerDE = new TH1F("hESDSumLocalChi2XPerDE", "sum of local chi2-X per DE;DetElem ID;#Sigma(local #chi^{2}_{X})", nDE+1, -0.5, nDE+0.5);
815 Add2ESDsList(hESDSumLocalChi2XPerDE, kESDSumLocalChi2XPerDE, expert, !image);
816 TH1F* hESDSumLocalChi2YPerDE = new TH1F("hESDSumLocalChi2YPerDE", "sum of local chi2-Y per DE;DetElem ID;#Sigma(local #chi^{2}_{Y})", nDE+1, -0.5, nDE+0.5);
817 Add2ESDsList(hESDSumLocalChi2YPerDE, kESDSumLocalChi2YPerDE, expert, !image);
818 TH1F* hESDSumLocalChi2PerDE = new TH1F("hESDSumLocalChi2PerDE", "sum of local chi2 (~0.5*(#chi^{2}_{X}+#chi^{2}_{Y})) per DE;DetElem ID;#Sigma(local #chi^{2})", nDE+1, -0.5, nDE+0.5);
819 Add2ESDsList(hESDSumLocalChi2PerDE, kESDSumLocalChi2PerDE, expert, !image);
820}
821
822//____________________________________________________________________________
823void AliMUONTrackerQADataMakerRec::MakeRaws(AliRawReader* rawReader)
824{
825 /// make QA for rawdata tracker
826
827 AliCodeTimerAuto("",0);
828
829 /// forces init
830 GetRawsData(kTrackerBusPatchOccupancy);
831
832 ((AliMUONTrackerDataMaker*)fTrackerDataMaker)->SetRawReader(rawReader);
833
834 fTrackerDataMaker->ProcessEvent();
835}
836
837//__________________________________________________________________
838void AliMUONTrackerQADataMakerRec::MakeDigits(TTree* digitsTree)
839{
840 /// makes data from Digits
841
842 AliCodeTimerAuto("",0);
843
844 // Do nothing in case of calibration event
845 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
846
847 if (!fDigitStore)
848 fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
849 fDigitStore->Connect(*digitsTree, false);
850 digitsTree->GetEvent(0);
851
852 TIter next(fDigitStore->CreateIterator());
853
854 AliMUONVDigit* dig = 0x0;
855
856 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
857 {
858 GetDigitsData(0)->Fill(dig->DetElemId());
859 GetDigitsData(1)->Fill(dig->ADC());
860 }
861}
862
863
864//____________________________________________________________________________
865void AliMUONTrackerQADataMakerRec::MakeRecPoints(TTree* clustersTree)
866{
867 /// Fill histograms related to tracker clusters
868
869 // First things first : do we have clusters in the TreeR ?
870 // In "normal" production mode, it should be perfectly normal
871 // *not* to have them.
872 // But if for some reason we de-activated the combined tracking,
873 // then we have clusters in TreeR, so let's take that opportunity
874 // to QA them...
875
876 AliCodeTimerAuto("",0);
877
878 // Do nothing in case of calibration event
879 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
880
881 if (!fClusterStore)
882 {
883 AliCodeTimerAuto("ClusterStore creation",1);
884 fClusterStore = AliMUONVClusterStore::Create(*clustersTree);
885 if (!fClusterStore)
886 {
887 return;
888 }
889 }
890
891 fClusterStore->Connect(*clustersTree,kFALSE);
892 clustersTree->GetEvent(0);
893
894 TIter next(fClusterStore->CreateIterator());
895 AliMUONVCluster* cluster;
896
897 if ( fMappingCheckRecPoints ) fMappingCheckRecPoints->NewEvent();
898
899 while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) )
900 {
901 Int_t detElemId = cluster->GetDetElemId();
902 Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
903
904 GetRecPointsData(kTrackerNumberOfClustersPerDE)->Fill(detElemId);
905 GetRecPointsData(kTrackerClusterChargePerDE+detElemId)->Fill(cluster->GetCharge());
906 GetRecPointsData(kTrackerClusterMultiplicityPerDE+detElemId)->Fill(cluster->GetNDigits());
907
908 GetRecPointsData(kTrackerNumberOfClustersPerChamber)->Fill(chamberId);
909 GetRecPointsData(kTrackerClusterChargePerChamber+chamberId)->Fill(cluster->GetCharge());
910 GetRecPointsData(kTrackerClusterMultiplicityPerChamber+chamberId)->Fill(cluster->GetNDigits());
911 GetRecPointsData(kTrackerClusterHitMapPerChamber+chamberId)->Fill(cluster->GetX(),cluster->GetY());
912
913 if ( fMappingCheckRecPoints ) fMappingCheckRecPoints->Store(*cluster);
914
915 }
916
917 fClusterStore->Clear();
918}
919
920//____________________________________________________________________________
921void AliMUONTrackerQADataMakerRec::MakeESDs(AliESDEvent* esd)
922{
923 /// make QA data from ESDs
924
925 AliCodeTimerAuto("",0);
926
927 // Do nothing in case of calibration event
928 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
929
930 // load ESD event in the interface
931 AliMUONESDInterface esdInterface;
a99c3449 932 if (GetRecoParam()) AliMUONESDInterface::ResetTracker(GetRecoParam(), kFALSE);
ece56eb9 933 else AliError("Unable to get recoParam: use default ones for residual calculation");
934 esdInterface.LoadEvent(*esd);
935
936 GetESDsData(kESDnTracks)->Fill(esdInterface.GetNTracks());
937
938 Int_t nTrackMatchTrig = 0;
939
940 // loop over tracks
941 Int_t nTracks = (Int_t) esd->GetNumberOfMuonTracks();
942 for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
943
944 // get the ESD track and skip "ghosts"
945 AliESDMuonTrack* esdTrack = esd->GetMuonTrack(iTrack);
946 if (!esdTrack->ContainTrackerData()) continue;
947
948 // get corresponding MUON track
949 AliMUONTrack* track = esdInterface.FindTrack(esdTrack->GetUniqueID());
950
951 if (esdTrack->ContainTriggerData()) nTrackMatchTrig++;
952
953 GetESDsData(kESDMomentum)->Fill(esdTrack->P());
954 GetESDsData(kESDPt)->Fill(esdTrack->Pt());
955 GetESDsData(kESDRapidity)->Fill(esdTrack->Y());
956 GetESDsData(kESDChi2)->Fill(track->GetNormalizedChi2());
957 GetESDsData(kESDProbChi2)->Fill(TMath::Prob(track->GetGlobalChi2(),track->GetNDF()));
958 GetESDsData(kESDThetaX)->Fill(esdTrack->GetThetaXUncorrected() / TMath::Pi() * 180.);
959 GetESDsData(kESDThetaY)->Fill(esdTrack->GetThetaYUncorrected() / TMath::Pi() * 180.);
960 GetESDsData(kESDnClustersPerTrack)->Fill(track->GetNClusters());
961
962 // loop over clusters
963 AliMUONTrackParam* trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->First());
964 while (trackParam) {
965
966 AliMUONVCluster* cluster = trackParam->GetClusterPtr();
967 Int_t chId = cluster->GetChamberId();
968 Int_t deID = cluster->GetDetElemId();
969 Double_t residualX = cluster->GetX() - trackParam->GetNonBendingCoor();
970 Double_t residualY = cluster->GetY() - trackParam->GetBendingCoor();
971 Double_t sigmaResidualX2 = cluster->GetErrX2() - trackParam->GetCovariances()(0,0);
972 Double_t sigmaResidualY2 = cluster->GetErrY2() - trackParam->GetCovariances()(2,2);
973 Double_t localChi2X = (sigmaResidualX2 > 0.) ? residualX*residualX/sigmaResidualX2 : 0.;
974 Double_t localChi2Y = (sigmaResidualY2 > 0.) ? residualY*residualY/sigmaResidualY2 : 0.;
975 Double_t localChi2 = 0.5 * trackParam->GetLocalChi2();
976
977 GetESDsData(kESDClusterHitMap+chId)->Fill(cluster->GetX(), cluster->GetY());
978
979 GetESDsData(kESDnTotClustersPerCh)->Fill(chId);
980 GetESDsData(kESDnTotClustersPerDE)->Fill(deID);
981
982 GetESDsData(kESDClusterChargeInCh+chId)->Fill(cluster->GetCharge());
983 GetESDsData(kESDSumClusterChargePerDE)->Fill(deID, cluster->GetCharge());
984
985 if (cluster->GetNDigits() > 0) { // discard clusters with pad not stored in ESD
986 GetESDsData(kESDnTotFullClustersPerDE)->Fill(deID);
987 GetESDsData(kESDClusterSizeInCh+chId)->Fill(cluster->GetNDigits());
988 GetESDsData(kESDSumClusterSizePerDE)->Fill(deID, cluster->GetNDigits());
989 }
990
991 GetESDsData(kESDResidualXInCh+chId)->Fill(residualX);
992 GetESDsData(kESDResidualYInCh+chId)->Fill(residualY);
993 GetESDsData(kESDSumResidualXPerDE)->Fill(deID, residualX);
994 GetESDsData(kESDSumResidualYPerDE)->Fill(deID, residualY);
995 GetESDsData(kESDSumResidualX2PerDE)->Fill(deID, residualX*residualX);
996 GetESDsData(kESDSumResidualY2PerDE)->Fill(deID, residualY*residualY);
997
998 GetESDsData(kESDLocalChi2XInCh+chId)->Fill(localChi2X);
999 GetESDsData(kESDLocalChi2YInCh+chId)->Fill(localChi2Y);
1000 GetESDsData(kESDLocalChi2InCh+chId)->Fill(localChi2);
1001 GetESDsData(kESDSumLocalChi2XPerDE)->Fill(deID, localChi2X);
1002 GetESDsData(kESDSumLocalChi2YPerDE)->Fill(deID, localChi2Y);
1003 GetESDsData(kESDSumLocalChi2PerDE)->Fill(deID, localChi2);
1004
1005 trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->After(trackParam));
1006
1007 }
1008
1009 }
1010
1011 GetESDsData(kESDMatchTrig)->Fill(nTrackMatchTrig);
1012
1013}
1014
1015//____________________________________________________________________________
1016AliMUONVTrackerData* AliMUONTrackerQADataMakerRec::GetTrackerData() const
1017{
1018/// Return tracker data
1019
1020 return fTrackerDataMaker->Data();
1021
1022}