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