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