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 "AliMUONQAMappingCheck.h"
28 #include "AliMUONLocalStruct.h"
29 #include "AliMUONLocalTrigger.h"
30 #include "AliMUONRawStreamTracker.h"
31 #include "AliMUONRawStreamTrigger.h"
32 #include "AliMUONRegHeader.h"
33 #include "AliMUONTrackerDataMaker.h"
34 #include "AliMUONTriggerDisplay.h"
35 #include "AliMUONVCluster.h"
36 #include "AliMUONVClusterStore.h"
37 #include "AliMUONVDigit.h"
38 #include "AliMUONVDigitStore.h"
39 #include "AliMUONVTrackerData.h"
40 #include "AliMUONVTriggerStore.h"
41 #include "AliMUONTrack.h"
42 #include "AliMUONTrackParam.h"
43 #include "AliMUONESDInterface.h"
44 #include "AliMUONCalibrationData.h"
45 #include "AliMpBusPatch.h"
47 #include "AliMpConstants.h"
48 #include "AliMpDDLStore.h"
49 #include "AliMpDEIterator.h"
50 #include "AliMpDEManager.h"
51 #include "AliMpDetElement.h"
52 #include "AliMpLocalBoard.h"
53 #include "AliMpStationType.h"
54 #include "AliMpTriggerCrate.h"
55 #include "AliMpDCSNamer.h"
56 #include "AliRawEventHeaderBase.h"
58 // --- AliRoot header files ---
59 #include "AliCDBManager.h"
60 #include "AliCDBStorage.h"
61 #include "AliESDEvent.h"
62 #include "AliESDMuonTrack.h"
63 #include "AliESDMuonCluster.h"
65 #include "AliRawReader.h"
66 #include "AliQAChecker.h"
67 #include "AliCodeTimer.h"
68 #include "AliDCSValue.h"
69 #include "AliMUONVDigit.h"
71 // --- ROOT system ---
72 #include <TClonesArray.h>
78 #include <TPaveText.h>
79 #include <Riostream.h>
82 //-----------------------------------------------------------------------------
83 /// \class AliMUONQADataMakerRec
85 /// MUON base class for quality assurance data (histo) maker
87 /// \author C. Finck, D. Stocco, L. Aphecetche
90 ClassImp(AliMUONQADataMakerRec)
105 // Calculates the trimmed (tmean) mean
106 // of a sample (x) and estimates the variance (tvar)
110 // First check input parameters
112 // number of observations
118 if ( alpha < 0 || alpha >= 0.5 )
119 // proportion of observations
120 // to be trimmed at each end of the sorted sample
125 // Input parameters are good. Let's move on.
127 // Insure we use a sample sorted into ascending order.
129 Int_t* indices = new Int_t[n];
131 TMath::Sort(n,x,indices,kFALSE);
133 Double_t* sx = new Double_t[n];
135 for ( Int_t i = 0; i < n; ++i )
137 sx[i] = x[indices[i]];
142 // Number of observations trimmed at each end.
144 Int_t k = static_cast<Int_t>(floorf(alpha * n));
148 for ( Int_t i = k; i < n - k ; ++i )
153 tmean = sum / ( n - 2 * k );
157 for ( Int_t i = k; i < n - k; ++i )
159 t2 += (sx[i] - tmean) * (sx[i] - tmean);
164 k * (sx[k] - tmean) * (sx[k] - tmean) +
165 k * (sx[n - k - 1] - tmean) * (sx[n - k - 1] - tmean)
168 // get the min and max for the non-rejected values
172 for ( Int_t i = k; i < n-k; ++i )
174 min = TMath::Min(min,sx[i]);
175 max = TMath::Max(max,sx[i]);
184 //____________________________________________________________________________
185 AliMUONQADataMakerRec::AliMUONQADataMakerRec() :
186 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kMUON), "MUON Quality Assurance Data Maker"),
191 fTrackerDataMaker(0x0),
192 fMappingCheckRecPoints(0x0)
196 AliDebug(AliQAv1::GetQADebugLevel(),"");
201 //____________________________________________________________________________
203 AliMUONQADataMakerRec::Ctor()
205 /// Init some members
206 AliCodeTimerAuto("",);
207 fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV1");
208 fDigitMaker = new AliMUONDigitMaker(kTRUE);
211 //____________________________________________________________________________
212 AliMUONQADataMakerRec::AliMUONQADataMakerRec(const AliMUONQADataMakerRec& qadm) :
213 AliQADataMakerRec(qadm),
218 fTrackerDataMaker(0x0),
219 fMappingCheckRecPoints(0x0)
223 AliDebug(AliQAv1::GetQADebugLevel(),"");
226 SetName((const char*)qadm.GetName()) ;
227 SetTitle((const char*)qadm.GetTitle());
229 // Do not copy the digit store and digit maker, but create its own ones
235 //__________________________________________________________________
236 AliMUONQADataMakerRec& AliMUONQADataMakerRec::operator = (const AliMUONQADataMakerRec& qadm )
238 /// Assignment operator
240 AliDebug(AliQAv1::GetQADebugLevel(),"");
242 // check assignment to self
243 if (this == &qadm) return *this;
245 this->~AliMUONQADataMakerRec();
246 new(this) AliMUONQADataMakerRec(qadm);
250 //__________________________________________________________________
251 AliMUONQADataMakerRec::~AliMUONQADataMakerRec()
255 AliDebug(AliQAv1::GetQADebugLevel(),"");
257 AliCodeTimerAuto("",);
260 delete fTriggerStore;
262 delete fClusterStore;
263 delete fTrackerDataMaker;
264 delete fMappingCheckRecPoints;
267 //____________________________________________________________________________
268 void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
270 /// Detector specific actions at end of cycle
272 AliCodeTimerAuto("",);
274 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
276 if (! IsValidEventSpecie(specie, list) ) continue;
278 SetEventSpecie(AliRecoParam::ConvertIndex(specie));
280 if ( task == AliQAv1::kRAWS && fTrackerDataMaker )
282 // export trackerdata as is, and also make a summarized version (buspatchoccupancy)
283 EndOfDetectorCycleRaws(specie,list);
286 if ( task == AliQAv1::kRECPOINTS )
288 // normalize recpoints histograms
289 EndOfDetectorCycleRecPoints(specie,list);
292 if ( task == AliQAv1::kESDS )
294 // normalize esds histograms
295 EndOfDetectorCycleESDs();
298 // Display trigger histos in a more user friendly way
299 DisplayTriggerInfo(task);
303 // do the QA checking
304 AliQAChecker::Instance()->Run(AliQAv1::kMUON,task,list);
307 //____________________________________________________________________________
308 void AliMUONQADataMakerRec::InsertTrackerData(Int_t specie, TObjArray** list,
309 TObject* object, Int_t indexNumber,
312 /// Insert an object to a given list
314 TIter next(list[specie]);
317 Bool_t alreadyThere(kFALSE);
318 while ( ( o = next() ) && !alreadyThere )
320 TString classname(o->ClassName());
321 if ( classname.Contains("TrackerData") )
323 alreadyThere = kTRUE;
327 if ( (!alreadyThere && object) || (alreadyThere && replace) )
330 AliDebug(AliQAv1::GetQADebugLevel(), Form("Adding %s to the list of qa objects",object->GetName()));
331 list[specie]->AddAt(object,indexNumber);
335 //____________________________________________________________________________
336 void AliMUONQADataMakerRec::EndOfDetectorCycleESDs()
338 /// Normalize ESD histograms
340 if (!GetESDsData(kESDnClustersPerTrack)) return;
342 Double_t nTracks = GetESDsData(kESDnClustersPerTrack)->GetEntries();
343 if (nTracks <= 0) return;
345 TH1* hESDnClustersPerCh = GetESDsData(kESDnClustersPerCh);
346 TH1* hESDnClustersPerDE = GetESDsData(kESDnClustersPerDE);
347 TH1* hESDClusterChargePerChMean = GetESDsData(kESDClusterChargePerChMean);
348 TH1* hESDClusterChargePerChSigma = GetESDsData(kESDClusterChargePerChSigma);
349 TH1* hESDClusterSizePerChMean = GetESDsData(kESDClusterSizePerChMean);
350 TH1* hESDClusterSizePerChSigma = GetESDsData(kESDClusterSizePerChSigma);
351 TH1* hESDResidualXPerChMean = GetESDsData(kESDResidualXPerChMean);
352 TH1* hESDResidualXPerChSigma = GetESDsData(kESDResidualXPerChSigma);
353 TH1* hESDResidualYPerChMean = GetESDsData(kESDResidualYPerChMean);
354 TH1* hESDResidualYPerChSigma = GetESDsData(kESDResidualYPerChSigma);
355 TH1* hESDLocalChi2XPerChMean = GetESDsData(kESDLocalChi2XPerChMean);
356 TH1* hESDLocalChi2YPerChMean = GetESDsData(kESDLocalChi2YPerChMean);
357 TH1* hESDLocalChi2PerChMean = GetESDsData(kESDLocalChi2PerChMean);
358 TH1* hESDClusterChargePerDE = GetESDsData(kESDClusterChargePerDE);
359 TH1* hESDClusterSizePerDE = GetESDsData(kESDClusterSizePerDE);
360 TH1* hESDResidualXPerDEMean = GetESDsData(kESDResidualXPerDEMean);
361 TH1* hESDResidualXPerDESigma = GetESDsData(kESDResidualXPerDESigma);
362 TH1* hESDResidualYPerDEMean = GetESDsData(kESDResidualYPerDEMean);
363 TH1* hESDResidualYPerDESigma = GetESDsData(kESDResidualYPerDESigma);
364 TH1* hESDLocalChi2XPerDEMean = GetESDsData(kESDLocalChi2XPerDEMean);
365 TH1* hESDLocalChi2YPerDEMean = GetESDsData(kESDLocalChi2YPerDEMean);
366 TH1* hESDLocalChi2PerDEMean = GetESDsData(kESDLocalChi2PerDEMean);
367 TH1* hESDnTotClustersPerCh = GetESDsData(kESDnTotClustersPerCh);
368 TH1* hESDnTotClustersPerDE = GetESDsData(kESDnTotClustersPerDE);
369 TH1* hESDnTotFullClustersPerDE = GetESDsData(kESDnTotFullClustersPerDE);
370 TH1* hESDSumClusterChargePerDE = GetESDsData(kESDSumClusterChargePerDE);
371 TH1* hESDSumClusterSizePerDE = GetESDsData(kESDSumClusterSizePerDE);
372 TH1* hESDSumResidualXPerDE = GetESDsData(kESDSumResidualXPerDE);
373 TH1* hESDSumResidualYPerDE = GetESDsData(kESDSumResidualYPerDE);
374 TH1* hESDSumResidualX2PerDE = GetESDsData(kESDSumResidualX2PerDE);
375 TH1* hESDSumResidualY2PerDE = GetESDsData(kESDSumResidualY2PerDE);
376 TH1* hESDSumLocalChi2XPerDE = GetESDsData(kESDSumLocalChi2XPerDE);
377 TH1* hESDSumLocalChi2YPerDE = GetESDsData(kESDSumLocalChi2YPerDE);
378 TH1* hESDSumLocalChi2PerDE = GetESDsData(kESDSumLocalChi2PerDE);
380 hESDnClustersPerCh->Reset();
381 hESDnClustersPerDE->Reset();
382 hESDnClustersPerCh->Add(hESDnTotClustersPerCh, 1./nTracks);
383 hESDnClustersPerDE->Add(hESDnTotClustersPerDE, 1./nTracks);
385 // loop over chambers
386 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
388 TH1* hESDClusterChargeInCh = GetESDsData(kESDClusterChargeInCh+iCh);
389 Double_t sigmaCharge = hESDClusterChargeInCh->GetRMS();
390 hESDClusterChargePerChMean->SetBinContent(iCh+1, hESDClusterChargeInCh->GetMean());
391 hESDClusterChargePerChMean->SetBinError(iCh+1, hESDClusterChargeInCh->GetMeanError());
392 hESDClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
393 hESDClusterChargePerChSigma->SetBinError(iCh+1, hESDClusterChargeInCh->GetRMSError());
395 TH1* hESDClusterSizeInCh = GetESDsData(kESDClusterSizeInCh+iCh);
396 Double_t sigmaSize = hESDClusterSizeInCh->GetRMS();
397 hESDClusterSizePerChMean->SetBinContent(iCh+1, hESDClusterSizeInCh->GetMean());
398 hESDClusterSizePerChMean->SetBinError(iCh+1, hESDClusterSizeInCh->GetMeanError());
399 hESDClusterSizePerChSigma->SetBinContent(iCh+1, sigmaSize);
400 hESDClusterSizePerChSigma->SetBinError(iCh+1, hESDClusterSizeInCh->GetRMSError());
402 TH1* hESDResidualXInCh = GetESDsData(kESDResidualXInCh+iCh);
403 Double_t sigmaResidualX = hESDResidualXInCh->GetRMS();
404 hESDResidualXPerChMean->SetBinContent(iCh+1, hESDResidualXInCh->GetMean());
405 hESDResidualXPerChMean->SetBinError(iCh+1, hESDResidualXInCh->GetMeanError());
406 hESDResidualXPerChSigma->SetBinContent(iCh+1, sigmaResidualX);
407 hESDResidualXPerChSigma->SetBinError(iCh+1, hESDResidualXInCh->GetRMSError());
409 TH1* hESDResidualYInCh = GetESDsData(kESDResidualYInCh+iCh);
410 Double_t sigmaResidualY = hESDResidualYInCh->GetRMS();
411 hESDResidualYPerChMean->SetBinContent(iCh+1, hESDResidualYInCh->GetMean());
412 hESDResidualYPerChMean->SetBinError(iCh+1, hESDResidualYInCh->GetMeanError());
413 hESDResidualYPerChSigma->SetBinContent(iCh+1, sigmaResidualY);
414 hESDResidualYPerChSigma->SetBinError(iCh+1, hESDResidualYInCh->GetRMSError());
416 TH1* hESDLocalChi2XInCh = GetESDsData(kESDLocalChi2XInCh+iCh);
417 Double_t sigmaLocalChi2X = hESDLocalChi2XInCh->GetRMS();
418 hESDLocalChi2XPerChMean->SetBinContent(iCh+1, hESDLocalChi2XInCh->GetMean());
419 hESDLocalChi2XPerChMean->SetBinError(iCh+1, hESDLocalChi2XInCh->GetMeanError());
421 TH1* hESDLocalChi2YInCh = GetESDsData(kESDLocalChi2YInCh+iCh);
422 Double_t sigmaLocalChi2Y = hESDLocalChi2YInCh->GetRMS();
423 hESDLocalChi2YPerChMean->SetBinContent(iCh+1, hESDLocalChi2YInCh->GetMean());
424 hESDLocalChi2YPerChMean->SetBinError(iCh+1, hESDLocalChi2YInCh->GetMeanError());
426 TH1* hESDLocalChi2InCh = GetESDsData(kESDLocalChi2InCh+iCh);
427 Double_t sigmaLocalChi2 = hESDLocalChi2InCh->GetRMS();
428 hESDLocalChi2PerChMean->SetBinContent(iCh+1, hESDLocalChi2InCh->GetMean());
429 hESDLocalChi2PerChMean->SetBinError(iCh+1, hESDLocalChi2InCh->GetMeanError());
431 // loop over DE into chamber iCh
434 while ( !it.IsDone()) {
436 Int_t iDE = it.CurrentDEId();
438 Double_t nClusters = hESDnTotClustersPerDE->GetBinContent(iDE+1);
441 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1)/nClusters);
442 hESDClusterChargePerDE->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
444 Double_t meanResX = hESDSumResidualXPerDE->GetBinContent(iDE+1)/nClusters;
445 hESDResidualXPerDEMean->SetBinContent(iDE+1, meanResX);
446 hESDResidualXPerDEMean->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(nClusters));
447 hESDResidualXPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualX2PerDE->GetBinContent(iDE+1)/nClusters - meanResX*meanResX));
448 hESDResidualXPerDESigma->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(2.*nClusters));
450 Double_t meanResY = hESDSumResidualYPerDE->GetBinContent(iDE+1)/nClusters;
451 hESDResidualYPerDEMean->SetBinContent(iDE+1, meanResY);
452 hESDResidualYPerDEMean->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(nClusters));
453 hESDResidualYPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualY2PerDE->GetBinContent(iDE+1)/nClusters - meanResY*meanResY));
454 hESDResidualYPerDESigma->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(2.*nClusters));
456 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)/nClusters);
457 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, sigmaLocalChi2X/TMath::Sqrt(nClusters));
459 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1)/nClusters);
460 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, sigmaLocalChi2Y/TMath::Sqrt(nClusters));
462 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1)/nClusters);
463 hESDLocalChi2PerDEMean->SetBinError(iDE+1, sigmaLocalChi2/TMath::Sqrt(nClusters));
467 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1));
468 hESDClusterChargePerDE->SetBinError(iDE+1, hESDClusterChargeInCh->GetXaxis()->GetXmax());
470 hESDResidualXPerDEMean->SetBinContent(iDE+1, hESDSumResidualXPerDE->GetBinContent(iDE+1));
471 hESDResidualXPerDEMean->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
472 hESDResidualXPerDESigma->SetBinContent(iDE+1, 0.);
473 hESDResidualXPerDESigma->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
475 hESDResidualYPerDEMean->SetBinContent(iDE+1, hESDSumResidualYPerDE->GetBinContent(iDE+1));
476 hESDResidualYPerDEMean->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
477 hESDResidualYPerDESigma->SetBinContent(iDE+1, 0.);
478 hESDResidualYPerDESigma->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
480 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1));
481 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, hESDLocalChi2XInCh->GetXaxis()->GetXmax());
483 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1));
484 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, hESDLocalChi2YInCh->GetXaxis()->GetXmax());
486 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1));
487 hESDLocalChi2PerDEMean->SetBinError(iDE+1, hESDLocalChi2InCh->GetXaxis()->GetXmax());
491 Double_t nFullClusters = hESDnTotFullClustersPerDE->GetBinContent(iDE+1);
492 if (nFullClusters > 1) {
494 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1)/nFullClusters);
495 hESDClusterSizePerDE->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nFullClusters));
499 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1));
500 hESDClusterSizePerDE->SetBinError(iDE+1, hESDClusterSizeInCh->GetXaxis()->GetXmax());
511 //____________________________________________________________________________
512 void AliMUONQADataMakerRec::EndOfDetectorCycleRecPoints(Int_t specie, TObjArray** list)
514 /// Normalize RecPoints histograms
516 if (!GetRecPointsData(kTrackerClusterChargePerChMean)) return;
518 TH1* hTrackerClusterChargePerChMean = GetRecPointsData(kTrackerClusterChargePerChMean);
519 TH1* hTrackerClusterChargePerChSigma = GetRecPointsData(kTrackerClusterChargePerChSigma);
520 TH1* hTrackerClusterMultiplicityPerChMean = GetRecPointsData(kTrackerClusterMultiplicityPerChMean);
521 TH1* hTrackerClusterMultiplicityPerChSigma = GetRecPointsData(kTrackerClusterMultiplicityPerChSigma);
522 TH1* hTrackerClusterChargePerDEMean = GetRecPointsData(kTrackerClusterChargePerDEMean);
523 TH1* hTrackerClusterMultiplicityPerDEMean = GetRecPointsData(kTrackerClusterMultiplicityPerDEMean);
525 // loop over chambers
526 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
528 TH1* hTrackerClusterChargePerChamber = GetRecPointsData(kTrackerClusterChargePerChamber+iCh);
529 Double_t sigmaCharge = hTrackerClusterChargePerChamber->GetRMS();
530 hTrackerClusterChargePerChMean->SetBinContent(iCh+1, hTrackerClusterChargePerChamber->GetMean());
531 hTrackerClusterChargePerChMean->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetMeanError());
532 hTrackerClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
533 hTrackerClusterChargePerChSigma->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetRMSError());
535 TH1* hTrackerClusterMultiplicityPerChamber = GetRecPointsData(kTrackerClusterMultiplicityPerChamber+iCh);
536 Double_t sigmaSize = hTrackerClusterMultiplicityPerChamber->GetRMS();
537 hTrackerClusterMultiplicityPerChMean->SetBinContent(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMean());
538 hTrackerClusterMultiplicityPerChMean->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMeanError());
539 hTrackerClusterMultiplicityPerChSigma->SetBinContent(iCh+1, sigmaSize);
540 hTrackerClusterMultiplicityPerChSigma->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetRMSError());
542 // loop over DE into chamber iCh
545 while ( !it.IsDone()) {
547 Int_t iDE = it.CurrentDEId();
549 TH1* hTrackerClusterChargePerDE = GetRecPointsData(kTrackerClusterChargePerDE+iDE);
550 hTrackerClusterChargePerDEMean->SetBinContent(iDE+1, hTrackerClusterChargePerDE->GetMean());
551 Double_t nClusters = hTrackerClusterChargePerDE->GetEntries();
552 if (nClusters > 1) hTrackerClusterChargePerDEMean->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
553 else hTrackerClusterChargePerDEMean->SetBinError(iDE+1, hTrackerClusterChargePerChamber->GetXaxis()->GetXmax());
555 TH1* hTrackerClusterMultiplicityPerDE = GetRecPointsData(kTrackerClusterMultiplicityPerDE+iDE);
556 hTrackerClusterMultiplicityPerDEMean->SetBinContent(iDE+1, hTrackerClusterMultiplicityPerDE->GetMean());
557 nClusters = hTrackerClusterMultiplicityPerDE->GetEntries();
558 if (nClusters > 1) hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nClusters));
559 else hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, hTrackerClusterMultiplicityPerChamber->GetXaxis()->GetXmax());
565 if ( fMappingCheckRecPoints ) InsertTrackerData(specie,list,fMappingCheckRecPoints->CreateData("RecPoints"),kTrackerRecPoints,kTRUE);
569 //____________________________________________________________________________
570 void AliMUONQADataMakerRec::EndOfDetectorCycleRaws(Int_t specie, TObjArray** list)
572 /// create Raws histograms in Raws subdir
574 if ( !GetRawsData(kTrackerBusPatchOccupancy) ) return;
576 if ( fTrackerDataMaker )
578 InsertTrackerData(specie,list,fTrackerDataMaker->Data(),kTrackerData);
580 TH1* hbp = GetRawsData(kTrackerBusPatchOccupancy);
582 TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator());
583 AliMpBusPatch* bp(0x0);
584 AliMUONVTrackerData* data = fTrackerDataMaker->Data();
587 while ( ( bp = static_cast<AliMpBusPatch*>(nextBP())) )
589 Int_t busPatchId = bp->GetId();
590 Int_t bin = hbp->FindBin(busPatchId);
591 hbp->SetBinContent(bin,data->BusPatch(busPatchId,occDim)*100.0); // occupancy, in percent
594 BeautifyTrackerBusPatchOccupancy(*hbp);
598 //____________________________________________________________________________
599 void AliMUONQADataMakerRec::InitRaws()
601 /// create Raws histograms in Raws subdir
603 AliCodeTimerAuto("",);
605 const Bool_t expert = kTRUE ;
606 const Bool_t saveCorr = kTRUE ;
607 const Bool_t image = kTRUE ;
609 TString boardName = "Local board Id";
611 TString histoName, histoTitle;
612 for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
613 TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
614 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
615 histoName = Form("hTriggerScalers%sChamber%i", cathName.Data(), 11+iChamber);
616 histoTitle = Form("Chamber %i - %s: trigger scaler counts", 11+iChamber, cathName.Data());
617 TH2F* h3 = new TH2F(histoName.Data(), histoTitle.Data(),
620 h3->GetXaxis()->SetTitle(boardName.Data());
621 h3->GetYaxis()->SetTitle("Strip");
622 Add2RawsList(h3, kTriggerScalers + AliMpConstants::NofTriggerChambers()*iCath + iChamber, expert, !image, !saveCorr);
626 AliMUONTriggerDisplay triggerDisplay;
627 for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
628 TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
629 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
630 histoName = Form("hScalersDisplay%sChamber%i", cathName.Data(), 11+iChamber);
631 histoTitle = Form("Chamber %i - %s: Hit rate from scalers (Hz/cm^{2})", 11+iChamber, cathName.Data());
632 TH2F* h5 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips,
633 iCath, iChamber, histoTitle);
634 Add2RawsList(h5, kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber, !expert, image, !saveCorr);
638 FillTriggerDCSHistos();
640 TH1F* h10 = new TH1F("hTriggerScalersTime", "Acquisition time from trigger scalers", 1, 0.5, 1.5);
641 h10->GetXaxis()->SetBinLabel(1, "One-bin histogram: bin is filled at each scaler event.");
642 h10->GetYaxis()->SetTitle("Cumulated scaler time (s)");
643 Add2RawsList(h10, kTriggerScalersTime, !expert, !image, !saveCorr);
648 TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
649 AliMpBusPatch* bp(0x0);
650 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
652 bpmin = TMath::Min(bpmin,bp->GetId());
653 bpmax = TMath::Max(bpmax,bp->GetId());
656 Double_t xmin = bpmin-0.5;
657 Double_t xmax = bpmax+0.5;
658 Int_t nbins = bpmax-bpmin+1;
660 TH1* hbp = new TH1F("hTrackerBusPatchOccupancy","Occupancy of bus patches",nbins,xmin,xmax);
662 TH1* hbpnpads = new TH1F("hTrackerBusPatchNofPads","Number of pads per bus patch",nbins,xmin,xmax);
664 TH1* hbpnmanus = new TH1F("hTrackerBusPatchNofManus","Number of manus per bus patch",nbins,xmin,xmax);
666 Add2RawsList(hbp,kTrackerBusPatchOccupancy, !expert, image, !saveCorr);
667 Add2RawsList(hbpnpads,kTrackerBusPatchNofPads, expert, !image, !saveCorr);
668 Add2RawsList(hbpnmanus,kTrackerBusPatchNofManus, expert, !image, !saveCorr);
670 const Bool_t histogram(kFALSE);
672 if(!fTrackerDataMaker)
674 fTrackerDataMaker = new AliMUONTrackerDataMaker(GetMUONRecoParam(),
675 AliCDBManager::Instance()->GetRun(),
683 fTrackerDataMaker->Data()->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level
685 fTrackerDataMaker->SetRunning(kTRUE);
688 //__________________________________________________________________
689 void AliMUONQADataMakerRec::InitDigits()
691 /// Initialized Digits spectra
692 const Bool_t expert = kTRUE ;
693 const Bool_t image = kTRUE ;
695 TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits;Detection element Id;Counts", 1400, 100, 1500);
696 Add2DigitsList(h0, 0, !expert, image);
698 TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits;ACD value;Counts", 4096, 0, 4095);
699 Add2DigitsList(h1, 1, !expert, image);
702 //____________________________________________________________________________
703 void AliMUONQADataMakerRec::InitRecPoints()
705 /// create Reconstructed Points histograms in RecPoints subdir
707 AliCodeTimerAuto("",);
709 InitRecPointsTrigger();
710 InitRecPointsTracker();
713 //____________________________________________________________________________
714 void AliMUONQADataMakerRec::InitRecPointsTracker()
716 /// create Reconstructed Points histograms in RecPoints subdir for the
717 /// MUON tracker subsystem.
718 const Bool_t expert = kTRUE ;
719 const Bool_t image = kTRUE ;
721 AliCodeTimerAuto("",);
727 // histograms per chamber
728 Int_t nCh = AliMpConstants::NofTrackingChambers();
729 for ( Int_t i = 0; i < nCh; ++i )
731 h1I = new TH1I(Form("hTrackerClusterMultiplicityForChamber%d",i+1), Form("cluster size distribution in chamber %d;size (n_{pads};Counts)",i+1), 100,0,100);
732 Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerChamber+i, expert, !image);
734 h1I = new TH1I(Form("hTrackerClusterChargeForChamber%d",i+1), Form("cluster charge distribution in chamber %d;charge (fC);Counts",i+1), 100,0,1000);
735 Add2RecPointsList(h1I,kTrackerClusterChargePerChamber+i, expert, !image);
737 Float_t rMax = AliMUONConstants::Rmax(i/2);
738 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);
739 Add2RecPointsList(h2F, kTrackerClusterHitMapPerChamber+i, expert, !image);
742 // summary histograms per chamber
743 h1I = new TH1I("hTrackerNumberOfClustersPerChamber", "Number of clusters per chamber;chamber ID;n_{clusters}", nCh,-0.5,nCh-0.5);
744 Add2RecPointsList(h1I,kTrackerNumberOfClustersPerChamber, !expert, image);
746 h1F = new TH1F("hTrackerClusterMultiplicityPerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh,-0.5,nCh-0.5);
748 h1F->SetMarkerStyle(kFullDotMedium);
749 h1F->SetMarkerColor(kRed);
750 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChMean, !expert, image);
752 h1F = new TH1F("hTrackerClusterMultiplicityPerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh,-0.5,nCh-0.5);
754 h1F->SetMarkerStyle(kFullDotMedium);
755 h1F->SetMarkerColor(kRed);
756 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChSigma, !expert, image);
758 h1F = new TH1F("hTrackerClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (fC)", nCh,-0.5,nCh-0.5);
760 h1F->SetMarkerStyle(kFullDotMedium);
761 h1F->SetMarkerColor(kRed);
762 Add2RecPointsList(h1F, kTrackerClusterChargePerChMean, !expert, image);
764 h1F = new TH1F("hTrackerClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (fC)", nCh,-0.5,nCh-0.5);
766 h1F->SetMarkerStyle(kFullDotMedium);
767 h1F->SetMarkerColor(kRed);
768 Add2RecPointsList(h1F, kTrackerClusterChargePerChSigma, !expert, image);
774 while ( !it.IsDone())
776 Int_t detElemId = it.CurrentDEId();
778 if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
780 ndes = TMath::Max(ndes,detElemId);
782 h1I = new TH1I(Form("hTrackerClusterMultiplicityForDE%04d",detElemId), Form("cluster size distribution in detection element %d;size (n_{pads})",detElemId), 100,0,100);
783 Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerDE+detElemId, expert, !image);
785 h1I = new TH1I(Form("hTrackerClusterChargeForDE%04d",detElemId), Form("cluster charge distribution in detection element %d;charge (fC)",detElemId), 100,0,1000);
786 Add2RecPointsList(h1I,kTrackerClusterChargePerDE+detElemId, expert, !image);
792 // summary histograms per DE
793 h1I = new TH1I("hTrackerNumberOfClustersPerDE", "Number of clusters per detection element;DetElem ID;n_{clusters}", ndes+1,-0.5,ndes+0.5);
794 Add2RecPointsList(h1I, kTrackerNumberOfClustersPerDE, !expert, image);
796 h1F = new TH1F("hTrackerClusterMultiplicityPerDEMean", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", ndes+1,-0.5,ndes+0.5);
798 h1F->SetMarkerStyle(kFullDotMedium);
799 h1F->SetMarkerColor(kRed);
800 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerDEMean, !expert, image);
802 h1F = new TH1F("hTrackerClusterChargePerDEMean", "cluster mean charge per DE;DetElem ID;<charge> (fC)", ndes+1,-0.5,ndes+0.5);
804 h1F->SetMarkerStyle(kFullDotMedium);
805 h1F->SetMarkerColor(kRed);
806 Add2RecPointsList(h1F, kTrackerClusterChargePerDEMean, !expert, image);
808 if (!fMappingCheckRecPoints) fMappingCheckRecPoints = new AliMUONQAMappingCheck(fRun);
811 //____________________________________________________________________________
812 void AliMUONQADataMakerRec::InitRecPointsTrigger()
814 /// create Reconstructed Points histograms in RecPoints subdir for the
815 /// MUON Trigger subsystem.
817 const Bool_t expert = kTRUE ;
818 const Bool_t image = kTRUE ;
820 TString boardName = "Local board Id";
822 TString histoName, histoTitle;
823 for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
824 TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
825 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
826 histoName = Form("hTriggerDigits%sChamber%i", cathName.Data(), 11+iChamber);
827 histoTitle = Form("Chamber %i - %s: counts per strip", 11+iChamber, cathName.Data());
828 TH2F* h0 = new TH2F(histoName.Data(), histoTitle.Data(),
831 h0->GetXaxis()->SetTitle(boardName.Data());
832 h0->GetYaxis()->SetTitle("Strip");
833 Add2RecPointsList(h0, kTriggerDigits + AliMpConstants::NofTriggerChambers()*iCath + iChamber, expert, !image);
837 TH1F* h2 = new TH1F("hTriggeredBoards", "Triggered boards", 234, 0.5, 234.5);
838 Add2RecPointsList(h2, kTriggeredBoards, expert, !image);
840 AliMUONTriggerDisplay triggerDisplay;
841 for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
842 TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
843 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
844 histoName = Form("hTriggerDigitsDisplay%sChamber%i", cathName.Data(), 11+iChamber);
845 histoTitle = Form("Chamber %i - %s: Occupancy per strip (counts/event)", 11+iChamber, cathName.Data());
846 TH2F* h3 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips,
847 iCath, iChamber, histoTitle);
848 Add2RecPointsList(h3, kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber, !expert, image);
852 TH2F* h4 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto("hFiredBoardsDisplay", AliMUONTriggerDisplay::kDisplayBoards,
853 0, 0, "Local board triggers / event");
854 Add2RecPointsList(h4, kTriggerBoardsDisplay, !expert, image);
856 TH1F* h5 = new TH1F("hNAnalyzedEvents", "Number of analyzed events per specie", 1, 0.5, 1.5);
857 Int_t esindex = AliRecoParam::AConvert(fEventSpecie);
858 h5->GetXaxis()->SetBinLabel(1, AliRecoParam::GetEventSpecieName(esindex));
859 h5->GetYaxis()->SetTitle("Number of analyzed events");
860 Add2RecPointsList(h5, kNAnalyzedEvents, !expert, image);
864 //____________________________________________________________________________
865 void AliMUONQADataMakerRec::InitESDs()
867 ///create ESDs histograms in ESDs subdir
869 const Bool_t expert = kTRUE ;
870 const Bool_t image = kTRUE ;
872 Int_t nCh = AliMUONConstants::NTrackingCh();
876 TH1F* hESDnTracks = new TH1F("hESDnTracks", "number of tracks;n_{tracks}", 20, 0., 20.);
877 Add2ESDsList(hESDnTracks, kESDnTracks, !expert, image);
879 TH1F* hESDMatchTrig = new TH1F("hESDMatchTrig", "number of tracks matched with trigger;n_{tracks}", 20, 0., 20.);
880 Add2ESDsList(hESDMatchTrig, kESDMatchTrig, !expert, image);
882 TH1F* hESDMomentum = new TH1F("hESDMomentum", "momentum distribution;p (GeV/c)", 300, 0., 300);
883 Add2ESDsList(hESDMomentum, kESDMomentum, !expert, image);
885 TH1F* hESDPt = new TH1F("hESDPt", "transverse momentum distribution;p_{t} (GeV/c)", 200, 0., 50);
886 Add2ESDsList(hESDPt, kESDPt, !expert, image);
888 TH1F* hESDRapidity = new TH1F("hESDRapidity", "rapidity distribution;rapidity", 200, -4.5, -2.);
889 Add2ESDsList(hESDRapidity, kESDRapidity, !expert, image);
891 TH1F* hESDChi2 = new TH1F("hESDChi2", "normalized #chi^{2} distribution;#chi^{2} / ndf", 500, 0., 50.);
892 Add2ESDsList(hESDChi2, kESDChi2, !expert, image);
894 TH1F* hESDProbChi2 = new TH1F("hESDProbChi2", "distribution of probability of #chi^{2};prob(#chi^{2})", 100, 0., 1.);
895 Add2ESDsList(hESDProbChi2, kESDProbChi2, !expert, image);
897 TH1F* hESDThetaX = new TH1F("hESDThetaX", "#theta_{X} distribution;#theta_{X} (degree)", 360, -180., 180);
898 Add2ESDsList(hESDThetaX, kESDThetaX, !expert, image);
900 TH1F* hESDThetaY = new TH1F("hESDThetaY", "#theta_{Y} distribution;#theta_{Y} (degree)", 360, -180., 180);
901 Add2ESDsList(hESDThetaY, kESDThetaY, !expert, image);
904 for (Int_t i = 0; i < nCh; i++) {
905 Float_t rMax = AliMUONConstants::Rmax(i/2);
906 TH2F* hESDClusterHitMap = new TH2F(Form("hESDClusterHitMap%d",i+1), Form("cluster position distribution in chamber %d;X (cm);Y (cm)",i+1),
907 100, -rMax, rMax, 100, -rMax, rMax);
908 Add2ESDsList(hESDClusterHitMap, kESDClusterHitMap+i, expert, !image);
911 TH1F* hESDnClustersPerTrack = new TH1F("hESDnClustersPerTrack", "number of associated clusters per track;n_{clusters}", 20, 0., 20.);
912 Add2ESDsList(hESDnClustersPerTrack, kESDnClustersPerTrack, !expert, image);
914 TH1F* hESDnClustersPerCh = new TH1F("hESDnClustersPerCh", "averaged number of clusters per chamber per track;chamber ID;<n_{clusters}>", nCh, -0.5, nCh-0.5);
915 hESDnClustersPerCh->SetFillColor(kRed);
916 Add2ESDsList(hESDnClustersPerCh, kESDnClustersPerCh, !expert, image);
918 TH1F* hESDnClustersPerDE = new TH1F("hESDnClustersPerDE", "averaged number of clusters per DE per track;DetElem ID;<n_{clusters}>", nDE+1, -0.5, nDE+0.5);
919 hESDnClustersPerDE->SetFillColor(kRed);
920 Add2ESDsList(hESDnClustersPerDE, kESDnClustersPerDE, !expert, image);
922 for (Int_t i = 0; i < nCh; i++) {
923 TH1F* hESDClusterChargeInCh = new TH1F(Form("hESDClusterChargeInCh%d",i+1), Form("cluster charge distribution in chamber %d;charge (fC)",i+1), 100, 0., 1000.);
924 Add2ESDsList(hESDClusterChargeInCh, kESDClusterChargeInCh+i, expert, !image);
927 TH1F* hESDClusterChargePerChMean = new TH1F("hESDClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (fC)", nCh, -0.5, nCh-0.5);
928 hESDClusterChargePerChMean->SetOption("P");
929 hESDClusterChargePerChMean->SetMarkerStyle(kFullDotMedium);
930 hESDClusterChargePerChMean->SetMarkerColor(kRed);
931 Add2ESDsList(hESDClusterChargePerChMean, kESDClusterChargePerChMean, !expert, image);
933 TH1F* hESDClusterChargePerChSigma = new TH1F("hESDClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (fC)", nCh, -0.5, nCh-0.5);
934 hESDClusterChargePerChSigma->SetOption("P");
935 hESDClusterChargePerChSigma->SetMarkerStyle(kFullDotMedium);
936 hESDClusterChargePerChSigma->SetMarkerColor(kRed);
937 Add2ESDsList(hESDClusterChargePerChSigma, kESDClusterChargePerChSigma, !expert, image);
939 TH1F* hESDClusterChargePerDE = new TH1F("hESDClusterChargePerDE", "cluster mean charge per DE;DetElem ID;<charge> (fC)", nDE+1, -0.5, nDE+0.5);
940 hESDClusterChargePerDE->SetOption("P");
941 hESDClusterChargePerDE->SetMarkerStyle(kFullDotMedium);
942 hESDClusterChargePerDE->SetMarkerColor(kRed);
943 Add2ESDsList(hESDClusterChargePerDE, kESDClusterChargePerDE, !expert, image);
945 for (Int_t i = 0; i < nCh; i++) {
946 TH1F* hESDClusterSizeInCh = new TH1F(Form("hESDClusterSizeInCh%d",i+1), Form("cluster size distribution in chamber %d;size (n_{pads})",i+1), 200, 0., 200.);
947 Add2ESDsList(hESDClusterSizeInCh, kESDClusterSizeInCh+i, expert, !image);
950 TH1F* hESDClusterSizePerChMean = new TH1F("hESDClusterSizePerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh, -0.5, nCh-0.5);
951 hESDClusterSizePerChMean->SetOption("P");
952 hESDClusterSizePerChMean->SetMarkerStyle(kFullDotMedium);
953 hESDClusterSizePerChMean->SetMarkerColor(kRed);
954 Add2ESDsList(hESDClusterSizePerChMean, kESDClusterSizePerChMean, !expert, image);
956 TH1F* hESDClusterSizePerChSigma = new TH1F("hESDClusterSizePerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh, -0.5, nCh-0.5);
957 hESDClusterSizePerChSigma->SetOption("P");
958 hESDClusterSizePerChSigma->SetMarkerStyle(kFullDotMedium);
959 hESDClusterSizePerChSigma->SetMarkerColor(kRed);
960 Add2ESDsList(hESDClusterSizePerChSigma, kESDClusterSizePerChSigma, !expert, image);
962 TH1F* hESDClusterSizePerDE = new TH1F("hESDClusterSizePerDE", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", nDE+1, -0.5, nDE+0.5);
963 hESDClusterSizePerDE->SetOption("P");
964 hESDClusterSizePerDE->SetMarkerStyle(kFullDotMedium);
965 hESDClusterSizePerDE->SetMarkerColor(kRed);
966 Add2ESDsList(hESDClusterSizePerDE, kESDClusterSizePerDE, !expert, image);
968 // cluster - track info
969 for (Int_t i = 0; i < nCh; i++) {
970 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.);
971 Add2ESDsList(hESDResidualXInCh, kESDResidualXInCh+i, expert, !image);
973 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.);
974 Add2ESDsList(hESDResidualYInCh, kESDResidualYInCh+i, expert, !image);
976 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);
977 Add2ESDsList(hESDLocalChi2XInCh, kESDLocalChi2XInCh+i, expert, !image);
979 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);
980 Add2ESDsList(hESDLocalChi2YInCh, kESDLocalChi2YInCh+i, expert, !image);
982 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);
983 Add2ESDsList(hESDLocalChi2InCh, kESDLocalChi2InCh+i, expert, !image);
986 TH1F* hESDResidualXPerChMean = new TH1F("hESDResidualXPerChMean", "cluster-track residual-X per Ch: mean;chamber ID;<#Delta_{X}> (cm)", nCh, -0.5, nCh-0.5);
987 hESDResidualXPerChMean->SetOption("P");
988 hESDResidualXPerChMean->SetMarkerStyle(kFullDotMedium);
989 hESDResidualXPerChMean->SetMarkerColor(kRed);
990 Add2ESDsList(hESDResidualXPerChMean, kESDResidualXPerChMean, !expert, image);
992 TH1F* hESDResidualYPerChMean = new TH1F("hESDResidualYPerChMean", "cluster-track residual-Y per Ch: mean;chamber ID;<#Delta_{Y}> (cm)", nCh, -0.5, nCh-0.5);
993 hESDResidualYPerChMean->SetOption("P");
994 hESDResidualYPerChMean->SetMarkerStyle(kFullDotMedium);
995 hESDResidualYPerChMean->SetMarkerColor(kRed);
996 Add2ESDsList(hESDResidualYPerChMean, kESDResidualYPerChMean, !expert, image);
998 TH1F* hESDResidualXPerChSigma = new TH1F("hESDResidualXPerChSigma", "cluster-track residual-X per Ch: sigma;chamber ID;#sigma_{X} (cm)", nCh, -0.5, nCh-0.5);
999 hESDResidualXPerChSigma->SetOption("P");
1000 hESDResidualXPerChSigma->SetMarkerStyle(kFullDotMedium);
1001 hESDResidualXPerChSigma->SetMarkerColor(kRed);
1002 Add2ESDsList(hESDResidualXPerChSigma, kESDResidualXPerChSigma, !expert, image);
1004 TH1F* hESDResidualYPerChSigma = new TH1F("hESDResidualYPerChSigma", "cluster-track residual-Y per Ch: sigma;chamber ID;#sigma_{Y} (cm)", nCh, -0.5, nCh-0.5);
1005 hESDResidualYPerChSigma->SetOption("P");
1006 hESDResidualYPerChSigma->SetMarkerStyle(kFullDotMedium);
1007 hESDResidualYPerChSigma->SetMarkerColor(kRed);
1008 Add2ESDsList(hESDResidualYPerChSigma, kESDResidualYPerChSigma, !expert, image);
1010 TH1F* hESDLocalChi2XPerChMean = new TH1F("hESDLocalChi2XPerCh", "local chi2-X per Ch: mean;chamber ID;<local #chi^{2}_{X}>", nCh, -0.5, nCh-0.5);
1011 hESDLocalChi2XPerChMean->SetOption("P");
1012 hESDLocalChi2XPerChMean->SetMarkerStyle(kFullDotMedium);
1013 hESDLocalChi2XPerChMean->SetMarkerColor(kRed);
1014 Add2ESDsList(hESDLocalChi2XPerChMean, kESDLocalChi2XPerChMean, !expert, image);
1016 TH1F* hESDLocalChi2YPerChMean = new TH1F("hESDLocalChi2YPerCh", "local chi2-Y per Ch: mean;chamber ID;<local #chi^{2}_{Y}>", nCh, -0.5, nCh-0.5);
1017 hESDLocalChi2YPerChMean->SetOption("P");
1018 hESDLocalChi2YPerChMean->SetMarkerStyle(kFullDotMedium);
1019 hESDLocalChi2YPerChMean->SetMarkerColor(kRed);
1020 Add2ESDsList(hESDLocalChi2YPerChMean, kESDLocalChi2YPerChMean, !expert, image);
1022 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);
1023 hESDLocalChi2PerChMean->SetOption("P");
1024 hESDLocalChi2PerChMean->SetMarkerStyle(kFullDotMedium);
1025 hESDLocalChi2PerChMean->SetMarkerColor(kRed);
1026 Add2ESDsList(hESDLocalChi2PerChMean, kESDLocalChi2PerChMean, !expert, image);
1028 TH1F* hESDResidualXPerDEMean = new TH1F("hESDResidualXPerDEMean", "cluster-track residual-X per DE: mean;DetElem ID;<#Delta_{X}> (cm)", nDE+1, -0.5, nDE+0.5);
1029 hESDResidualXPerDEMean->SetOption("P");
1030 hESDResidualXPerDEMean->SetMarkerStyle(kFullDotMedium);
1031 hESDResidualXPerDEMean->SetMarkerColor(kRed);
1032 Add2ESDsList(hESDResidualXPerDEMean, kESDResidualXPerDEMean, !expert, image);
1034 TH1F* hESDResidualYPerDEMean = new TH1F("hESDResidualYPerDEMean", "cluster-track residual-Y per DE: mean;DetElem ID;<#Delta_{Y}> (cm)", nDE+1, -0.5, nDE+0.5);
1035 hESDResidualYPerDEMean->SetOption("P");
1036 hESDResidualYPerDEMean->SetMarkerStyle(kFullDotMedium);
1037 hESDResidualYPerDEMean->SetMarkerColor(kRed);
1038 Add2ESDsList(hESDResidualYPerDEMean, kESDResidualYPerDEMean, !expert, image);
1040 TH1F* hESDResidualXPerDESigma = new TH1F("hESDResidualXPerDESigma", "cluster-track residual-X per DE: sigma;DetElem ID;#sigma_{X} (cm)", nDE+1, -0.5, nDE+0.5);
1041 hESDResidualXPerDESigma->SetOption("P");
1042 hESDResidualXPerDESigma->SetMarkerStyle(kFullDotMedium);
1043 hESDResidualXPerDESigma->SetMarkerColor(kRed);
1044 Add2ESDsList(hESDResidualXPerDESigma, kESDResidualXPerDESigma, !expert, image);
1046 TH1F* hESDResidualYPerDESigma = new TH1F("hESDResidualYPerDESigma", "cluster-track residual-Y per DE: sigma;DetElem ID;#sigma_{Y} (cm)", nDE+1, -0.5, nDE+0.5);
1047 hESDResidualYPerDESigma->SetOption("P");
1048 hESDResidualYPerDESigma->SetMarkerStyle(kFullDotMedium);
1049 hESDResidualYPerDESigma->SetMarkerColor(kRed);
1050 Add2ESDsList(hESDResidualYPerDESigma, kESDResidualYPerDESigma, !expert, image);
1052 TH1F* hESDLocalChi2XPerDEMean = new TH1F("hESDLocalChi2XPerDE", "local chi2-X per DE: mean;DetElem ID;<local #chi^{2}_{X}>", nDE+1, -0.5, nDE+0.5);
1053 hESDLocalChi2XPerDEMean->SetOption("P");
1054 hESDLocalChi2XPerDEMean->SetMarkerStyle(kFullDotMedium);
1055 hESDLocalChi2XPerDEMean->SetMarkerColor(kRed);
1056 Add2ESDsList(hESDLocalChi2XPerDEMean, kESDLocalChi2XPerDEMean, !expert, image);
1058 TH1F* hESDLocalChi2YPerDEMean = new TH1F("hESDLocalChi2YPerDE", "local chi2-Y per DE: mean;DetElem ID;<local #chi^{2}_{Y}>", nDE+1, -0.5, nDE+0.5);
1059 hESDLocalChi2YPerDEMean->SetOption("P");
1060 hESDLocalChi2YPerDEMean->SetMarkerStyle(kFullDotMedium);
1061 hESDLocalChi2YPerDEMean->SetMarkerColor(kRed);
1062 Add2ESDsList(hESDLocalChi2YPerDEMean, kESDLocalChi2YPerDEMean, !expert, image);
1064 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);
1065 hESDLocalChi2PerDEMean->SetOption("P");
1066 hESDLocalChi2PerDEMean->SetMarkerStyle(kFullDotMedium);
1067 hESDLocalChi2PerDEMean->SetMarkerColor(kRed);
1068 Add2ESDsList(hESDLocalChi2PerDEMean, kESDLocalChi2PerDEMean, !expert, image);
1070 // intermediate histograms
1071 TH1F* hESDnTotClustersPerCh = new TH1F("hESDnTotClustersPerCh", "total number of associated clusters per chamber;chamber ID;#Sigma(n_{clusters})", nCh, -0.5, nCh-0.5);
1072 Add2ESDsList(hESDnTotClustersPerCh, kESDnTotClustersPerCh, expert, !image);
1073 TH1F* hESDnTotClustersPerDE = new TH1F("hESDnTotClustersPerDE", "total number of associated clusters per DE;DetElem ID;#Sigma(n_{clusters})", nDE+1, -0.5, nDE+0.5);
1074 Add2ESDsList(hESDnTotClustersPerDE, kESDnTotClustersPerDE, expert, !image);
1075 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);
1076 Add2ESDsList(hESDnTotFullClustersPerDE, kESDnTotFullClustersPerDE, expert, !image);
1077 TH1F* hESDSumClusterChargePerDE = new TH1F("hESDSumClusterChargePerDE", "sum of cluster charge per DE;DetElem ID;#Sigma(charge) (fC)", nDE+1, -0.5, nDE+0.5);
1078 Add2ESDsList(hESDSumClusterChargePerDE, kESDSumClusterChargePerDE, expert, !image);
1079 TH1F* hESDSumClusterSizePerDE = new TH1F("hESDSumClusterSizePerDE", "sum of cluster size per DE;DetElem ID;#Sigma(size) (n_{pads})", nDE+1, -0.5, nDE+0.5);
1080 Add2ESDsList(hESDSumClusterSizePerDE, kESDSumClusterSizePerDE, expert, !image);
1081 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);
1082 Add2ESDsList(hESDSumResidualXPerDE, kESDSumResidualXPerDE, expert, !image);
1083 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);
1084 Add2ESDsList(hESDSumResidualYPerDE, kESDSumResidualYPerDE, expert, !image);
1085 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);
1086 Add2ESDsList(hESDSumResidualX2PerDE, kESDSumResidualX2PerDE, expert, !image);
1087 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);
1088 Add2ESDsList(hESDSumResidualY2PerDE, kESDSumResidualY2PerDE, expert, !image);
1089 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);
1090 Add2ESDsList(hESDSumLocalChi2XPerDE, kESDSumLocalChi2XPerDE, expert, !image);
1091 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);
1092 Add2ESDsList(hESDSumLocalChi2YPerDE, kESDSumLocalChi2YPerDE, expert, !image);
1093 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);
1094 Add2ESDsList(hESDSumLocalChi2PerDE, kESDSumLocalChi2PerDE, expert, !image);
1097 //____________________________________________________________________________
1098 void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader)
1100 /// make QA for rawdata
1102 // Check id histograms already created for this Event Specie
1104 AliDebug(AliQAv1::GetQADebugLevel(),
1105 Form("RAW event type %s", AliRawEventHeaderBase::GetTypeName(rawReader->GetType())));
1107 if ( rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent )
1110 MakeRawsTracker(rawReader);
1113 if ( rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent ||
1114 rawReader->GetType() == AliRawEventHeaderBase::kCalibrationEvent )
1117 MakeRawsTrigger(rawReader);
1121 //____________________________________________________________________________
1122 void AliMUONQADataMakerRec::MakeRawsTracker(AliRawReader* rawReader)
1124 /// make QA for rawdata tracker
1127 GetRawsData(kTrackerBusPatchOccupancy);
1129 ((AliMUONTrackerDataMaker*)fTrackerDataMaker)->SetRawReader(rawReader);
1131 fTrackerDataMaker->ProcessEvent();
1134 //____________________________________________________________________________
1135 void AliMUONQADataMakerRec::MakeRawsTrigger(AliRawReader* rawReader)
1137 /// make QA for rawdata trigger
1139 // Get trigger scalers
1142 AliMpCDB::LoadDDLStore();
1144 AliMUONRawStreamTrigger rawStreamTrig(rawReader);
1145 while (rawStreamTrig.NextDDL())
1147 // If not a scaler event, do nothing
1148 Bool_t scalerEvent = rawReader->GetDataHeader()->GetL1TriggerMessage() & 0x1;
1149 if ( !scalerEvent ) continue;
1151 AliDebug(AliQAv1::GetQADebugLevel(),"Filling trigger scalers");
1153 AliMUONDDLTrigger* ddlTrigger = rawStreamTrig.GetDDLTrigger();
1154 AliMUONDarcHeader* darcHeader = ddlTrigger->GetDarcHeader();
1156 if (darcHeader->GetGlobalFlag()){
1157 UInt_t nOfClocks = darcHeader->GetGlobalClock();
1158 Double_t nOfSeconds = ((Double_t) nOfClocks) / 40e6; // 1 clock each 25 ns
1159 ((TH1F*)GetRawsData(kTriggerScalersTime))->Fill(1., nOfSeconds);
1162 Int_t nReg = darcHeader->GetRegHeaderEntries();
1164 for(Int_t iReg = 0; iReg < nReg ;iReg++)
1168 AliMpTriggerCrate* crate = AliMpDDLStore::Instance()->
1169 GetTriggerCrate(rawStreamTrig.GetDDL(), iReg);
1171 AliMUONRegHeader* regHeader = darcHeader->GetRegHeaderEntry(iReg);
1173 // loop over local structures
1174 Int_t nLocal = regHeader->GetLocalEntries();
1175 for(Int_t iLocal = 0; iLocal < nLocal; iLocal++)
1177 AliMUONLocalStruct* localStruct = regHeader->GetLocalEntry(iLocal);
1180 if (!localStruct) continue;
1182 loCircuit = crate->GetLocalBoardId(localStruct->GetId());
1184 if ( !loCircuit ) continue; // empty slot
1186 AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit, false);
1189 if( !localBoard->IsNotified())
1192 Int_t cathode = localStruct->GetComptXY()%2;
1195 for (Int_t ibitxy = 0; ibitxy < 16; ++ibitxy) {
1196 if(localStruct->GetXY1(ibitxy) > 0)
1197 ((TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*cathode + 0))
1198 ->Fill(loCircuit, ibitxy, 2*localStruct->GetXY1(ibitxy));
1199 if(localStruct->GetXY2(ibitxy) > 0)
1200 ((TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*cathode + 1))
1201 ->Fill(loCircuit, ibitxy, 2*localStruct->GetXY2(ibitxy));
1202 if(localStruct->GetXY3(ibitxy) > 0)
1203 ((TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*cathode + 2))
1204 ->Fill(loCircuit, ibitxy, 2*localStruct->GetXY3(ibitxy));
1205 if(localStruct->GetXY4(ibitxy) > 0)
1206 ((TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*cathode + 3))
1207 ->Fill(loCircuit, ibitxy, 2*localStruct->GetXY4(ibitxy));
1214 //__________________________________________________________________
1215 void AliMUONQADataMakerRec::MakeDigits(TTree* digitsTree)
1217 /// makes data from Digits
1219 // Do nothing in case of calibration event
1220 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
1223 fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
1224 fDigitStore->Connect(*digitsTree, false);
1225 digitsTree->GetEvent(0);
1227 TIter next(fDigitStore->CreateIterator());
1229 AliMUONVDigit* dig = 0x0;
1231 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
1233 GetDigitsData(0)->Fill(dig->DetElemId());
1234 GetDigitsData(1)->Fill(dig->ADC());
1238 //____________________________________________________________________________
1239 void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree)
1241 /// Fill histograms from treeR
1243 // Do nothing in case of calibration event
1244 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
1246 GetRecPointsData(kNAnalyzedEvents)->Fill(1.);
1248 MakeRecPointsTracker(clustersTree);
1249 MakeRecPointsTrigger(clustersTree);
1254 //____________________________________________________________________________
1255 void AliMUONQADataMakerRec::MakeRecPointsTracker(TTree* clustersTree)
1257 /// Fill histograms related to tracker clusters
1259 // First things first : do we have clusters in the TreeR ?
1260 // In "normal" production mode, it should be perfectly normal
1261 // *not* to have them.
1262 // But if for some reason we de-activated the combined tracking,
1263 // then we have clusters in TreeR, so let's take that opportunity
1266 AliCodeTimerAuto("",);
1268 // Do nothing in case of calibration event
1269 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
1273 AliCodeTimerAuto("ClusterStore creation",0);
1274 fClusterStore = AliMUONVClusterStore::Create(*clustersTree);
1281 fClusterStore->Connect(*clustersTree,kFALSE);
1282 clustersTree->GetEvent(0);
1284 TIter next(fClusterStore->CreateIterator());
1285 AliMUONVCluster* cluster;
1287 if ( fMappingCheckRecPoints ) fMappingCheckRecPoints->NewEvent();
1289 while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) )
1291 Int_t detElemId = cluster->GetDetElemId();
1292 Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
1294 GetRecPointsData(kTrackerNumberOfClustersPerDE)->Fill(detElemId);
1295 GetRecPointsData(kTrackerClusterChargePerDE+detElemId)->Fill(cluster->GetCharge());
1296 GetRecPointsData(kTrackerClusterMultiplicityPerDE+detElemId)->Fill(cluster->GetNDigits());
1298 GetRecPointsData(kTrackerNumberOfClustersPerChamber)->Fill(chamberId);
1299 GetRecPointsData(kTrackerClusterChargePerChamber+chamberId)->Fill(cluster->GetCharge());
1300 GetRecPointsData(kTrackerClusterMultiplicityPerChamber+chamberId)->Fill(cluster->GetNDigits());
1301 GetRecPointsData(kTrackerClusterHitMapPerChamber+chamberId)->Fill(cluster->GetX(),cluster->GetY());
1303 if ( fMappingCheckRecPoints ) fMappingCheckRecPoints->Store(*cluster);
1307 fClusterStore->Clear();
1310 //____________________________________________________________________________
1311 void AliMUONQADataMakerRec::MakeRecPointsTrigger(TTree* clustersTree)
1313 /// makes data from trigger response
1315 AliCodeTimerAuto("",);
1318 fDigitStore->Clear();
1320 if (!fTriggerStore) fTriggerStore = AliMUONVTriggerStore::Create(*clustersTree);
1321 fTriggerStore->Clear();
1322 fTriggerStore->Connect(*clustersTree, false);
1323 clustersTree->GetEvent(0);
1325 AliMUONLocalTrigger* locTrg;
1326 TIter nextLoc(fTriggerStore->CreateLocalIterator());
1328 while ( ( locTrg = static_cast<AliMUONLocalTrigger*>(nextLoc()) ) )
1330 if (locTrg->IsNull()) continue;
1332 TArrayS xyPattern[2];
1333 locTrg->GetXPattern(xyPattern[0]);
1334 locTrg->GetYPattern(xyPattern[1]);
1336 Int_t nBoard = locTrg->LoCircuit();
1338 Bool_t xTrig=locTrg->IsTrigX();
1339 Bool_t yTrig=locTrg->IsTrigY();
1342 ((TH1F*)GetRecPointsData(kTriggeredBoards))->Fill(nBoard);
1344 fDigitMaker->TriggerDigits(nBoard, xyPattern, *fDigitStore);
1347 TIter nextDigit(fDigitStore->CreateIterator());
1348 AliMUONVDigit* mDigit;
1349 while ( ( mDigit = static_cast<AliMUONVDigit*>(nextDigit()) ) )
1351 Int_t detElemId = mDigit->DetElemId();
1352 Int_t ch = detElemId/100;
1353 Int_t localBoard = mDigit->ManuId();
1354 Int_t channel = mDigit->ManuChannel();
1355 Int_t cathode = mDigit->Cathode();
1356 Int_t iChamber = ch - 11;
1358 ((TH2F*)GetRecPointsData(kTriggerDigits + AliMpConstants::NofTriggerChambers()*cathode + iChamber))
1359 ->Fill(localBoard, channel);
1363 //____________________________________________________________________________
1364 void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd)
1366 /// make QA data from ESDs
1368 AliCodeTimerAuto("",);
1370 // Do nothing in case of calibration event
1371 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
1373 // load ESD event in the interface
1374 AliMUONESDInterface esdInterface;
1375 if (GetMUONRecoParam()) AliMUONESDInterface::ResetTracker(GetMUONRecoParam());
1376 else AliError("Unable to get recoParam: use default ones for residual calculation");
1377 esdInterface.LoadEvent(*esd);
1379 GetESDsData(kESDnTracks)->Fill(esdInterface.GetNTracks());
1381 Int_t nTrackMatchTrig = 0;
1384 Int_t nTracks = (Int_t) esd->GetNumberOfMuonTracks();
1385 for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
1387 // get the ESD track and skip "ghosts"
1388 AliESDMuonTrack* esdTrack = esd->GetMuonTrack(iTrack);
1389 if (!esdTrack->ContainTrackerData()) continue;
1391 // get corresponding MUON track
1392 AliMUONTrack* track = esdInterface.FindTrack(esdTrack->GetUniqueID());
1394 if (esdTrack->ContainTriggerData()) nTrackMatchTrig++;
1396 GetESDsData(kESDMomentum)->Fill(esdTrack->P());
1397 GetESDsData(kESDPt)->Fill(esdTrack->Pt());
1398 GetESDsData(kESDRapidity)->Fill(esdTrack->Y());
1399 GetESDsData(kESDChi2)->Fill(track->GetNormalizedChi2());
1400 GetESDsData(kESDProbChi2)->Fill(TMath::Prob(track->GetGlobalChi2(),track->GetNDF()));
1401 GetESDsData(kESDThetaX)->Fill(esdTrack->GetThetaXUncorrected() / TMath::Pi() * 180.);
1402 GetESDsData(kESDThetaY)->Fill(esdTrack->GetThetaYUncorrected() / TMath::Pi() * 180.);
1403 GetESDsData(kESDnClustersPerTrack)->Fill(track->GetNClusters());
1405 // loop over clusters
1406 AliMUONTrackParam* trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->First());
1407 while (trackParam) {
1409 AliMUONVCluster* cluster = trackParam->GetClusterPtr();
1410 Int_t chId = cluster->GetChamberId();
1411 Int_t deID = cluster->GetDetElemId();
1412 Double_t residualX = cluster->GetX() - trackParam->GetNonBendingCoor();
1413 Double_t residualY = cluster->GetY() - trackParam->GetBendingCoor();
1414 Double_t sigmaResidualX2 = cluster->GetErrX2() - trackParam->GetCovariances()(0,0);
1415 Double_t sigmaResidualY2 = cluster->GetErrY2() - trackParam->GetCovariances()(2,2);
1416 Double_t localChi2X = (sigmaResidualX2 > 0.) ? residualX*residualX/sigmaResidualX2 : 0.;
1417 Double_t localChi2Y = (sigmaResidualY2 > 0.) ? residualY*residualY/sigmaResidualY2 : 0.;
1418 Double_t localChi2 = 0.5 * trackParam->GetLocalChi2();
1420 GetESDsData(kESDClusterHitMap+chId)->Fill(cluster->GetX(), cluster->GetY());
1422 GetESDsData(kESDnTotClustersPerCh)->Fill(chId);
1423 GetESDsData(kESDnTotClustersPerDE)->Fill(deID);
1425 GetESDsData(kESDClusterChargeInCh+chId)->Fill(cluster->GetCharge());
1426 GetESDsData(kESDSumClusterChargePerDE)->Fill(deID, cluster->GetCharge());
1428 if (cluster->GetNDigits() > 0) { // discard clusters with pad not stored in ESD
1429 GetESDsData(kESDnTotFullClustersPerDE)->Fill(deID);
1430 GetESDsData(kESDClusterSizeInCh+chId)->Fill(cluster->GetNDigits());
1431 GetESDsData(kESDSumClusterSizePerDE)->Fill(deID, cluster->GetNDigits());
1434 GetESDsData(kESDResidualXInCh+chId)->Fill(residualX);
1435 GetESDsData(kESDResidualYInCh+chId)->Fill(residualY);
1436 GetESDsData(kESDSumResidualXPerDE)->Fill(deID, residualX);
1437 GetESDsData(kESDSumResidualYPerDE)->Fill(deID, residualY);
1438 GetESDsData(kESDSumResidualX2PerDE)->Fill(deID, residualX*residualX);
1439 GetESDsData(kESDSumResidualY2PerDE)->Fill(deID, residualY*residualY);
1441 GetESDsData(kESDLocalChi2XInCh+chId)->Fill(localChi2X);
1442 GetESDsData(kESDLocalChi2YInCh+chId)->Fill(localChi2Y);
1443 GetESDsData(kESDLocalChi2InCh+chId)->Fill(localChi2);
1444 GetESDsData(kESDSumLocalChi2XPerDE)->Fill(deID, localChi2X);
1445 GetESDsData(kESDSumLocalChi2YPerDE)->Fill(deID, localChi2Y);
1446 GetESDsData(kESDSumLocalChi2PerDE)->Fill(deID, localChi2);
1448 trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->After(trackParam));
1454 GetESDsData(kESDMatchTrig)->Fill(nTrackMatchTrig);
1458 //____________________________________________________________________________
1459 void AliMUONQADataMakerRec::StartOfDetectorCycle()
1461 /// Detector specific actions at start of cycle
1465 //____________________________________________________________________________
1466 void AliMUONQADataMakerRec::DisplayTriggerInfo(AliQAv1::TASKINDEX_t task)
1469 /// Display trigger information in a user-friendly way:
1470 /// from local board and strip numbers to their position on chambers
1474 if(task!=AliQAv1::kRECPOINTS && task!=AliQAv1::kRAWS) return;
1476 // check we get histograms, otherwise return right now
1477 if ( task == AliQAv1::kRECPOINTS )
1479 if ( !GetRecPointsData(kTriggerDigits) ) return;
1482 if ( task == AliQAv1::kRAWS )
1484 if ( !GetRawsData(kTriggerScalers) ) return;
1487 AliMUONTriggerDisplay triggerDisplay;
1489 TH2F* histoStrips=0x0;
1490 TH2F* histoDisplayStrips=0x0;
1491 AliMUONTriggerDisplay::EDisplayOption displayOption = AliMUONTriggerDisplay::kDefaultDisplay;
1492 if(task == AliQAv1::kRAWS) displayOption = AliMUONTriggerDisplay::kNormalizeToArea;
1494 for (Int_t iCath = 0; iCath < AliMpConstants::NofCathodes(); iCath++)
1496 for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++)
1498 if(task==AliQAv1::kRECPOINTS){
1499 histoStrips = (TH2F*)GetRecPointsData(kTriggerDigits + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
1501 else if(task==AliQAv1::kRAWS){
1502 histoStrips = (TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
1505 if(histoStrips->GetEntries()==0) continue; // No events found => No need to display
1507 if(task==AliQAv1::kRECPOINTS){
1508 histoDisplayStrips = (TH2F*)GetRecPointsData(kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
1510 else if(task==AliQAv1::kRAWS){
1511 histoDisplayStrips = (TH2F*)GetRawsData(kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
1514 triggerDisplay.FillDisplayHistogram(histoStrips, histoDisplayStrips,
1515 AliMUONTriggerDisplay::kDisplayStrips, iCath, iChamber, displayOption);
1517 Float_t scaleValue = 0.;
1518 if(task==AliQAv1::kRAWS) {
1519 scaleValue = ((TH1F*)GetRawsData(kTriggerScalersTime))->GetBinContent(1);
1521 else if ( task == AliQAv1::kRECPOINTS ) {
1522 scaleValue = GetRecPointsData(kNAnalyzedEvents)->GetBinContent(1);
1524 if(scaleValue>0.) histoDisplayStrips->Scale(1./scaleValue);
1528 if(task==AliQAv1::kRECPOINTS){
1529 TH1F* histoBoards = (TH1F*)GetRecPointsData(kTriggeredBoards);
1530 TH2F* histoDisplayBoards = (TH2F*)GetRecPointsData(kTriggerBoardsDisplay);
1531 triggerDisplay.FillDisplayHistogram(histoBoards, histoDisplayBoards, AliMUONTriggerDisplay::kDisplayBoards, 0, 0);
1532 Float_t scaleValue = GetRecPointsData(kNAnalyzedEvents)->GetBinContent(1);
1533 if(scaleValue>0.) histoDisplayBoards->Scale(1./scaleValue);
1538 //_____________________________________________________________________________
1540 AliMUONQADataMakerRec::FillTriggerDCSHistos()
1542 /// Get HV and currents values for one trigger chamber
1544 AliCodeTimerAuto("",);
1546 AliMUONCalibrationData calibrationData(AliCDBManager::Instance()->GetRun());
1548 TMap* triggerDcsMap = calibrationData.TriggerDCS();
1550 if ( !triggerDcsMap )
1552 AliError("Cannot fill DCS histos, as triggerDcsMap is NULL");
1556 AliMpDEIterator deIt;
1560 AliMpDCSNamer triggerDcsNamer("TRIGGER");
1562 TH2* currHisto = 0x0;
1563 Int_t histoIndex = 0;
1564 TString histoName, histoTitle;
1566 Bool_t error = kFALSE;
1567 Bool_t expert = kTRUE;
1568 Bool_t saveCorr = kTRUE;
1569 Bool_t image = kTRUE;
1571 while ( !deIt.IsDone() )
1573 Int_t detElemId = deIt.CurrentDEId();
1575 if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStationTrigger) {
1577 Int_t iChamber = AliMpDEManager::GetChamberId(detElemId);
1578 Int_t slat = detElemId%100;
1580 for(Int_t iMeas=0; iMeas<AliMpDCSNamer::kNDCSMeas; iMeas++){
1581 TString currAlias = triggerDcsNamer.DCSChannelName(detElemId, 0, iMeas);
1583 AliDebug(AliQAv1::GetQADebugLevel(), Form("\nDetElemId %i dcsAlias %s", detElemId, currAlias.Data()));
1585 TPair* triggerDcsPair = static_cast<TPair*>(triggerDcsMap->FindObject(currAlias.Data()));
1587 if (!triggerDcsPair)
1589 AliError(Form("Did not find expected alias (%s) for DE %d",
1590 currAlias.Data(),detElemId));
1595 TObjArray* values = static_cast<TObjArray*>(triggerDcsPair->Value());
1598 AliError(Form("Could not get values for alias %s",currAlias.Data()));
1604 AliDCSValue* val = 0x0;
1606 Int_t ich = iChamber - AliMpConstants::NofTrackingChambers();
1609 case AliMpDCSNamer::kDCSI:
1610 histoIndex = kTriggerRPCi + ich;
1611 histoName = Form("hRPCIChamber%i", 11+ich);
1612 histoTitle = Form("Chamber %i: RPC Currents (#muA)", 11+ich);
1614 case AliMpDCSNamer::kDCSHV:
1615 histoIndex = kTriggerRPChv + ich;
1616 histoName = Form("hRPCHVChamber%i", 11+ich);
1617 histoTitle = Form("Chamber %i: RPC HV (V)", 11+ich);
1621 currHisto = (TH2F*) GetRawsData(histoIndex);
1624 Int_t npoints = values->GetEntries();
1625 TArrayF axisSlat(18+1), axisTime(npoints+1);
1626 for(Int_t islat=0; islat<=18; islat++){
1627 axisSlat[islat] = -0.5 + (Float_t)islat;
1629 for(Int_t ientry=0; ientry<npoints; ientry++){
1630 val = static_cast<AliDCSValue*>(values->At(ientry));
1631 axisTime[ientry] = val->GetTimeStamp();
1633 axisTime[npoints] = val->GetTimeStamp() + 100;
1635 currHisto = new TH2F(histoName.Data(), histoTitle.Data(),
1636 npoints, axisTime.GetArray(),
1637 18, axisSlat.GetArray());
1638 currHisto->GetXaxis()->SetTitle("Time");
1639 currHisto->GetXaxis()->SetTimeDisplay(1);
1640 //currHisto->GetXaxis()->SetTimeFormat("%d%b%y %H:%M:%S");
1641 currHisto->GetYaxis()->SetTitle("RPC");
1642 Add2RawsList(currHisto, histoIndex, !expert, image, !saveCorr);
1645 while ( ( val = static_cast<AliDCSValue*>(next()) ) )
1647 Float_t hvi = val->GetFloat();
1649 AliDebug(AliQAv1::GetQADebugLevel(), Form("Value %f", hvi));
1651 currHisto->Fill(1.0001 * val->GetTimeStamp(), slat, hvi);
1654 } // if (!triggerDcsPair)
1655 } // loop on measured types (HV and currents)
1656 } // if (stationType == kStationTrigger)
1663 //____________________________________________________________________________
1664 AliMUONVTrackerData* AliMUONQADataMakerRec::GetTrackerData() const
1666 /// Return tracker data
1668 return fTrackerDataMaker->Data();
1672 //____________________________________________________________________________
1674 AliMUONQADataMakerRec::BeautifyTrackerBusPatchOccupancy(TH1& hbp)
1676 /// Put labels, limits and so on on the TrackerBusPatchOccupancy histogram
1678 hbp.SetXTitle("Absolute Bus Patch Id");
1679 hbp.SetYTitle("Occupancy (percent)");
1680 hbp.SetStats(kFALSE);
1682 Double_t xmin = hbp.GetXaxis()->GetXmin();
1683 Double_t xmax = hbp.GetXaxis()->GetXmax();
1685 Double_t occMax(0.1); // 0.1% y-limit for the plot
1686 Double_t occError(1.0); // 1.0% y-limit to count the "errors"
1688 TLine* line = new TLine(xmin,occError,xmax,occError);
1689 line->SetLineColor(2);
1690 line->SetLineWidth(3);
1692 hbp.GetListOfFunctions()->Add(line);
1694 TH1* hnpads = GetRawsData(kTrackerBusPatchNofPads);
1695 hnpads->SetStats(kFALSE);
1696 TH1* hnmanus = GetRawsData(kTrackerBusPatchNofManus);
1697 hnmanus->SetStats(kFALSE);
1699 TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
1700 AliMpBusPatch* bp(0x0);
1701 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
1704 for ( Int_t imanu = 0; imanu < bp->GetNofManus(); ++imanu )
1706 Int_t manuId = bp->GetManuId(imanu);
1707 AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(bp->GetDEId());
1708 n += de->NofChannelsInManu(manuId);
1710 hnpads->Fill(bp->GetId(),n*1.0);
1711 hnmanus->Fill(bp->GetId(),bp->GetNofManus()*1.0);
1716 Int_t nMissingPads(0);
1718 Int_t nBusPatches(0);
1719 Int_t nMissingBusPatches(0);
1721 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
1723 Int_t bin = hbp.FindBin(bp->GetId());
1724 Int_t n = hnpads->GetBinContent(bin);
1730 if ( hbp.GetBinContent(bin) <= 0 )
1733 ++nMissingBusPatches;
1741 Int_t nBusPatchesAboveLimit(0);
1742 Double_t alpha(0.1); // trim 10% of data
1743 Double_t tmean(0.0),tvar(0.0);
1744 Double_t ymin(0.0),ymax(0.0);
1749 Double_t* x = new Double_t[nBusPatches];
1751 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
1753 Int_t bin = hbp.FindBin(bp->GetId());
1754 if ( hbp.GetBinContent(bin) > 0 )
1756 x[n] = hbp.GetBinContent(bin);
1759 if ( hbp.GetBinContent(bin) > occError )
1761 ++nBusPatchesAboveLimit;
1765 // computed the truncated mean of the occupancy values, in order to get a
1766 // reasonable y-range for the histogram (without giant peaks to the roof
1767 // for misbehaving buspatches).
1768 ok = trim(n,x,alpha,tmean,tvar,ymin,ymax);
1779 ymax = TMath::Max(ymax,occMax);
1782 hbp.SetMaximum(ymax*1.4);
1784 TPaveText* text = new TPaveText(0.55,0.85,0.99,0.99,"NDC");
1788 text->AddText("Could not compute truncated mean. Not enough events ?");
1789 text->SetFillColor(2);
1791 else if (!nPads || !nBusPatches)
1793 text->AddText("Could not get the total number of pads. ERROR !!!");
1794 text->SetFillColor(2);
1798 Float_t missingPadFraction = nMissingPads*100.0/nPads;
1799 Float_t missingBusPatchFraction = nMissingBusPatches*100.0/nBusPatches;
1800 Float_t aboveLimitFraction = nBusPatchesAboveLimit*100.0/nBusPatches;
1802 text->AddText(Form("%5.2f %% of missing buspatches (%d out of %d)",missingBusPatchFraction,nMissingBusPatches,nBusPatches));
1803 text->AddText(Form("%5.2f %% of missing pads (%d out of %d)",missingPadFraction,nMissingPads,nPads));
1804 text->AddText(Form("%5.2f %% bus patches above the %5.2f %% limit",aboveLimitFraction,occError));
1805 text->AddText(Form("Truncated mean at %2d %% is %7.2f %%",(Int_t)(alpha*100),tmean));
1807 if ( missingPadFraction > 10.0 || aboveLimitFraction > 5.0 )
1809 text->SetFillColor(2);
1813 text->SetFillColor(3);
1817 hbp.GetListOfFunctions()->Add(text);