1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 // $Id: AliMUONTrackerQADataMakerRec.cxx 35760 2009-10-21 21:45:42Z ivana $
18 // --- MUON header files ---
19 #include "AliMUONTrackerQADataMakerRec.h"
21 #include "AliCDBManager.h"
22 #include "AliCodeTimer.h"
24 #include "AliESDEvent.h"
25 #include "AliESDMuonTrack.h"
27 #include "AliMUON2DMap.h"
28 #include "AliMUONCalibParamND.h"
29 #include "AliMUONCalibrationData.h"
30 #include "AliMUONConstants.h"
31 #include "AliMUONDigitMaker.h"
32 #include "AliMUONESDInterface.h"
33 #include "AliMUONLogger.h"
34 #include "AliMUONQADataMakerRec.h"
35 #include "AliMUONQAIndices.h"
36 #include "AliMUONQAMappingCheck.h"
37 #include "AliMUONTrack.h"
38 #include "AliMUONTrackParam.h"
39 #include "AliMUONTrackerData.h"
40 #include "AliMUONTrackerDataMaker.h"
41 #include "AliMUONVCluster.h"
42 #include "AliMUONVClusterStore.h"
43 #include "AliMUONVDigit.h"
44 #include "AliMUONVDigit.h"
45 #include "AliMUONVDigitStore.h"
46 #include "AliMpBusPatch.h"
47 #include "AliMpConstants.h"
49 #include "AliMpDDLStore.h"
50 #include "AliMpDEIterator.h"
51 #include "AliMpDEManager.h"
52 #include "AliMpDetElement.h"
53 #include "AliMpManuIterator.h"
55 #include "AliRawReader.h"
56 #include "AliRawEventHeaderBase.h"
57 #include <Riostream.h>
62 #include <TObjArray.h>
63 #include <TPaveText.h>
65 //-----------------------------------------------------------------------------
66 /// \class AliMUONTrackerQADataMakerRec
68 /// Quality assurance data (histo) maker for MUON tracker
71 /// Note that all the methods of this class shoud not be called when eventSpecie is AliRecoParam::kCalib !
73 /// \author C. Finck, D. Stocco, L. Aphecetche
76 ClassImp(AliMUONTrackerQADataMakerRec)
81 Double_t ProtectedSqrt(Double_t x)
83 return ( x > 0.0 ? TMath::Sqrt(x) : 0.0 );
88 //____________________________________________________________________________
89 AliMUONTrackerQADataMakerRec::AliMUONTrackerQADataMakerRec(AliQADataMakerRec* master) :
90 AliMUONVQADataMakerRec(master),
92 fDigitMaker(new AliMUONDigitMaker(kTRUE)),
94 fCalibrationData(new AliMUONCalibrationData(AliCDBManager::Instance()->GetRun())),
100 fTrackerDataMakerArray(0x0),
101 fTrackerCalDataArray(0x0),
102 fTrackerRecDataArray(0x0),
103 fMappingCheckRecPointsArray(0x0)
108 //__________________________________________________________________
109 AliMUONTrackerQADataMakerRec::~AliMUONTrackerQADataMakerRec()
114 delete fClusterStore;
115 delete fCalibrationData;
116 delete fMappingCheckRecPointsArray;
119 if ( fLogger->NumberOfEntries() != 0 )
121 AliError("Some unprocessed logged errors are still there... Please check");
125 delete fTrackerDataMakerArray;
126 delete fTrackerCalDataArray;
127 delete fTrackerRecDataArray;
128 delete fBusPatchConfig;
131 //____________________________________________________________________________
132 void AliMUONTrackerQADataMakerRec::InsertTrackerData(Int_t specie,
138 /// Insert an object to a given list
140 TIter next(list[specie]);
143 Bool_t alreadyThere(kFALSE);
145 while ( ( o = next() ) && !alreadyThere )
147 TString classname(o->ClassName());
148 if ( classname.Contains("TrackerData") )
150 if ( !strcmp(object->GetName(),o->GetName()) )
152 alreadyThere = kTRUE;
157 if ( (!alreadyThere && object) || (alreadyThere && replace) )
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);
168 //____________________________________________________________________________
169 void AliMUONTrackerQADataMakerRec::EndOfDetectorCycleESDs(Int_t, TObjArray**)
171 /// Normalize ESD histograms
173 if (!GetESDsData(AliMUONQAIndices::kESDnClustersPerTrack)) return;
175 AliCodeTimerAuto("",0);
177 Double_t nTracks = GetESDsData(AliMUONQAIndices::kESDnClustersPerTrack)->GetEntries();
178 if (nTracks <= 0) return;
180 TH1* hESDnClustersPerCh = GetESDsData(AliMUONQAIndices::kESDnClustersPerCh);
181 TH1* hESDnClustersPerDE = GetESDsData(AliMUONQAIndices::kESDnClustersPerDE);
182 TH1* hESDClusterChargePerChMean = GetESDsData(AliMUONQAIndices::kESDClusterChargePerChMean);
183 TH1* hESDClusterChargePerChSigma = GetESDsData(AliMUONQAIndices::kESDClusterChargePerChSigma);
184 TH1* hESDClusterSizePerChMean = GetESDsData(AliMUONQAIndices::kESDClusterSizePerChMean);
185 TH1* hESDClusterSizePerChSigma = GetESDsData(AliMUONQAIndices::kESDClusterSizePerChSigma);
186 TH1* hESDResidualXPerChMean = GetESDsData(AliMUONQAIndices::kESDResidualXPerChMean);
187 TH1* hESDResidualXPerChSigma = GetESDsData(AliMUONQAIndices::kESDResidualXPerChSigma);
188 TH1* hESDResidualYPerChMean = GetESDsData(AliMUONQAIndices::kESDResidualYPerChMean);
189 TH1* hESDResidualYPerChSigma = GetESDsData(AliMUONQAIndices::kESDResidualYPerChSigma);
190 TH1* hESDLocalChi2XPerChMean = GetESDsData(AliMUONQAIndices::kESDLocalChi2XPerChMean);
191 TH1* hESDLocalChi2YPerChMean = GetESDsData(AliMUONQAIndices::kESDLocalChi2YPerChMean);
192 TH1* hESDLocalChi2PerChMean = GetESDsData(AliMUONQAIndices::kESDLocalChi2PerChMean);
193 TH1* hESDClusterChargePerDE = GetESDsData(AliMUONQAIndices::kESDClusterChargePerDE);
194 TH1* hESDClusterSizePerDE = GetESDsData(AliMUONQAIndices::kESDClusterSizePerDE);
195 TH1* hESDResidualXPerDEMean = GetESDsData(AliMUONQAIndices::kESDResidualXPerDEMean);
196 TH1* hESDResidualXPerDESigma = GetESDsData(AliMUONQAIndices::kESDResidualXPerDESigma);
197 TH1* hESDResidualYPerDEMean = GetESDsData(AliMUONQAIndices::kESDResidualYPerDEMean);
198 TH1* hESDResidualYPerDESigma = GetESDsData(AliMUONQAIndices::kESDResidualYPerDESigma);
199 TH1* hESDLocalChi2XPerDEMean = GetESDsData(AliMUONQAIndices::kESDLocalChi2XPerDEMean);
200 TH1* hESDLocalChi2YPerDEMean = GetESDsData(AliMUONQAIndices::kESDLocalChi2YPerDEMean);
201 TH1* hESDLocalChi2PerDEMean = GetESDsData(AliMUONQAIndices::kESDLocalChi2PerDEMean);
202 TH1* hESDnTotClustersPerCh = GetESDsData(AliMUONQAIndices::kESDnTotClustersPerCh);
203 TH1* hESDnTotClustersPerDE = GetESDsData(AliMUONQAIndices::kESDnTotClustersPerDE);
204 TH1* hESDnTotFullClustersPerDE = GetESDsData(AliMUONQAIndices::kESDnTotFullClustersPerDE);
205 TH1* hESDSumClusterChargePerDE = GetESDsData(AliMUONQAIndices::kESDSumClusterChargePerDE);
206 TH1* hESDSumClusterSizePerDE = GetESDsData(AliMUONQAIndices::kESDSumClusterSizePerDE);
207 TH1* hESDSumResidualXPerDE = GetESDsData(AliMUONQAIndices::kESDSumResidualXPerDE);
208 TH1* hESDSumResidualYPerDE = GetESDsData(AliMUONQAIndices::kESDSumResidualYPerDE);
209 TH1* hESDSumResidualX2PerDE = GetESDsData(AliMUONQAIndices::kESDSumResidualX2PerDE);
210 TH1* hESDSumResidualY2PerDE = GetESDsData(AliMUONQAIndices::kESDSumResidualY2PerDE);
211 TH1* hESDSumLocalChi2XPerDE = GetESDsData(AliMUONQAIndices::kESDSumLocalChi2XPerDE);
212 TH1* hESDSumLocalChi2YPerDE = GetESDsData(AliMUONQAIndices::kESDSumLocalChi2YPerDE);
213 TH1* hESDSumLocalChi2PerDE = GetESDsData(AliMUONQAIndices::kESDSumLocalChi2PerDE);
215 hESDnClustersPerCh->Reset();
216 hESDnClustersPerDE->Reset();
217 hESDnClustersPerCh->Add(hESDnTotClustersPerCh, 1./nTracks);
218 hESDnClustersPerDE->Add(hESDnTotClustersPerDE, 1./nTracks);
220 // loop over chambers
221 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
223 TH1* hESDClusterChargeInCh = GetESDsData(AliMUONQAIndices::kESDClusterChargeInCh+iCh);
224 Double_t sigmaCharge = hESDClusterChargeInCh->GetRMS();
225 hESDClusterChargePerChMean->SetBinContent(iCh+1, hESDClusterChargeInCh->GetMean());
226 hESDClusterChargePerChMean->SetBinError(iCh+1, hESDClusterChargeInCh->GetMeanError());
227 hESDClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
228 hESDClusterChargePerChSigma->SetBinError(iCh+1, hESDClusterChargeInCh->GetRMSError());
230 TH1* hESDClusterSizeInCh = GetESDsData(AliMUONQAIndices::kESDClusterSizeInCh+iCh);
231 Double_t sigmaSize = hESDClusterSizeInCh->GetRMS();
232 hESDClusterSizePerChMean->SetBinContent(iCh+1, hESDClusterSizeInCh->GetMean());
233 hESDClusterSizePerChMean->SetBinError(iCh+1, hESDClusterSizeInCh->GetMeanError());
234 hESDClusterSizePerChSigma->SetBinContent(iCh+1, sigmaSize);
235 hESDClusterSizePerChSigma->SetBinError(iCh+1, hESDClusterSizeInCh->GetRMSError());
237 TH1* hESDResidualXInCh = GetESDsData(AliMUONQAIndices::kESDResidualXInCh+iCh);
238 Double_t sigmaResidualX = hESDResidualXInCh->GetRMS();
239 hESDResidualXPerChMean->SetBinContent(iCh+1, hESDResidualXInCh->GetMean());
240 hESDResidualXPerChMean->SetBinError(iCh+1, hESDResidualXInCh->GetMeanError());
241 hESDResidualXPerChSigma->SetBinContent(iCh+1, sigmaResidualX);
242 hESDResidualXPerChSigma->SetBinError(iCh+1, hESDResidualXInCh->GetRMSError());
244 TH1* hESDResidualYInCh = GetESDsData(AliMUONQAIndices::kESDResidualYInCh+iCh);
245 Double_t sigmaResidualY = hESDResidualYInCh->GetRMS();
246 hESDResidualYPerChMean->SetBinContent(iCh+1, hESDResidualYInCh->GetMean());
247 hESDResidualYPerChMean->SetBinError(iCh+1, hESDResidualYInCh->GetMeanError());
248 hESDResidualYPerChSigma->SetBinContent(iCh+1, sigmaResidualY);
249 hESDResidualYPerChSigma->SetBinError(iCh+1, hESDResidualYInCh->GetRMSError());
251 TH1* hESDLocalChi2XInCh = GetESDsData(AliMUONQAIndices::kESDLocalChi2XInCh+iCh);
252 Double_t sigmaLocalChi2X = hESDLocalChi2XInCh->GetRMS();
253 hESDLocalChi2XPerChMean->SetBinContent(iCh+1, hESDLocalChi2XInCh->GetMean());
254 hESDLocalChi2XPerChMean->SetBinError(iCh+1, hESDLocalChi2XInCh->GetMeanError());
256 TH1* hESDLocalChi2YInCh = GetESDsData(AliMUONQAIndices::kESDLocalChi2YInCh+iCh);
257 Double_t sigmaLocalChi2Y = hESDLocalChi2YInCh->GetRMS();
258 hESDLocalChi2YPerChMean->SetBinContent(iCh+1, hESDLocalChi2YInCh->GetMean());
259 hESDLocalChi2YPerChMean->SetBinError(iCh+1, hESDLocalChi2YInCh->GetMeanError());
261 TH1* hESDLocalChi2InCh = GetESDsData(AliMUONQAIndices::kESDLocalChi2InCh+iCh);
262 Double_t sigmaLocalChi2 = hESDLocalChi2InCh->GetRMS();
263 hESDLocalChi2PerChMean->SetBinContent(iCh+1, hESDLocalChi2InCh->GetMean());
264 hESDLocalChi2PerChMean->SetBinError(iCh+1, hESDLocalChi2InCh->GetMeanError());
266 // loop over DE into chamber iCh
269 while ( !it.IsDone()) {
271 Int_t iDE = it.CurrentDEId();
273 Double_t nClusters = hESDnTotClustersPerDE->GetBinContent(iDE+1);
276 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1)/nClusters);
277 hESDClusterChargePerDE->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
279 Double_t meanResX = hESDSumResidualXPerDE->GetBinContent(iDE+1)/nClusters;
280 hESDResidualXPerDEMean->SetBinContent(iDE+1, meanResX);
281 hESDResidualXPerDEMean->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(nClusters));
282 hESDResidualXPerDESigma->SetBinContent(iDE+1, ProtectedSqrt(hESDSumResidualX2PerDE->GetBinContent(iDE+1)/nClusters - meanResX*meanResX));
283 hESDResidualXPerDESigma->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(2.*nClusters));
285 Double_t meanResY = hESDSumResidualYPerDE->GetBinContent(iDE+1)/nClusters;
286 hESDResidualYPerDEMean->SetBinContent(iDE+1, meanResY);
287 hESDResidualYPerDEMean->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(nClusters));
288 hESDResidualYPerDESigma->SetBinContent(iDE+1, ProtectedSqrt(hESDSumResidualY2PerDE->GetBinContent(iDE+1)/nClusters - meanResY*meanResY));
289 hESDResidualYPerDESigma->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(2.*nClusters));
291 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)/nClusters);
292 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, sigmaLocalChi2X/TMath::Sqrt(nClusters));
294 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1)/nClusters);
295 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, sigmaLocalChi2Y/TMath::Sqrt(nClusters));
297 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1)/nClusters);
298 hESDLocalChi2PerDEMean->SetBinError(iDE+1, sigmaLocalChi2/TMath::Sqrt(nClusters));
302 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1));
303 hESDClusterChargePerDE->SetBinError(iDE+1, hESDClusterChargeInCh->GetXaxis()->GetXmax());
305 hESDResidualXPerDEMean->SetBinContent(iDE+1, hESDSumResidualXPerDE->GetBinContent(iDE+1));
306 hESDResidualXPerDEMean->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
307 hESDResidualXPerDESigma->SetBinContent(iDE+1, 0.);
308 hESDResidualXPerDESigma->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
310 hESDResidualYPerDEMean->SetBinContent(iDE+1, hESDSumResidualYPerDE->GetBinContent(iDE+1));
311 hESDResidualYPerDEMean->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
312 hESDResidualYPerDESigma->SetBinContent(iDE+1, 0.);
313 hESDResidualYPerDESigma->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
315 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1));
316 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, hESDLocalChi2XInCh->GetXaxis()->GetXmax());
318 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1));
319 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, hESDLocalChi2YInCh->GetXaxis()->GetXmax());
321 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1));
322 hESDLocalChi2PerDEMean->SetBinError(iDE+1, hESDLocalChi2InCh->GetXaxis()->GetXmax());
326 Double_t nFullClusters = hESDnTotFullClustersPerDE->GetBinContent(iDE+1);
327 if (nFullClusters > 1) {
329 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1)/nFullClusters);
330 hESDClusterSizePerDE->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nFullClusters));
334 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1));
335 hESDClusterSizePerDE->SetBinError(iDE+1, hESDClusterSizeInCh->GetXaxis()->GetXmax());
346 //____________________________________________________________________________
347 void AliMUONTrackerQADataMakerRec::EndOfDetectorCycleRecPoints(Int_t specie, TObjArray** list)
349 /// Normalize RecPoints histograms
351 if (!GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerChMean)) return;
353 AliCodeTimerAuto("",0);
355 TH1* hTrackerClusterChargePerChMean = GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerChMean);
356 TH1* hTrackerClusterChargePerChSigma = GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerChSigma);
357 TH1* hTrackerClusterMultiplicityPerChMean = GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerChMean);
358 TH1* hTrackerClusterMultiplicityPerChSigma = GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerChSigma);
359 TH1* hTrackerClusterChargePerDEMean = GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerDEMean);
360 TH1* hTrackerClusterMultiplicityPerDEMean = GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerDEMean);
362 // loop over chambers
363 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
365 TH1* hTrackerClusterChargePerChamber = GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerChamber+iCh);
366 Double_t sigmaCharge = hTrackerClusterChargePerChamber->GetRMS();
367 hTrackerClusterChargePerChMean->SetBinContent(iCh+1, hTrackerClusterChargePerChamber->GetMean());
368 hTrackerClusterChargePerChMean->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetMeanError());
369 hTrackerClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
370 hTrackerClusterChargePerChSigma->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetRMSError());
372 TH1* hTrackerClusterMultiplicityPerChamber = GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerChamber+iCh);
373 Double_t sigmaSize = hTrackerClusterMultiplicityPerChamber->GetRMS();
374 hTrackerClusterMultiplicityPerChMean->SetBinContent(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMean());
375 hTrackerClusterMultiplicityPerChMean->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMeanError());
376 hTrackerClusterMultiplicityPerChSigma->SetBinContent(iCh+1, sigmaSize);
377 hTrackerClusterMultiplicityPerChSigma->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetRMSError());
379 // loop over DE into chamber iCh
382 while ( !it.IsDone()) {
384 Int_t iDE = it.CurrentDEId();
386 TH1* hTrackerClusterChargePerDE = GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerDE+iDE);
387 hTrackerClusterChargePerDEMean->SetBinContent(iDE+1, hTrackerClusterChargePerDE->GetMean());
388 Double_t nClusters = hTrackerClusterChargePerDE->GetEntries();
389 if (nClusters > 1) hTrackerClusterChargePerDEMean->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
390 else hTrackerClusterChargePerDEMean->SetBinError(iDE+1, hTrackerClusterChargePerChamber->GetXaxis()->GetXmax());
392 TH1* hTrackerClusterMultiplicityPerDE = GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerDE+iDE);
393 hTrackerClusterMultiplicityPerDEMean->SetBinContent(iDE+1, hTrackerClusterMultiplicityPerDE->GetMean());
394 nClusters = hTrackerClusterMultiplicityPerDE->GetEntries();
395 if (nClusters > 1) hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nClusters));
396 else hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, hTrackerClusterMultiplicityPerChamber->GetXaxis()->GetXmax());
402 if ( MappingCheckRecPoints(specie) )
404 InsertTrackerData(specie,list,MappingCheckRecPoints(specie)->CreateData("RecPoints"),AliMUONQAIndices::kTrackerRecPoints,kTRUE);
407 if ( TrackerRecData(specie) )
409 /// put the trackerdata in the pipeline
410 InsertTrackerData(specie,list,TrackerRecData(specie),AliMUONQAIndices::kTrackerData);
412 TH1* hbp = GetRecPointsData(AliMUONQAIndices::kTrackerBusPatchOccupancy);
413 TH1* hnevents = GetRecPointsData(AliMUONQAIndices::kTrackerNofGoodPhysicsEventsUsed);
414 TH1* hddl = GetRecPointsData(AliMUONQAIndices::kTrackerDDLOccupancy);
415 TH1* hddlevents = GetRecPointsData(AliMUONQAIndices::kTrackerDDLNofEventsUsed);
417 if ( !hbp || !hnevents || !hddl || !hddlevents)
419 AliError(Form("Missing some histograms : cannot work : hbp=%p hnevents=%p hddl=%p hddlevents=%p",hbp,hnevents,hddl,hddlevents));
423 ProjectTrackerData(TrackerRecData(specie),
424 *hbp,*hnevents,*hddl,*hddlevents);
428 AliError(Form("TrackerRecData is null for specie %s",AliRecoParam::GetEventSpecieName(specie)));
433 //____________________________________________________________________________
434 void AliMUONTrackerQADataMakerRec::EndOfDetectorCycleDigits(Int_t specie, TObjArray** list)
436 /// create digits histograms in digits subdir
438 if ( TrackerCalData(specie) )
440 AliCodeTimerAuto("",0);
442 /// put the trackerdata in the pipeline
443 InsertTrackerData(specie,list,TrackerCalData(specie),AliMUONQAIndices::kTrackerData);
445 TH1* hbp = GetDigitsData(AliMUONQAIndices::kTrackerBusPatchOccupancy);
446 TH1* hnevents = GetDigitsData(AliMUONQAIndices::kTrackerNofGoodPhysicsEventsUsed);
447 TH1* hddl = GetDigitsData(AliMUONQAIndices::kTrackerDDLOccupancy);
448 TH1* hddlevents = GetDigitsData(AliMUONQAIndices::kTrackerDDLNofEventsUsed);
450 if ( !hbp || !hnevents || !hddl || !hddlevents)
452 AliError(Form("Missing some histograms : cannot work : hbp=%p hnevents=%p hddl=%p hddlevents=%p",hbp,hnevents,hddl,hddlevents));
456 ProjectTrackerData(TrackerCalData(specie),
457 *hbp,*hnevents,*hddl,*hddlevents);
461 //____________________________________________________________________________
462 AliMUONQADataMakerRec* AliMUONTrackerQADataMakerRec::Master() const
465 return static_cast<AliMUONQADataMakerRec*>(fMaster);
468 //____________________________________________________________________________
469 void AliMUONTrackerQADataMakerRec::ProjectTrackerData(AliMUONVTrackerData* data,
475 /// Project tracker data into shifter-friendly histograms
477 AliCodeTimerAuto(Form("%s",data->Name()),0);
479 /// project the tracerdata into buspatch occupancies (for the experts)
481 hbp.SetStats(kFALSE);
483 TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator());
484 AliMpBusPatch* bp(0x0);
487 while ( ( bp = static_cast<AliMpBusPatch*>(nextBP())) )
489 Int_t busPatchId = bp->GetId();
490 Int_t bin = hbp.FindBin(busPatchId);
491 if ( data->HasBusPatch(busPatchId) )
493 hbp.SetBinContent(bin,data->BusPatch(busPatchId,occDim)*100.0); // occupancy, in percent
497 /// log the readout errors (for the shifter)
499 hnevents.SetStats(kFALSE);
500 hnevents.SetBinContent(1,data->NumberOfEvents(-1));
502 /// project tracker data into DDL occupancies (for the shifter)
504 hddl.SetStats(kFALSE);
506 hddlevents.SetStats(kFALSE);
508 const Int_t nddls = AliDAQ::NumberOfDdls("MUONTRK");
509 const Int_t offset = AliDAQ::DdlIDOffset("MUONTRK");
511 for ( Int_t iddl = 0; iddl < nddls; ++iddl )
513 AliMpDDL* ddl = AliMpDDLStore::Instance()->GetDDL(iddl);
515 Int_t ddlId = offset + ddl->GetId();
518 Int_t nevents = data->NumberOfEvents(iddl);
520 hddlevents.Fill(ddlId,nevents);
526 for ( Int_t ide = 0; ide < ddl->GetNofDEs(); ++ide )
528 Int_t de = ddl->GetDEId(ide);
530 npads += TMath::Nint(data->DetectionElement(de,3));
532 occ += data->DetectionElement(de,4);
537 occ = occ/npads/nevents;
545 hddl.Fill(ddlId,100.0*occ); // occ in percent
548 TPaveText* text = new TPaveText(0.50,0.8,0.9,0.9,"NDC");
550 text->AddText(Form("MCH RUN %d - %d events",AliCDBManager::Instance()->GetRun(),data->NumberOfEvents(-1)));
552 hddl.GetListOfFunctions()->Add(text);
555 //____________________________________________________________________________
556 void AliMUONTrackerQADataMakerRec::EndOfDetectorCycleRaws(Int_t specie, TObjArray** list)
558 /// create Raws histograms in Raws subdir
560 if ( TrackerDataMaker(specie) && TrackerDataMaker(specie)->Data() )
562 AliCodeTimerAuto("",0);
564 /// put the trackerdata in the pipeline
565 InsertTrackerData(specie,list,TrackerDataMaker(specie)->Data(),AliMUONQAIndices::kTrackerData);
566 TrackerDataMaker(specie)->SetOwnerOfData(kFALSE); // now that it's attached to list, list will take care of the deletion
568 TH1* hbp = GetRawsData(AliMUONQAIndices::kTrackerBusPatchOccupancy);
569 TH1* hnevents = GetRawsData(AliMUONQAIndices::kTrackerNofGoodPhysicsEventsUsed);
570 TH1* hddl = GetRawsData(AliMUONQAIndices::kTrackerDDLOccupancy);
571 TH1* hddlevents = GetRawsData(AliMUONQAIndices::kTrackerDDLNofEventsUsed);
573 if ( !hbp || !hnevents || !hddl || !hddlevents)
575 AliError(Form("Missing some histograms : cannot work : hbp=%p hnevents=%p hddl=%p hddlevents=%p",hbp,hnevents,hddl,hddlevents));
579 ProjectTrackerData(TrackerDataMaker(specie)->Data(),
580 *hbp,*hnevents,*hddl,*hddlevents);
582 if ( fLogger->NumberOfEntries() > 0 )
585 FillReadoutStatus(*fLogger,TrackerDataMaker(specie)->Data());
591 //____________________________________________________________________________
592 void AliMUONTrackerQADataMakerRec::FillReadoutStatus(AliMUONLogger& log, AliMUONVTrackerData* data)
599 TH1* hparity = GetRawsData(AliMUONQAIndices::kTrackerBusPatchParityErrors);
601 TH1* htoken = GetRawsData(AliMUONQAIndices::kTrackerBusPatchTokenLostErrors);
603 TH1* hpadding = GetRawsData(AliMUONQAIndices::kTrackerBusPatchPaddingErrors);
605 TH1* hrostatus = GetRawsData(AliMUONQAIndices::kTrackerReadoutStatus);
607 TH1* hnevents = GetRawsData(AliMUONQAIndices::kTrackerNofPhysicsEventsSeen);
609 Int_t nevents = TMath::Nint(hnevents->GetBinContent(1));
613 TPaveText* text = new TPaveText(0,0,0.99,0.99,"NDC");
614 text->AddText("FATAL : 0 event seen ? That's NOT normal...");
615 text->SetFillColor(2); // red = FATAL
616 hrostatus->GetListOfFunctions()->Add(text);
620 /////////////////////////////////////////////////////////////////
621 /// Start by counting the number of errors
622 /////////////////////////////////////////////////////////////////
624 while ( log.Next(msg,occurence) )
626 AliDebug(1,Form("msg=%s occurence=%d",msg.Data(),occurence));
628 if ( msg.Contains("token") )
630 Int_t dsp(-1),iddl(-1),ecode(-1);
632 sscanf(msg.Data(),"Lost token error detected with address 0x%X of DDL %d and code %d.",
634 Int_t localBP = ((dsp >> 16)- 4)*5 + 1;
635 Int_t buspatch = localBP + iddl*100;
637 // Let's try to get all the suspected bus patches (i.e. one full FRT, as currently
638 // we don't have more precise information to locate the faulty bus patch(es)).
640 AliMpBusPatch* bp = AliMpDDLStore::Instance()->GetBusPatch(buspatch,kFALSE);
643 Int_t frt = bp->GetFrtId();
644 AliMpDDL* ddl = AliMpDDLStore::Instance()->GetDDL(bp->GetDdlId());
645 Int_t* b = new Int_t[ddl->GetMaxDsp()];
646 ddl->GetBusPerDsp(b);
648 for ( Int_t i = 0; i < ddl->GetNofFrts() && !nbus; ++i )
650 if ( ddl->GetFrtId(i) == frt )
657 AliError("GOT NBUS<=0 ! THAT IS BAD ! CHECK !");
663 htoken->Fill(buspatch+nbus-1,occurence);
667 hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofTokenLostErrors,occurence);
670 if ( msg.Contains("Parity") )
673 sscanf(msg.Data(),"Parity error in buspatch %d (0x%X).",&buspatch,&buspatch);
674 hparity->Fill(buspatch,occurence);
675 hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofParityErrors,occurence);
678 if ( msg.Contains("Glitch") )
680 hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofGlitchErrors,occurence);
683 if ( msg.Contains("Padding") )
685 Int_t block, dsp, buspatch;
686 sscanf(msg.Data(),"Padding word error for iBlock %d, iDsp %d, iBus %d.",&block,&dsp,&buspatch);
687 hpadding->Fill(buspatch,occurence);
688 hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofPaddingErrors,occurence);
692 /////////////////////////////////////////////////////////////////
694 /// Then make the status about number of missing bus patches
696 /////////////////////////////////////////////////////////////////
698 Int_t nofBusPatchesNotInConfig(0);
700 for ( int i = 1; i <= fBusPatchConfig->GetNbinsX(); ++i )
702 Double_t buspatchId = fBusPatchConfig->GetBinCenter(i);
703 if ( TMath::Nint(buspatchId) != i )
705 AliError(Form("buspathId=%e i=%d",buspatchId,i));
707 Double_t content = fBusPatchConfig->GetBinContent(i);
709 if ( content <= 0. /* no content */
711 AliMpDDLStore::Instance()->GetBusPatch(i,kFALSE) /* but a valid bus patch */ )
713 ++nofBusPatchesNotInConfig;
717 Double_t nbuspatches = fBusPatchConfig->GetEntries();
719 Int_t bin = hrostatus->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofMissingBusPatchesFromConfig);
720 hrostatus->SetBinContent(bin,nofBusPatchesNotInConfig*nevents/nbuspatches);
722 Double_t nofBusPatchesNotInData(0);
724 TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
727 while ( ( bp = static_cast<AliMpBusPatch*>(next()) ) )
729 if ( !data->HasBusPatch(bp->GetId()) ) ++nofBusPatchesNotInData;
732 bin = hrostatus->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofMissingBusPatchesFromDataStream);
733 hrostatus->SetBinContent(bin,nofBusPatchesNotInData*nevents/nbuspatches);
736 //____________________________________________________________________________
737 void AliMUONTrackerQADataMakerRec::FillEventSize(AliRawReader* rawReader)
739 /// Fill event size histogram(s)
741 TH1* hnevents = GetRawsData(AliMUONQAIndices::kTrackerNofPhysicsEventsSeen);
743 TH1* hddlevents = GetRawsData(AliMUONQAIndices::kTrackerDDLNofEventsSeen);
745 TH1* hDDLEventSize = GetRawsData(AliMUONQAIndices::kTrackerDDLEventSize);
749 Int_t offset = AliDAQ::DdlIDOffset("MUONTRK");
751 for ( int i = 0; i < AliDAQ::NumberOfDdls("MUONTRK"); ++i )
754 rawReader->Select("MUONTRK",i,i);
755 if (rawReader->ReadHeader() )
757 UInt_t ddlsize = rawReader->GetEquipmentSize();
758 hDDLEventSize->Fill(i+offset,ddlsize);
759 hddlevents->Fill(i+offset);
765 //____________________________________________________________________________
766 void AliMUONTrackerQADataMakerRec::InitCommon()
768 if (!fBusPatchConfig)
773 TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
774 AliMpBusPatch* bp(0x0);
775 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
777 bpmin = TMath::Min(bpmin,bp->GetId());
778 bpmax = TMath::Max(bpmax,bp->GetId());
783 fBPnbins = TMath::Nint(fBPxmax-fBPxmin);
785 AliMUONVStore* config = fCalibrationData->Config();
789 fBusPatchConfig = new TH1F("hTrackerBusPatchConfig","Configuration of bus patches",fBPnbins,fBPxmin,fBPxmax);
790 fBusPatchConfig->SetDirectory(0);
794 AliWarning("Tracker configuration not found. Will not be able to cut on low occupancies");
798 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
802 Int_t nofManusInConfig(0);
804 for ( Int_t imanu = 0; imanu < bp->GetNofManus(); ++imanu )
806 Int_t manuId = bp->GetManuId(imanu);
807 if ( config->FindObject(bp->GetDEId(),manuId)) ++nofManusInConfig;
810 if ( nofManusInConfig > 0 )
812 fBusPatchConfig->Fill(bp->GetId(),1.0);
816 fBusPatchConfig->Fill(bp->GetId(),0.0);
819 else // no config, we assume all is there...
821 fBusPatchConfig->Fill(bp->GetId());
827 //____________________________________________________________________________
828 void AliMUONTrackerQADataMakerRec::BookHistograms(AliQAv1::TASKINDEX_t task)
830 AliCodeTimerAuto("",0);
834 const Bool_t expert = kTRUE ;
835 const Bool_t saveCorr = kTRUE ;
836 const Bool_t image = kTRUE ;
838 TH1* hbp = new TH1F("hTrackerBusPatchOccupancy","Occupancy of bus patches",fBPnbins,fBPxmin,fBPxmax);
840 Master()->Add2List(hbp,AliMUONQAIndices::kTrackerBusPatchOccupancy, task, expert, !image, !saveCorr);
842 TH1* h = new TH1F("hTrackerBusPatchParityErrors","Number of parity errors per bus patch",fBPnbins,fBPxmin,fBPxmax);
844 Master()->Add2List(h,AliMUONQAIndices::kTrackerBusPatchParityErrors,task,expert,!image,!saveCorr);
846 h = new TH1F("hTrackerBusPatchTokenLostErrors","Number of token lost errors per bus patch",fBPnbins,fBPxmin,fBPxmax);
847 Master()->Add2List(h,AliMUONQAIndices::kTrackerBusPatchTokenLostErrors,task,expert,!image,!saveCorr);
849 h = new TH1F("hTrackerBusPatchPaddingErrors","Number of padding errors per bus patch",fBPnbins,fBPxmin,fBPxmax);
851 Master()->Add2List(h,AliMUONQAIndices::kTrackerBusPatchPaddingErrors,task,expert,!image,!saveCorr);
856 if ( task == AliQAv1::kRAWS )
858 // for raw data, we differentiate events seen from events used to be able to detect
859 // severe decoder errors that lead to no event decoded (i.e. zero event used) even if
860 // events are there (i.e non-zero event seen).
861 hnevents = new TH1F("hTrackerNofPhysicsEventsSeen","Number of physics events seen",1,-0.5,0.5);
862 // this one will count the number of physics event the rawdatamaker is *seeing*
863 TAxis* a = hnevents->GetXaxis();
864 a->SetBinLabel(1,"NPhysicsEvents");
865 hnevents->SetStats(kFALSE);
866 Master()->Add2List(hnevents,AliMUONQAIndices::kTrackerNofPhysicsEventsSeen,task,expert,!image,!saveCorr);
869 hnevents = new TH1F("hTrackerNofGoodPhysicsEventsUsed","Number of good physics events used",1,-0.5,0.5);
870 // this one will get its content from the TrackerData, i.e. it will count the number of *good* physics events *used*
871 // (i.e. not empty and with no fatal readout error)
872 TAxis* a = hnevents->GetXaxis();
873 a->SetBinLabel(1,"NGoodPhysicsEvents");
874 hnevents->SetStats(kFALSE);
876 Master()->Add2List(hnevents,AliMUONQAIndices::kTrackerNofGoodPhysicsEventsUsed,task,expert,!image,!saveCorr);
878 Master()->Add2List(static_cast<TH1*>(fBusPatchConfig->Clone()),AliMUONQAIndices::kTrackerBusPatchConfig, task,expert, !image, !saveCorr);
880 Int_t nbins = AliDAQ::NumberOfDdls("MUONTRK");
881 const Int_t offset = AliDAQ::DdlIDOffset("MUONTRK");
883 Double_t xmin = offset - 0.5;
884 Double_t xmax = offset + nbins - 0.5;
886 TString what(AliQAv1::GetTaskName(task));
888 h = new TH1F(Form("hTrackerDDL%sOccupancy",what.Data()),Form(";DDLId;DDL Occupancy in %% (from %s)",what.Data()),nbins,xmin,xmax);
890 Master()->Add2List(h,AliMUONQAIndices::kTrackerDDLOccupancy,task,expert,!image,!saveCorr);
892 if ( task == AliQAv1::kRAWS )
894 // see above the comment about why we have event seen vs used for raw data.
895 h = new TH1F("hTrackerDDLNofEventsSeen","Number of events seen by DDL;DDLId",nbins,xmin,xmax);
896 Master()->Add2List(h,AliMUONQAIndices::kTrackerDDLNofEventsSeen,task,expert,!image,!saveCorr);
899 h = new TH1F("hTrackerDDLNofEventsUsed","Number of events used by DDL;DDLId",nbins,xmin,xmax);
900 Master()->Add2List(h,AliMUONQAIndices::kTrackerDDLNofEventsUsed,task,expert,!image,!saveCorr);
904 //____________________________________________________________________________
905 void AliMUONTrackerQADataMakerRec::InitRaws()
907 /// create monitor objects for RAWS
909 TrackerDataMaker(AliRecoParam::AConvert(Master()->GetEventSpecie()),kTRUE);
911 /// Book histograms that are common to Raws and Digits
912 BookHistograms(AliQAv1::kRAWS);
914 /// Now the Raws specific parts
915 TH1* h = new TH1F("hTrackerReadoutStatus","Readout status (x events)",7,-0.5,6.5);
918 TAxis* a = h->GetXaxis();
920 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofGlitchErrors),"Glitch errors");
921 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofTokenLostErrors),"Token lost errors");
922 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofParityErrors),"Parity errors");
923 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofPaddingErrors),"Padding errors");
925 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofEmptyEvents),"Empty events");
927 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofMissingBusPatchesFromConfig),"Not readout bus patches");
928 a->SetBinLabel(h->FindBin(1.0*AliMUONQAIndices::kTrackerRawNofMissingBusPatchesFromDataStream),"Missing bus patches");
930 TH1* h1 = static_cast<TH1*>(h->Clone("hTrackerReadoutStatusPerEvent"));
931 h1->SetTitle("Readout status per event");
932 h1->GetYaxis()->SetTitle("Percentage");
934 // The QA shifter will only see the summary plot below
936 Add2RawsList(h,AliMUONQAIndices::kTrackerReadoutStatus,kTRUE,kFALSE,kFALSE);
937 Add2RawsList(h1,AliMUONQAIndices::kTrackerReadoutStatusPerEvent,kFALSE,kTRUE,kFALSE);
939 // Lastly the event size histograms
941 Int_t nbins = AliDAQ::NumberOfDdls("MUONTRK");
942 const Int_t offset = AliDAQ::DdlIDOffset("MUONTRK");
944 Double_t xmin = offset - 0.5;
945 Double_t xmax = offset + nbins - 0.5;
947 h = new TH1F("hTrackerDDLEventSize","DDL event size (bytes);DDL Id;Data size (bytes)",nbins,xmin,xmax);
949 Add2RawsList(h,AliMUONQAIndices::kTrackerDDLEventSize,kTRUE,kFALSE,kFALSE);
951 h = new TH1F("hTrackerDDLMeanEventSize","DDL mean event size (KB) per event;DDL Id;Mean Event size (KB)",nbins,xmin,xmax);
953 Add2RawsList(h,AliMUONQAIndices::kTrackerDDLEventSizePerEvent,kFALSE,kTRUE,kFALSE);
955 Add2RawsList(new TH1F("hTrackerIsThere","tracker is there",1,0,1),AliMUONQAIndices::kTrackerIsThere,kTRUE,kFALSE,kFALSE);
958 //__________________________________________________________________
959 void AliMUONTrackerQADataMakerRec::InitDigits()
961 /// create monitor objects for DIGITS
963 AliCodeTimerAuto("",0);
965 if ( GetRecoParam()->TryRecover() )
967 fDigitMaker->SetTryRecover(kTRUE);
971 fDigitMaker->SetTryRecover(kFALSE);
974 TrackerCalData(AliRecoParam::AConvert(Master()->GetEventSpecie()),kTRUE);
976 /// Book histograms that are common to Raws and Digits
977 BookHistograms(AliQAv1::kDIGITSR);
980 //____________________________________________________________________________
981 void AliMUONTrackerQADataMakerRec::InitRecPoints()
983 /// create Reconstructed Points histograms in RecPoints subdir for the
984 /// MUON tracker subsystem.
985 const Bool_t expert = kTRUE ;
986 const Bool_t image = kTRUE ;
988 AliCodeTimerAuto("",0);
990 TrackerRecData(AliRecoParam::AConvert(Master()->GetEventSpecie()),kTRUE);
992 BookHistograms(AliQAv1::kRECPOINTS);
998 // histograms per chamber
999 Int_t nCh = AliMpConstants::NofTrackingChambers();
1000 for ( Int_t i = 0; i < nCh; ++i )
1002 h1I = new TH1I(Form("hTrackerClusterMultiplicityForChamber%d",i+1), Form("cluster size distribution in chamber %d;size (n_{pads};Counts)",i+1), 100,0,100);
1003 Add2RecPointsList(h1I,AliMUONQAIndices::kTrackerClusterMultiplicityPerChamber+i, expert, !image);
1005 h1I = new TH1I(Form("hTrackerClusterChargeForChamber%d",i+1), Form("cluster charge distribution in chamber %d;charge (fC);Counts",i+1), 100,0,1000);
1006 Add2RecPointsList(h1I,AliMUONQAIndices::kTrackerClusterChargePerChamber+i, expert, !image);
1008 Float_t rMax = AliMUONConstants::Rmax(i/2);
1009 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);
1010 Add2RecPointsList(h2F, AliMUONQAIndices::kTrackerClusterHitMapPerChamber+i, expert, !image);
1013 // summary histograms per chamber
1014 h1I = new TH1I("hTrackerNumberOfClustersPerChamber", "Number of clusters per chamber;chamber ID;n_{clusters}", nCh,-0.5,nCh-0.5);
1015 Add2RecPointsList(h1I,AliMUONQAIndices::kTrackerNumberOfClustersPerChamber, !expert, image);
1017 h1F = new TH1F("hTrackerClusterMultiplicityPerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh,-0.5,nCh-0.5);
1018 h1F->SetOption("P");
1019 h1F->SetMarkerStyle(kFullDotMedium);
1020 h1F->SetMarkerColor(kRed);
1021 Add2RecPointsList(h1F, AliMUONQAIndices::kTrackerClusterMultiplicityPerChMean, !expert, image);
1023 h1F = new TH1F("hTrackerClusterMultiplicityPerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh,-0.5,nCh-0.5);
1024 h1F->SetOption("P");
1025 h1F->SetMarkerStyle(kFullDotMedium);
1026 h1F->SetMarkerColor(kRed);
1027 Add2RecPointsList(h1F, AliMUONQAIndices::kTrackerClusterMultiplicityPerChSigma, !expert, image);
1029 h1F = new TH1F("hTrackerClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (fC)", nCh,-0.5,nCh-0.5);
1030 h1F->SetOption("P");
1031 h1F->SetMarkerStyle(kFullDotMedium);
1032 h1F->SetMarkerColor(kRed);
1033 Add2RecPointsList(h1F, AliMUONQAIndices::kTrackerClusterChargePerChMean, !expert, image);
1035 h1F = new TH1F("hTrackerClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (fC)", nCh,-0.5,nCh-0.5);
1036 h1F->SetOption("P");
1037 h1F->SetMarkerStyle(kFullDotMedium);
1038 h1F->SetMarkerColor(kRed);
1039 Add2RecPointsList(h1F, AliMUONQAIndices::kTrackerClusterChargePerChSigma, !expert, image);
1041 // histograms per DE
1045 while ( !it.IsDone())
1047 Int_t detElemId = it.CurrentDEId();
1049 if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
1051 ndes = TMath::Max(ndes,detElemId);
1053 h1I = new TH1I(Form("hTrackerClusterMultiplicityForDE%04d",detElemId), Form("cluster size distribution in detection element %d;size (n_{pads})",detElemId), 100,0,100);
1054 Add2RecPointsList(h1I,AliMUONQAIndices::kTrackerClusterMultiplicityPerDE+detElemId, expert, !image);
1056 h1I = new TH1I(Form("hTrackerClusterChargeForDE%04d",detElemId), Form("cluster charge distribution in detection element %d;charge (fC)",detElemId), 100,0,1000);
1057 Add2RecPointsList(h1I,AliMUONQAIndices::kTrackerClusterChargePerDE+detElemId, expert, !image);
1063 // summary histograms per DE
1064 h1I = new TH1I("hTrackerNumberOfClustersPerDE", "Number of clusters per detection element;DetElem ID;n_{clusters}", ndes+1,-0.5,ndes+0.5);
1065 Add2RecPointsList(h1I, AliMUONQAIndices::kTrackerNumberOfClustersPerDE, !expert, image);
1067 h1F = new TH1F("hTrackerClusterMultiplicityPerDEMean", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", ndes+1,-0.5,ndes+0.5);
1068 h1F->SetOption("P");
1069 h1F->SetMarkerStyle(kFullDotMedium);
1070 h1F->SetMarkerColor(kRed);
1071 Add2RecPointsList(h1F, AliMUONQAIndices::kTrackerClusterMultiplicityPerDEMean, !expert, image);
1073 h1F = new TH1F("hTrackerClusterChargePerDEMean", "cluster mean charge per DE;DetElem ID;<charge> (fC)", ndes+1,-0.5,ndes+0.5);
1074 h1F->SetOption("P");
1075 h1F->SetMarkerStyle(kFullDotMedium);
1076 h1F->SetMarkerColor(kRed);
1077 Add2RecPointsList(h1F, AliMUONQAIndices::kTrackerClusterChargePerDEMean, !expert, image);
1079 MappingCheckRecPoints(AliRecoParam::AConvert(Master()->GetEventSpecie()),kTRUE);
1082 //____________________________________________________________________________
1083 void AliMUONTrackerQADataMakerRec::InitESDs()
1085 ///create ESDs histograms in ESDs subdir
1087 const Bool_t expert = kTRUE ;
1088 const Bool_t image = kTRUE ;
1090 Int_t nCh = AliMUONConstants::NTrackingCh();
1094 TH1F* hESDnTracks = new TH1F("hESDnTracks", "number of tracks;n_{tracks}", 20, 0., 20.);
1095 Add2ESDsList(hESDnTracks, AliMUONQAIndices::kESDnTracks, !expert, image);
1097 TH1F* hESDMatchTrig = new TH1F("hESDMatchTrig", "number of tracks matched with trigger;n_{tracks}", 20, 0., 20.);
1098 Add2ESDsList(hESDMatchTrig, AliMUONQAIndices::kESDMatchTrig, !expert, image);
1100 TH1F* hESDMomentum = new TH1F("hESDMomentum", "momentum distribution;p (GeV/c)", 300, 0., 300);
1101 Add2ESDsList(hESDMomentum, AliMUONQAIndices::kESDMomentum, !expert, image);
1103 TH1F* hESDPt = new TH1F("hESDPt", "transverse momentum distribution;p_{t} (GeV/c)", 200, 0., 50);
1104 Add2ESDsList(hESDPt, AliMUONQAIndices::kESDPt, !expert, image);
1106 TH1F* hESDRapidity = new TH1F("hESDRapidity", "rapidity distribution;rapidity", 200, -4.5, -2.);
1107 Add2ESDsList(hESDRapidity, AliMUONQAIndices::kESDRapidity, !expert, image);
1109 TH1F* hESDChi2 = new TH1F("hESDChi2", "normalized #chi^{2} distribution;#chi^{2} / ndf", 500, 0., 50.);
1110 Add2ESDsList(hESDChi2, AliMUONQAIndices::kESDChi2, !expert, image);
1112 TH1F* hESDProbChi2 = new TH1F("hESDProbChi2", "distribution of probability of #chi^{2};prob(#chi^{2})", 100, 0., 1.);
1113 Add2ESDsList(hESDProbChi2, AliMUONQAIndices::kESDProbChi2, !expert, image);
1115 TH1F* hESDThetaX = new TH1F("hESDThetaX", "#theta_{X} distribution;#theta_{X} (degree)", 360, -180., 180);
1116 Add2ESDsList(hESDThetaX, AliMUONQAIndices::kESDThetaX, !expert, image);
1118 TH1F* hESDThetaY = new TH1F("hESDThetaY", "#theta_{Y} distribution;#theta_{Y} (degree)", 360, -180., 180);
1119 Add2ESDsList(hESDThetaY, AliMUONQAIndices::kESDThetaY, !expert, image);
1122 for (Int_t i = 0; i < nCh; i++) {
1123 Float_t rMax = AliMUONConstants::Rmax(i/2);
1124 TH2F* hESDClusterHitMap = new TH2F(Form("hESDClusterHitMap%d",i+1), Form("cluster position distribution in chamber %d;X (cm);Y (cm)",i+1),
1125 100, -rMax, rMax, 100, -rMax, rMax);
1126 Add2ESDsList(hESDClusterHitMap, AliMUONQAIndices::kESDClusterHitMap+i, expert, !image);
1129 TH1F* hESDnClustersPerTrack = new TH1F("hESDnClustersPerTrack", "number of associated clusters per track;n_{clusters}", 20, 0., 20.);
1130 Add2ESDsList(hESDnClustersPerTrack, AliMUONQAIndices::kESDnClustersPerTrack, !expert, image);
1132 TH1F* hESDnClustersPerCh = new TH1F("hESDnClustersPerCh", "averaged number of clusters per chamber per track;chamber ID;<n_{clusters}>", nCh, -0.5, nCh-0.5);
1133 hESDnClustersPerCh->SetFillColor(kRed);
1134 Add2ESDsList(hESDnClustersPerCh, AliMUONQAIndices::kESDnClustersPerCh, !expert, image);
1136 TH1F* hESDnClustersPerDE = new TH1F("hESDnClustersPerDE", "averaged number of clusters per DE per track;DetElem ID;<n_{clusters}>", nDE+1, -0.5, nDE+0.5);
1137 hESDnClustersPerDE->SetFillColor(kRed);
1138 Add2ESDsList(hESDnClustersPerDE, AliMUONQAIndices::kESDnClustersPerDE, !expert, image);
1140 for (Int_t i = 0; i < nCh; i++) {
1141 TH1F* hESDClusterChargeInCh = new TH1F(Form("hESDClusterChargeInCh%d",i+1), Form("cluster charge distribution in chamber %d;charge (fC)",i+1), 100, 0., 1000.);
1142 Add2ESDsList(hESDClusterChargeInCh, AliMUONQAIndices::kESDClusterChargeInCh+i, expert, !image);
1145 TH1F* hESDClusterChargePerChMean = new TH1F("hESDClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (fC)", nCh, -0.5, nCh-0.5);
1146 hESDClusterChargePerChMean->SetOption("P");
1147 hESDClusterChargePerChMean->SetMarkerStyle(kFullDotMedium);
1148 hESDClusterChargePerChMean->SetMarkerColor(kRed);
1149 Add2ESDsList(hESDClusterChargePerChMean, AliMUONQAIndices::kESDClusterChargePerChMean, !expert, image);
1151 TH1F* hESDClusterChargePerChSigma = new TH1F("hESDClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (fC)", nCh, -0.5, nCh-0.5);
1152 hESDClusterChargePerChSigma->SetOption("P");
1153 hESDClusterChargePerChSigma->SetMarkerStyle(kFullDotMedium);
1154 hESDClusterChargePerChSigma->SetMarkerColor(kRed);
1155 Add2ESDsList(hESDClusterChargePerChSigma, AliMUONQAIndices::kESDClusterChargePerChSigma, !expert, image);
1157 TH1F* hESDClusterChargePerDE = new TH1F("hESDClusterChargePerDE", "cluster mean charge per DE;DetElem ID;<charge> (fC)", nDE+1, -0.5, nDE+0.5);
1158 hESDClusterChargePerDE->SetOption("P");
1159 hESDClusterChargePerDE->SetMarkerStyle(kFullDotMedium);
1160 hESDClusterChargePerDE->SetMarkerColor(kRed);
1161 Add2ESDsList(hESDClusterChargePerDE, AliMUONQAIndices::kESDClusterChargePerDE, !expert, image);
1163 for (Int_t i = 0; i < nCh; i++) {
1164 TH1F* hESDClusterSizeInCh = new TH1F(Form("hESDClusterSizeInCh%d",i+1), Form("cluster size distribution in chamber %d;size (n_{pads})",i+1), 200, 0., 200.);
1165 Add2ESDsList(hESDClusterSizeInCh, AliMUONQAIndices::kESDClusterSizeInCh+i, expert, !image);
1168 TH1F* hESDClusterSizePerChMean = new TH1F("hESDClusterSizePerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh, -0.5, nCh-0.5);
1169 hESDClusterSizePerChMean->SetOption("P");
1170 hESDClusterSizePerChMean->SetMarkerStyle(kFullDotMedium);
1171 hESDClusterSizePerChMean->SetMarkerColor(kRed);
1172 Add2ESDsList(hESDClusterSizePerChMean, AliMUONQAIndices::kESDClusterSizePerChMean, !expert, image);
1174 TH1F* hESDClusterSizePerChSigma = new TH1F("hESDClusterSizePerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh, -0.5, nCh-0.5);
1175 hESDClusterSizePerChSigma->SetOption("P");
1176 hESDClusterSizePerChSigma->SetMarkerStyle(kFullDotMedium);
1177 hESDClusterSizePerChSigma->SetMarkerColor(kRed);
1178 Add2ESDsList(hESDClusterSizePerChSigma, AliMUONQAIndices::kESDClusterSizePerChSigma, !expert, image);
1180 TH1F* hESDClusterSizePerDE = new TH1F("hESDClusterSizePerDE", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", nDE+1, -0.5, nDE+0.5);
1181 hESDClusterSizePerDE->SetOption("P");
1182 hESDClusterSizePerDE->SetMarkerStyle(kFullDotMedium);
1183 hESDClusterSizePerDE->SetMarkerColor(kRed);
1184 Add2ESDsList(hESDClusterSizePerDE, AliMUONQAIndices::kESDClusterSizePerDE, !expert, image);
1186 // cluster - track info
1187 for (Int_t i = 0; i < nCh; i++) {
1188 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.);
1189 Add2ESDsList(hESDResidualXInCh, AliMUONQAIndices::kESDResidualXInCh+i, expert, !image);
1191 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.);
1192 Add2ESDsList(hESDResidualYInCh, AliMUONQAIndices::kESDResidualYInCh+i, expert, !image);
1194 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);
1195 Add2ESDsList(hESDLocalChi2XInCh, AliMUONQAIndices::kESDLocalChi2XInCh+i, expert, !image);
1197 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);
1198 Add2ESDsList(hESDLocalChi2YInCh, AliMUONQAIndices::kESDLocalChi2YInCh+i, expert, !image);
1200 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);
1201 Add2ESDsList(hESDLocalChi2InCh, AliMUONQAIndices::kESDLocalChi2InCh+i, expert, !image);
1204 TH1F* hESDResidualXPerChMean = new TH1F("hESDResidualXPerChMean", "cluster-track residual-X per Ch: mean;chamber ID;<#Delta_{X}> (cm)", nCh, -0.5, nCh-0.5);
1205 hESDResidualXPerChMean->SetOption("P");
1206 hESDResidualXPerChMean->SetMarkerStyle(kFullDotMedium);
1207 hESDResidualXPerChMean->SetMarkerColor(kRed);
1208 Add2ESDsList(hESDResidualXPerChMean, AliMUONQAIndices::kESDResidualXPerChMean, !expert, image);
1210 TH1F* hESDResidualYPerChMean = new TH1F("hESDResidualYPerChMean", "cluster-track residual-Y per Ch: mean;chamber ID;<#Delta_{Y}> (cm)", nCh, -0.5, nCh-0.5);
1211 hESDResidualYPerChMean->SetOption("P");
1212 hESDResidualYPerChMean->SetMarkerStyle(kFullDotMedium);
1213 hESDResidualYPerChMean->SetMarkerColor(kRed);
1214 Add2ESDsList(hESDResidualYPerChMean, AliMUONQAIndices::kESDResidualYPerChMean, !expert, image);
1216 TH1F* hESDResidualXPerChSigma = new TH1F("hESDResidualXPerChSigma", "cluster-track residual-X per Ch: sigma;chamber ID;#sigma_{X} (cm)", nCh, -0.5, nCh-0.5);
1217 hESDResidualXPerChSigma->SetOption("P");
1218 hESDResidualXPerChSigma->SetMarkerStyle(kFullDotMedium);
1219 hESDResidualXPerChSigma->SetMarkerColor(kRed);
1220 Add2ESDsList(hESDResidualXPerChSigma, AliMUONQAIndices::kESDResidualXPerChSigma, !expert, image);
1222 TH1F* hESDResidualYPerChSigma = new TH1F("hESDResidualYPerChSigma", "cluster-track residual-Y per Ch: sigma;chamber ID;#sigma_{Y} (cm)", nCh, -0.5, nCh-0.5);
1223 hESDResidualYPerChSigma->SetOption("P");
1224 hESDResidualYPerChSigma->SetMarkerStyle(kFullDotMedium);
1225 hESDResidualYPerChSigma->SetMarkerColor(kRed);
1226 Add2ESDsList(hESDResidualYPerChSigma, AliMUONQAIndices::kESDResidualYPerChSigma, !expert, image);
1228 TH1F* hESDLocalChi2XPerChMean = new TH1F("hESDLocalChi2XPerCh", "local chi2-X per Ch: mean;chamber ID;<local #chi^{2}_{X}>", nCh, -0.5, nCh-0.5);
1229 hESDLocalChi2XPerChMean->SetOption("P");
1230 hESDLocalChi2XPerChMean->SetMarkerStyle(kFullDotMedium);
1231 hESDLocalChi2XPerChMean->SetMarkerColor(kRed);
1232 Add2ESDsList(hESDLocalChi2XPerChMean, AliMUONQAIndices::kESDLocalChi2XPerChMean, !expert, image);
1234 TH1F* hESDLocalChi2YPerChMean = new TH1F("hESDLocalChi2YPerCh", "local chi2-Y per Ch: mean;chamber ID;<local #chi^{2}_{Y}>", nCh, -0.5, nCh-0.5);
1235 hESDLocalChi2YPerChMean->SetOption("P");
1236 hESDLocalChi2YPerChMean->SetMarkerStyle(kFullDotMedium);
1237 hESDLocalChi2YPerChMean->SetMarkerColor(kRed);
1238 Add2ESDsList(hESDLocalChi2YPerChMean, AliMUONQAIndices::kESDLocalChi2YPerChMean, !expert, image);
1240 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);
1241 hESDLocalChi2PerChMean->SetOption("P");
1242 hESDLocalChi2PerChMean->SetMarkerStyle(kFullDotMedium);
1243 hESDLocalChi2PerChMean->SetMarkerColor(kRed);
1244 Add2ESDsList(hESDLocalChi2PerChMean, AliMUONQAIndices::kESDLocalChi2PerChMean, !expert, image);
1246 TH1F* hESDResidualXPerDEMean = new TH1F("hESDResidualXPerDEMean", "cluster-track residual-X per DE: mean;DetElem ID;<#Delta_{X}> (cm)", nDE+1, -0.5, nDE+0.5);
1247 hESDResidualXPerDEMean->SetOption("P");
1248 hESDResidualXPerDEMean->SetMarkerStyle(kFullDotMedium);
1249 hESDResidualXPerDEMean->SetMarkerColor(kRed);
1250 Add2ESDsList(hESDResidualXPerDEMean, AliMUONQAIndices::kESDResidualXPerDEMean, !expert, image);
1252 TH1F* hESDResidualYPerDEMean = new TH1F("hESDResidualYPerDEMean", "cluster-track residual-Y per DE: mean;DetElem ID;<#Delta_{Y}> (cm)", nDE+1, -0.5, nDE+0.5);
1253 hESDResidualYPerDEMean->SetOption("P");
1254 hESDResidualYPerDEMean->SetMarkerStyle(kFullDotMedium);
1255 hESDResidualYPerDEMean->SetMarkerColor(kRed);
1256 Add2ESDsList(hESDResidualYPerDEMean, AliMUONQAIndices::kESDResidualYPerDEMean, !expert, image);
1258 TH1F* hESDResidualXPerDESigma = new TH1F("hESDResidualXPerDESigma", "cluster-track residual-X per DE: sigma;DetElem ID;#sigma_{X} (cm)", nDE+1, -0.5, nDE+0.5);
1259 hESDResidualXPerDESigma->SetOption("P");
1260 hESDResidualXPerDESigma->SetMarkerStyle(kFullDotMedium);
1261 hESDResidualXPerDESigma->SetMarkerColor(kRed);
1262 Add2ESDsList(hESDResidualXPerDESigma, AliMUONQAIndices::kESDResidualXPerDESigma, !expert, image);
1264 TH1F* hESDResidualYPerDESigma = new TH1F("hESDResidualYPerDESigma", "cluster-track residual-Y per DE: sigma;DetElem ID;#sigma_{Y} (cm)", nDE+1, -0.5, nDE+0.5);
1265 hESDResidualYPerDESigma->SetOption("P");
1266 hESDResidualYPerDESigma->SetMarkerStyle(kFullDotMedium);
1267 hESDResidualYPerDESigma->SetMarkerColor(kRed);
1268 Add2ESDsList(hESDResidualYPerDESigma, AliMUONQAIndices::kESDResidualYPerDESigma, !expert, image);
1270 TH1F* hESDLocalChi2XPerDEMean = new TH1F("hESDLocalChi2XPerDE", "local chi2-X per DE: mean;DetElem ID;<local #chi^{2}_{X}>", nDE+1, -0.5, nDE+0.5);
1271 hESDLocalChi2XPerDEMean->SetOption("P");
1272 hESDLocalChi2XPerDEMean->SetMarkerStyle(kFullDotMedium);
1273 hESDLocalChi2XPerDEMean->SetMarkerColor(kRed);
1274 Add2ESDsList(hESDLocalChi2XPerDEMean, AliMUONQAIndices::kESDLocalChi2XPerDEMean, !expert, image);
1276 TH1F* hESDLocalChi2YPerDEMean = new TH1F("hESDLocalChi2YPerDE", "local chi2-Y per DE: mean;DetElem ID;<local #chi^{2}_{Y}>", nDE+1, -0.5, nDE+0.5);
1277 hESDLocalChi2YPerDEMean->SetOption("P");
1278 hESDLocalChi2YPerDEMean->SetMarkerStyle(kFullDotMedium);
1279 hESDLocalChi2YPerDEMean->SetMarkerColor(kRed);
1280 Add2ESDsList(hESDLocalChi2YPerDEMean, AliMUONQAIndices::kESDLocalChi2YPerDEMean, !expert, image);
1282 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);
1283 hESDLocalChi2PerDEMean->SetOption("P");
1284 hESDLocalChi2PerDEMean->SetMarkerStyle(kFullDotMedium);
1285 hESDLocalChi2PerDEMean->SetMarkerColor(kRed);
1286 Add2ESDsList(hESDLocalChi2PerDEMean, AliMUONQAIndices::kESDLocalChi2PerDEMean, !expert, image);
1288 // intermediate histograms
1289 TH1F* hESDnTotClustersPerCh = new TH1F("hESDnTotClustersPerCh", "total number of associated clusters per chamber;chamber ID;#Sigma(n_{clusters})", nCh, -0.5, nCh-0.5);
1290 Add2ESDsList(hESDnTotClustersPerCh, AliMUONQAIndices::kESDnTotClustersPerCh, expert, !image);
1291 TH1F* hESDnTotClustersPerDE = new TH1F("hESDnTotClustersPerDE", "total number of associated clusters per DE;DetElem ID;#Sigma(n_{clusters})", nDE+1, -0.5, nDE+0.5);
1292 Add2ESDsList(hESDnTotClustersPerDE, AliMUONQAIndices::kESDnTotClustersPerDE, expert, !image);
1293 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);
1294 Add2ESDsList(hESDnTotFullClustersPerDE, AliMUONQAIndices::kESDnTotFullClustersPerDE, expert, !image);
1295 TH1F* hESDSumClusterChargePerDE = new TH1F("hESDSumClusterChargePerDE", "sum of cluster charge per DE;DetElem ID;#Sigma(charge) (fC)", nDE+1, -0.5, nDE+0.5);
1296 Add2ESDsList(hESDSumClusterChargePerDE, AliMUONQAIndices::kESDSumClusterChargePerDE, expert, !image);
1297 TH1F* hESDSumClusterSizePerDE = new TH1F("hESDSumClusterSizePerDE", "sum of cluster size per DE;DetElem ID;#Sigma(size) (n_{pads})", nDE+1, -0.5, nDE+0.5);
1298 Add2ESDsList(hESDSumClusterSizePerDE, AliMUONQAIndices::kESDSumClusterSizePerDE, expert, !image);
1299 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);
1300 Add2ESDsList(hESDSumResidualXPerDE, AliMUONQAIndices::kESDSumResidualXPerDE, expert, !image);
1301 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);
1302 Add2ESDsList(hESDSumResidualYPerDE, AliMUONQAIndices::kESDSumResidualYPerDE, expert, !image);
1303 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);
1304 Add2ESDsList(hESDSumResidualX2PerDE, AliMUONQAIndices::kESDSumResidualX2PerDE, expert, !image);
1305 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);
1306 Add2ESDsList(hESDSumResidualY2PerDE, AliMUONQAIndices::kESDSumResidualY2PerDE, expert, !image);
1307 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);
1308 Add2ESDsList(hESDSumLocalChi2XPerDE, AliMUONQAIndices::kESDSumLocalChi2XPerDE, expert, !image);
1309 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);
1310 Add2ESDsList(hESDSumLocalChi2YPerDE, AliMUONQAIndices::kESDSumLocalChi2YPerDE, expert, !image);
1311 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);
1312 Add2ESDsList(hESDSumLocalChi2PerDE, AliMUONQAIndices::kESDSumLocalChi2PerDE, expert, !image);
1315 //____________________________________________________________________________
1316 void AliMUONTrackerQADataMakerRec::MakeRaws(AliRawReader* rawReader)
1318 /// make QA for rawdata tracker
1320 AliCodeTimerAuto(Form("%s",AliRecoParam::GetEventSpecieName(AliRecoParam::AConvert(Master()->GetEventSpecie()))),0);
1323 GetRawsData(AliMUONQAIndices::kTrackerBusPatchOccupancy);
1325 AliMUONTrackerDataMaker* dm = static_cast<AliMUONTrackerDataMaker*>(TrackerDataMaker(AliRecoParam::AConvert(Master()->GetEventSpecie())));
1327 dm->SetRawReader(rawReader);
1329 Int_t eventType = rawReader->GetType();
1331 if (eventType == AliRawEventHeaderBase::kPhysicsEvent )
1335 FillEventSize(rawReader);
1337 if ( dm->LastEventWasEmpty() )
1339 TH1* hrostatus = GetRawsData(AliMUONQAIndices::kTrackerReadoutStatus);
1341 if (hrostatus) hrostatus->Fill(1.0*AliMUONQAIndices::kTrackerRawNofEmptyEvents);
1346 //__________________________________________________________________
1347 void AliMUONTrackerQADataMakerRec::MakeDigits(TTree* digitsTree)
1349 /// makes data from Digits
1350 AliCodeTimerAuto(Form("%s",AliRecoParam::GetEventSpecieName(AliRecoParam::AConvert(Master()->GetEventSpecie()))),0);
1354 GetDigitsData(AliMUONQAIndices::kTrackerBusPatchOccupancy);
1357 fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
1358 fDigitStore->Connect(*digitsTree, false);
1359 digitsTree->GetEvent(0);
1361 TIter next(fDigitStore->CreateIterator());
1363 AliMUONVDigit* dig = 0x0;
1365 AliMUON2DMap oneEventData(true);
1367 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
1369 if ( dig->IsTracker() )
1371 if ( dig->Charge() > 0.0 )
1374 Int_t detElemId = dig->DetElemId();
1375 Int_t manuId = dig->ManuId();
1377 AliMUONVCalibParam* param = static_cast<AliMUONVCalibParam*>(oneEventData.FindObject(detElemId,manuId));
1380 param = new AliMUONCalibParamND(1,AliMpConstants::ManuNofChannels(),detElemId,manuId,
1381 AliMUONVCalibParam::InvalidFloatValue());
1382 oneEventData.Add(param);
1384 param->SetValueAsDouble(dig->ManuChannel(),0,dig->Charge());
1389 TrackerCalData(AliRecoParam::AConvert(Master()->GetEventSpecie()))->Add(oneEventData);
1392 //____________________________________________________________________________
1393 void AliMUONTrackerQADataMakerRec::MakeRecPoints(TTree* clustersTree)
1395 /// Fill histograms related to tracker clusters
1397 // First things first : do we have clusters in the TreeR ?
1398 // In "normal" production mode, it should be perfectly normal
1399 // *not* to have them.
1400 // But if for some reason we de-activated the combined tracking,
1401 // then we have clusters in TreeR, so let's take that opportunity
1404 AliCodeTimerAuto(Form("%s",AliRecoParam::GetEventSpecieName(AliRecoParam::AConvert(Master()->GetEventSpecie()))),0);
1405 // Forces init by requesting an histogram
1406 GetRecPointsData(AliMUONQAIndices::kTrackerBusPatchOccupancy);
1410 AliCodeTimerAuto("ClusterStore creation",1);
1411 fClusterStore = AliMUONVClusterStore::Create(*clustersTree);
1418 fClusterStore->Connect(*clustersTree,kFALSE);
1419 clustersTree->GetEvent(0);
1421 TIter next(fClusterStore->CreateIterator());
1422 AliMUONVCluster* cluster;
1424 AliMUONQAMappingCheck* mcr = MappingCheckRecPoints(AliRecoParam::AConvert(Master()->GetEventSpecie()));
1426 if ( mcr ) mcr->NewEvent();
1428 AliMUON2DMap oneEventData(true);
1430 while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) )
1432 Int_t detElemId = cluster->GetDetElemId();
1433 Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
1435 GetRecPointsData(AliMUONQAIndices::kTrackerNumberOfClustersPerDE)->Fill(detElemId);
1436 GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerDE+detElemId)->Fill(cluster->GetCharge());
1437 GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerDE+detElemId)->Fill(cluster->GetNDigits());
1439 GetRecPointsData(AliMUONQAIndices::kTrackerNumberOfClustersPerChamber)->Fill(chamberId);
1440 GetRecPointsData(AliMUONQAIndices::kTrackerClusterChargePerChamber+chamberId)->Fill(cluster->GetCharge());
1441 GetRecPointsData(AliMUONQAIndices::kTrackerClusterMultiplicityPerChamber+chamberId)->Fill(cluster->GetNDigits());
1442 GetRecPointsData(AliMUONQAIndices::kTrackerClusterHitMapPerChamber+chamberId)->Fill(cluster->GetX(),cluster->GetY());
1444 if ( mcr ) mcr->Store(*cluster);
1446 for ( int i = 0; i < cluster->GetNDigits(); ++i )
1448 UInt_t digitId = cluster->GetDigitId(i);
1450 Int_t manuId = AliMUONVDigit::ManuId(digitId);
1451 Int_t manuChannel = AliMUONVDigit::ManuChannel(digitId);
1453 AliMUONVCalibParam* param = static_cast<AliMUONVCalibParam*>(oneEventData.FindObject(detElemId,manuId));
1456 param = new AliMUONCalibParamND(1,AliMpConstants::ManuNofChannels(),detElemId,manuId,AliMUONVCalibParam::InvalidFloatValue());
1457 oneEventData.Add(param);
1459 param->SetValueAsDouble(manuChannel,0,1.0);
1463 TrackerRecData(AliRecoParam::AConvert(Master()->GetEventSpecie()))->Add(oneEventData);
1465 fClusterStore->Clear();
1468 //____________________________________________________________________________
1469 void AliMUONTrackerQADataMakerRec::MakeESDs(AliESDEvent* esd)
1471 /// make QA data from ESDs
1473 AliCodeTimerAuto(Form("%s",AliRecoParam::GetEventSpecieName(AliRecoParam::AConvert(Master()->GetEventSpecie()))),0);
1475 // load ESD event in the interface
1476 AliMUONESDInterface esdInterface;
1477 if (GetRecoParam()) AliMUONESDInterface::ResetTracker(GetRecoParam(), kFALSE);
1478 else AliError("Unable to get recoParam: use default ones for residual calculation");
1479 esdInterface.LoadEvent(*esd);
1481 GetESDsData(AliMUONQAIndices::kESDnTracks)->Fill(esdInterface.GetNTracks());
1483 Int_t nTrackMatchTrig = 0;
1486 Int_t nTracks = (Int_t) esd->GetNumberOfMuonTracks();
1487 for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
1489 // get the ESD track and skip "ghosts"
1490 AliESDMuonTrack* esdTrack = esd->GetMuonTrack(iTrack);
1491 if (!esdTrack->ContainTrackerData()) continue;
1493 // get corresponding MUON track
1494 AliMUONTrack* track = esdInterface.FindTrack(esdTrack->GetUniqueID());
1496 if (esdTrack->ContainTriggerData()) nTrackMatchTrig++;
1498 GetESDsData(AliMUONQAIndices::kESDMomentum)->Fill(esdTrack->P());
1499 GetESDsData(AliMUONQAIndices::kESDPt)->Fill(esdTrack->Pt());
1500 GetESDsData(AliMUONQAIndices::kESDRapidity)->Fill(esdTrack->Y());
1501 GetESDsData(AliMUONQAIndices::kESDChi2)->Fill(track->GetNormalizedChi2());
1502 GetESDsData(AliMUONQAIndices::kESDProbChi2)->Fill(TMath::Prob(track->GetGlobalChi2(),track->GetNDF()));
1503 GetESDsData(AliMUONQAIndices::kESDThetaX)->Fill(esdTrack->GetThetaXUncorrected() / TMath::Pi() * 180.);
1504 GetESDsData(AliMUONQAIndices::kESDThetaY)->Fill(esdTrack->GetThetaYUncorrected() / TMath::Pi() * 180.);
1505 GetESDsData(AliMUONQAIndices::kESDnClustersPerTrack)->Fill(track->GetNClusters());
1507 // loop over clusters
1508 AliMUONTrackParam* trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->First());
1509 while (trackParam) {
1511 AliMUONVCluster* cluster = trackParam->GetClusterPtr();
1512 Int_t chId = cluster->GetChamberId();
1513 Int_t deID = cluster->GetDetElemId();
1514 Double_t residualX = cluster->GetX() - trackParam->GetNonBendingCoor();
1515 Double_t residualY = cluster->GetY() - trackParam->GetBendingCoor();
1516 Double_t sigmaResidualX2 = cluster->GetErrX2() - trackParam->GetCovariances()(0,0);
1517 Double_t sigmaResidualY2 = cluster->GetErrY2() - trackParam->GetCovariances()(2,2);
1518 Double_t localChi2X = (sigmaResidualX2 > 0.) ? residualX*residualX/sigmaResidualX2 : 0.;
1519 Double_t localChi2Y = (sigmaResidualY2 > 0.) ? residualY*residualY/sigmaResidualY2 : 0.;
1520 Double_t localChi2 = 0.5 * trackParam->GetLocalChi2();
1522 GetESDsData(AliMUONQAIndices::kESDClusterHitMap+chId)->Fill(cluster->GetX(), cluster->GetY());
1524 GetESDsData(AliMUONQAIndices::kESDnTotClustersPerCh)->Fill(chId);
1525 GetESDsData(AliMUONQAIndices::kESDnTotClustersPerDE)->Fill(deID);
1527 GetESDsData(AliMUONQAIndices::kESDClusterChargeInCh+chId)->Fill(cluster->GetCharge());
1528 GetESDsData(AliMUONQAIndices::kESDSumClusterChargePerDE)->Fill(deID, cluster->GetCharge());
1530 if (cluster->GetNDigits() > 0) { // discard clusters with pad not stored in ESD
1531 GetESDsData(AliMUONQAIndices::kESDnTotFullClustersPerDE)->Fill(deID);
1532 GetESDsData(AliMUONQAIndices::kESDClusterSizeInCh+chId)->Fill(cluster->GetNDigits());
1533 GetESDsData(AliMUONQAIndices::kESDSumClusterSizePerDE)->Fill(deID, cluster->GetNDigits());
1536 GetESDsData(AliMUONQAIndices::kESDResidualXInCh+chId)->Fill(residualX);
1537 GetESDsData(AliMUONQAIndices::kESDResidualYInCh+chId)->Fill(residualY);
1538 GetESDsData(AliMUONQAIndices::kESDSumResidualXPerDE)->Fill(deID, residualX);
1539 GetESDsData(AliMUONQAIndices::kESDSumResidualYPerDE)->Fill(deID, residualY);
1540 GetESDsData(AliMUONQAIndices::kESDSumResidualX2PerDE)->Fill(deID, residualX*residualX);
1541 GetESDsData(AliMUONQAIndices::kESDSumResidualY2PerDE)->Fill(deID, residualY*residualY);
1543 GetESDsData(AliMUONQAIndices::kESDLocalChi2XInCh+chId)->Fill(localChi2X);
1544 GetESDsData(AliMUONQAIndices::kESDLocalChi2YInCh+chId)->Fill(localChi2Y);
1545 GetESDsData(AliMUONQAIndices::kESDLocalChi2InCh+chId)->Fill(localChi2);
1546 GetESDsData(AliMUONQAIndices::kESDSumLocalChi2XPerDE)->Fill(deID, localChi2X);
1547 GetESDsData(AliMUONQAIndices::kESDSumLocalChi2YPerDE)->Fill(deID, localChi2Y);
1548 GetESDsData(AliMUONQAIndices::kESDSumLocalChi2PerDE)->Fill(deID, localChi2);
1550 trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->After(trackParam));
1556 GetESDsData(AliMUONQAIndices::kESDMatchTrig)->Fill(nTrackMatchTrig);
1560 //____________________________________________________________________________
1561 AliMUONVTrackerData* AliMUONTrackerQADataMakerRec::GetTrackerData() const
1563 /// Return tracker data
1565 return TrackerDataMaker(AliRecoParam::AConvert(Master()->GetEventSpecie()))->Data();
1568 //____________________________________________________________________________
1570 AliMUONTrackerQADataMakerRec::ResetDetectorRaws(TObjArray* list)
1572 /// Reset those histograms that must be reset (and only those), plus
1573 /// the trackerdata itself.
1577 while ( ( o = next() ) )
1579 TH1* h = dynamic_cast<TH1*>(o);
1582 TString hn(h->GetName());
1584 if ( !hn.Contains("TrackerBusPatchConfig") )
1586 AliDebug(1,Form("Resetting %s",hn.Data()));
1592 AliDebug(1,Form("Will not reset histogram %s",hn.Data()));
1597 AliMUONVTrackerData* d = dynamic_cast<AliMUONVTrackerData*>(o);
1600 AliDebug(1,Form("Resetting %s",d->GetName()));
1605 AliError(Form("Found an object of class %s. Do not know how to reset.",o->ClassName()));
1611 //____________________________________________________________________________
1612 TObjArray* AliMUONTrackerQADataMakerRec::GetArray(TObjArray*& array, Bool_t create)
1614 /// Get (or create) the array
1620 array = new TObjArray(AliRecoParam::kNSpecies);
1627 //____________________________________________________________________________
1628 AliMUONVTrackerDataMaker*
1629 AliMUONTrackerQADataMakerRec::TrackerDataMaker(Int_t specieIndex) const
1631 /// const version of the getter
1632 if ( fTrackerDataMakerArray )
1634 return static_cast<AliMUONVTrackerDataMaker*>(fTrackerDataMakerArray->At(specieIndex));
1639 //____________________________________________________________________________
1640 AliMUONVTrackerDataMaker*
1641 AliMUONTrackerQADataMakerRec::TrackerDataMaker(Int_t specieIndex, Bool_t create)
1643 /// Get (or create) TrackerDataMaker object for a given specie
1645 TObjArray* array = GetArray(fTrackerDataMakerArray,create);
1650 array->SetOwner(kTRUE);
1651 o = array->At(specieIndex);
1655 AliMUONTrackerDataMaker* dm = new AliMUONTrackerDataMaker(0x0,
1656 AliCDBManager::Instance()->GetRun(),
1663 if (!fLogger) fLogger = new AliMUONLogger(-1); // note that we share the logger between species... should not be a big deal though
1664 dm->EnableErrorLogger(fLogger);
1665 dm->Data()->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level
1666 dm->Data()->SetName("RawCharges");
1667 dm->SetRunning(kTRUE);
1670 array->AddAt(o,specieIndex);
1673 return static_cast<AliMUONVTrackerDataMaker*>(o);
1676 //____________________________________________________________________________
1677 AliMUONVTrackerData*
1678 AliMUONTrackerQADataMakerRec::TrackerCalData(Int_t specieIndex, Bool_t create)
1680 TObjArray* array = GetArray(fTrackerCalDataArray,create);
1685 o = array->At(specieIndex);
1688 AliMUONTrackerData* data = new AliMUONTrackerData("CalCharges",Form("Calibrated charges (fC) %s",GetRecoParam()->GetCalibrationMode()),1);
1689 data->SetDimensionName(0,"charge");
1690 data->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level
1692 array->AddAt(o,specieIndex);
1695 return static_cast<AliMUONVTrackerData*>(o);
1698 //____________________________________________________________________________
1699 AliMUONVTrackerData*
1700 AliMUONTrackerQADataMakerRec::TrackerRecData(Int_t specieIndex, Bool_t create)
1702 TObjArray* array = GetArray(fTrackerRecDataArray,create);
1707 o = array->At(specieIndex);
1710 AliMUONTrackerData* data = new AliMUONTrackerData("RecCharges",Form("Calibrated charges (fC) %s for digits belonging to a reconstructed cluster",GetRecoParam()->GetCalibrationMode()),1);
1711 data->SetDimensionName(0,"one");
1712 data->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level
1714 array->AddAt(o,specieIndex);
1717 return static_cast<AliMUONVTrackerData*>(o);
1720 //____________________________________________________________________________
1721 AliMUONQAMappingCheck*
1722 AliMUONTrackerQADataMakerRec::MappingCheckRecPoints(Int_t specieIndex, Bool_t create)
1724 TObjArray* array = GetArray(fMappingCheckRecPointsArray,create);
1729 o = array->At(specieIndex);
1730 array->SetOwner(kTRUE);
1733 AliMUONQAMappingCheck* mcheck = new AliMUONQAMappingCheck(RunNumber());
1735 array->AddAt(o,specieIndex);
1738 return static_cast<AliMUONQAMappingCheck*>(o);