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