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