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 **************************************************************************/
18 // --- MUON header files ---
19 #include "AliMUONQADataMakerRec.h"
21 #include "AliMUON2DMap.h"
22 #include "AliMUONCluster.h"
23 #include "AliMUONConstants.h"
24 #include "AliMUONDDLTrigger.h"
25 #include "AliMUONDarcHeader.h"
26 #include "AliMUONDigitMaker.h"
27 #include "AliMUONLocalStruct.h"
28 #include "AliMUONLocalTrigger.h"
29 #include "AliMUONRawStreamTracker.h"
30 #include "AliMUONRawStreamTrigger.h"
31 #include "AliMUONRegHeader.h"
32 #include "AliMUONTrackerDataMaker.h"
33 #include "AliMUONTriggerDisplay.h"
34 #include "AliMUONVCluster.h"
35 #include "AliMUONVClusterStore.h"
36 #include "AliMUONVDigit.h"
37 #include "AliMUONVDigitStore.h"
38 #include "AliMUONVTrackerData.h"
39 #include "AliMUONVTriggerStore.h"
40 #include "AliMUONTrack.h"
41 #include "AliMUONTrackParam.h"
42 #include "AliMUONESDInterface.h"
43 #include "AliMUONCalibrationData.h"
44 #include "AliMpBusPatch.h"
46 #include "AliMpConstants.h"
47 #include "AliMpDDLStore.h"
48 #include "AliMpDEIterator.h"
49 #include "AliMpDEManager.h"
50 #include "AliMpDetElement.h"
51 #include "AliMpLocalBoard.h"
52 #include "AliMpStationType.h"
53 #include "AliMpTriggerCrate.h"
54 #include "AliMpDCSNamer.h"
55 #include "AliRawEventHeaderBase.h"
57 // --- AliRoot header files ---
58 #include "AliCDBManager.h"
59 #include "AliCDBStorage.h"
60 #include "AliESDEvent.h"
61 #include "AliESDMuonTrack.h"
62 #include "AliESDMuonCluster.h"
64 #include "AliRawReader.h"
65 #include "AliQAChecker.h"
66 #include "AliCodeTimer.h"
67 #include "AliDCSValue.h"
68 #include "AliMUONVDigit.h"
70 // --- ROOT system ---
71 #include <TClonesArray.h>
77 #include <TPaveText.h>
78 #include <Riostream.h>
81 //-----------------------------------------------------------------------------
82 /// \class AliMUONQADataMakerRec
84 /// MUON base class for quality assurance data (histo) maker
86 /// \author C. Finck, D. Stocco, L. Aphecetche
89 ClassImp(AliMUONQADataMakerRec)
104 // Calculates the trimmed (tmean) mean
105 // of a sample (x) and estimates the variance (tvar)
109 // First check input parameters
111 // number of observations
117 if ( alpha < 0 || alpha >= 0.5 )
118 // proportion of observations
119 // to be trimmed at each end of the sorted sample
124 // Input parameters are good. Let's move on.
126 // Insure we use a sample sorted into ascending order.
128 Int_t* indices = new Int_t[n];
130 TMath::Sort(n,x,indices,kFALSE);
132 Double_t* sx = new Double_t[n];
134 for ( Int_t i = 0; i < n; ++i )
136 sx[i] = x[indices[i]];
141 // Number of observations trimmed at each end.
143 Int_t k = static_cast<Int_t>(floorf(alpha * n));
147 for ( Int_t i = k; i < n - k ; ++i )
152 tmean = sum / ( n - 2 * k );
156 for ( Int_t i = k; i < n - k; ++i )
158 t2 += (sx[i] - tmean) * (sx[i] - tmean);
163 k * (sx[k] - tmean) * (sx[k] - tmean) +
164 k * (sx[n - k - 1] - tmean) * (sx[n - k - 1] - tmean)
167 // get the min and max for the non-rejected values
171 for ( Int_t i = k; i < n-k; ++i )
173 min = TMath::Min(min,sx[i]);
174 max = TMath::Max(max,sx[i]);
183 //____________________________________________________________________________
184 AliMUONQADataMakerRec::AliMUONQADataMakerRec() :
185 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kMUON), "MUON Quality Assurance Data Maker"),
190 fTrackerDataMaker(0x0)
194 AliDebug(AliQAv1::GetQADebugLevel(),"");
199 //____________________________________________________________________________
201 AliMUONQADataMakerRec::Ctor()
203 /// Init some members
204 fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV1");
205 fDigitMaker = new AliMUONDigitMaker(kTRUE);
208 //____________________________________________________________________________
209 AliMUONQADataMakerRec::AliMUONQADataMakerRec(const AliMUONQADataMakerRec& qadm) :
210 AliQADataMakerRec(qadm),
215 fTrackerDataMaker(0x0)
219 AliDebug(AliQAv1::GetQADebugLevel(),"");
222 SetName((const char*)qadm.GetName()) ;
223 SetTitle((const char*)qadm.GetTitle());
225 // Do not copy the digit store and digit maker, but create its own ones
231 //__________________________________________________________________
232 AliMUONQADataMakerRec& AliMUONQADataMakerRec::operator = (const AliMUONQADataMakerRec& qadm )
234 /// Assignment operator
236 AliDebug(AliQAv1::GetQADebugLevel(),"");
238 // check assignment to self
239 if (this == &qadm) return *this;
241 this->~AliMUONQADataMakerRec();
242 new(this) AliMUONQADataMakerRec(qadm);
246 //__________________________________________________________________
247 AliMUONQADataMakerRec::~AliMUONQADataMakerRec()
251 AliDebug(AliQAv1::GetQADebugLevel(),"");
253 AliCodeTimerAuto("");
256 delete fTriggerStore;
258 delete fClusterStore;
259 delete fTrackerDataMaker;
262 //____________________________________________________________________________
263 void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
265 ///Detector specific actions at end of cycle
267 AliCodeTimerAuto("");
269 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
271 if (! IsValidEventSpecie(specie, list) )
273 SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ;
274 if ( task == AliQAv1::kRAWS && fTrackerDataMaker )
276 if ( !GetRawsData(kTrackerBusPatchOccupancy) ) continue;
278 TIter next(list[specie]);
280 Bool_t alreadyThere(kFALSE);
281 while ( ( o = next() ) && !alreadyThere )
283 TString classname(o->ClassName());
284 if ( classname.Contains("TrackerData") ) alreadyThere = kTRUE;
286 if (!alreadyThere && fTrackerDataMaker)
288 AliDebug(AliQAv1::GetQADebugLevel(), "Adding fTrackerData to the list of qa objects");
289 list[specie]->AddAt(fTrackerDataMaker->Data(),(Int_t)kTrackerData);
291 if ( fTrackerDataMaker )
293 TH1* hbp = GetRawsData(kTrackerBusPatchOccupancy);
295 TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator());
296 AliMpBusPatch* bp(0x0);
297 AliMUONVTrackerData* data = fTrackerDataMaker->Data();
300 while ( ( bp = static_cast<AliMpBusPatch*>(nextBP())) )
302 Int_t busPatchId = bp->GetId();
303 Int_t bin = hbp->FindBin(busPatchId);
304 hbp->SetBinContent(bin,data->BusPatch(busPatchId,occDim)*100.0); // occupancy, in percent
307 BeautifyTrackerBusPatchOccupancy(*hbp);
311 // Normalize RecPoints histos
312 if ( task == AliQAv1::kRECPOINTS ) {
314 if (!GetRecPointsData(kTrackerClusterChargePerChMean)) continue;
316 TH1* hTrackerClusterChargePerChMean = GetRecPointsData(kTrackerClusterChargePerChMean);
317 TH1* hTrackerClusterChargePerChSigma = GetRecPointsData(kTrackerClusterChargePerChSigma);
318 TH1* hTrackerClusterMultiplicityPerChMean = GetRecPointsData(kTrackerClusterMultiplicityPerChMean);
319 TH1* hTrackerClusterMultiplicityPerChSigma = GetRecPointsData(kTrackerClusterMultiplicityPerChSigma);
320 TH1* hTrackerClusterChargePerDEMean = GetRecPointsData(kTrackerClusterChargePerDEMean);
321 TH1* hTrackerClusterMultiplicityPerDEMean = GetRecPointsData(kTrackerClusterMultiplicityPerDEMean);
323 // loop over chambers
324 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
326 TH1* hTrackerClusterChargePerChamber = GetRecPointsData(kTrackerClusterChargePerChamber+iCh);
327 Double_t sigmaCharge = hTrackerClusterChargePerChamber->GetRMS();
328 hTrackerClusterChargePerChMean->SetBinContent(iCh+1, hTrackerClusterChargePerChamber->GetMean());
329 hTrackerClusterChargePerChMean->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetMeanError());
330 hTrackerClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
331 hTrackerClusterChargePerChSigma->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetRMSError());
333 TH1* hTrackerClusterMultiplicityPerChamber = GetRecPointsData(kTrackerClusterMultiplicityPerChamber+iCh);
334 Double_t sigmaSize = hTrackerClusterMultiplicityPerChamber->GetRMS();
335 hTrackerClusterMultiplicityPerChMean->SetBinContent(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMean());
336 hTrackerClusterMultiplicityPerChMean->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMeanError());
337 hTrackerClusterMultiplicityPerChSigma->SetBinContent(iCh+1, sigmaSize);
338 hTrackerClusterMultiplicityPerChSigma->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetRMSError());
340 // loop over DE into chamber iCh
343 while ( !it.IsDone()) {
345 Int_t iDE = it.CurrentDEId();
347 TH1* hTrackerClusterChargePerDE = GetRecPointsData(kTrackerClusterChargePerDE+iDE);
348 hTrackerClusterChargePerDEMean->SetBinContent(iDE+1, hTrackerClusterChargePerDE->GetMean());
349 Double_t nClusters = hTrackerClusterChargePerDE->GetEntries();
350 if (nClusters > 1) hTrackerClusterChargePerDEMean->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
351 else hTrackerClusterChargePerDEMean->SetBinError(iDE+1, hTrackerClusterChargePerChamber->GetXaxis()->GetXmax());
353 TH1* hTrackerClusterMultiplicityPerDE = GetRecPointsData(kTrackerClusterMultiplicityPerDE+iDE);
354 hTrackerClusterMultiplicityPerDEMean->SetBinContent(iDE+1, hTrackerClusterMultiplicityPerDE->GetMean());
355 nClusters = hTrackerClusterMultiplicityPerDE->GetEntries();
356 if (nClusters > 1) hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nClusters));
357 else hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, hTrackerClusterMultiplicityPerChamber->GetXaxis()->GetXmax());
366 // Normalize ESD histos
367 if ( task == AliQAv1::kESDS ) {
369 if (!GetESDsData(kESDnClustersPerTrack)) continue;
371 Double_t nTracks = GetESDsData(kESDnClustersPerTrack)->GetEntries();
372 if (nTracks <= 0) continue;
374 TH1* hESDnClustersPerCh = GetESDsData(kESDnClustersPerCh);
375 TH1* hESDnClustersPerDE = GetESDsData(kESDnClustersPerDE);
376 TH1* hESDClusterChargePerChMean = GetESDsData(kESDClusterChargePerChMean);
377 TH1* hESDClusterChargePerChSigma = GetESDsData(kESDClusterChargePerChSigma);
378 TH1* hESDClusterSizePerChMean = GetESDsData(kESDClusterSizePerChMean);
379 TH1* hESDClusterSizePerChSigma = GetESDsData(kESDClusterSizePerChSigma);
380 TH1* hESDResidualXPerChMean = GetESDsData(kESDResidualXPerChMean);
381 TH1* hESDResidualXPerChSigma = GetESDsData(kESDResidualXPerChSigma);
382 TH1* hESDResidualYPerChMean = GetESDsData(kESDResidualYPerChMean);
383 TH1* hESDResidualYPerChSigma = GetESDsData(kESDResidualYPerChSigma);
384 TH1* hESDLocalChi2XPerChMean = GetESDsData(kESDLocalChi2XPerChMean);
385 TH1* hESDLocalChi2YPerChMean = GetESDsData(kESDLocalChi2YPerChMean);
386 TH1* hESDLocalChi2PerChMean = GetESDsData(kESDLocalChi2PerChMean);
387 TH1* hESDClusterChargePerDE = GetESDsData(kESDClusterChargePerDE);
388 TH1* hESDClusterSizePerDE = GetESDsData(kESDClusterSizePerDE);
389 TH1* hESDResidualXPerDEMean = GetESDsData(kESDResidualXPerDEMean);
390 TH1* hESDResidualXPerDESigma = GetESDsData(kESDResidualXPerDESigma);
391 TH1* hESDResidualYPerDEMean = GetESDsData(kESDResidualYPerDEMean);
392 TH1* hESDResidualYPerDESigma = GetESDsData(kESDResidualYPerDESigma);
393 TH1* hESDLocalChi2XPerDEMean = GetESDsData(kESDLocalChi2XPerDEMean);
394 TH1* hESDLocalChi2YPerDEMean = GetESDsData(kESDLocalChi2YPerDEMean);
395 TH1* hESDLocalChi2PerDEMean = GetESDsData(kESDLocalChi2PerDEMean);
396 TH1* hESDnTotClustersPerCh = GetESDsData(kESDnTotClustersPerCh);
397 TH1* hESDnTotClustersPerDE = GetESDsData(kESDnTotClustersPerDE);
398 TH1* hESDnTotFullClustersPerDE = GetESDsData(kESDnTotFullClustersPerDE);
399 TH1* hESDSumClusterChargePerDE = GetESDsData(kESDSumClusterChargePerDE);
400 TH1* hESDSumClusterSizePerDE = GetESDsData(kESDSumClusterSizePerDE);
401 TH1* hESDSumResidualXPerDE = GetESDsData(kESDSumResidualXPerDE);
402 TH1* hESDSumResidualYPerDE = GetESDsData(kESDSumResidualYPerDE);
403 TH1* hESDSumResidualX2PerDE = GetESDsData(kESDSumResidualX2PerDE);
404 TH1* hESDSumResidualY2PerDE = GetESDsData(kESDSumResidualY2PerDE);
405 TH1* hESDSumLocalChi2XPerDE = GetESDsData(kESDSumLocalChi2XPerDE);
406 TH1* hESDSumLocalChi2YPerDE = GetESDsData(kESDSumLocalChi2YPerDE);
407 TH1* hESDSumLocalChi2PerDE = GetESDsData(kESDSumLocalChi2PerDE);
409 hESDnClustersPerCh->Reset();
410 hESDnClustersPerDE->Reset();
411 hESDnClustersPerCh->Add(hESDnTotClustersPerCh, 1./nTracks);
412 hESDnClustersPerDE->Add(hESDnTotClustersPerDE, 1./nTracks);
414 // loop over chambers
415 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
417 TH1* hESDClusterChargeInCh = GetESDsData(kESDClusterChargeInCh+iCh);
418 Double_t sigmaCharge = hESDClusterChargeInCh->GetRMS();
419 hESDClusterChargePerChMean->SetBinContent(iCh+1, hESDClusterChargeInCh->GetMean());
420 hESDClusterChargePerChMean->SetBinError(iCh+1, hESDClusterChargeInCh->GetMeanError());
421 hESDClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
422 hESDClusterChargePerChSigma->SetBinError(iCh+1, hESDClusterChargeInCh->GetRMSError());
424 TH1* hESDClusterSizeInCh = GetESDsData(kESDClusterSizeInCh+iCh);
425 Double_t sigmaSize = hESDClusterSizeInCh->GetRMS();
426 hESDClusterSizePerChMean->SetBinContent(iCh+1, hESDClusterSizeInCh->GetMean());
427 hESDClusterSizePerChMean->SetBinError(iCh+1, hESDClusterSizeInCh->GetMeanError());
428 hESDClusterSizePerChSigma->SetBinContent(iCh+1, sigmaSize);
429 hESDClusterSizePerChSigma->SetBinError(iCh+1, hESDClusterSizeInCh->GetRMSError());
431 TH1* hESDResidualXInCh = GetESDsData(kESDResidualXInCh+iCh);
432 Double_t sigmaResidualX = hESDResidualXInCh->GetRMS();
433 hESDResidualXPerChMean->SetBinContent(iCh+1, hESDResidualXInCh->GetMean());
434 hESDResidualXPerChMean->SetBinError(iCh+1, hESDResidualXInCh->GetMeanError());
435 hESDResidualXPerChSigma->SetBinContent(iCh+1, sigmaResidualX);
436 hESDResidualXPerChSigma->SetBinError(iCh+1, hESDResidualXInCh->GetRMSError());
438 TH1* hESDResidualYInCh = GetESDsData(kESDResidualYInCh+iCh);
439 Double_t sigmaResidualY = hESDResidualYInCh->GetRMS();
440 hESDResidualYPerChMean->SetBinContent(iCh+1, hESDResidualYInCh->GetMean());
441 hESDResidualYPerChMean->SetBinError(iCh+1, hESDResidualYInCh->GetMeanError());
442 hESDResidualYPerChSigma->SetBinContent(iCh+1, sigmaResidualY);
443 hESDResidualYPerChSigma->SetBinError(iCh+1, hESDResidualYInCh->GetRMSError());
445 TH1* hESDLocalChi2XInCh = GetESDsData(kESDLocalChi2XInCh+iCh);
446 Double_t sigmaLocalChi2X = hESDLocalChi2XInCh->GetRMS();
447 hESDLocalChi2XPerChMean->SetBinContent(iCh+1, hESDLocalChi2XInCh->GetMean());
448 hESDLocalChi2XPerChMean->SetBinError(iCh+1, hESDLocalChi2XInCh->GetMeanError());
450 TH1* hESDLocalChi2YInCh = GetESDsData(kESDLocalChi2YInCh+iCh);
451 Double_t sigmaLocalChi2Y = hESDLocalChi2YInCh->GetRMS();
452 hESDLocalChi2YPerChMean->SetBinContent(iCh+1, hESDLocalChi2YInCh->GetMean());
453 hESDLocalChi2YPerChMean->SetBinError(iCh+1, hESDLocalChi2YInCh->GetMeanError());
455 TH1* hESDLocalChi2InCh = GetESDsData(kESDLocalChi2InCh+iCh);
456 Double_t sigmaLocalChi2 = hESDLocalChi2InCh->GetRMS();
457 hESDLocalChi2PerChMean->SetBinContent(iCh+1, hESDLocalChi2InCh->GetMean());
458 hESDLocalChi2PerChMean->SetBinError(iCh+1, hESDLocalChi2InCh->GetMeanError());
460 // loop over DE into chamber iCh
463 while ( !it.IsDone()) {
465 Int_t iDE = it.CurrentDEId();
467 Double_t nClusters = hESDnTotClustersPerDE->GetBinContent(iDE+1);
470 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1)/nClusters);
471 hESDClusterChargePerDE->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
473 Double_t meanResX = hESDSumResidualXPerDE->GetBinContent(iDE+1)/nClusters;
474 hESDResidualXPerDEMean->SetBinContent(iDE+1, meanResX);
475 hESDResidualXPerDEMean->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(nClusters));
476 hESDResidualXPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualX2PerDE->GetBinContent(iDE+1)/nClusters - meanResX*meanResX));
477 hESDResidualXPerDESigma->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(2.*nClusters));
479 Double_t meanResY = hESDSumResidualYPerDE->GetBinContent(iDE+1)/nClusters;
480 hESDResidualYPerDEMean->SetBinContent(iDE+1, meanResY);
481 hESDResidualYPerDEMean->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(nClusters));
482 hESDResidualYPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualY2PerDE->GetBinContent(iDE+1)/nClusters - meanResY*meanResY));
483 hESDResidualYPerDESigma->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(2.*nClusters));
485 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)/nClusters);
486 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, sigmaLocalChi2X/TMath::Sqrt(nClusters));
488 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1)/nClusters);
489 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, sigmaLocalChi2Y/TMath::Sqrt(nClusters));
491 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1)/nClusters);
492 hESDLocalChi2PerDEMean->SetBinError(iDE+1, sigmaLocalChi2/TMath::Sqrt(nClusters));
496 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1));
497 hESDClusterChargePerDE->SetBinError(iDE+1, hESDClusterChargeInCh->GetXaxis()->GetXmax());
499 hESDResidualXPerDEMean->SetBinContent(iDE+1, hESDSumResidualXPerDE->GetBinContent(iDE+1));
500 hESDResidualXPerDEMean->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
501 hESDResidualXPerDESigma->SetBinContent(iDE+1, 0.);
502 hESDResidualXPerDESigma->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
504 hESDResidualYPerDEMean->SetBinContent(iDE+1, hESDSumResidualYPerDE->GetBinContent(iDE+1));
505 hESDResidualYPerDEMean->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
506 hESDResidualYPerDESigma->SetBinContent(iDE+1, 0.);
507 hESDResidualYPerDESigma->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
509 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1));
510 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, hESDLocalChi2XInCh->GetXaxis()->GetXmax());
512 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1));
513 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, hESDLocalChi2YInCh->GetXaxis()->GetXmax());
515 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1));
516 hESDLocalChi2PerDEMean->SetBinError(iDE+1, hESDLocalChi2InCh->GetXaxis()->GetXmax());
520 Double_t nFullClusters = hESDnTotFullClustersPerDE->GetBinContent(iDE+1);
521 if (nFullClusters > 1) {
523 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1)/nFullClusters);
524 hESDClusterSizePerDE->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nFullClusters));
528 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1));
529 hESDClusterSizePerDE->SetBinError(iDE+1, hESDClusterSizeInCh->GetXaxis()->GetXmax());
540 // Display trigger histos in a more user friendly way
541 DisplayTriggerInfo(task);
544 // do the QA checking
545 AliQAChecker::Instance()->Run(AliQAv1::kMUON, task, list) ;
548 //____________________________________________________________________________
549 void AliMUONQADataMakerRec::InitRaws()
551 /// create Raws histograms in Raws subdir
553 AliCodeTimerAuto("");
555 const Bool_t expert = kTRUE ;
556 const Bool_t saveCorr = kTRUE ;
557 const Bool_t image = kTRUE ;
559 TString boardName = "Local board Id";
561 TString histoName, histoTitle;
562 for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
563 TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
564 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
565 histoName = Form("hTriggerScalers%sChamber%i", cathName.Data(), 11+iChamber);
566 histoTitle = Form("Chamber %i - %s: trigger scaler counts", 11+iChamber, cathName.Data());
567 TH2F* h3 = new TH2F(histoName.Data(), histoTitle.Data(),
570 h3->GetXaxis()->SetTitle(boardName.Data());
571 h3->GetYaxis()->SetTitle("Strip");
572 Add2RawsList(h3, kTriggerScalers + AliMpConstants::NofTriggerChambers()*iCath + iChamber, expert, !image, !saveCorr);
576 AliMUONTriggerDisplay triggerDisplay;
577 for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
578 TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
579 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
580 histoName = Form("hScalersDisplay%sChamber%i", cathName.Data(), 11+iChamber);
581 histoTitle = Form("Chamber %i - %s: Hit rate from scalers (Hz/cm^{2})", 11+iChamber, cathName.Data());
582 TH2F* h5 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips,
583 iCath, iChamber, histoTitle);
584 Add2RawsList(h5, kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber, !expert, image, !saveCorr);
588 FillTriggerDCSHistos();
590 TH1F* h10 = new TH1F("hTriggerScalersTime", "Acquisition time from trigger scalers", 1, 0.5, 1.5);
591 h10->GetXaxis()->SetBinLabel(1, "One-bin histogram: bin is filled at each scaler event.");
592 h10->GetYaxis()->SetTitle("Cumulated scaler time (s)");
593 Add2RawsList(h10, kTriggerScalersTime, !expert, !image, !saveCorr);
598 TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
599 AliMpBusPatch* bp(0x0);
600 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
602 bpmin = TMath::Min(bpmin,bp->GetId());
603 bpmax = TMath::Max(bpmax,bp->GetId());
606 Double_t xmin = bpmin-0.5;
607 Double_t xmax = bpmax+0.5;
608 Int_t nbins = bpmax-bpmin+1;
610 TH1* hbp = new TH1F("hTrackerBusPatchOccupancy","Occupancy of bus patches",nbins,xmin,xmax);
612 TH1* hbpnpads = new TH1F("hTrackerBusPatchNofPads","Number of pads per bus patch",nbins,xmin,xmax);
614 TH1* hbpnmanus = new TH1F("hTrackerBusPatchNofManus","Number of manus per bus patch",nbins,xmin,xmax);
616 Add2RawsList(hbp,kTrackerBusPatchOccupancy, !expert, image, !saveCorr);
617 Add2RawsList(hbpnpads,kTrackerBusPatchNofPads, expert, !image, !saveCorr);
618 Add2RawsList(hbpnmanus,kTrackerBusPatchNofManus, expert, !image, !saveCorr);
620 const Bool_t histogram(kFALSE);
622 if(!fTrackerDataMaker) fTrackerDataMaker = new AliMUONTrackerDataMaker(GetMUONRecoParam(),
623 AliCDBManager::Instance()->GetRun(),
630 fTrackerDataMaker->Data()->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level
632 fTrackerDataMaker->SetRunning(kTRUE);
635 //__________________________________________________________________
636 void AliMUONQADataMakerRec::InitDigits()
638 /// Initialized Digits spectra
639 const Bool_t expert = kTRUE ;
640 const Bool_t image = kTRUE ;
642 TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits;Detection element Id;Counts", 1400, 100, 1500);
643 Add2DigitsList(h0, 0, !expert, image);
645 TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits;ACD value;Counts", 4096, 0, 4095);
646 Add2DigitsList(h1, 1, !expert, image);
649 //____________________________________________________________________________
650 void AliMUONQADataMakerRec::InitRecPoints()
652 /// create Reconstructed Points histograms in RecPoints subdir
654 AliCodeTimerAuto("");
656 InitRecPointsTrigger();
657 InitRecPointsTracker();
660 //____________________________________________________________________________
661 void AliMUONQADataMakerRec::InitRecPointsTracker()
663 /// create Reconstructed Points histograms in RecPoints subdir for the
664 /// MUON tracker subsystem.
665 const Bool_t expert = kTRUE ;
666 const Bool_t image = kTRUE ;
668 AliCodeTimerAuto("");
674 // histograms per chamber
675 Int_t nCh = AliMpConstants::NofTrackingChambers();
676 for ( Int_t i = 0; i < nCh; ++i )
678 h1I = new TH1I(Form("hTrackerClusterMultiplicityForChamber%d",i+1), Form("cluster size distribution in chamber %d;size (n_{pads};Counts)",i+1), 100,0,100);
679 Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerChamber+i, expert, !image);
681 h1I = new TH1I(Form("hTrackerClusterChargeForChamber%d",i+1), Form("cluster charge distribution in chamber %d;charge (fC);Counts",i+1), 100,0,1000);
682 Add2RecPointsList(h1I,kTrackerClusterChargePerChamber+i, expert, !image);
684 Float_t rMax = AliMUONConstants::Rmax(i/2);
685 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);
686 Add2RecPointsList(h2F, kTrackerClusterHitMapPerChamber+i, expert, !image);
689 // summary histograms per chamber
690 h1I = new TH1I("hTrackerNumberOfClustersPerChamber", "Number of clusters per chamber;chamber ID;n_{clusters}", nCh,-0.5,nCh-0.5);
691 Add2RecPointsList(h1I,kTrackerNumberOfClustersPerChamber, !expert, image);
693 h1F = new TH1F("hTrackerClusterMultiplicityPerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh,-0.5,nCh-0.5);
695 h1F->SetMarkerStyle(kFullDotMedium);
696 h1F->SetMarkerColor(kRed);
697 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChMean, !expert, image);
699 h1F = new TH1F("hTrackerClusterMultiplicityPerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh,-0.5,nCh-0.5);
701 h1F->SetMarkerStyle(kFullDotMedium);
702 h1F->SetMarkerColor(kRed);
703 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChSigma, !expert, image);
705 h1F = new TH1F("hTrackerClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (fC)", nCh,-0.5,nCh-0.5);
707 h1F->SetMarkerStyle(kFullDotMedium);
708 h1F->SetMarkerColor(kRed);
709 Add2RecPointsList(h1F, kTrackerClusterChargePerChMean, !expert, image);
711 h1F = new TH1F("hTrackerClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (fC)", nCh,-0.5,nCh-0.5);
713 h1F->SetMarkerStyle(kFullDotMedium);
714 h1F->SetMarkerColor(kRed);
715 Add2RecPointsList(h1F, kTrackerClusterChargePerChSigma, !expert, image);
721 while ( !it.IsDone())
723 Int_t detElemId = it.CurrentDEId();
725 if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
727 ndes = TMath::Max(ndes,detElemId);
729 h1I = new TH1I(Form("hTrackerClusterMultiplicityForDE%04d",detElemId), Form("cluster size distribution in detection element %d;size (n_{pads})",detElemId), 100,0,100);
730 Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerDE+detElemId, expert, !image);
732 h1I = new TH1I(Form("hTrackerClusterChargeForDE%04d",detElemId), Form("cluster charge distribution in detection element %d;charge (fC)",detElemId), 100,0,1000);
733 Add2RecPointsList(h1I,kTrackerClusterChargePerDE+detElemId, expert, !image);
739 // summary histograms per DE
740 h1I = new TH1I("hTrackerNumberOfClustersPerDE", "Number of clusters per detection element;DetElem ID;n_{clusters}", ndes+1,-0.5,ndes+0.5);
741 Add2RecPointsList(h1I, kTrackerNumberOfClustersPerDE, !expert, image);
743 h1F = new TH1F("hTrackerClusterMultiplicityPerDEMean", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", ndes+1,-0.5,ndes+0.5);
745 h1F->SetMarkerStyle(kFullDotMedium);
746 h1F->SetMarkerColor(kRed);
747 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerDEMean, !expert, image);
749 h1F = new TH1F("hTrackerClusterChargePerDEMean", "cluster mean charge per DE;DetElem ID;<charge> (fC)", ndes+1,-0.5,ndes+0.5);
751 h1F->SetMarkerStyle(kFullDotMedium);
752 h1F->SetMarkerColor(kRed);
753 Add2RecPointsList(h1F, kTrackerClusterChargePerDEMean, !expert, image);
756 //____________________________________________________________________________
757 void AliMUONQADataMakerRec::InitRecPointsTrigger()
759 /// create Reconstructed Points histograms in RecPoints subdir for the
760 /// MUON Trigger subsystem.
762 const Bool_t expert = kTRUE ;
763 const Bool_t image = kTRUE ;
765 TString boardName = "Local board Id";
767 TString histoName, histoTitle;
768 for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
769 TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
770 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
771 histoName = Form("hTriggerDigits%sChamber%i", cathName.Data(), 11+iChamber);
772 histoTitle = Form("Chamber %i - %s: counts per strip", 11+iChamber, cathName.Data());
773 TH2F* h0 = new TH2F(histoName.Data(), histoTitle.Data(),
776 h0->GetXaxis()->SetTitle(boardName.Data());
777 h0->GetYaxis()->SetTitle("Strip");
778 Add2RecPointsList(h0, kTriggerDigits + AliMpConstants::NofTriggerChambers()*iCath + iChamber, expert, !image);
782 TH1F* h2 = new TH1F("hTriggeredBoards", "Triggered boards", 234, 0.5, 234.5);
783 Add2RecPointsList(h2, kTriggeredBoards, expert, !image);
785 AliMUONTriggerDisplay triggerDisplay;
786 for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
787 TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
788 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
789 histoName = Form("hTriggerDigitsDisplay%sChamber%i", cathName.Data(), 11+iChamber);
790 histoTitle = Form("Chamber %i - %s: Occupancy per strip (counts/event)", 11+iChamber, cathName.Data());
791 TH2F* h3 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips,
792 iCath, iChamber, histoTitle);
793 Add2RecPointsList(h3, kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber, !expert, image);
797 TH2F* h4 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto("hFiredBoardsDisplay", AliMUONTriggerDisplay::kDisplayBoards,
798 0, 0, "Local board triggers / event");
799 Add2RecPointsList(h4, kTriggerBoardsDisplay, !expert, image);
801 TH1F* h5 = new TH1F("hNAnalyzedEvents", "Number of analyzed events per specie", 1, 0.5, 1.5);
802 Int_t esindex = AliRecoParam::AConvert(fEventSpecie);
803 h5->GetXaxis()->SetBinLabel(1, AliRecoParam::GetEventSpecieName(esindex));
804 h5->GetYaxis()->SetTitle("Number of analyzed events");
805 Add2RecPointsList(h5, kNAnalyzedEvents, !expert, image);
809 //____________________________________________________________________________
810 void AliMUONQADataMakerRec::InitESDs()
812 ///create ESDs histograms in ESDs subdir
814 const Bool_t expert = kTRUE ;
815 const Bool_t image = kTRUE ;
817 Int_t nCh = AliMUONConstants::NTrackingCh();
821 TH1F* hESDnTracks = new TH1F("hESDnTracks", "number of tracks;n_{tracks}", 20, 0., 20.);
822 Add2ESDsList(hESDnTracks, kESDnTracks, !expert, image);
824 TH1F* hESDMatchTrig = new TH1F("hESDMatchTrig", "number of tracks matched with trigger;n_{tracks}", 20, 0., 20.);
825 Add2ESDsList(hESDMatchTrig, kESDMatchTrig, !expert, image);
827 TH1F* hESDMomentum = new TH1F("hESDMomentum", "momentum distribution;p (GeV/c)", 300, 0., 300);
828 Add2ESDsList(hESDMomentum, kESDMomentum, !expert, image);
830 TH1F* hESDPt = new TH1F("hESDPt", "transverse momentum distribution;p_{t} (GeV/c)", 200, 0., 50);
831 Add2ESDsList(hESDPt, kESDPt, !expert, image);
833 TH1F* hESDRapidity = new TH1F("hESDRapidity", "rapidity distribution;rapidity", 200, -4.5, -2.);
834 Add2ESDsList(hESDRapidity, kESDRapidity, !expert, image);
836 TH1F* hESDChi2 = new TH1F("hESDChi2", "normalized #chi^{2} distribution;#chi^{2} / ndf", 500, 0., 50.);
837 Add2ESDsList(hESDChi2, kESDChi2, !expert, image);
839 TH1F* hESDProbChi2 = new TH1F("hESDProbChi2", "distribution of probability of #chi^{2};prob(#chi^{2})", 100, 0., 1.);
840 Add2ESDsList(hESDProbChi2, kESDProbChi2, !expert, image);
842 TH1F* hESDThetaX = new TH1F("hESDThetaX", "#theta_{X} distribution;#theta_{X} (degree)", 360, -180., 180);
843 Add2ESDsList(hESDThetaX, kESDThetaX, !expert, image);
845 TH1F* hESDThetaY = new TH1F("hESDThetaY", "#theta_{Y} distribution;#theta_{Y} (degree)", 360, -180., 180);
846 Add2ESDsList(hESDThetaY, kESDThetaY, !expert, image);
849 for (Int_t i = 0; i < nCh; i++) {
850 Float_t rMax = AliMUONConstants::Rmax(i/2);
851 TH2F* hESDClusterHitMap = new TH2F(Form("hESDClusterHitMap%d",i+1), Form("cluster position distribution in chamber %d;X (cm);Y (cm)",i+1),
852 100, -rMax, rMax, 100, -rMax, rMax);
853 Add2ESDsList(hESDClusterHitMap, kESDClusterHitMap+i, expert, !image);
856 TH1F* hESDnClustersPerTrack = new TH1F("hESDnClustersPerTrack", "number of associated clusters per track;n_{clusters}", 20, 0., 20.);
857 Add2ESDsList(hESDnClustersPerTrack, kESDnClustersPerTrack, !expert, image);
859 TH1F* hESDnClustersPerCh = new TH1F("hESDnClustersPerCh", "averaged number of clusters per chamber per track;chamber ID;<n_{clusters}>", nCh, -0.5, nCh-0.5);
860 hESDnClustersPerCh->SetFillColor(kRed);
861 Add2ESDsList(hESDnClustersPerCh, kESDnClustersPerCh, !expert, image);
863 TH1F* hESDnClustersPerDE = new TH1F("hESDnClustersPerDE", "averaged number of clusters per DE per track;DetElem ID;<n_{clusters}>", nDE+1, -0.5, nDE+0.5);
864 hESDnClustersPerDE->SetFillColor(kRed);
865 Add2ESDsList(hESDnClustersPerDE, kESDnClustersPerDE, !expert, image);
867 for (Int_t i = 0; i < nCh; i++) {
868 TH1F* hESDClusterChargeInCh = new TH1F(Form("hESDClusterChargeInCh%d",i+1), Form("cluster charge distribution in chamber %d;charge (fC)",i+1), 100, 0., 1000.);
869 Add2ESDsList(hESDClusterChargeInCh, kESDClusterChargeInCh+i, expert, !image);
872 TH1F* hESDClusterChargePerChMean = new TH1F("hESDClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (fC)", nCh, -0.5, nCh-0.5);
873 hESDClusterChargePerChMean->SetOption("P");
874 hESDClusterChargePerChMean->SetMarkerStyle(kFullDotMedium);
875 hESDClusterChargePerChMean->SetMarkerColor(kRed);
876 Add2ESDsList(hESDClusterChargePerChMean, kESDClusterChargePerChMean, !expert, image);
878 TH1F* hESDClusterChargePerChSigma = new TH1F("hESDClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (fC)", nCh, -0.5, nCh-0.5);
879 hESDClusterChargePerChSigma->SetOption("P");
880 hESDClusterChargePerChSigma->SetMarkerStyle(kFullDotMedium);
881 hESDClusterChargePerChSigma->SetMarkerColor(kRed);
882 Add2ESDsList(hESDClusterChargePerChSigma, kESDClusterChargePerChSigma, !expert, image);
884 TH1F* hESDClusterChargePerDE = new TH1F("hESDClusterChargePerDE", "cluster mean charge per DE;DetElem ID;<charge> (fC)", nDE+1, -0.5, nDE+0.5);
885 hESDClusterChargePerDE->SetOption("P");
886 hESDClusterChargePerDE->SetMarkerStyle(kFullDotMedium);
887 hESDClusterChargePerDE->SetMarkerColor(kRed);
888 Add2ESDsList(hESDClusterChargePerDE, kESDClusterChargePerDE, !expert, image);
890 for (Int_t i = 0; i < nCh; i++) {
891 TH1F* hESDClusterSizeInCh = new TH1F(Form("hESDClusterSizeInCh%d",i+1), Form("cluster size distribution in chamber %d;size (n_{pads})",i+1), 200, 0., 200.);
892 Add2ESDsList(hESDClusterSizeInCh, kESDClusterSizeInCh+i, expert, !image);
895 TH1F* hESDClusterSizePerChMean = new TH1F("hESDClusterSizePerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh, -0.5, nCh-0.5);
896 hESDClusterSizePerChMean->SetOption("P");
897 hESDClusterSizePerChMean->SetMarkerStyle(kFullDotMedium);
898 hESDClusterSizePerChMean->SetMarkerColor(kRed);
899 Add2ESDsList(hESDClusterSizePerChMean, kESDClusterSizePerChMean, !expert, image);
901 TH1F* hESDClusterSizePerChSigma = new TH1F("hESDClusterSizePerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh, -0.5, nCh-0.5);
902 hESDClusterSizePerChSigma->SetOption("P");
903 hESDClusterSizePerChSigma->SetMarkerStyle(kFullDotMedium);
904 hESDClusterSizePerChSigma->SetMarkerColor(kRed);
905 Add2ESDsList(hESDClusterSizePerChSigma, kESDClusterSizePerChSigma, !expert, image);
907 TH1F* hESDClusterSizePerDE = new TH1F("hESDClusterSizePerDE", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", nDE+1, -0.5, nDE+0.5);
908 hESDClusterSizePerDE->SetOption("P");
909 hESDClusterSizePerDE->SetMarkerStyle(kFullDotMedium);
910 hESDClusterSizePerDE->SetMarkerColor(kRed);
911 Add2ESDsList(hESDClusterSizePerDE, kESDClusterSizePerDE, !expert, image);
913 // cluster - track info
914 for (Int_t i = 0; i < nCh; i++) {
915 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.);
916 Add2ESDsList(hESDResidualXInCh, kESDResidualXInCh+i, expert, !image);
918 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.);
919 Add2ESDsList(hESDResidualYInCh, kESDResidualYInCh+i, expert, !image);
921 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);
922 Add2ESDsList(hESDLocalChi2XInCh, kESDLocalChi2XInCh+i, expert, !image);
924 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);
925 Add2ESDsList(hESDLocalChi2YInCh, kESDLocalChi2YInCh+i, expert, !image);
927 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);
928 Add2ESDsList(hESDLocalChi2InCh, kESDLocalChi2InCh+i, expert, !image);
931 TH1F* hESDResidualXPerChMean = new TH1F("hESDResidualXPerChMean", "cluster-track residual-X per Ch: mean;chamber ID;<#Delta_{X}> (cm)", nCh, -0.5, nCh-0.5);
932 hESDResidualXPerChMean->SetOption("P");
933 hESDResidualXPerChMean->SetMarkerStyle(kFullDotMedium);
934 hESDResidualXPerChMean->SetMarkerColor(kRed);
935 Add2ESDsList(hESDResidualXPerChMean, kESDResidualXPerChMean, !expert, image);
937 TH1F* hESDResidualYPerChMean = new TH1F("hESDResidualYPerChMean", "cluster-track residual-Y per Ch: mean;chamber ID;<#Delta_{Y}> (cm)", nCh, -0.5, nCh-0.5);
938 hESDResidualYPerChMean->SetOption("P");
939 hESDResidualYPerChMean->SetMarkerStyle(kFullDotMedium);
940 hESDResidualYPerChMean->SetMarkerColor(kRed);
941 Add2ESDsList(hESDResidualYPerChMean, kESDResidualYPerChMean, !expert, image);
943 TH1F* hESDResidualXPerChSigma = new TH1F("hESDResidualXPerChSigma", "cluster-track residual-X per Ch: sigma;chamber ID;#sigma_{X} (cm)", nCh, -0.5, nCh-0.5);
944 hESDResidualXPerChSigma->SetOption("P");
945 hESDResidualXPerChSigma->SetMarkerStyle(kFullDotMedium);
946 hESDResidualXPerChSigma->SetMarkerColor(kRed);
947 Add2ESDsList(hESDResidualXPerChSigma, kESDResidualXPerChSigma, !expert, image);
949 TH1F* hESDResidualYPerChSigma = new TH1F("hESDResidualYPerChSigma", "cluster-track residual-Y per Ch: sigma;chamber ID;#sigma_{Y} (cm)", nCh, -0.5, nCh-0.5);
950 hESDResidualYPerChSigma->SetOption("P");
951 hESDResidualYPerChSigma->SetMarkerStyle(kFullDotMedium);
952 hESDResidualYPerChSigma->SetMarkerColor(kRed);
953 Add2ESDsList(hESDResidualYPerChSigma, kESDResidualYPerChSigma, !expert, image);
955 TH1F* hESDLocalChi2XPerChMean = new TH1F("hESDLocalChi2XPerCh", "local chi2-X per Ch: mean;chamber ID;<local #chi^{2}_{X}>", nCh, -0.5, nCh-0.5);
956 hESDLocalChi2XPerChMean->SetOption("P");
957 hESDLocalChi2XPerChMean->SetMarkerStyle(kFullDotMedium);
958 hESDLocalChi2XPerChMean->SetMarkerColor(kRed);
959 Add2ESDsList(hESDLocalChi2XPerChMean, kESDLocalChi2XPerChMean, !expert, image);
961 TH1F* hESDLocalChi2YPerChMean = new TH1F("hESDLocalChi2YPerCh", "local chi2-Y per Ch: mean;chamber ID;<local #chi^{2}_{Y}>", nCh, -0.5, nCh-0.5);
962 hESDLocalChi2YPerChMean->SetOption("P");
963 hESDLocalChi2YPerChMean->SetMarkerStyle(kFullDotMedium);
964 hESDLocalChi2YPerChMean->SetMarkerColor(kRed);
965 Add2ESDsList(hESDLocalChi2YPerChMean, kESDLocalChi2YPerChMean, !expert, image);
967 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);
968 hESDLocalChi2PerChMean->SetOption("P");
969 hESDLocalChi2PerChMean->SetMarkerStyle(kFullDotMedium);
970 hESDLocalChi2PerChMean->SetMarkerColor(kRed);
971 Add2ESDsList(hESDLocalChi2PerChMean, kESDLocalChi2PerChMean, !expert, image);
973 TH1F* hESDResidualXPerDEMean = new TH1F("hESDResidualXPerDEMean", "cluster-track residual-X per DE: mean;DetElem ID;<#Delta_{X}> (cm)", nDE+1, -0.5, nDE+0.5);
974 hESDResidualXPerDEMean->SetOption("P");
975 hESDResidualXPerDEMean->SetMarkerStyle(kFullDotMedium);
976 hESDResidualXPerDEMean->SetMarkerColor(kRed);
977 Add2ESDsList(hESDResidualXPerDEMean, kESDResidualXPerDEMean, !expert, image);
979 TH1F* hESDResidualYPerDEMean = new TH1F("hESDResidualYPerDEMean", "cluster-track residual-Y per DE: mean;DetElem ID;<#Delta_{Y}> (cm)", nDE+1, -0.5, nDE+0.5);
980 hESDResidualYPerDEMean->SetOption("P");
981 hESDResidualYPerDEMean->SetMarkerStyle(kFullDotMedium);
982 hESDResidualYPerDEMean->SetMarkerColor(kRed);
983 Add2ESDsList(hESDResidualYPerDEMean, kESDResidualYPerDEMean, !expert, image);
985 TH1F* hESDResidualXPerDESigma = new TH1F("hESDResidualXPerDESigma", "cluster-track residual-X per DE: sigma;DetElem ID;#sigma_{X} (cm)", nDE+1, -0.5, nDE+0.5);
986 hESDResidualXPerDESigma->SetOption("P");
987 hESDResidualXPerDESigma->SetMarkerStyle(kFullDotMedium);
988 hESDResidualXPerDESigma->SetMarkerColor(kRed);
989 Add2ESDsList(hESDResidualXPerDESigma, kESDResidualXPerDESigma, !expert, image);
991 TH1F* hESDResidualYPerDESigma = new TH1F("hESDResidualYPerDESigma", "cluster-track residual-Y per DE: sigma;DetElem ID;#sigma_{Y} (cm)", nDE+1, -0.5, nDE+0.5);
992 hESDResidualYPerDESigma->SetOption("P");
993 hESDResidualYPerDESigma->SetMarkerStyle(kFullDotMedium);
994 hESDResidualYPerDESigma->SetMarkerColor(kRed);
995 Add2ESDsList(hESDResidualYPerDESigma, kESDResidualYPerDESigma, !expert, image);
997 TH1F* hESDLocalChi2XPerDEMean = new TH1F("hESDLocalChi2XPerDE", "local chi2-X per DE: mean;DetElem ID;<local #chi^{2}_{X}>", nDE+1, -0.5, nDE+0.5);
998 hESDLocalChi2XPerDEMean->SetOption("P");
999 hESDLocalChi2XPerDEMean->SetMarkerStyle(kFullDotMedium);
1000 hESDLocalChi2XPerDEMean->SetMarkerColor(kRed);
1001 Add2ESDsList(hESDLocalChi2XPerDEMean, kESDLocalChi2XPerDEMean, !expert, image);
1003 TH1F* hESDLocalChi2YPerDEMean = new TH1F("hESDLocalChi2YPerDE", "local chi2-Y per DE: mean;DetElem ID;<local #chi^{2}_{Y}>", nDE+1, -0.5, nDE+0.5);
1004 hESDLocalChi2YPerDEMean->SetOption("P");
1005 hESDLocalChi2YPerDEMean->SetMarkerStyle(kFullDotMedium);
1006 hESDLocalChi2YPerDEMean->SetMarkerColor(kRed);
1007 Add2ESDsList(hESDLocalChi2YPerDEMean, kESDLocalChi2YPerDEMean, !expert, image);
1009 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);
1010 hESDLocalChi2PerDEMean->SetOption("P");
1011 hESDLocalChi2PerDEMean->SetMarkerStyle(kFullDotMedium);
1012 hESDLocalChi2PerDEMean->SetMarkerColor(kRed);
1013 Add2ESDsList(hESDLocalChi2PerDEMean, kESDLocalChi2PerDEMean, !expert, image);
1015 // intermediate histograms
1016 TH1F* hESDnTotClustersPerCh = new TH1F("hESDnTotClustersPerCh", "total number of associated clusters per chamber;chamber ID;#Sigma(n_{clusters})", nCh, -0.5, nCh-0.5);
1017 Add2ESDsList(hESDnTotClustersPerCh, kESDnTotClustersPerCh, expert, !image);
1018 TH1F* hESDnTotClustersPerDE = new TH1F("hESDnTotClustersPerDE", "total number of associated clusters per DE;DetElem ID;#Sigma(n_{clusters})", nDE+1, -0.5, nDE+0.5);
1019 Add2ESDsList(hESDnTotClustersPerDE, kESDnTotClustersPerDE, expert, !image);
1020 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);
1021 Add2ESDsList(hESDnTotFullClustersPerDE, kESDnTotFullClustersPerDE, expert, !image);
1022 TH1F* hESDSumClusterChargePerDE = new TH1F("hESDSumClusterChargePerDE", "sum of cluster charge per DE;DetElem ID;#Sigma(charge) (fC)", nDE+1, -0.5, nDE+0.5);
1023 Add2ESDsList(hESDSumClusterChargePerDE, kESDSumClusterChargePerDE, expert, !image);
1024 TH1F* hESDSumClusterSizePerDE = new TH1F("hESDSumClusterSizePerDE", "sum of cluster size per DE;DetElem ID;#Sigma(size) (n_{pads})", nDE+1, -0.5, nDE+0.5);
1025 Add2ESDsList(hESDSumClusterSizePerDE, kESDSumClusterSizePerDE, expert, !image);
1026 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);
1027 Add2ESDsList(hESDSumResidualXPerDE, kESDSumResidualXPerDE, expert, !image);
1028 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);
1029 Add2ESDsList(hESDSumResidualYPerDE, kESDSumResidualYPerDE, expert, !image);
1030 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);
1031 Add2ESDsList(hESDSumResidualX2PerDE, kESDSumResidualX2PerDE, expert, !image);
1032 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);
1033 Add2ESDsList(hESDSumResidualY2PerDE, kESDSumResidualY2PerDE, expert, !image);
1034 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);
1035 Add2ESDsList(hESDSumLocalChi2XPerDE, kESDSumLocalChi2XPerDE, expert, !image);
1036 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);
1037 Add2ESDsList(hESDSumLocalChi2YPerDE, kESDSumLocalChi2YPerDE, expert, !image);
1038 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);
1039 Add2ESDsList(hESDSumLocalChi2PerDE, kESDSumLocalChi2PerDE, expert, !image);
1042 //____________________________________________________________________________
1043 void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader)
1045 /// make QA for rawdata
1047 // Check id histograms already created for this Event Specie
1049 AliDebug(AliQAv1::GetQADebugLevel(),
1050 Form("RAW event type %s", AliRawEventHeaderBase::GetTypeName(rawReader->GetType())));
1052 if ( rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent )
1055 MakeRawsTracker(rawReader);
1058 if ( rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent ||
1059 rawReader->GetType() == AliRawEventHeaderBase::kCalibrationEvent )
1062 MakeRawsTrigger(rawReader);
1066 //____________________________________________________________________________
1067 void AliMUONQADataMakerRec::MakeRawsTracker(AliRawReader* rawReader)
1069 /// make QA for rawdata tracker
1072 GetRawsData(kTrackerBusPatchOccupancy);
1074 ((AliMUONTrackerDataMaker*)fTrackerDataMaker)->SetRawReader(rawReader);
1076 fTrackerDataMaker->ProcessEvent();
1079 //____________________________________________________________________________
1080 void AliMUONQADataMakerRec::MakeRawsTrigger(AliRawReader* rawReader)
1082 /// make QA for rawdata trigger
1084 // Get trigger scalers
1087 AliMpCDB::LoadDDLStore();
1089 AliMUONRawStreamTrigger rawStreamTrig(rawReader);
1090 while (rawStreamTrig.NextDDL())
1092 // If not a scaler event, do nothing
1093 Bool_t scalerEvent = rawReader->GetDataHeader()->GetL1TriggerMessage() & 0x1;
1094 if ( !scalerEvent ) continue;
1096 AliDebug(AliQAv1::GetQADebugLevel(),"Filling trigger scalers");
1098 AliMUONDDLTrigger* ddlTrigger = rawStreamTrig.GetDDLTrigger();
1099 AliMUONDarcHeader* darcHeader = ddlTrigger->GetDarcHeader();
1101 if (darcHeader->GetGlobalFlag()){
1102 UInt_t nOfClocks = darcHeader->GetGlobalClock();
1103 Double_t nOfSeconds = ((Double_t) nOfClocks) / 40e6; // 1 clock each 25 ns
1104 ((TH1F*)GetRawsData(kTriggerScalersTime))->Fill(1., nOfSeconds);
1107 Int_t nReg = darcHeader->GetRegHeaderEntries();
1109 for(Int_t iReg = 0; iReg < nReg ;iReg++)
1113 AliMpTriggerCrate* crate = AliMpDDLStore::Instance()->
1114 GetTriggerCrate(rawStreamTrig.GetDDL(), iReg);
1116 AliMUONRegHeader* regHeader = darcHeader->GetRegHeaderEntry(iReg);
1118 // loop over local structures
1119 Int_t nLocal = regHeader->GetLocalEntries();
1120 for(Int_t iLocal = 0; iLocal < nLocal; iLocal++)
1122 AliMUONLocalStruct* localStruct = regHeader->GetLocalEntry(iLocal);
1125 if (!localStruct) continue;
1127 loCircuit = crate->GetLocalBoardId(localStruct->GetId());
1129 if ( !loCircuit ) continue; // empty slot
1131 AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit, false);
1134 if( !localBoard->IsNotified())
1137 Int_t cathode = localStruct->GetComptXY()%2;
1140 for (Int_t ibitxy = 0; ibitxy < 16; ++ibitxy) {
1141 if(localStruct->GetXY1(ibitxy) > 0)
1142 ((TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*cathode + 0))
1143 ->Fill(loCircuit, ibitxy, 2*localStruct->GetXY1(ibitxy));
1144 if(localStruct->GetXY2(ibitxy) > 0)
1145 ((TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*cathode + 1))
1146 ->Fill(loCircuit, ibitxy, 2*localStruct->GetXY2(ibitxy));
1147 if(localStruct->GetXY3(ibitxy) > 0)
1148 ((TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*cathode + 2))
1149 ->Fill(loCircuit, ibitxy, 2*localStruct->GetXY3(ibitxy));
1150 if(localStruct->GetXY4(ibitxy) > 0)
1151 ((TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*cathode + 3))
1152 ->Fill(loCircuit, ibitxy, 2*localStruct->GetXY4(ibitxy));
1159 //__________________________________________________________________
1160 void AliMUONQADataMakerRec::MakeDigits(TTree* digitsTree)
1162 /// makes data from Digits
1164 // Do nothing in case of calibration event
1165 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
1168 fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
1169 fDigitStore->Connect(*digitsTree, false);
1170 digitsTree->GetEvent(0);
1172 TIter next(fDigitStore->CreateIterator());
1174 AliMUONVDigit* dig = 0x0;
1176 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
1178 GetDigitsData(0)->Fill(dig->DetElemId());
1179 GetDigitsData(1)->Fill(dig->ADC());
1183 //____________________________________________________________________________
1184 void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree)
1186 /// Fill histograms from treeR
1188 // Do nothing in case of calibration event
1189 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
1191 GetRecPointsData(kNAnalyzedEvents)->Fill(1.);
1193 MakeRecPointsTracker(clustersTree);
1194 MakeRecPointsTrigger(clustersTree);
1197 //____________________________________________________________________________
1198 void AliMUONQADataMakerRec::MakeRecPointsTracker(TTree* clustersTree)
1200 /// Fill histograms related to tracker clusters
1202 // First things first : do we have clusters in the TreeR ?
1203 // In "normal" production mode, it should be perfectly normal
1204 // *not* to have them.
1205 // But if for some reason we de-activated the combined tracking,
1206 // then we have clusters in TreeR, so let's take that opportunity
1211 AliCodeTimerAuto("ClusterStore creation");
1212 fClusterStore = AliMUONVClusterStore::Create(*clustersTree);
1219 AliCodeTimerAuto("");
1221 fClusterStore->Connect(*clustersTree,kFALSE);
1222 clustersTree->GetEvent(0);
1224 TIter next(fClusterStore->CreateIterator());
1225 AliMUONVCluster* cluster;
1227 while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) )
1229 Int_t detElemId = cluster->GetDetElemId();
1230 Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
1232 GetRecPointsData(kTrackerNumberOfClustersPerDE)->Fill(detElemId);
1233 GetRecPointsData(kTrackerClusterChargePerDE+detElemId)->Fill(cluster->GetCharge());
1234 GetRecPointsData(kTrackerClusterMultiplicityPerDE+detElemId)->Fill(cluster->GetNDigits());
1236 GetRecPointsData(kTrackerNumberOfClustersPerChamber)->Fill(chamberId);
1237 GetRecPointsData(kTrackerClusterChargePerChamber+chamberId)->Fill(cluster->GetCharge());
1238 GetRecPointsData(kTrackerClusterMultiplicityPerChamber+chamberId)->Fill(cluster->GetNDigits());
1239 GetRecPointsData(kTrackerClusterHitMapPerChamber+chamberId)->Fill(cluster->GetX(),cluster->GetY());
1243 fClusterStore->Clear();
1246 //____________________________________________________________________________
1247 void AliMUONQADataMakerRec::MakeRecPointsTrigger(TTree* clustersTree)
1249 /// makes data from trigger response
1252 fDigitStore->Clear();
1254 if (!fTriggerStore) fTriggerStore = AliMUONVTriggerStore::Create(*clustersTree);
1255 fTriggerStore->Clear();
1256 fTriggerStore->Connect(*clustersTree, false);
1257 clustersTree->GetEvent(0);
1259 AliMUONLocalTrigger* locTrg;
1260 TIter nextLoc(fTriggerStore->CreateLocalIterator());
1262 while ( ( locTrg = static_cast<AliMUONLocalTrigger*>(nextLoc()) ) )
1264 if (locTrg->IsNull()) continue;
1266 TArrayS xyPattern[2];
1267 locTrg->GetXPattern(xyPattern[0]);
1268 locTrg->GetYPattern(xyPattern[1]);
1270 Int_t nBoard = locTrg->LoCircuit();
1272 Bool_t xTrig=locTrg->IsTrigX();
1273 Bool_t yTrig=locTrg->IsTrigY();
1276 ((TH1F*)GetRecPointsData(kTriggeredBoards))->Fill(nBoard);
1278 fDigitMaker->TriggerDigits(nBoard, xyPattern, *fDigitStore);
1281 TIter nextDigit(fDigitStore->CreateIterator());
1282 AliMUONVDigit* mDigit;
1283 while ( ( mDigit = static_cast<AliMUONVDigit*>(nextDigit()) ) )
1285 Int_t detElemId = mDigit->DetElemId();
1286 Int_t ch = detElemId/100;
1287 Int_t localBoard = mDigit->ManuId();
1288 Int_t channel = mDigit->ManuChannel();
1289 Int_t cathode = mDigit->Cathode();
1290 Int_t iChamber = ch - 11;
1292 ((TH2F*)GetRecPointsData(kTriggerDigits + AliMpConstants::NofTriggerChambers()*cathode + iChamber))
1293 ->Fill(localBoard, channel);
1297 //____________________________________________________________________________
1298 void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd)
1300 /// make QA data from ESDs
1302 // Do nothing in case of calibration event
1303 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
1305 // load ESD event in the interface
1306 AliMUONESDInterface esdInterface;
1307 if (GetMUONRecoParam()) AliMUONESDInterface::ResetTracker(GetMUONRecoParam());
1308 else AliError("Unable to get recoParam: use default ones for residual calculation");
1309 esdInterface.LoadEvent(*esd);
1311 GetESDsData(kESDnTracks)->Fill(esdInterface.GetNTracks());
1313 Int_t nTrackMatchTrig = 0;
1316 Int_t nTracks = (Int_t) esd->GetNumberOfMuonTracks();
1317 for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
1319 // get the ESD track and skip "ghosts"
1320 AliESDMuonTrack* esdTrack = esd->GetMuonTrack(iTrack);
1321 if (!esdTrack->ContainTrackerData()) continue;
1323 // get corresponding MUON track
1324 AliMUONTrack* track = esdInterface.FindTrack(esdTrack->GetUniqueID());
1326 if (esdTrack->ContainTriggerData()) nTrackMatchTrig++;
1328 GetESDsData(kESDMomentum)->Fill(esdTrack->P());
1329 GetESDsData(kESDPt)->Fill(esdTrack->Pt());
1330 GetESDsData(kESDRapidity)->Fill(esdTrack->Y());
1331 GetESDsData(kESDChi2)->Fill(track->GetNormalizedChi2());
1332 GetESDsData(kESDProbChi2)->Fill(TMath::Prob(track->GetGlobalChi2(),track->GetNDF()));
1333 GetESDsData(kESDThetaX)->Fill(esdTrack->GetThetaXUncorrected() / TMath::Pi() * 180.);
1334 GetESDsData(kESDThetaY)->Fill(esdTrack->GetThetaYUncorrected() / TMath::Pi() * 180.);
1335 GetESDsData(kESDnClustersPerTrack)->Fill(track->GetNClusters());
1337 // loop over clusters
1338 AliMUONTrackParam* trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->First());
1339 while (trackParam) {
1341 AliMUONVCluster* cluster = trackParam->GetClusterPtr();
1342 Int_t chId = cluster->GetChamberId();
1343 Int_t deID = cluster->GetDetElemId();
1344 Double_t residualX = cluster->GetX() - trackParam->GetNonBendingCoor();
1345 Double_t residualY = cluster->GetY() - trackParam->GetBendingCoor();
1346 Double_t sigmaResidualX2 = cluster->GetErrX2() - trackParam->GetCovariances()(0,0);
1347 Double_t sigmaResidualY2 = cluster->GetErrY2() - trackParam->GetCovariances()(2,2);
1348 Double_t localChi2X = (sigmaResidualX2 > 0.) ? residualX*residualX/sigmaResidualX2 : 0.;
1349 Double_t localChi2Y = (sigmaResidualY2 > 0.) ? residualY*residualY/sigmaResidualY2 : 0.;
1350 Double_t localChi2 = 0.5 * trackParam->GetLocalChi2();
1352 GetESDsData(kESDClusterHitMap+chId)->Fill(cluster->GetX(), cluster->GetY());
1354 GetESDsData(kESDnTotClustersPerCh)->Fill(chId);
1355 GetESDsData(kESDnTotClustersPerDE)->Fill(deID);
1357 GetESDsData(kESDClusterChargeInCh+chId)->Fill(cluster->GetCharge());
1358 GetESDsData(kESDSumClusterChargePerDE)->Fill(deID, cluster->GetCharge());
1360 if (cluster->GetNDigits() > 0) { // discard clusters with pad not stored in ESD
1361 GetESDsData(kESDnTotFullClustersPerDE)->Fill(deID);
1362 GetESDsData(kESDClusterSizeInCh+chId)->Fill(cluster->GetNDigits());
1363 GetESDsData(kESDSumClusterSizePerDE)->Fill(deID, cluster->GetNDigits());
1366 GetESDsData(kESDResidualXInCh+chId)->Fill(residualX);
1367 GetESDsData(kESDResidualYInCh+chId)->Fill(residualY);
1368 GetESDsData(kESDSumResidualXPerDE)->Fill(deID, residualX);
1369 GetESDsData(kESDSumResidualYPerDE)->Fill(deID, residualY);
1370 GetESDsData(kESDSumResidualX2PerDE)->Fill(deID, residualX*residualX);
1371 GetESDsData(kESDSumResidualY2PerDE)->Fill(deID, residualY*residualY);
1373 GetESDsData(kESDLocalChi2XInCh+chId)->Fill(localChi2X);
1374 GetESDsData(kESDLocalChi2YInCh+chId)->Fill(localChi2Y);
1375 GetESDsData(kESDLocalChi2InCh+chId)->Fill(localChi2);
1376 GetESDsData(kESDSumLocalChi2XPerDE)->Fill(deID, localChi2X);
1377 GetESDsData(kESDSumLocalChi2YPerDE)->Fill(deID, localChi2Y);
1378 GetESDsData(kESDSumLocalChi2PerDE)->Fill(deID, localChi2);
1380 trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->After(trackParam));
1385 GetESDsData(kESDMatchTrig)->Fill(nTrackMatchTrig);
1389 //____________________________________________________________________________
1390 void AliMUONQADataMakerRec::StartOfDetectorCycle()
1392 /// Detector specific actions at start of cycle
1396 //____________________________________________________________________________
1397 void AliMUONQADataMakerRec::DisplayTriggerInfo(AliQAv1::TASKINDEX_t task)
1400 /// Display trigger information in a user-friendly way:
1401 /// from local board and strip numbers to their position on chambers
1405 if(task!=AliQAv1::kRECPOINTS && task!=AliQAv1::kRAWS) return;
1407 // check we get histograms, otherwise return right now
1408 if ( task == AliQAv1::kRECPOINTS )
1410 if ( !GetRecPointsData(kTriggerDigits) ) return;
1413 if ( task == AliQAv1::kRAWS )
1415 if ( !GetRawsData(kTriggerScalers) ) return;
1418 AliMUONTriggerDisplay triggerDisplay;
1420 TH2F* histoStrips=0x0;
1421 TH2F* histoDisplayStrips=0x0;
1422 AliMUONTriggerDisplay::EDisplayOption displayOption = AliMUONTriggerDisplay::kDefaultDisplay;
1423 if(task == AliQAv1::kRAWS) displayOption = AliMUONTriggerDisplay::kNormalizeToArea;
1425 for (Int_t iCath = 0; iCath < AliMpConstants::NofCathodes(); iCath++)
1427 for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++)
1429 if(task==AliQAv1::kRECPOINTS){
1430 histoStrips = (TH2F*)GetRecPointsData(kTriggerDigits + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
1432 else if(task==AliQAv1::kRAWS){
1433 histoStrips = (TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
1436 if(histoStrips->GetEntries()==0) continue; // No events found => No need to display
1438 if(task==AliQAv1::kRECPOINTS){
1439 histoDisplayStrips = (TH2F*)GetRecPointsData(kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
1441 else if(task==AliQAv1::kRAWS){
1442 histoDisplayStrips = (TH2F*)GetRawsData(kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
1445 triggerDisplay.FillDisplayHistogram(histoStrips, histoDisplayStrips,
1446 AliMUONTriggerDisplay::kDisplayStrips, iCath, iChamber, displayOption);
1448 Float_t scaleValue = 0.;
1449 if(task==AliQAv1::kRAWS) {
1450 scaleValue = ((TH1F*)GetRawsData(kTriggerScalersTime))->GetBinContent(1);
1452 else if ( task == AliQAv1::kRECPOINTS ) {
1453 scaleValue = GetRecPointsData(kNAnalyzedEvents)->GetBinContent(1);
1455 if(scaleValue>0.) histoDisplayStrips->Scale(1./scaleValue);
1459 if(task==AliQAv1::kRECPOINTS){
1460 TH1F* histoBoards = (TH1F*)GetRecPointsData(kTriggeredBoards);
1461 TH2F* histoDisplayBoards = (TH2F*)GetRecPointsData(kTriggerBoardsDisplay);
1462 triggerDisplay.FillDisplayHistogram(histoBoards, histoDisplayBoards, AliMUONTriggerDisplay::kDisplayBoards, 0, 0);
1463 Float_t scaleValue = GetRecPointsData(kNAnalyzedEvents)->GetBinContent(1);
1464 if(scaleValue>0.) histoDisplayBoards->Scale(1./scaleValue);
1469 //_____________________________________________________________________________
1471 AliMUONQADataMakerRec::FillTriggerDCSHistos()
1473 /// Get HV and currents values for one trigger chamber
1475 AliCodeTimerAuto("");
1477 AliMUONCalibrationData calibrationData(AliCDBManager::Instance()->GetRun());
1479 TMap* triggerDcsMap = calibrationData.TriggerDCS();
1481 if ( !triggerDcsMap )
1483 AliError("Cannot fill DCS histos, as triggerDcsMap is NULL");
1487 AliMpDEIterator deIt;
1491 AliMpDCSNamer triggerDcsNamer("TRIGGER");
1493 TH2* currHisto = 0x0;
1494 Int_t histoIndex = 0;
1495 TString histoName, histoTitle;
1497 Bool_t error = kFALSE;
1498 Bool_t expert = kTRUE;
1499 Bool_t saveCorr = kTRUE;
1500 Bool_t image = kTRUE;
1502 while ( !deIt.IsDone() )
1504 Int_t detElemId = deIt.CurrentDEId();
1506 if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStationTrigger) {
1508 Int_t iChamber = AliMpDEManager::GetChamberId(detElemId);
1509 Int_t slat = detElemId%100;
1511 for(Int_t iMeas=0; iMeas<AliMpDCSNamer::kNDCSMeas; iMeas++){
1512 TString currAlias = triggerDcsNamer.DCSChannelName(detElemId, 0, iMeas);
1514 AliDebug(AliQAv1::GetQADebugLevel(), Form("\nDetElemId %i dcsAlias %s", detElemId, currAlias.Data()));
1516 TPair* triggerDcsPair = static_cast<TPair*>(triggerDcsMap->FindObject(currAlias.Data()));
1518 if (!triggerDcsPair)
1520 AliError(Form("Did not find expected alias (%s) for DE %d",
1521 currAlias.Data(),detElemId));
1526 TObjArray* values = static_cast<TObjArray*>(triggerDcsPair->Value());
1529 AliError(Form("Could not get values for alias %s",currAlias.Data()));
1535 AliDCSValue* val = 0x0;
1537 Int_t ich = iChamber - AliMpConstants::NofTrackingChambers();
1540 case AliMpDCSNamer::kDCSI:
1541 histoIndex = kTriggerRPCi + ich;
1542 histoName = Form("hRPCIChamber%i", 11+ich);
1543 histoTitle = Form("Chamber %i: RPC Currents (#muA)", 11+ich);
1545 case AliMpDCSNamer::kDCSHV:
1546 histoIndex = kTriggerRPChv + ich;
1547 histoName = Form("hRPCHVChamber%i", 11+ich);
1548 histoTitle = Form("Chamber %i: RPC HV (V)", 11+ich);
1552 currHisto = (TH2F*) GetRawsData(histoIndex);
1555 Int_t npoints = values->GetEntries();
1556 TArrayF axisSlat(18+1), axisTime(npoints+1);
1557 for(Int_t islat=0; islat<=18; islat++){
1558 axisSlat[islat] = -0.5 + (Float_t)islat;
1560 for(Int_t ientry=0; ientry<npoints; ientry++){
1561 val = static_cast<AliDCSValue*>(values->At(ientry));
1562 axisTime[ientry] = val->GetTimeStamp();
1564 axisTime[npoints] = val->GetTimeStamp() + 100;
1566 currHisto = new TH2F(histoName.Data(), histoTitle.Data(),
1567 npoints, axisTime.GetArray(),
1568 18, axisSlat.GetArray());
1569 currHisto->GetXaxis()->SetTitle("Time");
1570 currHisto->GetXaxis()->SetTimeDisplay(1);
1571 //currHisto->GetXaxis()->SetTimeFormat("%d%b%y %H:%M:%S");
1572 currHisto->GetYaxis()->SetTitle("RPC");
1573 Add2RawsList(currHisto, histoIndex, !expert, image, !saveCorr);
1576 while ( ( val = static_cast<AliDCSValue*>(next()) ) )
1578 Float_t hvi = val->GetFloat();
1580 AliDebug(AliQAv1::GetQADebugLevel(), Form("Value %f", hvi));
1582 currHisto->Fill(1.0001 * val->GetTimeStamp(), slat, hvi);
1585 } // if (!triggerDcsPair)
1586 } // loop on measured types (HV and currents)
1587 } // if (stationType == kStationTrigger)
1594 //____________________________________________________________________________
1595 AliMUONVTrackerData* AliMUONQADataMakerRec::GetTrackerData() const
1597 /// Return tracker data
1599 return fTrackerDataMaker->Data();
1603 //____________________________________________________________________________
1605 AliMUONQADataMakerRec::BeautifyTrackerBusPatchOccupancy(TH1& hbp)
1607 /// Put labels, limits and so on on the TrackerBusPatchOccupancy histogram
1609 hbp.SetXTitle("Absolute Bus Patch Id");
1610 hbp.SetYTitle("Occupancy (percent)");
1611 hbp.SetStats(kFALSE);
1613 Double_t xmin = hbp.GetXaxis()->GetXmin();
1614 Double_t xmax = hbp.GetXaxis()->GetXmax();
1616 Double_t occMax(0.1); // 0.1% y-limit for the plot
1617 Double_t occError(1.0); // 1.0% y-limit to count the "errors"
1619 TLine* line = new TLine(xmin,occError,xmax,occError);
1620 line->SetLineColor(2);
1621 line->SetLineWidth(3);
1623 hbp.GetListOfFunctions()->Add(line);
1625 TH1* hnpads = GetRawsData(kTrackerBusPatchNofPads);
1626 hnpads->SetStats(kFALSE);
1627 TH1* hnmanus = GetRawsData(kTrackerBusPatchNofManus);
1628 hnmanus->SetStats(kFALSE);
1630 TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
1631 AliMpBusPatch* bp(0x0);
1632 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
1635 for ( Int_t imanu = 0; imanu < bp->GetNofManus(); ++imanu )
1637 Int_t manuId = bp->GetManuId(imanu);
1638 AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(bp->GetDEId());
1639 n += de->NofChannelsInManu(manuId);
1641 hnpads->Fill(bp->GetId(),n*1.0);
1642 hnmanus->Fill(bp->GetId(),bp->GetNofManus()*1.0);
1647 Int_t nMissingPads(0);
1649 Int_t nBusPatches(0);
1650 Int_t nMissingBusPatches(0);
1652 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
1654 Int_t bin = hbp.FindBin(bp->GetId());
1655 Int_t n = hnpads->GetBinContent(bin);
1661 if ( hbp.GetBinContent(bin) <= 0 )
1664 ++nMissingBusPatches;
1670 Double_t* x = new Double_t[nBusPatches];
1672 Int_t nBusPatchesAboveLimit(0);
1674 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
1676 Int_t bin = hbp.FindBin(bp->GetId());
1677 if ( hbp.GetBinContent(bin) > 0 )
1679 x[n] = hbp.GetBinContent(bin);
1682 if ( hbp.GetBinContent(bin) > occError )
1684 ++nBusPatchesAboveLimit;
1688 Double_t alpha(0.1); // trim 10% of data
1689 Double_t tmean,tvar;
1692 // computed the truncated mean of the occupancy values, in order to get a
1693 // reasonable y-range for the histogram (without giant peaks to the roof
1694 // for misbehaving buspatches).
1695 Int_t ok = trim(nBusPatches,x,alpha,tmean,tvar,ymin,ymax);
1703 ymax = TMath::Max(ymax,occMax);
1706 hbp.SetMaximum(ymax*1.4);
1708 TPaveText* text = new TPaveText(0.55,0.85,0.99,0.99,"NDC");
1712 text->AddText("Could not compute truncated mean. Not enough events ?");
1713 text->SetFillColor(2);
1715 else if (!nPads || !nBusPatches)
1717 text->AddText("Could not get the total number of pads. ERROR !!!");
1718 text->SetFillColor(2);
1722 Float_t missingPadFraction = nMissingPads*100.0/nPads;
1723 Float_t missingBusPatchFraction = nMissingBusPatches*100.0/nBusPatches;
1724 Float_t aboveLimitFraction = nBusPatchesAboveLimit*100.0/nBusPatches;
1726 text->AddText(Form("%5.2f %% of missing buspatches (%d out of %d)",missingBusPatchFraction,nMissingBusPatches,nBusPatches));
1727 text->AddText(Form("%5.2f %% of missing pads (%d out of %d)",missingPadFraction,nMissingPads,nPads));
1728 text->AddText(Form("%5.2f %% bus patches above the %5.2f %% limit",aboveLimitFraction,occError));
1729 text->AddText(Form("Truncated mean at %2d %% is %7.2f %%",(Int_t)(alpha*100),tmean));
1731 if ( missingPadFraction > 10.0 || aboveLimitFraction > 5.0 )
1733 text->SetFillColor(2);
1737 text->SetFillColor(3);
1741 hbp.GetListOfFunctions()->Add(text);