]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONTrackerQADataMakerRec.cxx
adding some dijet plots
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackerQADataMakerRec.cxx
CommitLineData
b3d57767 1 /**************************************************************************
ece56eb9 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
b3d57767 21#include "AliCDBManager.h"
22#include "AliCodeTimer.h"
b71c3d2d 23#include "AliDAQ.h"
b3d57767 24#include "AliESDEvent.h"
25#include "AliESDMuonTrack.h"
26#include "AliLog.h"
27#include "AliMUON2DMap.h"
28#include "AliMUONCalibParamND.h"
29#include "AliMUONCalibrationData.h"
ece56eb9 30#include "AliMUONConstants.h"
31#include "AliMUONDigitMaker.h"
b3d57767 32#include "AliMUONESDInterface.h"
33#include "AliMUONLogger.h"
34#include "AliMUONQADataMakerRec.h"
6482f70b 35#include "AliMUONQAIndices.h"
ece56eb9 36#include "AliMUONQAMappingCheck.h"
b3d57767 37#include "AliMUONTrack.h"
38#include "AliMUONTrackParam.h"
39#include "AliMUONTrackerData.h"
ece56eb9 40#include "AliMUONTrackerDataMaker.h"
41#include "AliMUONVCluster.h"
42#include "AliMUONVClusterStore.h"
43#include "AliMUONVDigit.h"
b3d57767 44#include "AliMUONVDigit.h"
ece56eb9 45#include "AliMUONVDigitStore.h"
ece56eb9 46#include "AliMpBusPatch.h"
47#include "AliMpConstants.h"
b3d57767 48#include "AliMpDDL.h"
ece56eb9 49#include "AliMpDDLStore.h"
50#include "AliMpDEIterator.h"
51#include "AliMpDEManager.h"
52#include "AliMpDetElement.h"
b3d57767 53#include "AliMpManuIterator.h"
54#include "AliQAv1.h"
55#include "AliRawEquipment.h"
56#include "AliRawEquipmentHeader.h"
57#include "AliRawEventHeaderBase.h"
ece56eb9 58#include "AliRawReader.h"
b3d57767 59#include "AliRawVEvent.h"
60#include <Riostream.h>
ece56eb9 61#include <TH1F.h>
62#include <TH1I.h>
63#include <TH2F.h>
ece56eb9 64#include <TMath.h>
b3d57767 65#include <TObjArray.h>
64c2397e 66#include <TPaveText.h>
ece56eb9 67
68//-----------------------------------------------------------------------------
69/// \class AliMUONTrackerQADataMakerRec
70///
b3d57767 71/// Quality assurance data (histo) maker for MUON tracker
72///
73///
74/// Note that all the methods of this class shoud not be called when eventSpecie is AliRecoParam::kCalib !
ece56eb9 75///
76/// \author C. Finck, D. Stocco, L. Aphecetche
77
78/// \cond CLASSIMP
79ClassImp(AliMUONTrackerQADataMakerRec)
80/// \endcond
81
680e610f 82namespace
83{
84 Double_t ProtectedSqrt(Double_t x)
85 {
86 return ( x > 0.0 ? TMath::Sqrt(x) : 0.0 );
87 }
b3d57767 88
680e610f 89}
b3d57767 90
ece56eb9 91//____________________________________________________________________________
92AliMUONTrackerQADataMakerRec::AliMUONTrackerQADataMakerRec(AliQADataMakerRec* master) :
93AliMUONVQADataMakerRec(master),
b3d57767 94fDigitStore(0x0),
ece56eb9 95fDigitMaker(new AliMUONDigitMaker(kTRUE)),
96fClusterStore(0x0),
64c2397e 97fCalibrationData(new AliMUONCalibrationData(AliCDBManager::Instance()->GetRun())),
b3d57767 98fLogger(0x0),
99fBusPatchConfig(0x0),
100fBPxmin(0),
101fBPxmax(0),
102fBPnbins(0),
103fTrackerDataMakerArray(0x0),
104fTrackerCalDataArray(0x0),
105fTrackerRecDataArray(0x0),
106fMappingCheckRecPointsArray(0x0)
ece56eb9 107{
108 /// ctor
109}
110
111//__________________________________________________________________
112AliMUONTrackerQADataMakerRec::~AliMUONTrackerQADataMakerRec()
113{
114 /// dtor
115 delete fDigitStore;
116 delete fDigitMaker;
117 delete fClusterStore;
ece56eb9 118 delete fCalibrationData;
b3d57767 119 delete fMappingCheckRecPointsArray;
64c2397e 120 if (fLogger)
121 {
122 if ( fLogger->NumberOfEntries() != 0 )
123 {
124 AliError("Some unprocessed logged errors are still there... Please check");
125 }
126 delete fLogger;
127 }
b3d57767 128 delete fTrackerDataMakerArray;
129 delete fTrackerCalDataArray;
130 delete fTrackerRecDataArray;
131 delete fBusPatchConfig;
ece56eb9 132}
133
134//____________________________________________________________________________
b3d57767 135void AliMUONTrackerQADataMakerRec::InsertTrackerData(Int_t specie,
136 TObjArray** list,
137 TObject* object,
138 Int_t indexNumber,
ece56eb9 139 Bool_t replace)
140{
141 /// Insert an object to a given list
142
143 TIter next(list[specie]);
144 TObject* o;
145 TObject* old(0x0);
146 Bool_t alreadyThere(kFALSE);
b3d57767 147
ece56eb9 148 while ( ( o = next() ) && !alreadyThere )
149 {
150 TString classname(o->ClassName());
151 if ( classname.Contains("TrackerData") )
152 {
b3d57767 153 if ( !strcmp(object->GetName(),o->GetName()) )
154 {
155 alreadyThere = kTRUE;
156 old = o;
157 }
ece56eb9 158 }
159 }
160 if ( (!alreadyThere && object) || (alreadyThere && replace) )
161 {
162 delete old;
163 AliDebug(AliQAv1::GetQADebugLevel(), Form("Adding %s to the list of qa objects",object->GetName()));
164 TNamed* named = static_cast<TNamed*>(object);
165 named->SetName(Form("%s_%s",AliRecoParam::GetEventSpecieName(specie),object->GetName()));
166 object->SetBit(AliQAv1::GetExpertBit());
167 list[specie]->AddAt(object,indexNumber);
168 }
169}
170
171//____________________________________________________________________________
172void AliMUONTrackerQADataMakerRec::EndOfDetectorCycleESDs(Int_t, TObjArray**)
173{
174 /// Normalize ESD histograms
175
6482f70b 176 if (!GetESDsData(AliMUONQAIndices::kESDnClustersPerTrack)) return;
ece56eb9 177
b3d57767 178 AliCodeTimerAuto("",0);
179
6482f70b 180 Double_t nTracks = GetESDsData(AliMUONQAIndices::kESDnClustersPerTrack)->GetEntries();
ece56eb9 181 if (nTracks <= 0) return;
182
6482f70b 183 TH1* hESDnClustersPerCh = GetESDsData(AliMUONQAIndices::kESDnClustersPerCh);
184 TH1* hESDnClustersPerDE = GetESDsData(AliMUONQAIndices::kESDnClustersPerDE);
185 TH1* hESDClusterChargePerChMean = GetESDsData(AliMUONQAIndices::kESDClusterChargePerChMean);
186 TH1* hESDClusterChargePerChSigma = GetESDsData(AliMUONQAIndices::kESDClusterChargePerChSigma);
187 TH1* hESDClusterSizePerChMean = GetESDsData(AliMUONQAIndices::kESDClusterSizePerChMean);
188 TH1* hESDClusterSizePerChSigma = GetESDsData(AliMUONQAIndices::kESDClusterSizePerChSigma);
189 TH1* hESDResidualXPerChMean = GetESDsData(AliMUONQAIndices::kESDResidualXPerChMean);
190 TH1* hESDResidualXPerChSigma = GetESDsData(AliMUONQAIndices::kESDResidualXPerChSigma);
191 TH1* hESDResidualYPerChMean = GetESDsData(AliMUONQAIndices::kESDResidualYPerChMean);
192 TH1* hESDResidualYPerChSigma = GetESDsData(AliMUONQAIndices::kESDResidualYPerChSigma);
193 TH1* hESDLocalChi2XPerChMean = GetESDsData(AliMUONQAIndices::kESDLocalChi2XPerChMean);
194 TH1* hESDLocalChi2YPerChMean = GetESDsData(AliMUONQAIndices::kESDLocalChi2YPerChMean);
195 TH1* hESDLocalChi2PerChMean = GetESDsData(AliMUONQAIndices::kESDLocalChi2PerChMean);
196 TH1* hESDClusterChargePerDE = GetESDsData(AliMUONQAIndices::kESDClusterChargePerDE);
197 TH1* hESDClusterSizePerDE = GetESDsData(AliMUONQAIndices::kESDClusterSizePerDE);
198 TH1* hESDResidualXPerDEMean = GetESDsData(AliMUONQAIndices::kESDResidualXPerDEMean);
199 TH1* hESDResidualXPerDESigma = GetESDsData(AliMUONQAIndices::kESDResidualXPerDESigma);
200 TH1* hESDResidualYPerDEMean = GetESDsData(AliMUONQAIndices::kESDResidualYPerDEMean);
201 TH1* hESDResidualYPerDESigma = GetESDsData(AliMUONQAIndices::kESDResidualYPerDESigma);
202 TH1* hESDLocalChi2XPerDEMean = GetESDsData(AliMUONQAIndices::kESDLocalChi2XPerDEMean);
203 TH1* hESDLocalChi2YPerDEMean = GetESDsData(AliMUONQAIndices::kESDLocalChi2YPerDEMean);
204 TH1* hESDLocalChi2PerDEMean = GetESDsData(AliMUONQAIndices::kESDLocalChi2PerDEMean);
205 TH1* hESDnTotClustersPerCh = GetESDsData(AliMUONQAIndices::kESDnTotClustersPerCh);
206 TH1* hESDnTotClustersPerDE = GetESDsData(AliMUONQAIndices::kESDnTotClustersPerDE);
207 TH1* hESDnTotFullClustersPerDE = GetESDsData(AliMUONQAIndices::kESDnTotFullClustersPerDE);
208 TH1* hESDSumClusterChargePerDE = GetESDsData(AliMUONQAIndices::kESDSumClusterChargePerDE);
209 TH1* hESDSumClusterSizePerDE = GetESDsData(AliMUONQAIndices::kESDSumClusterSizePerDE);
210 TH1* hESDSumResidualXPerDE = GetESDsData(AliMUONQAIndices::kESDSumResidualXPerDE);
211 TH1* hESDSumResidualYPerDE = GetESDsData(AliMUONQAIndices::kESDSumResidualYPerDE);
212 TH1* hESDSumResidualX2PerDE = GetESDsData(AliMUONQAIndices::kESDSumResidualX2PerDE);
213 TH1* hESDSumResidualY2PerDE = GetESDsData(AliMUONQAIndices::kESDSumResidualY2PerDE);
214 TH1* hESDSumLocalChi2XPerDE = GetESDsData(AliMUONQAIndices::kESDSumLocalChi2XPerDE);
215 TH1* hESDSumLocalChi2YPerDE = GetESDsData(AliMUONQAIndices::kESDSumLocalChi2YPerDE);
216 TH1* hESDSumLocalChi2PerDE = GetESDsData(AliMUONQAIndices::kESDSumLocalChi2PerDE);
ece56eb9 217
218 hESDnClustersPerCh->Reset();
219 hESDnClustersPerDE->Reset();
220 hESDnClustersPerCh->Add(hESDnTotClustersPerCh, 1./nTracks);
221 hESDnClustersPerDE->Add(hESDnTotClustersPerDE, 1./nTracks);
222
223 // loop over chambers
224 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
225
6482f70b 226 TH1* hESDClusterChargeInCh = GetESDsData(AliMUONQAIndices::kESDClusterChargeInCh+iCh);
ece56eb9 227 Double_t sigmaCharge = hESDClusterChargeInCh->GetRMS();
228 hESDClusterChargePerChMean->SetBinContent(iCh+1, hESDClusterChargeInCh->GetMean());
229 hESDClusterChargePerChMean->SetBinError(iCh+1, hESDClusterChargeInCh->GetMeanError());
230 hESDClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
231 hESDClusterChargePerChSigma->SetBinError(iCh+1, hESDClusterChargeInCh->GetRMSError());
232
6482f70b 233 TH1* hESDClusterSizeInCh = GetESDsData(AliMUONQAIndices::kESDClusterSizeInCh+iCh);
ece56eb9 234 Double_t sigmaSize = hESDClusterSizeInCh->GetRMS();
235 hESDClusterSizePerChMean->SetBinContent(iCh+1, hESDClusterSizeInCh->GetMean());
236 hESDClusterSizePerChMean->SetBinError(iCh+1, hESDClusterSizeInCh->GetMeanError());
237 hESDClusterSizePerChSigma->SetBinContent(iCh+1, sigmaSize);
238 hESDClusterSizePerChSigma->SetBinError(iCh+1, hESDClusterSizeInCh->GetRMSError());
239
6482f70b 240 TH1* hESDResidualXInCh = GetESDsData(AliMUONQAIndices::kESDResidualXInCh+iCh);
ece56eb9 241 Double_t sigmaResidualX = hESDResidualXInCh->GetRMS();
242 hESDResidualXPerChMean->SetBinContent(iCh+1, hESDResidualXInCh->GetMean());
243 hESDResidualXPerChMean->SetBinError(iCh+1, hESDResidualXInCh->GetMeanError());
244 hESDResidualXPerChSigma->SetBinContent(iCh+1, sigmaResidualX);
245 hESDResidualXPerChSigma->SetBinError(iCh+1, hESDResidualXInCh->GetRMSError());
246
6482f70b 247 TH1* hESDResidualYInCh = GetESDsData(AliMUONQAIndices::kESDResidualYInCh+iCh);
ece56eb9 248 Double_t sigmaResidualY = hESDResidualYInCh->GetRMS();
249 hESDResidualYPerChMean->SetBinContent(iCh+1, hESDResidualYInCh->GetMean());
250 hESDResidualYPerChMean->SetBinError(iCh+1, hESDResidualYInCh->GetMeanError());
251 hESDResidualYPerChSigma->SetBinContent(iCh+1, sigmaResidualY);
252 hESDResidualYPerChSigma->SetBinError(iCh+1, hESDResidualYInCh->GetRMSError());
253
6482f70b 254 TH1* hESDLocalChi2XInCh = GetESDsData(AliMUONQAIndices::kESDLocalChi2XInCh+iCh);
ece56eb9 255 Double_t sigmaLocalChi2X = hESDLocalChi2XInCh->GetRMS();
256 hESDLocalChi2XPerChMean->SetBinContent(iCh+1, hESDLocalChi2XInCh->GetMean());
257 hESDLocalChi2XPerChMean->SetBinError(iCh+1, hESDLocalChi2XInCh->GetMeanError());
258
6482f70b 259 TH1* hESDLocalChi2YInCh = GetESDsData(AliMUONQAIndices::kESDLocalChi2YInCh+iCh);
ece56eb9 260 Double_t sigmaLocalChi2Y = hESDLocalChi2YInCh->GetRMS();
261 hESDLocalChi2YPerChMean->SetBinContent(iCh+1, hESDLocalChi2YInCh->GetMean());
262 hESDLocalChi2YPerChMean->SetBinError(iCh+1, hESDLocalChi2YInCh->GetMeanError());
263
6482f70b 264 TH1* hESDLocalChi2InCh = GetESDsData(AliMUONQAIndices::kESDLocalChi2InCh+iCh);
ece56eb9 265 Double_t sigmaLocalChi2 = hESDLocalChi2InCh->GetRMS();
266 hESDLocalChi2PerChMean->SetBinContent(iCh+1, hESDLocalChi2InCh->GetMean());
267 hESDLocalChi2PerChMean->SetBinError(iCh+1, hESDLocalChi2InCh->GetMeanError());
268
269 // loop over DE into chamber iCh
270 AliMpDEIterator it;
271 it.First(iCh);
272 while ( !it.IsDone()) {
273
274 Int_t iDE = it.CurrentDEId();
275
276 Double_t nClusters = hESDnTotClustersPerDE->GetBinContent(iDE+1);
277 if (nClusters > 1) {
278
279 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1)/nClusters);
280 hESDClusterChargePerDE->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
281
282 Double_t meanResX = hESDSumResidualXPerDE->GetBinContent(iDE+1)/nClusters;
283 hESDResidualXPerDEMean->SetBinContent(iDE+1, meanResX);
284 hESDResidualXPerDEMean->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(nClusters));
680e610f 285 hESDResidualXPerDESigma->SetBinContent(iDE+1, ProtectedSqrt(hESDSumResidualX2PerDE->GetBinContent(iDE+1)/nClusters - meanResX*meanResX));
ece56eb9 286 hESDResidualXPerDESigma->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(2.*nClusters));
287
288 Double_t meanResY = hESDSumResidualYPerDE->GetBinContent(iDE+1)/nClusters;
289 hESDResidualYPerDEMean->SetBinContent(iDE+1, meanResY);
290 hESDResidualYPerDEMean->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(nClusters));
680e610f 291 hESDResidualYPerDESigma->SetBinContent(iDE+1, ProtectedSqrt(hESDSumResidualY2PerDE->GetBinContent(iDE+1)/nClusters - meanResY*meanResY));
ece56eb9 292 hESDResidualYPerDESigma->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(2.*nClusters));
293
294 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)/nClusters);
295 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, sigmaLocalChi2X/TMath::Sqrt(nClusters));
296
297 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1)/nClusters);
298 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, sigmaLocalChi2Y/TMath::Sqrt(nClusters));
299
300 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1)/nClusters);
301 hESDLocalChi2PerDEMean->SetBinError(iDE+1, sigmaLocalChi2/TMath::Sqrt(nClusters));
302
303 } else {
304
305 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1));
306 hESDClusterChargePerDE->SetBinError(iDE+1, hESDClusterChargeInCh->GetXaxis()->GetXmax());
307
308 hESDResidualXPerDEMean->SetBinContent(iDE+1, hESDSumResidualXPerDE->GetBinContent(iDE+1));
309 hESDResidualXPerDEMean->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
310 hESDResidualXPerDESigma->SetBinContent(iDE+1, 0.);
311 hESDResidualXPerDESigma->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
312
313 hESDResidualYPerDEMean->SetBinContent(iDE+1, hESDSumResidualYPerDE->GetBinContent(iDE+1));
314 hESDResidualYPerDEMean->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
315 hESDResidualYPerDESigma->SetBinContent(iDE+1, 0.);
316 hESDResidualYPerDESigma->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
317
318 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1));
319 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, hESDLocalChi2XInCh->GetXaxis()->GetXmax());
320
321 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1));
322 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, hESDLocalChi2YInCh->GetXaxis()->GetXmax());
323
324 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1));
325 hESDLocalChi2PerDEMean->SetBinError(iDE+1, hESDLocalChi2InCh->GetXaxis()->GetXmax());
326
327 }
328
329 Double_t nFullClusters = hESDnTotFullClustersPerDE->GetBinContent(iDE+1);
330 if (nFullClusters > 1) {
331
332 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1)/nFullClusters);
333 hESDClusterSizePerDE->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nFullClusters));
334
335 } else {
336
337 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1));
338 hESDClusterSizePerDE->SetBinError(iDE+1, hESDClusterSizeInCh->GetXaxis()->GetXmax());
339
340 }
341
342 it.Next();
343 }
344
345 }
346
347}
348
349//____________________________________________________________________________
350void AliMUONTrackerQADataMakerRec::EndOfDetectorCycleRecPoints(Int_t specie, TObjArray** list)
351{
352 /// Normalize RecPoints histograms
353
6482f70b 354 if (!GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerChMean)) return;
ece56eb9 355
b3d57767 356 AliCodeTimerAuto("",0);
357
6482f70b 358 TH1* hTrackerClusterChargePerChMean = GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerChMean);
359 TH1* hTrackerClusterChargePerChSigma = GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerChSigma);
360 TH1* hTrackerClusterMultiplicityPerChMean = GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerChMean);
361 TH1* hTrackerClusterMultiplicityPerChSigma = GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerChSigma);
362 TH1* hTrackerClusterChargePerDEMean = GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerDEMean);
363 TH1* hTrackerClusterMultiplicityPerDEMean = GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerDEMean);
ece56eb9 364
365 // loop over chambers
366 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
367
6482f70b 368 TH1* hTrackerClusterChargePerChamber = GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerChamber+iCh);
ece56eb9 369 Double_t sigmaCharge = hTrackerClusterChargePerChamber->GetRMS();
370 hTrackerClusterChargePerChMean->SetBinContent(iCh+1, hTrackerClusterChargePerChamber->GetMean());
371 hTrackerClusterChargePerChMean->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetMeanError());
372 hTrackerClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
373 hTrackerClusterChargePerChSigma->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetRMSError());
374
6482f70b 375 TH1* hTrackerClusterMultiplicityPerChamber = GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerChamber+iCh);
ece56eb9 376 Double_t sigmaSize = hTrackerClusterMultiplicityPerChamber->GetRMS();
377 hTrackerClusterMultiplicityPerChMean->SetBinContent(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMean());
378 hTrackerClusterMultiplicityPerChMean->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMeanError());
379 hTrackerClusterMultiplicityPerChSigma->SetBinContent(iCh+1, sigmaSize);
380 hTrackerClusterMultiplicityPerChSigma->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetRMSError());
381
382 // loop over DE into chamber iCh
383 AliMpDEIterator it;
384 it.First(iCh);
385 while ( !it.IsDone()) {
386
387 Int_t iDE = it.CurrentDEId();
388
6482f70b 389 TH1* hTrackerClusterChargePerDE = GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerDE+iDE);
ece56eb9 390 hTrackerClusterChargePerDEMean->SetBinContent(iDE+1, hTrackerClusterChargePerDE->GetMean());
391 Double_t nClusters = hTrackerClusterChargePerDE->GetEntries();
392 if (nClusters > 1) hTrackerClusterChargePerDEMean->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
393 else hTrackerClusterChargePerDEMean->SetBinError(iDE+1, hTrackerClusterChargePerChamber->GetXaxis()->GetXmax());
394
6482f70b 395 TH1* hTrackerClusterMultiplicityPerDE = GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerDE+iDE);
ece56eb9 396 hTrackerClusterMultiplicityPerDEMean->SetBinContent(iDE+1, hTrackerClusterMultiplicityPerDE->GetMean());
397 nClusters = hTrackerClusterMultiplicityPerDE->GetEntries();
398 if (nClusters > 1) hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nClusters));
399 else hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, hTrackerClusterMultiplicityPerChamber->GetXaxis()->GetXmax());
400
401 it.Next();
402 }
403 }
404
b3d57767 405 if ( MappingCheckRecPoints(specie) )
406 {
407 InsertTrackerData(specie,list,MappingCheckRecPoints(specie)->CreateData("RecPoints"),AliMUONQAIndices::kTrackerRecPoints,kTRUE);
408 }
409
410 if ( TrackerRecData(specie) )
411 {
412 /// put the trackerdata in the pipeline
413 InsertTrackerData(specie,list,TrackerRecData(specie),AliMUONQAIndices::kTrackerData);
414
415 TH1* hbp = GetRecPointsData(AliMUONQAIndices::kTrackerBusPatchOccupancy);
416 TH1* hnevents = GetRecPointsData(AliMUONQAIndices::kTrackerNofGoodPhysicsEventsUsed);
417 TH1* hddl = GetRecPointsData(AliMUONQAIndices::kTrackerDDLOccupancy);
418 TH1* hddlevents = GetRecPointsData(AliMUONQAIndices::kTrackerDDLNofEventsUsed);
419
420 if ( !hbp || !hnevents || !hddl || !hddlevents)
421 {
422 AliError(Form("Missing some histograms : cannot work : hbp=%p hnevents=%p hddl=%p hddlevents=%p",hbp,hnevents,hddl,hddlevents));
423 return;
424 }
425
426 ProjectTrackerData(TrackerRecData(specie),
427 *hbp,*hnevents,*hddl,*hddlevents);
428 }
429 else
430 {
431 AliError(Form("TrackerRecData is null for specie %s",AliRecoParam::GetEventSpecieName(specie)));
432 }
433
ece56eb9 434}
435
ece56eb9 436//____________________________________________________________________________
b3d57767 437void AliMUONTrackerQADataMakerRec::EndOfDetectorCycleDigits(Int_t specie, TObjArray** list)
ece56eb9 438{
b3d57767 439 /// create digits histograms in digits subdir
ece56eb9 440
b3d57767 441 if ( TrackerCalData(specie) )
ece56eb9 442 {
b3d57767 443 AliCodeTimerAuto("",0);
444
b71c3d2d 445 /// put the trackerdata in the pipeline
b3d57767 446 InsertTrackerData(specie,list,TrackerCalData(specie),AliMUONQAIndices::kTrackerData);
447
448 TH1* hbp = GetDigitsData(AliMUONQAIndices::kTrackerBusPatchOccupancy);
449 TH1* hnevents = GetDigitsData(AliMUONQAIndices::kTrackerNofGoodPhysicsEventsUsed);
450 TH1* hddl = GetDigitsData(AliMUONQAIndices::kTrackerDDLOccupancy);
451 TH1* hddlevents = GetDigitsData(AliMUONQAIndices::kTrackerDDLNofEventsUsed);
ece56eb9 452
b3d57767 453 if ( !hbp || !hnevents || !hddl || !hddlevents)
ece56eb9 454 {
b3d57767 455 AliError(Form("Missing some histograms : cannot work : hbp=%p hnevents=%p hddl=%p hddlevents=%p",hbp,hnevents,hddl,hddlevents));
456 return;
ece56eb9 457 }
64c2397e 458
b3d57767 459 ProjectTrackerData(TrackerCalData(specie),
460 *hbp,*hnevents,*hddl,*hddlevents);
461 }
462}
463
464//____________________________________________________________________________
465AliMUONQADataMakerRec* AliMUONTrackerQADataMakerRec::Master() const
466{
467 /// Get our master
468 return static_cast<AliMUONQADataMakerRec*>(fMaster);
469}
470
471//____________________________________________________________________________
472void AliMUONTrackerQADataMakerRec::ProjectTrackerData(AliMUONVTrackerData* data,
473 TH1& hbp,
474 TH1& hnevents,
475 TH1& hddl,
476 TH1& hddlevents)
477{
478 /// Project tracker data into shifter-friendly histograms
479
480 AliCodeTimerAuto(Form("%s",data->Name()),0);
481
482 /// project the tracerdata into buspatch occupancies (for the experts)
483 hbp.Reset();
484 hbp.SetStats(kFALSE);
485
486 TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator());
487 AliMpBusPatch* bp(0x0);
488 Int_t occDim = 2;
489
490 while ( ( bp = static_cast<AliMpBusPatch*>(nextBP())) )
491 {
492 Int_t busPatchId = bp->GetId();
493 Int_t bin = hbp.FindBin(busPatchId);
494 if ( data->HasBusPatch(busPatchId) )
64c2397e 495 {
b3d57767 496 hbp.SetBinContent(bin,data->BusPatch(busPatchId,occDim)*100.0); // occupancy, in percent
64c2397e 497 }
b3d57767 498 }
499
500 /// log the readout errors (for the shifter)
501 hnevents.Reset();
502 hnevents.SetStats(kFALSE);
503 hnevents.SetBinContent(1,data->NumberOfEvents(-1));
504
505 /// project tracker data into DDL occupancies (for the shifter)
506 hddl.Reset();
507 hddl.SetStats(kFALSE);
508 hddlevents.Reset();
509 hddlevents.SetStats(kFALSE);
510
511 const Int_t nddls = AliDAQ::NumberOfDdls("MUONTRK");
512 const Int_t offset = AliDAQ::DdlIDOffset("MUONTRK");
513
514 for ( Int_t iddl = 0; iddl < nddls; ++iddl )
515 {
516 AliMpDDL* ddl = AliMpDDLStore::Instance()->GetDDL(iddl);
517
518 Int_t ddlId = offset + ddl->GetId();
519 Int_t npads = 0;
520
521 Int_t nevents = data->NumberOfEvents(iddl);
b71c3d2d 522
b3d57767 523 hddlevents.Fill(ddlId,nevents);
b71c3d2d 524
b3d57767 525 Double_t occ(0.0);
526
527 if ( nevents > 0 )
b71c3d2d 528 {
b71c3d2d 529 for ( Int_t ide = 0; ide < ddl->GetNofDEs(); ++ide )
530 {
531 Int_t de = ddl->GetDEId(ide);
532
533 npads += TMath::Nint(data->DetectionElement(de,3));
534
535 occ += data->DetectionElement(de,4);
536 }
537
b3d57767 538 if ( npads > 0 )
b71c3d2d 539 {
540 occ = occ/npads/nevents;
541 }
b3d57767 542 else
543 {
544 occ = 0.0;
545 }
b71c3d2d 546 }
b3d57767 547
548 hddl.Fill(ddlId,100.0*occ); // occ in percent
64c2397e 549 }
b3d57767 550
551 TPaveText* text = new TPaveText(0.50,0.8,0.9,0.9,"NDC");
552
553 text->AddText(Form("MCH RUN %d - %d events",AliCDBManager::Instance()->GetRun(),data->NumberOfEvents(-1)));
554
555 hddl.GetListOfFunctions()->Add(text);
64c2397e 556}
557
558//____________________________________________________________________________
b3d57767 559void AliMUONTrackerQADataMakerRec::EndOfDetectorCycleRaws(Int_t specie, TObjArray** list)
560{
561 /// create Raws histograms in Raws subdir
562
563 if ( TrackerDataMaker(specie) && TrackerDataMaker(specie)->Data() )
564 {
565 AliCodeTimerAuto("",0);
566
567 /// put the trackerdata in the pipeline
568 InsertTrackerData(specie,list,TrackerDataMaker(specie)->Data(),AliMUONQAIndices::kTrackerData);
569 TrackerDataMaker(specie)->SetOwnerOfData(kFALSE); // now that it's attached to list, list will take care of the deletion
570
571 TH1* hbp = GetRawsData(AliMUONQAIndices::kTrackerBusPatchOccupancy);
572 TH1* hnevents = GetRawsData(AliMUONQAIndices::kTrackerNofGoodPhysicsEventsUsed);
573 TH1* hddl = GetRawsData(AliMUONQAIndices::kTrackerDDLOccupancy);
574 TH1* hddlevents = GetRawsData(AliMUONQAIndices::kTrackerDDLNofEventsUsed);
575
576 if ( !hbp || !hnevents || !hddl || !hddlevents)
577 {
578 AliError(Form("Missing some histograms : cannot work : hbp=%p hnevents=%p hddl=%p hddlevents=%p",hbp,hnevents,hddl,hddlevents));
579 return;
580 }
581
582 ProjectTrackerData(TrackerDataMaker(specie)->Data(),
583 *hbp,*hnevents,*hddl,*hddlevents);
584
585 if ( fLogger->NumberOfEntries() > 0 )
586 {
587 // readout errors
588 FillReadoutStatus(*fLogger,TrackerDataMaker(specie)->Data());
589 fLogger->Clear();
590 }
591 }
592}
593
594//____________________________________________________________________________
595void AliMUONTrackerQADataMakerRec::FillReadoutStatus(AliMUONLogger& log, AliMUONVTrackerData* data)
64c2397e 596{
597 log.ResetItr();
598
599 TString msg;
600 Int_t occurence;
601
602 TH1* hparity = GetRawsData(AliMUONQAIndices::kTrackerBusPatchParityErrors);
603
604 TH1* htoken = GetRawsData(AliMUONQAIndices::kTrackerBusPatchTokenLostErrors);
605
606 TH1* hpadding = GetRawsData(AliMUONQAIndices::kTrackerBusPatchPaddingErrors);
607
b3d57767 608 TH1* hrostatus = GetRawsData(AliMUONQAIndices::kTrackerReadoutStatus);
64c2397e 609
b3d57767 610 TH1* hnevents = GetRawsData(AliMUONQAIndices::kTrackerNofPhysicsEventsSeen);
64c2397e 611
612 Int_t nevents = TMath::Nint(hnevents->GetBinContent(1));
613
614 if ( !nevents )
615 {
616 TPaveText* text = new TPaveText(0,0,0.99,0.99,"NDC");
617 text->AddText("FATAL : 0 event seen ? That's NOT normal...");
618 text->SetFillColor(2); // red = FATAL
b3d57767 619 hrostatus->GetListOfFunctions()->Add(text);
64c2397e 620 return;
621 }
622
b3d57767 623 /////////////////////////////////////////////////////////////////
624 /// Start by counting the number of errors
625 /////////////////////////////////////////////////////////////////
626
64c2397e 627 while ( log.Next(msg,occurence) )
628 {
629 AliDebug(1,Form("msg=%s occurence=%d",msg.Data(),occurence));
630
631 if ( msg.Contains("token") )
632 {
f2e6387f 633 Int_t dsp(-1),iddl(-1),ecode(-1);
64c2397e 634
f2e6387f 635 sscanf(msg.Data(),"Lost token error detected with address 0x%X of DDL %d and code %d.",
636 &dsp,&iddl,&ecode);
64c2397e 637 Int_t localBP = ((dsp >> 16)- 4)*5 + 1;
f2e6387f 638 Int_t buspatch = localBP + iddl*100;
639
640 // Let's try to get all the suspected bus patches (i.e. one full FRT, as currently
641 // we don't have more precise information to locate the faulty bus patch(es)).
642
b3d57767 643 AliMpBusPatch* bp = AliMpDDLStore::Instance()->GetBusPatch(buspatch,kFALSE);
644 if (bp)
f2e6387f 645 {
b3d57767 646 Int_t frt = bp->GetFrtId();
647 AliMpDDL* ddl = AliMpDDLStore::Instance()->GetDDL(bp->GetDdlId());
648 Int_t* b = new Int_t[ddl->GetMaxDsp()];
649 ddl->GetBusPerDsp(b);
650 Int_t nbus(0);
651 for ( Int_t i = 0; i < ddl->GetNofFrts() && !nbus; ++i )
f2e6387f 652 {
b3d57767 653 if ( ddl->GetFrtId(i) == frt )
654 {
655 nbus = b[i];
656 }
f2e6387f 657 }
b3d57767 658 if (nbus<=0)
659 {
660 AliError("GOT NBUS<=0 ! THAT IS BAD ! CHECK !");
661 nbus=1;
662 }
663 delete[] b;
f2e6387f 664
b3d57767 665 while (nbus) {
666 htoken->Fill(buspatch+nbus-1,occurence);
667 --nbus;
668 }
f2e6387f 669 }
b3d57767 670 hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofTokenLostErrors,occurence);
64c2397e 671 }
672
673 if ( msg.Contains("Parity") )
674 {
675 Int_t buspatch;
676 sscanf(msg.Data(),"Parity error in buspatch %d (0x%X).",&buspatch,&buspatch);
677 hparity->Fill(buspatch,occurence);
b3d57767 678 hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofParityErrors,occurence);
64c2397e 679 }
680
681 if ( msg.Contains("Glitch") )
682 {
b3d57767 683 hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofGlitchErrors,occurence);
64c2397e 684 }
685
686 if ( msg.Contains("Padding") )
687 {
688 Int_t block, dsp, buspatch;
689 sscanf(msg.Data(),"Padding word error for iBlock %d, iDsp %d, iBus %d.",&block,&dsp,&buspatch);
690 hpadding->Fill(buspatch,occurence);
b3d57767 691 hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofPaddingErrors,occurence);
692 }
693 }
694
695 /////////////////////////////////////////////////////////////////
696 ///
697 /// Then make the status about number of missing bus patches
698 ///
699 /////////////////////////////////////////////////////////////////
700
701 Int_t nofBusPatchesNotInConfig(0);
702
703 for ( int i = 1; i <= fBusPatchConfig->GetNbinsX(); ++i )
704 {
705 Double_t buspatchId = fBusPatchConfig->GetBinCenter(i);
706 if ( TMath::Nint(buspatchId) != i )
707 {
708 AliError(Form("buspathId=%e i=%d",buspatchId,i));
64c2397e 709 }
b3d57767 710 Double_t content = fBusPatchConfig->GetBinContent(i);
711
712 if ( content <= 0. /* no content */
713 &&
714 AliMpDDLStore::Instance()->GetBusPatch(i,kFALSE) /* but a valid bus patch */ )
715 {
716 ++nofBusPatchesNotInConfig;
717 }
718 }
719
720 Double_t nbuspatches = fBusPatchConfig->GetEntries();
721
722 hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofMissingBusPatchesFromConfig,nofBusPatchesNotInConfig*nevents/nbuspatches);
723
724 Double_t nofBusPatchesNotInData(0);
725
726 TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
727 AliMpBusPatch* bp;
728
729 while ( ( bp = static_cast<AliMpBusPatch*>(next()) ) )
730 {
731 if ( !data->HasBusPatch(bp->GetId()) ) ++nofBusPatchesNotInData;
ece56eb9 732 }
64c2397e 733
b3d57767 734 hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofMissingBusPatchesFromDataStream,nofBusPatchesNotInData*nevents/nbuspatches);
ece56eb9 735}
736
b3d57767 737//____________________________________________________________________________
738void AliMUONTrackerQADataMakerRec::FillEventSize(const AliRawVEvent* cevent)
739{
740 /// Fill event size histogram(s)
741
742 if (!cevent)
743 {
744 AliError("Got a null cevent...");
745 return;
746 }
747
748 AliRawVEvent* event = const_cast<AliRawVEvent*>(cevent); // not good, but the Get*Event() methods are not const...
749
750 TH1* hnevents = GetRawsData(AliMUONQAIndices::kTrackerNofPhysicsEventsSeen);
751
752 TH1* hddlevents = GetRawsData(AliMUONQAIndices::kTrackerDDLNofEventsSeen);
753
754 TH1* hDDLEventSize = GetRawsData(AliMUONQAIndices::kTrackerDDLEventSize);
755
756 Double_t eventSize = 0;
757
758 hnevents->Fill(0.0);
759
760 for ( int i = 0; i < event->GetNSubEvents(); ++i )
761 {
762 AliRawVEvent* sub = event->GetSubEvent(i);
763
764 for ( int j = 0; j < sub->GetNEquipments(); ++j )
765 {
766 AliRawVEquipment* eq = sub->GetEquipment(j);
767
768 AliRawEquipmentHeader* equipmentHeader = eq->GetEquipmentHeader();
769
770 UInt_t uid = equipmentHeader->GetId();
771
772 int index;
773
774 TString det(AliDAQ::DetectorNameFromDdlID(uid,index));
775
776 if (det=="MUONTRK")
777 {
778 UInt_t ddlsize = equipmentHeader->GetEquipmentSize();
779 hDDLEventSize->Fill(uid,ddlsize);
780 hddlevents->Fill(uid);
781 eventSize += ddlsize;
782 }
783 }
784 }
785}
64c2397e 786
ece56eb9 787//____________________________________________________________________________
b3d57767 788void AliMUONTrackerQADataMakerRec::InitCommon()
789{
790 if (!fBusPatchConfig)
791 {
792 Int_t bpmin(999999);
793 Int_t bpmax(0);
794
795 TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
796 AliMpBusPatch* bp(0x0);
797 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
798 {
799 bpmin = TMath::Min(bpmin,bp->GetId());
800 bpmax = TMath::Max(bpmax,bp->GetId());
801 }
802
803 fBPxmin = bpmin-0.5;
804 fBPxmax = bpmax+0.5;
805 fBPnbins = TMath::Nint(fBPxmax-fBPxmin);
806
807 AliMUONVStore* config = fCalibrationData->Config();
808
809 if (config)
810 {
811 fBusPatchConfig = new TH1F("hTrackerBusPatchConfig","Configuration of bus patches",fBPnbins,fBPxmin,fBPxmax);
812 fBusPatchConfig->SetDirectory(0);
813 }
814 else
815 {
816 AliWarning("Tracker configuration not found. Will not be able to cut on low occupancies");
817 }
818
819 next.Reset();
820 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
821 {
822 if ( config )
823 {
824 Int_t nofManusInConfig(0);
825
826 for ( Int_t imanu = 0; imanu < bp->GetNofManus(); ++imanu )
827 {
828 Int_t manuId = bp->GetManuId(imanu);
829 if ( config->FindObject(bp->GetDEId(),manuId)) ++nofManusInConfig;
830 }
831
832 if ( nofManusInConfig > 0 )
833 {
834 fBusPatchConfig->Fill(bp->GetId(),1.0);
835 }
836 else
837 {
838 fBusPatchConfig->Fill(bp->GetId(),0.0);
839 }
840 }
841 else // no config, we assume all is there...
842 {
843 fBusPatchConfig->Fill(bp->GetId());
844 }
845 }
846 }
847}
848
849//____________________________________________________________________________
850void AliMUONTrackerQADataMakerRec::BookHistograms(AliQAv1::TASKINDEX_t task)
ece56eb9 851{
ece56eb9 852 AliCodeTimerAuto("",0);
b3d57767 853
854 InitCommon();
ece56eb9 855
856 const Bool_t expert = kTRUE ;
857 const Bool_t saveCorr = kTRUE ;
858 const Bool_t image = kTRUE ;
ece56eb9 859
b3d57767 860 TH1* hbp = new TH1F("hTrackerBusPatchOccupancy","Occupancy of bus patches",fBPnbins,fBPxmin,fBPxmax);
861
862 Master()->Add2List(hbp,AliMUONQAIndices::kTrackerBusPatchOccupancy, task, expert, !image, !saveCorr);
863
864 TH1* h = new TH1F("hTrackerBusPatchParityErrors","Number of parity errors per bus patch",fBPnbins,fBPxmin,fBPxmax);
865
866 Master()->Add2List(h,AliMUONQAIndices::kTrackerBusPatchParityErrors,task,expert,!image,!saveCorr);
867
868 h = new TH1F("hTrackerBusPatchTokenLostErrors","Number of token lost errors per bus patch",fBPnbins,fBPxmin,fBPxmax);
869 Master()->Add2List(h,AliMUONQAIndices::kTrackerBusPatchTokenLostErrors,task,expert,!image,!saveCorr);
870
871 h = new TH1F("hTrackerBusPatchPaddingErrors","Number of padding errors per bus patch",fBPnbins,fBPxmin,fBPxmax);
872
873 Master()->Add2List(h,AliMUONQAIndices::kTrackerBusPatchPaddingErrors,task,expert,!image,!saveCorr);
874
875
876 TH1* hnevents(0x0);
877
878 if ( task == AliQAv1::kRAWS )
ece56eb9 879 {
b3d57767 880 // for raw data, we differentiate events seen from events used to be able to detect
881 // severe decoder errors that lead to no event decoded (i.e. zero event used) even if
882 // events are there (i.e non-zero event seen).
883 hnevents = new TH1F("kTrackerNofPhysicsEventsSeen","Number of physics events seen",1,-0.5,0.5);
884 // this one will count the number of physics event the rawdatamaker is *seeing*
885 TAxis* a = hnevents->GetXaxis();
886 a->SetBinLabel(1,"NPhysicsEvents");
887 hnevents->SetStats(kFALSE);
888 Master()->Add2List(hnevents,AliMUONQAIndices::kTrackerNofPhysicsEventsSeen,task,expert,!image,!saveCorr);
ece56eb9 889 }
890
b3d57767 891 hnevents = new TH1F("kTrackerNofGoodPhysicsEventsUsed","Number of good physics events used",1,-0.5,0.5);
892 // this one will get its content from the TrackerData, i.e. it will count the number of *good* physics events *used*
893 // (i.e. not empty and with no fatal readout error)
894 TAxis* a = hnevents->GetXaxis();
895 a->SetBinLabel(1,"NGoodPhysicsEvents");
896 hnevents->SetStats(kFALSE);
ece56eb9 897
b3d57767 898 Master()->Add2List(hnevents,AliMUONQAIndices::kTrackerNofGoodPhysicsEventsUsed,task,expert,!image,!saveCorr);
ece56eb9 899
b3d57767 900 Master()->Add2List(static_cast<TH1*>(fBusPatchConfig->Clone()),AliMUONQAIndices::kTrackerBusPatchConfig, task,expert, !image, !saveCorr);
ece56eb9 901
b3d57767 902 Int_t nbins = AliDAQ::NumberOfDdls("MUONTRK");
903 const Int_t offset = AliDAQ::DdlIDOffset("MUONTRK");
904
905 Double_t xmin = offset - 0.5;
906 Double_t xmax = offset + nbins - 0.5;
907
908 TString what(AliQAv1::GetTaskName(task));
909
910 h = new TH1F(Form("hTrackerDDL%sOccupancy",what.Data()),Form(";DDLId;DDL Occupancy in %% (from %s)",what.Data()),nbins,xmin,xmax);
911
912 Master()->Add2List(h,AliMUONQAIndices::kTrackerDDLOccupancy,task,expert,!image,!saveCorr);
64c2397e 913
b3d57767 914 if ( task == AliQAv1::kRAWS )
915 {
916 // see above the comment about why we have event seen vs used for raw data.
917 h = new TH1F("hTrackerDDLNofEventsSeen","Number of events seen by DDL;DDLId",nbins,xmin,xmax);
918 Master()->Add2List(h,AliMUONQAIndices::kTrackerDDLNofEventsSeen,task,expert,!image,!saveCorr);
919 }
920
921 h = new TH1F("hTrackerDDLNofEventsUsed","Number of events used by DDL;DDLId",nbins,xmin,xmax);
922 Master()->Add2List(h,AliMUONQAIndices::kTrackerDDLNofEventsUsed,task,expert,!image,!saveCorr);
923
924}
64c2397e 925
b3d57767 926//____________________________________________________________________________
927void AliMUONTrackerQADataMakerRec::InitRaws()
928{
929 /// create monitor objects for RAWS
930
931 TrackerDataMaker(AliRecoParam::AConvert(Master()->GetEventSpecie()),kTRUE);
932
933 /// Book histograms that are common to Raws and Digits
934 BookHistograms(AliQAv1::kRAWS);
935
936 /// Now the Raws specific parts
937 TH1* h = new TH1F("hTrackerReadoutStatus","Readout status (x events)",7,-0.5,6.5);
64c2397e 938 h->SetStats(kFALSE);
939
64c2397e 940 TAxis* a = h->GetXaxis();
941
f2e6387f 942 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofGlitchErrors),"Glitch errors");
943 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofTokenLostErrors),"Token lost errors");
944 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofParityErrors),"Parity errors");
945 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofPaddingErrors),"Padding errors");
64c2397e 946
b3d57767 947 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofEmptyEvents),"Empty events");
ece56eb9 948
b3d57767 949 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofMissingBusPatchesFromConfig),"Not readout bus patches");
950 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofMissingBusPatchesFromDataStream),"Missing bus patches");
ece56eb9 951
b3d57767 952 TH1* h1 = static_cast<TH1*>(h->Clone("hTrackerReadoutStatusPerEvent"));
953 h1->SetTitle("Readout status per event");
954 h1->GetYaxis()->SetTitle("Percentage");
ece56eb9 955
b3d57767 956 // The QA shifter will only see the summary plot below
ece56eb9 957
b3d57767 958 Add2RawsList(h,AliMUONQAIndices::kTrackerReadoutStatus,kTRUE,kFALSE,kFALSE);
959 Add2RawsList(h1,AliMUONQAIndices::kTrackerReadoutStatusPerEvent,kFALSE,kTRUE,kFALSE);
ece56eb9 960
b3d57767 961 // Lastly the event size histograms
ece56eb9 962
b3d57767 963 Int_t nbins = AliDAQ::NumberOfDdls("MUONTRK");
b71c3d2d 964 const Int_t offset = AliDAQ::DdlIDOffset("MUONTRK");
965
b3d57767 966 Double_t xmin = offset - 0.5;
967 Double_t xmax = offset + nbins - 0.5;
b71c3d2d 968
b3d57767 969 h = new TH1F("hTrackerDDLEventSize","DDL event size (bytes);DDL Id;Data size (bytes)",nbins,xmin,xmax);
970 h->SetStats(kFALSE);
971 Add2RawsList(h,AliMUONQAIndices::kTrackerDDLEventSize,kTRUE,kFALSE,kFALSE);
972
973 h = new TH1F("hTrackerDDLMeanEventSize","DDL mean event size (KB) per event;DDL Id;Mean Event size (KB)",nbins,xmin,xmax);
974 h->SetStats(kFALSE);
975 Add2RawsList(h,AliMUONQAIndices::kTrackerDDLEventSizePerEvent,kFALSE,kTRUE,kFALSE);
976
ece56eb9 977}
978
979//__________________________________________________________________
980void AliMUONTrackerQADataMakerRec::InitDigits()
981{
b3d57767 982 /// create monitor objects for DIGITS
ece56eb9 983
b3d57767 984 AliCodeTimerAuto("",0);
985
986 TrackerCalData(AliRecoParam::AConvert(Master()->GetEventSpecie()),kTRUE);
ece56eb9 987
b3d57767 988 /// Book histograms that are common to Raws and Digits
989 BookHistograms(AliQAv1::kDIGITSR);
ece56eb9 990}
991
992//____________________________________________________________________________
993void AliMUONTrackerQADataMakerRec::InitRecPoints()
994{
995 /// create Reconstructed Points histograms in RecPoints subdir for the
996 /// MUON tracker subsystem.
997 const Bool_t expert = kTRUE ;
998 const Bool_t image = kTRUE ;
999
1000 AliCodeTimerAuto("",0);
b3d57767 1001
1002 TrackerRecData(AliRecoParam::AConvert(Master()->GetEventSpecie()),kTRUE);
1003
1004 BookHistograms(AliQAv1::kRECPOINTS);
ece56eb9 1005
1006 TH1I *h1I;
1007 TH1F *h1F;
1008 TH2F *h2F;
1009
1010 // histograms per chamber
1011 Int_t nCh = AliMpConstants::NofTrackingChambers();
1012 for ( Int_t i = 0; i < nCh; ++i )
1013 {
1014 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 1015 Add2RecPointsList(h1I,AliMUONQAIndices::kTrackerClusterMultiplicityPerChamber+i, expert, !image);
ece56eb9 1016
1017 h1I = new TH1I(Form("hTrackerClusterChargeForChamber%d",i+1), Form("cluster charge distribution in chamber %d;charge (fC);Counts",i+1), 100,0,1000);
6482f70b 1018 Add2RecPointsList(h1I,AliMUONQAIndices::kTrackerClusterChargePerChamber+i, expert, !image);
ece56eb9 1019
1020 Float_t rMax = AliMUONConstants::Rmax(i/2);
1021 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 1022 Add2RecPointsList(h2F, AliMUONQAIndices::kTrackerClusterHitMapPerChamber+i, expert, !image);
ece56eb9 1023 }
1024
1025 // summary histograms per chamber
1026 h1I = new TH1I("hTrackerNumberOfClustersPerChamber", "Number of clusters per chamber;chamber ID;n_{clusters}", nCh,-0.5,nCh-0.5);
6482f70b 1027 Add2RecPointsList(h1I,AliMUONQAIndices::kTrackerNumberOfClustersPerChamber, !expert, image);
ece56eb9 1028
1029 h1F = new TH1F("hTrackerClusterMultiplicityPerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh,-0.5,nCh-0.5);
1030 h1F->SetOption("P");
1031 h1F->SetMarkerStyle(kFullDotMedium);
1032 h1F->SetMarkerColor(kRed);
6482f70b 1033 Add2RecPointsList(h1F, AliMUONQAIndices::kTrackerClusterMultiplicityPerChMean, !expert, image);
ece56eb9 1034
1035 h1F = new TH1F("hTrackerClusterMultiplicityPerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh,-0.5,nCh-0.5);
1036 h1F->SetOption("P");
1037 h1F->SetMarkerStyle(kFullDotMedium);
1038 h1F->SetMarkerColor(kRed);
6482f70b 1039 Add2RecPointsList(h1F, AliMUONQAIndices::kTrackerClusterMultiplicityPerChSigma, !expert, image);
ece56eb9 1040
1041 h1F = new TH1F("hTrackerClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (fC)", nCh,-0.5,nCh-0.5);
1042 h1F->SetOption("P");
1043 h1F->SetMarkerStyle(kFullDotMedium);
1044 h1F->SetMarkerColor(kRed);
6482f70b 1045 Add2RecPointsList(h1F, AliMUONQAIndices::kTrackerClusterChargePerChMean, !expert, image);
ece56eb9 1046
1047 h1F = new TH1F("hTrackerClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (fC)", nCh,-0.5,nCh-0.5);
1048 h1F->SetOption("P");
1049 h1F->SetMarkerStyle(kFullDotMedium);
1050 h1F->SetMarkerColor(kRed);
6482f70b 1051 Add2RecPointsList(h1F, AliMUONQAIndices::kTrackerClusterChargePerChSigma, !expert, image);
ece56eb9 1052
1053 // histograms per DE
1054 Int_t ndes(0);
1055 AliMpDEIterator it;
1056 it.First();
1057 while ( !it.IsDone())
1058 {
1059 Int_t detElemId = it.CurrentDEId();
1060
1061 if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
1062 {
1063 ndes = TMath::Max(ndes,detElemId);
1064
1065 h1I = new TH1I(Form("hTrackerClusterMultiplicityForDE%04d",detElemId), Form("cluster size distribution in detection element %d;size (n_{pads})",detElemId), 100,0,100);
6482f70b 1066 Add2RecPointsList(h1I,AliMUONQAIndices::kTrackerClusterMultiplicityPerDE+detElemId, expert, !image);
ece56eb9 1067
1068 h1I = new TH1I(Form("hTrackerClusterChargeForDE%04d",detElemId), Form("cluster charge distribution in detection element %d;charge (fC)",detElemId), 100,0,1000);
6482f70b 1069 Add2RecPointsList(h1I,AliMUONQAIndices::kTrackerClusterChargePerDE+detElemId, expert, !image);
ece56eb9 1070 }
1071
1072 it.Next();
1073 }
1074
1075 // summary histograms per DE
1076 h1I = new TH1I("hTrackerNumberOfClustersPerDE", "Number of clusters per detection element;DetElem ID;n_{clusters}", ndes+1,-0.5,ndes+0.5);
6482f70b 1077 Add2RecPointsList(h1I, AliMUONQAIndices::kTrackerNumberOfClustersPerDE, !expert, image);
ece56eb9 1078
1079 h1F = new TH1F("hTrackerClusterMultiplicityPerDEMean", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", ndes+1,-0.5,ndes+0.5);
1080 h1F->SetOption("P");
1081 h1F->SetMarkerStyle(kFullDotMedium);
1082 h1F->SetMarkerColor(kRed);
6482f70b 1083 Add2RecPointsList(h1F, AliMUONQAIndices::kTrackerClusterMultiplicityPerDEMean, !expert, image);
ece56eb9 1084
1085 h1F = new TH1F("hTrackerClusterChargePerDEMean", "cluster mean charge per DE;DetElem ID;<charge> (fC)", ndes+1,-0.5,ndes+0.5);
1086 h1F->SetOption("P");
1087 h1F->SetMarkerStyle(kFullDotMedium);
1088 h1F->SetMarkerColor(kRed);
6482f70b 1089 Add2RecPointsList(h1F, AliMUONQAIndices::kTrackerClusterChargePerDEMean, !expert, image);
ece56eb9 1090
b3d57767 1091 MappingCheckRecPoints(AliRecoParam::AConvert(Master()->GetEventSpecie()),kTRUE);
ece56eb9 1092}
1093
1094//____________________________________________________________________________
1095void AliMUONTrackerQADataMakerRec::InitESDs()
1096{
1097 ///create ESDs histograms in ESDs subdir
1098
1099 const Bool_t expert = kTRUE ;
1100 const Bool_t image = kTRUE ;
1101
1102 Int_t nCh = AliMUONConstants::NTrackingCh();
1103 Int_t nDE = 1100;
1104
1105 // track info
1106 TH1F* hESDnTracks = new TH1F("hESDnTracks", "number of tracks;n_{tracks}", 20, 0., 20.);
6482f70b 1107 Add2ESDsList(hESDnTracks, AliMUONQAIndices::kESDnTracks, !expert, image);
ece56eb9 1108
1109 TH1F* hESDMatchTrig = new TH1F("hESDMatchTrig", "number of tracks matched with trigger;n_{tracks}", 20, 0., 20.);
6482f70b 1110 Add2ESDsList(hESDMatchTrig, AliMUONQAIndices::kESDMatchTrig, !expert, image);
ece56eb9 1111
1112 TH1F* hESDMomentum = new TH1F("hESDMomentum", "momentum distribution;p (GeV/c)", 300, 0., 300);
6482f70b 1113 Add2ESDsList(hESDMomentum, AliMUONQAIndices::kESDMomentum, !expert, image);
ece56eb9 1114
1115 TH1F* hESDPt = new TH1F("hESDPt", "transverse momentum distribution;p_{t} (GeV/c)", 200, 0., 50);
6482f70b 1116 Add2ESDsList(hESDPt, AliMUONQAIndices::kESDPt, !expert, image);
ece56eb9 1117
1118 TH1F* hESDRapidity = new TH1F("hESDRapidity", "rapidity distribution;rapidity", 200, -4.5, -2.);
6482f70b 1119 Add2ESDsList(hESDRapidity, AliMUONQAIndices::kESDRapidity, !expert, image);
ece56eb9 1120
1121 TH1F* hESDChi2 = new TH1F("hESDChi2", "normalized #chi^{2} distribution;#chi^{2} / ndf", 500, 0., 50.);
6482f70b 1122 Add2ESDsList(hESDChi2, AliMUONQAIndices::kESDChi2, !expert, image);
ece56eb9 1123
1124 TH1F* hESDProbChi2 = new TH1F("hESDProbChi2", "distribution of probability of #chi^{2};prob(#chi^{2})", 100, 0., 1.);
6482f70b 1125 Add2ESDsList(hESDProbChi2, AliMUONQAIndices::kESDProbChi2, !expert, image);
ece56eb9 1126
1127 TH1F* hESDThetaX = new TH1F("hESDThetaX", "#theta_{X} distribution;#theta_{X} (degree)", 360, -180., 180);
6482f70b 1128 Add2ESDsList(hESDThetaX, AliMUONQAIndices::kESDThetaX, !expert, image);
ece56eb9 1129
1130 TH1F* hESDThetaY = new TH1F("hESDThetaY", "#theta_{Y} distribution;#theta_{Y} (degree)", 360, -180., 180);
6482f70b 1131 Add2ESDsList(hESDThetaY, AliMUONQAIndices::kESDThetaY, !expert, image);
ece56eb9 1132
1133 // cluster info
1134 for (Int_t i = 0; i < nCh; i++) {
1135 Float_t rMax = AliMUONConstants::Rmax(i/2);
1136 TH2F* hESDClusterHitMap = new TH2F(Form("hESDClusterHitMap%d",i+1), Form("cluster position distribution in chamber %d;X (cm);Y (cm)",i+1),
1137 100, -rMax, rMax, 100, -rMax, rMax);
6482f70b 1138 Add2ESDsList(hESDClusterHitMap, AliMUONQAIndices::kESDClusterHitMap+i, expert, !image);
ece56eb9 1139 }
1140
1141 TH1F* hESDnClustersPerTrack = new TH1F("hESDnClustersPerTrack", "number of associated clusters per track;n_{clusters}", 20, 0., 20.);
6482f70b 1142 Add2ESDsList(hESDnClustersPerTrack, AliMUONQAIndices::kESDnClustersPerTrack, !expert, image);
ece56eb9 1143
1144 TH1F* hESDnClustersPerCh = new TH1F("hESDnClustersPerCh", "averaged number of clusters per chamber per track;chamber ID;<n_{clusters}>", nCh, -0.5, nCh-0.5);
1145 hESDnClustersPerCh->SetFillColor(kRed);
6482f70b 1146 Add2ESDsList(hESDnClustersPerCh, AliMUONQAIndices::kESDnClustersPerCh, !expert, image);
ece56eb9 1147
1148 TH1F* hESDnClustersPerDE = new TH1F("hESDnClustersPerDE", "averaged number of clusters per DE per track;DetElem ID;<n_{clusters}>", nDE+1, -0.5, nDE+0.5);
1149 hESDnClustersPerDE->SetFillColor(kRed);
6482f70b 1150 Add2ESDsList(hESDnClustersPerDE, AliMUONQAIndices::kESDnClustersPerDE, !expert, image);
ece56eb9 1151
1152 for (Int_t i = 0; i < nCh; i++) {
1153 TH1F* hESDClusterChargeInCh = new TH1F(Form("hESDClusterChargeInCh%d",i+1), Form("cluster charge distribution in chamber %d;charge (fC)",i+1), 100, 0., 1000.);
6482f70b 1154 Add2ESDsList(hESDClusterChargeInCh, AliMUONQAIndices::kESDClusterChargeInCh+i, expert, !image);
ece56eb9 1155 }
1156
1157 TH1F* hESDClusterChargePerChMean = new TH1F("hESDClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (fC)", nCh, -0.5, nCh-0.5);
1158 hESDClusterChargePerChMean->SetOption("P");
1159 hESDClusterChargePerChMean->SetMarkerStyle(kFullDotMedium);
1160 hESDClusterChargePerChMean->SetMarkerColor(kRed);
6482f70b 1161 Add2ESDsList(hESDClusterChargePerChMean, AliMUONQAIndices::kESDClusterChargePerChMean, !expert, image);
ece56eb9 1162
1163 TH1F* hESDClusterChargePerChSigma = new TH1F("hESDClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (fC)", nCh, -0.5, nCh-0.5);
1164 hESDClusterChargePerChSigma->SetOption("P");
1165 hESDClusterChargePerChSigma->SetMarkerStyle(kFullDotMedium);
1166 hESDClusterChargePerChSigma->SetMarkerColor(kRed);
6482f70b 1167 Add2ESDsList(hESDClusterChargePerChSigma, AliMUONQAIndices::kESDClusterChargePerChSigma, !expert, image);
ece56eb9 1168
1169 TH1F* hESDClusterChargePerDE = new TH1F("hESDClusterChargePerDE", "cluster mean charge per DE;DetElem ID;<charge> (fC)", nDE+1, -0.5, nDE+0.5);
1170 hESDClusterChargePerDE->SetOption("P");
1171 hESDClusterChargePerDE->SetMarkerStyle(kFullDotMedium);
1172 hESDClusterChargePerDE->SetMarkerColor(kRed);
6482f70b 1173 Add2ESDsList(hESDClusterChargePerDE, AliMUONQAIndices::kESDClusterChargePerDE, !expert, image);
ece56eb9 1174
1175 for (Int_t i = 0; i < nCh; i++) {
1176 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 1177 Add2ESDsList(hESDClusterSizeInCh, AliMUONQAIndices::kESDClusterSizeInCh+i, expert, !image);
ece56eb9 1178 }
1179
1180 TH1F* hESDClusterSizePerChMean = new TH1F("hESDClusterSizePerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh, -0.5, nCh-0.5);
1181 hESDClusterSizePerChMean->SetOption("P");
1182 hESDClusterSizePerChMean->SetMarkerStyle(kFullDotMedium);
1183 hESDClusterSizePerChMean->SetMarkerColor(kRed);
6482f70b 1184 Add2ESDsList(hESDClusterSizePerChMean, AliMUONQAIndices::kESDClusterSizePerChMean, !expert, image);
ece56eb9 1185
1186 TH1F* hESDClusterSizePerChSigma = new TH1F("hESDClusterSizePerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh, -0.5, nCh-0.5);
1187 hESDClusterSizePerChSigma->SetOption("P");
1188 hESDClusterSizePerChSigma->SetMarkerStyle(kFullDotMedium);
1189 hESDClusterSizePerChSigma->SetMarkerColor(kRed);
6482f70b 1190 Add2ESDsList(hESDClusterSizePerChSigma, AliMUONQAIndices::kESDClusterSizePerChSigma, !expert, image);
ece56eb9 1191
1192 TH1F* hESDClusterSizePerDE = new TH1F("hESDClusterSizePerDE", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", nDE+1, -0.5, nDE+0.5);
1193 hESDClusterSizePerDE->SetOption("P");
1194 hESDClusterSizePerDE->SetMarkerStyle(kFullDotMedium);
1195 hESDClusterSizePerDE->SetMarkerColor(kRed);
6482f70b 1196 Add2ESDsList(hESDClusterSizePerDE, AliMUONQAIndices::kESDClusterSizePerDE, !expert, image);
ece56eb9 1197
1198 // cluster - track info
1199 for (Int_t i = 0; i < nCh; i++) {
1200 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 1201 Add2ESDsList(hESDResidualXInCh, AliMUONQAIndices::kESDResidualXInCh+i, expert, !image);
ece56eb9 1202
1203 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 1204 Add2ESDsList(hESDResidualYInCh, AliMUONQAIndices::kESDResidualYInCh+i, expert, !image);
ece56eb9 1205
1206 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 1207 Add2ESDsList(hESDLocalChi2XInCh, AliMUONQAIndices::kESDLocalChi2XInCh+i, expert, !image);
ece56eb9 1208
1209 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 1210 Add2ESDsList(hESDLocalChi2YInCh, AliMUONQAIndices::kESDLocalChi2YInCh+i, expert, !image);
ece56eb9 1211
1212 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 1213 Add2ESDsList(hESDLocalChi2InCh, AliMUONQAIndices::kESDLocalChi2InCh+i, expert, !image);
ece56eb9 1214 }
1215
1216 TH1F* hESDResidualXPerChMean = new TH1F("hESDResidualXPerChMean", "cluster-track residual-X per Ch: mean;chamber ID;<#Delta_{X}> (cm)", nCh, -0.5, nCh-0.5);
1217 hESDResidualXPerChMean->SetOption("P");
1218 hESDResidualXPerChMean->SetMarkerStyle(kFullDotMedium);
1219 hESDResidualXPerChMean->SetMarkerColor(kRed);
6482f70b 1220 Add2ESDsList(hESDResidualXPerChMean, AliMUONQAIndices::kESDResidualXPerChMean, !expert, image);
ece56eb9 1221
1222 TH1F* hESDResidualYPerChMean = new TH1F("hESDResidualYPerChMean", "cluster-track residual-Y per Ch: mean;chamber ID;<#Delta_{Y}> (cm)", nCh, -0.5, nCh-0.5);
1223 hESDResidualYPerChMean->SetOption("P");
1224 hESDResidualYPerChMean->SetMarkerStyle(kFullDotMedium);
1225 hESDResidualYPerChMean->SetMarkerColor(kRed);
6482f70b 1226 Add2ESDsList(hESDResidualYPerChMean, AliMUONQAIndices::kESDResidualYPerChMean, !expert, image);
ece56eb9 1227
1228 TH1F* hESDResidualXPerChSigma = new TH1F("hESDResidualXPerChSigma", "cluster-track residual-X per Ch: sigma;chamber ID;#sigma_{X} (cm)", nCh, -0.5, nCh-0.5);
1229 hESDResidualXPerChSigma->SetOption("P");
1230 hESDResidualXPerChSigma->SetMarkerStyle(kFullDotMedium);
1231 hESDResidualXPerChSigma->SetMarkerColor(kRed);
6482f70b 1232 Add2ESDsList(hESDResidualXPerChSigma, AliMUONQAIndices::kESDResidualXPerChSigma, !expert, image);
ece56eb9 1233
1234 TH1F* hESDResidualYPerChSigma = new TH1F("hESDResidualYPerChSigma", "cluster-track residual-Y per Ch: sigma;chamber ID;#sigma_{Y} (cm)", nCh, -0.5, nCh-0.5);
1235 hESDResidualYPerChSigma->SetOption("P");
1236 hESDResidualYPerChSigma->SetMarkerStyle(kFullDotMedium);
1237 hESDResidualYPerChSigma->SetMarkerColor(kRed);
6482f70b 1238 Add2ESDsList(hESDResidualYPerChSigma, AliMUONQAIndices::kESDResidualYPerChSigma, !expert, image);
ece56eb9 1239
1240 TH1F* hESDLocalChi2XPerChMean = new TH1F("hESDLocalChi2XPerCh", "local chi2-X per Ch: mean;chamber ID;<local #chi^{2}_{X}>", nCh, -0.5, nCh-0.5);
1241 hESDLocalChi2XPerChMean->SetOption("P");
1242 hESDLocalChi2XPerChMean->SetMarkerStyle(kFullDotMedium);
1243 hESDLocalChi2XPerChMean->SetMarkerColor(kRed);
6482f70b 1244 Add2ESDsList(hESDLocalChi2XPerChMean, AliMUONQAIndices::kESDLocalChi2XPerChMean, !expert, image);
ece56eb9 1245
1246 TH1F* hESDLocalChi2YPerChMean = new TH1F("hESDLocalChi2YPerCh", "local chi2-Y per Ch: mean;chamber ID;<local #chi^{2}_{Y}>", nCh, -0.5, nCh-0.5);
1247 hESDLocalChi2YPerChMean->SetOption("P");
1248 hESDLocalChi2YPerChMean->SetMarkerStyle(kFullDotMedium);
1249 hESDLocalChi2YPerChMean->SetMarkerColor(kRed);
6482f70b 1250 Add2ESDsList(hESDLocalChi2YPerChMean, AliMUONQAIndices::kESDLocalChi2YPerChMean, !expert, image);
ece56eb9 1251
1252 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);
1253 hESDLocalChi2PerChMean->SetOption("P");
1254 hESDLocalChi2PerChMean->SetMarkerStyle(kFullDotMedium);
1255 hESDLocalChi2PerChMean->SetMarkerColor(kRed);
6482f70b 1256 Add2ESDsList(hESDLocalChi2PerChMean, AliMUONQAIndices::kESDLocalChi2PerChMean, !expert, image);
ece56eb9 1257
1258 TH1F* hESDResidualXPerDEMean = new TH1F("hESDResidualXPerDEMean", "cluster-track residual-X per DE: mean;DetElem ID;<#Delta_{X}> (cm)", nDE+1, -0.5, nDE+0.5);
1259 hESDResidualXPerDEMean->SetOption("P");
1260 hESDResidualXPerDEMean->SetMarkerStyle(kFullDotMedium);
1261 hESDResidualXPerDEMean->SetMarkerColor(kRed);
6482f70b 1262 Add2ESDsList(hESDResidualXPerDEMean, AliMUONQAIndices::kESDResidualXPerDEMean, !expert, image);
ece56eb9 1263
1264 TH1F* hESDResidualYPerDEMean = new TH1F("hESDResidualYPerDEMean", "cluster-track residual-Y per DE: mean;DetElem ID;<#Delta_{Y}> (cm)", nDE+1, -0.5, nDE+0.5);
1265 hESDResidualYPerDEMean->SetOption("P");
1266 hESDResidualYPerDEMean->SetMarkerStyle(kFullDotMedium);
1267 hESDResidualYPerDEMean->SetMarkerColor(kRed);
6482f70b 1268 Add2ESDsList(hESDResidualYPerDEMean, AliMUONQAIndices::kESDResidualYPerDEMean, !expert, image);
ece56eb9 1269
1270 TH1F* hESDResidualXPerDESigma = new TH1F("hESDResidualXPerDESigma", "cluster-track residual-X per DE: sigma;DetElem ID;#sigma_{X} (cm)", nDE+1, -0.5, nDE+0.5);
1271 hESDResidualXPerDESigma->SetOption("P");
1272 hESDResidualXPerDESigma->SetMarkerStyle(kFullDotMedium);
1273 hESDResidualXPerDESigma->SetMarkerColor(kRed);
6482f70b 1274 Add2ESDsList(hESDResidualXPerDESigma, AliMUONQAIndices::kESDResidualXPerDESigma, !expert, image);
ece56eb9 1275
1276 TH1F* hESDResidualYPerDESigma = new TH1F("hESDResidualYPerDESigma", "cluster-track residual-Y per DE: sigma;DetElem ID;#sigma_{Y} (cm)", nDE+1, -0.5, nDE+0.5);
1277 hESDResidualYPerDESigma->SetOption("P");
1278 hESDResidualYPerDESigma->SetMarkerStyle(kFullDotMedium);
1279 hESDResidualYPerDESigma->SetMarkerColor(kRed);
6482f70b 1280 Add2ESDsList(hESDResidualYPerDESigma, AliMUONQAIndices::kESDResidualYPerDESigma, !expert, image);
ece56eb9 1281
1282 TH1F* hESDLocalChi2XPerDEMean = new TH1F("hESDLocalChi2XPerDE", "local chi2-X per DE: mean;DetElem ID;<local #chi^{2}_{X}>", nDE+1, -0.5, nDE+0.5);
1283 hESDLocalChi2XPerDEMean->SetOption("P");
1284 hESDLocalChi2XPerDEMean->SetMarkerStyle(kFullDotMedium);
1285 hESDLocalChi2XPerDEMean->SetMarkerColor(kRed);
6482f70b 1286 Add2ESDsList(hESDLocalChi2XPerDEMean, AliMUONQAIndices::kESDLocalChi2XPerDEMean, !expert, image);
ece56eb9 1287
1288 TH1F* hESDLocalChi2YPerDEMean = new TH1F("hESDLocalChi2YPerDE", "local chi2-Y per DE: mean;DetElem ID;<local #chi^{2}_{Y}>", nDE+1, -0.5, nDE+0.5);
1289 hESDLocalChi2YPerDEMean->SetOption("P");
1290 hESDLocalChi2YPerDEMean->SetMarkerStyle(kFullDotMedium);
1291 hESDLocalChi2YPerDEMean->SetMarkerColor(kRed);
6482f70b 1292 Add2ESDsList(hESDLocalChi2YPerDEMean, AliMUONQAIndices::kESDLocalChi2YPerDEMean, !expert, image);
ece56eb9 1293
1294 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);
1295 hESDLocalChi2PerDEMean->SetOption("P");
1296 hESDLocalChi2PerDEMean->SetMarkerStyle(kFullDotMedium);
1297 hESDLocalChi2PerDEMean->SetMarkerColor(kRed);
6482f70b 1298 Add2ESDsList(hESDLocalChi2PerDEMean, AliMUONQAIndices::kESDLocalChi2PerDEMean, !expert, image);
ece56eb9 1299
1300 // intermediate histograms
1301 TH1F* hESDnTotClustersPerCh = new TH1F("hESDnTotClustersPerCh", "total number of associated clusters per chamber;chamber ID;#Sigma(n_{clusters})", nCh, -0.5, nCh-0.5);
6482f70b 1302 Add2ESDsList(hESDnTotClustersPerCh, AliMUONQAIndices::kESDnTotClustersPerCh, expert, !image);
ece56eb9 1303 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 1304 Add2ESDsList(hESDnTotClustersPerDE, AliMUONQAIndices::kESDnTotClustersPerDE, expert, !image);
ece56eb9 1305 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 1306 Add2ESDsList(hESDnTotFullClustersPerDE, AliMUONQAIndices::kESDnTotFullClustersPerDE, expert, !image);
ece56eb9 1307 TH1F* hESDSumClusterChargePerDE = new TH1F("hESDSumClusterChargePerDE", "sum of cluster charge per DE;DetElem ID;#Sigma(charge) (fC)", nDE+1, -0.5, nDE+0.5);
6482f70b 1308 Add2ESDsList(hESDSumClusterChargePerDE, AliMUONQAIndices::kESDSumClusterChargePerDE, expert, !image);
ece56eb9 1309 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 1310 Add2ESDsList(hESDSumClusterSizePerDE, AliMUONQAIndices::kESDSumClusterSizePerDE, expert, !image);
ece56eb9 1311 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 1312 Add2ESDsList(hESDSumResidualXPerDE, AliMUONQAIndices::kESDSumResidualXPerDE, expert, !image);
ece56eb9 1313 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 1314 Add2ESDsList(hESDSumResidualYPerDE, AliMUONQAIndices::kESDSumResidualYPerDE, expert, !image);
ece56eb9 1315 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 1316 Add2ESDsList(hESDSumResidualX2PerDE, AliMUONQAIndices::kESDSumResidualX2PerDE, expert, !image);
ece56eb9 1317 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 1318 Add2ESDsList(hESDSumResidualY2PerDE, AliMUONQAIndices::kESDSumResidualY2PerDE, expert, !image);
ece56eb9 1319 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 1320 Add2ESDsList(hESDSumLocalChi2XPerDE, AliMUONQAIndices::kESDSumLocalChi2XPerDE, expert, !image);
ece56eb9 1321 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 1322 Add2ESDsList(hESDSumLocalChi2YPerDE, AliMUONQAIndices::kESDSumLocalChi2YPerDE, expert, !image);
ece56eb9 1323 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 1324 Add2ESDsList(hESDSumLocalChi2PerDE, AliMUONQAIndices::kESDSumLocalChi2PerDE, expert, !image);
ece56eb9 1325}
1326
1327//____________________________________________________________________________
1328void AliMUONTrackerQADataMakerRec::MakeRaws(AliRawReader* rawReader)
1329{
1330 /// make QA for rawdata tracker
1331
b3d57767 1332 AliCodeTimerAuto(Form("%s",AliRecoParam::GetEventSpecieName(AliRecoParam::AConvert(Master()->GetEventSpecie()))),0);
ece56eb9 1333
b3d57767 1334 AliInfo(Form("rawReader class=%s",rawReader->ClassName()));
1335
ece56eb9 1336 /// forces init
6482f70b 1337 GetRawsData(AliMUONQAIndices::kTrackerBusPatchOccupancy);
ece56eb9 1338
b3d57767 1339 AliMUONTrackerDataMaker* dm = static_cast<AliMUONTrackerDataMaker*>(TrackerDataMaker(AliRecoParam::AConvert(Master()->GetEventSpecie())));
1340
1341 dm->SetRawReader(rawReader);
ece56eb9 1342
b3d57767 1343 Int_t eventType = rawReader->GetType();
64c2397e 1344
b3d57767 1345 if (eventType == AliRawEventHeaderBase::kPhysicsEvent )
1346 {
1347 dm->ProcessEvent();
1348
1349 FillEventSize(rawReader->GetEvent());
1350
1351 if ( dm->LastEventWasEmpty() )
1352 {
1353 TH1* hrostatus = GetRawsData(AliMUONQAIndices::kTrackerReadoutStatus);
1354
1355 if (hrostatus) hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofEmptyEvents);
1356 }
1357 }
ece56eb9 1358}
1359
1360//__________________________________________________________________
1361void AliMUONTrackerQADataMakerRec::MakeDigits(TTree* digitsTree)
1362{
1363 /// makes data from Digits
b3d57767 1364 AliCodeTimerAuto(Form("%s",AliRecoParam::GetEventSpecieName(AliRecoParam::AConvert(Master()->GetEventSpecie()))),0);
ece56eb9 1365
b3d57767 1366 /// forces init
1367
1368 GetDigitsData(AliMUONQAIndices::kTrackerBusPatchOccupancy);
ece56eb9 1369
1370 if (!fDigitStore)
1371 fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
1372 fDigitStore->Connect(*digitsTree, false);
1373 digitsTree->GetEvent(0);
1374
1375 TIter next(fDigitStore->CreateIterator());
1376
1377 AliMUONVDigit* dig = 0x0;
1378
b3d57767 1379 AliMUON2DMap oneEventData(true);
1380
ece56eb9 1381 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
b3d57767 1382 {
1383 if ( dig->IsTracker() )
ece56eb9 1384 {
b3d57767 1385 if ( dig->Charge() > 0.0 )
1386 {
1387
1388 Int_t detElemId = dig->DetElemId();
1389 Int_t manuId = dig->ManuId();
1390
1391 AliMUONVCalibParam* param = static_cast<AliMUONVCalibParam*>(oneEventData.FindObject(detElemId,manuId));
1392 if (!param)
1393 {
1394 param = new AliMUONCalibParamND(1,AliMpConstants::ManuNofChannels(),detElemId,manuId,
1395 AliMUONVCalibParam::InvalidFloatValue());
1396 oneEventData.Add(param);
1397 }
1398 param->SetValueAsDouble(dig->ManuChannel(),0,dig->Charge());
1399 }
ece56eb9 1400 }
b3d57767 1401 }
1402
1403 TrackerCalData(AliRecoParam::AConvert(Master()->GetEventSpecie()))->Add(oneEventData);
ece56eb9 1404}
1405
ece56eb9 1406//____________________________________________________________________________
1407void AliMUONTrackerQADataMakerRec::MakeRecPoints(TTree* clustersTree)
1408{
1409 /// Fill histograms related to tracker clusters
1410
1411 // First things first : do we have clusters in the TreeR ?
1412 // In "normal" production mode, it should be perfectly normal
1413 // *not* to have them.
1414 // But if for some reason we de-activated the combined tracking,
1415 // then we have clusters in TreeR, so let's take that opportunity
1416 // to QA them...
1417
b3d57767 1418 AliCodeTimerAuto(Form("%s",AliRecoParam::GetEventSpecieName(AliRecoParam::AConvert(Master()->GetEventSpecie()))),0);
1419 // Forces init by requesting an histogram
1420 GetRecPointsData(AliMUONQAIndices::kTrackerBusPatchOccupancy);
ece56eb9 1421
1422 if (!fClusterStore)
1423 {
1424 AliCodeTimerAuto("ClusterStore creation",1);
1425 fClusterStore = AliMUONVClusterStore::Create(*clustersTree);
1426 if (!fClusterStore)
1427 {
1428 return;
1429 }
1430 }
1431
1432 fClusterStore->Connect(*clustersTree,kFALSE);
1433 clustersTree->GetEvent(0);
1434
1435 TIter next(fClusterStore->CreateIterator());
1436 AliMUONVCluster* cluster;
1437
b3d57767 1438 AliMUONQAMappingCheck* mcr = MappingCheckRecPoints(AliRecoParam::AConvert(Master()->GetEventSpecie()));
1439
1440 if ( mcr ) mcr->NewEvent();
1441
1442 AliMUON2DMap oneEventData(true);
ece56eb9 1443
1444 while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) )
1445 {
1446 Int_t detElemId = cluster->GetDetElemId();
1447 Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
1448
6482f70b 1449 GetRecPointsData(AliMUONQAIndices::kTrackerNumberOfClustersPerDE)->Fill(detElemId);
1450 GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerDE+detElemId)->Fill(cluster->GetCharge());
1451 GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerDE+detElemId)->Fill(cluster->GetNDigits());
1452
1453 GetRecPointsData(AliMUONQAIndices::kTrackerNumberOfClustersPerChamber)->Fill(chamberId);
1454 GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerChamber+chamberId)->Fill(cluster->GetCharge());
1455 GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerChamber+chamberId)->Fill(cluster->GetNDigits());
b3d57767 1456 GetRecPointsData(AliMUONQAIndices::kTrackerClusterHitMapPerChamber+chamberId)->Fill(cluster->GetX(),cluster->GetY());
ece56eb9 1457
b3d57767 1458 if ( mcr ) mcr->Store(*cluster);
ece56eb9 1459
b3d57767 1460 for ( int i = 0; i < cluster->GetNDigits(); ++i )
1461 {
1462 UInt_t digitId = cluster->GetDigitId(i);
1463
1464 Int_t manuId = AliMUONVDigit::ManuId(digitId);
1465 Int_t manuChannel = AliMUONVDigit::ManuChannel(digitId);
1466
1467 AliMUONVCalibParam* param = static_cast<AliMUONVCalibParam*>(oneEventData.FindObject(detElemId,manuId));
1468 if (!param)
1469 {
1470 param = new AliMUONCalibParamND(1,AliMpConstants::ManuNofChannels(),detElemId,manuId,AliMUONVCalibParam::InvalidFloatValue());
1471 oneEventData.Add(param);
1472 }
1473 param->SetValueAsDouble(manuChannel,0,1.0);
1474 }
ece56eb9 1475 }
1476
b3d57767 1477 TrackerRecData(AliRecoParam::AConvert(Master()->GetEventSpecie()))->Add(oneEventData);
1478
ece56eb9 1479 fClusterStore->Clear();
1480}
1481
1482//____________________________________________________________________________
1483void AliMUONTrackerQADataMakerRec::MakeESDs(AliESDEvent* esd)
1484{
1485 /// make QA data from ESDs
1486
b3d57767 1487 AliCodeTimerAuto(Form("%s",AliRecoParam::GetEventSpecieName(AliRecoParam::AConvert(Master()->GetEventSpecie()))),0);
1488
ece56eb9 1489 // load ESD event in the interface
1490 AliMUONESDInterface esdInterface;
a99c3449 1491 if (GetRecoParam()) AliMUONESDInterface::ResetTracker(GetRecoParam(), kFALSE);
ece56eb9 1492 else AliError("Unable to get recoParam: use default ones for residual calculation");
1493 esdInterface.LoadEvent(*esd);
1494
6482f70b 1495 GetESDsData(AliMUONQAIndices::kESDnTracks)->Fill(esdInterface.GetNTracks());
ece56eb9 1496
1497 Int_t nTrackMatchTrig = 0;
1498
1499 // loop over tracks
1500 Int_t nTracks = (Int_t) esd->GetNumberOfMuonTracks();
1501 for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
1502
1503 // get the ESD track and skip "ghosts"
1504 AliESDMuonTrack* esdTrack = esd->GetMuonTrack(iTrack);
1505 if (!esdTrack->ContainTrackerData()) continue;
1506
1507 // get corresponding MUON track
1508 AliMUONTrack* track = esdInterface.FindTrack(esdTrack->GetUniqueID());
1509
1510 if (esdTrack->ContainTriggerData()) nTrackMatchTrig++;
1511
6482f70b 1512 GetESDsData(AliMUONQAIndices::kESDMomentum)->Fill(esdTrack->P());
1513 GetESDsData(AliMUONQAIndices::kESDPt)->Fill(esdTrack->Pt());
1514 GetESDsData(AliMUONQAIndices::kESDRapidity)->Fill(esdTrack->Y());
1515 GetESDsData(AliMUONQAIndices::kESDChi2)->Fill(track->GetNormalizedChi2());
1516 GetESDsData(AliMUONQAIndices::kESDProbChi2)->Fill(TMath::Prob(track->GetGlobalChi2(),track->GetNDF()));
1517 GetESDsData(AliMUONQAIndices::kESDThetaX)->Fill(esdTrack->GetThetaXUncorrected() / TMath::Pi() * 180.);
1518 GetESDsData(AliMUONQAIndices::kESDThetaY)->Fill(esdTrack->GetThetaYUncorrected() / TMath::Pi() * 180.);
1519 GetESDsData(AliMUONQAIndices::kESDnClustersPerTrack)->Fill(track->GetNClusters());
ece56eb9 1520
1521 // loop over clusters
1522 AliMUONTrackParam* trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->First());
1523 while (trackParam) {
1524
1525 AliMUONVCluster* cluster = trackParam->GetClusterPtr();
1526 Int_t chId = cluster->GetChamberId();
1527 Int_t deID = cluster->GetDetElemId();
1528 Double_t residualX = cluster->GetX() - trackParam->GetNonBendingCoor();
1529 Double_t residualY = cluster->GetY() - trackParam->GetBendingCoor();
1530 Double_t sigmaResidualX2 = cluster->GetErrX2() - trackParam->GetCovariances()(0,0);
1531 Double_t sigmaResidualY2 = cluster->GetErrY2() - trackParam->GetCovariances()(2,2);
1532 Double_t localChi2X = (sigmaResidualX2 > 0.) ? residualX*residualX/sigmaResidualX2 : 0.;
1533 Double_t localChi2Y = (sigmaResidualY2 > 0.) ? residualY*residualY/sigmaResidualY2 : 0.;
1534 Double_t localChi2 = 0.5 * trackParam->GetLocalChi2();
1535
6482f70b 1536 GetESDsData(AliMUONQAIndices::kESDClusterHitMap+chId)->Fill(cluster->GetX(), cluster->GetY());
ece56eb9 1537
6482f70b 1538 GetESDsData(AliMUONQAIndices::kESDnTotClustersPerCh)->Fill(chId);
1539 GetESDsData(AliMUONQAIndices::kESDnTotClustersPerDE)->Fill(deID);
ece56eb9 1540
6482f70b 1541 GetESDsData(AliMUONQAIndices::kESDClusterChargeInCh+chId)->Fill(cluster->GetCharge());
1542 GetESDsData(AliMUONQAIndices::kESDSumClusterChargePerDE)->Fill(deID, cluster->GetCharge());
ece56eb9 1543
1544 if (cluster->GetNDigits() > 0) { // discard clusters with pad not stored in ESD
6482f70b 1545 GetESDsData(AliMUONQAIndices::kESDnTotFullClustersPerDE)->Fill(deID);
1546 GetESDsData(AliMUONQAIndices::kESDClusterSizeInCh+chId)->Fill(cluster->GetNDigits());
1547 GetESDsData(AliMUONQAIndices::kESDSumClusterSizePerDE)->Fill(deID, cluster->GetNDigits());
ece56eb9 1548 }
1549
6482f70b 1550 GetESDsData(AliMUONQAIndices::kESDResidualXInCh+chId)->Fill(residualX);
1551 GetESDsData(AliMUONQAIndices::kESDResidualYInCh+chId)->Fill(residualY);
1552 GetESDsData(AliMUONQAIndices::kESDSumResidualXPerDE)->Fill(deID, residualX);
1553 GetESDsData(AliMUONQAIndices::kESDSumResidualYPerDE)->Fill(deID, residualY);
1554 GetESDsData(AliMUONQAIndices::kESDSumResidualX2PerDE)->Fill(deID, residualX*residualX);
1555 GetESDsData(AliMUONQAIndices::kESDSumResidualY2PerDE)->Fill(deID, residualY*residualY);
ece56eb9 1556
6482f70b 1557 GetESDsData(AliMUONQAIndices::kESDLocalChi2XInCh+chId)->Fill(localChi2X);
1558 GetESDsData(AliMUONQAIndices::kESDLocalChi2YInCh+chId)->Fill(localChi2Y);
1559 GetESDsData(AliMUONQAIndices::kESDLocalChi2InCh+chId)->Fill(localChi2);
1560 GetESDsData(AliMUONQAIndices::kESDSumLocalChi2XPerDE)->Fill(deID, localChi2X);
1561 GetESDsData(AliMUONQAIndices::kESDSumLocalChi2YPerDE)->Fill(deID, localChi2Y);
1562 GetESDsData(AliMUONQAIndices::kESDSumLocalChi2PerDE)->Fill(deID, localChi2);
ece56eb9 1563
1564 trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->After(trackParam));
1565
1566 }
1567
1568 }
1569
6482f70b 1570 GetESDsData(AliMUONQAIndices::kESDMatchTrig)->Fill(nTrackMatchTrig);
ece56eb9 1571
1572}
1573
1574//____________________________________________________________________________
1575AliMUONVTrackerData* AliMUONTrackerQADataMakerRec::GetTrackerData() const
1576{
b3d57767 1577 /// Return tracker data
ece56eb9 1578
b3d57767 1579 return TrackerDataMaker(AliRecoParam::AConvert(Master()->GetEventSpecie()))->Data();
ece56eb9 1580}
152fe71e 1581
1582//____________________________________________________________________________
1583void
1584AliMUONTrackerQADataMakerRec::ResetDetectorRaws(TObjArray* list)
1585{
1586 /// Reset those histograms that must be reset (and only those), plus
1587 /// the trackerdata itself.
1588
1589 TIter next(list);
1590 TObject* o;
1591 while ( ( o = next() ) )
1592 {
1593 TH1* h = dynamic_cast<TH1*>(o);
1594 if (h)
1595 {
1596 TString hn(h->GetName());
1597
1598 if ( hn.Contains("Tracker") )
1599 {
b71c3d2d 1600 if ( !hn.Contains("hTrackerBusPatchNofPads") &&
b71c3d2d 1601 !hn.Contains("hTrackerBusPatchConfig" ) )
152fe71e 1602 {
1603 AliDebug(1,Form("Resetting %s",hn.Data()));
1604 h->Reset();
1605 }
1606 }
1607 else
1608 {
1609 AliDebug(1,Form("Will not reset histogram %s",hn.Data()));
1610 }
1611 }
1612 else
1613 {
1614 AliMUONVTrackerData* d = dynamic_cast<AliMUONVTrackerData*>(o);
1615 if (d)
1616 {
1617 AliDebug(1,Form("Resetting %s",d->GetName()));
1618 d->Clear();
1619 }
1620 else
1621 {
1622 AliError(Form("Found an object of class %s. Do not know how to reset.",o->ClassName()));
1623 }
1624 }
1625 }
c00bc129 1626}
b3d57767 1627
1628//____________________________________________________________________________
1629TObjArray* AliMUONTrackerQADataMakerRec::GetArray(TObjArray*& array, Bool_t create)
1630{
1631 /// Get (or create) the array
1632
1633 if ( ! array )
1634 {
1635 if ( create )
1636 {
1637 array = new TObjArray(AliRecoParam::kNSpecies);
1638 }
1639 }
1640
1641 return array;
1642}
1643
1644//____________________________________________________________________________
1645AliMUONVTrackerDataMaker*
1646AliMUONTrackerQADataMakerRec::TrackerDataMaker(Int_t specieIndex) const
1647{
1648 /// const version of the getter
1649 if ( fTrackerDataMakerArray )
1650 {
1651 return static_cast<AliMUONVTrackerDataMaker*>(fTrackerDataMakerArray->At(specieIndex));
1652 }
1653 return 0x0;
1654}
1655
1656//____________________________________________________________________________
1657AliMUONVTrackerDataMaker*
1658AliMUONTrackerQADataMakerRec::TrackerDataMaker(Int_t specieIndex, Bool_t create)
1659{
1660 /// Get (or create) TrackerDataMaker object for a given specie
1661
1662 TObjArray* array = GetArray(fTrackerDataMakerArray,create);
1663 TObject* o(0x0);
1664
1665 if ( array )
1666 {
1667 array->SetOwner(kTRUE);
1668 o = array->At(specieIndex);
1669 if (!o && create)
1670 {
1671
1672 AliMUONTrackerDataMaker* dm = new AliMUONTrackerDataMaker(0x0,
1673 AliCDBManager::Instance()->GetRun(),
1674 0x0,
1675 "",
1676 "",
1677 kFALSE,
1678 0.0,0.0);
1679
1680 if (!fLogger) fLogger = new AliMUONLogger(-1); // note that we share the logger between species... should not be a big deal though
1681 dm->EnableErrorLogger(fLogger);
1682 dm->Data()->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level
1683 dm->Data()->SetName("RawCharges");
1684 dm->SetRunning(kTRUE);
1685
1686 o = dm;
1687 array->AddAt(o,specieIndex);
1688 }
1689 }
1690 return static_cast<AliMUONVTrackerDataMaker*>(o);
1691}
1692
1693//____________________________________________________________________________
1694AliMUONVTrackerData*
1695AliMUONTrackerQADataMakerRec::TrackerCalData(Int_t specieIndex, Bool_t create)
1696{
1697 TObjArray* array = GetArray(fTrackerCalDataArray,create);
1698 TObject* o(0x0);
1699
1700 if (array)
1701 {
1702 array->SetOwner(kFALSE); // as the tracker data will be attached to fQADigitsList which will become the owner
1703 o = array->At(specieIndex);
1704 if (!o && create)
1705 {
1706 AliMUONTrackerData* data = new AliMUONTrackerData("CalCharges",Form("Calibrated charges (fC) %s",GetRecoParam()->GetCalibrationMode()),1);
1707 data->SetDimensionName(0,"charge");
1708 data->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level
1709 o=data;
1710 array->AddAt(o,specieIndex);
1711 }
1712 }
1713 return static_cast<AliMUONVTrackerData*>(o);
1714}
1715
1716//____________________________________________________________________________
1717AliMUONVTrackerData*
1718AliMUONTrackerQADataMakerRec::TrackerRecData(Int_t specieIndex, Bool_t create)
1719{
1720 TObjArray* array = GetArray(fTrackerRecDataArray,create);
1721 TObject* o(0x0);
1722
1723 if (array)
1724 {
1725 array->SetOwner(kFALSE); // as the tracker data will be attached to fQARecPointsList which will become the owner
1726 o = array->At(specieIndex);
1727 if (!o && create)
1728 {
1729 AliMUONTrackerData* data = new AliMUONTrackerData("RecCharges",Form("Calibrated charges (fC) %s for digits belonging to a reconstructed cluster",GetRecoParam()->GetCalibrationMode()),1);
1730 data->SetDimensionName(0,"one");
1731 data->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level
1732 o=data;
1733 array->AddAt(o,specieIndex);
1734 }
1735 }
1736 return static_cast<AliMUONVTrackerData*>(o);
1737}
1738
1739//____________________________________________________________________________
1740AliMUONQAMappingCheck*
1741AliMUONTrackerQADataMakerRec::MappingCheckRecPoints(Int_t specieIndex, Bool_t create)
1742{
1743 TObjArray* array = GetArray(fMappingCheckRecPointsArray,create);
1744 TObject* o(0x0);
1745
1746 if (array)
1747 {
1748 array->SetOwner(kTRUE);
1749 o = array->At(specieIndex);
1750 if (!o && create)
1751 {
1752 AliMUONQAMappingCheck* mcheck = new AliMUONQAMappingCheck(RunNumber());
1753 o=mcheck;
1754 array->AddAt(o,specieIndex);
1755 }
1756 }
1757 return static_cast<AliMUONQAMappingCheck*>(o);
1758}