Removing a line that was wrongly re-introduced by last commit (Diego)
[u/mrichter/AliRoot.git] / MUON / AliMUONQADataMakerRec.cxx
CommitLineData
04236e67 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
bf4d93eb 16// $Id$
17
b1341ab0 18// --- MUON header files ---
19#include "AliMUONQADataMakerRec.h"
04236e67 20
f587a77d 21#include "AliMUON2DMap.h"
04236e67 22#include "AliMUONCluster.h"
b1341ab0 23#include "AliMUONConstants.h"
2346e1ad 24#include "AliMUONDDLTrigger.h"
2346e1ad 25#include "AliMUONDarcHeader.h"
f587a77d 26#include "AliMUONDigitMaker.h"
2346e1ad 27#include "AliMUONLocalStruct.h"
f587a77d 28#include "AliMUONLocalTrigger.h"
29#include "AliMUONRawStreamTracker.h"
30#include "AliMUONRawStreamTrigger.h"
31#include "AliMUONRegHeader.h"
b6f591ae 32#include "AliMUONTrackerDataMaker.h"
aef183f7 33#include "AliMUONTriggerDisplay.h"
f587a77d 34#include "AliMUONVCluster.h"
35#include "AliMUONVClusterStore.h"
36#include "AliMUONVDigit.h"
37#include "AliMUONVDigitStore.h"
38#include "AliMUONVTrackerData.h"
39#include "AliMUONVTriggerStore.h"
c92a8c85 40#include "AliMUONTrack.h"
41#include "AliMUONTrackParam.h"
42#include "AliMUONESDInterface.h"
49e110ec 43#include "AliMUONCalibrationData.h"
5bb54f70 44#include "AliMpBusPatch.h"
f587a77d 45#include "AliMpCDB.h"
2346e1ad 46#include "AliMpConstants.h"
f587a77d 47#include "AliMpDDLStore.h"
48#include "AliMpDEIterator.h"
49#include "AliMpDEManager.h"
8f29b706 50#include "AliMpDetElement.h"
b1341ab0 51#include "AliMpLocalBoard.h"
f587a77d 52#include "AliMpStationType.h"
53#include "AliMpTriggerCrate.h"
49e110ec 54#include "AliMpDCSNamer.h"
f587a77d 55#include "AliRawEventHeaderBase.h"
2346e1ad 56
b1341ab0 57// --- AliRoot header files ---
f587a77d 58#include "AliCDBManager.h"
59#include "AliCDBStorage.h"
b1341ab0 60#include "AliESDEvent.h"
61#include "AliESDMuonTrack.h"
62#include "AliESDMuonCluster.h"
63#include "AliLog.h"
64#include "AliRawReader.h"
65#include "AliQAChecker.h"
f587a77d 66#include "AliCodeTimer.h"
49e110ec 67#include "AliDCSValue.h"
44ed7a66 68#include "AliMUONVDigit.h"
b1341ab0 69
70// --- ROOT system ---
71#include <TClonesArray.h>
72#include <TFile.h>
73#include <TH1F.h>
74#include <TH1I.h>
75#include <TH2F.h>
8f29b706 76#include <TLine.h>
77#include <TPaveText.h>
b1341ab0 78#include <Riostream.h>
8f29b706 79#include <TMath.h>
04236e67 80
81//-----------------------------------------------------------------------------
82/// \class AliMUONQADataMakerRec
83///
84/// MUON base class for quality assurance data (histo) maker
85///
f587a77d 86/// \author C. Finck, D. Stocco, L. Aphecetche
04236e67 87
88/// \cond CLASSIMP
89ClassImp(AliMUONQADataMakerRec)
90/// \endcond
91
8f29b706 92
93namespace {
94
95 int trim(Int_t n,
96 Double_t* x,
97 Double_t alpha,
98 Double_t& tmean,
99 Double_t& tvar,
100 Double_t& min,
101 Double_t& max)
102 {
103 //
104 // Calculates the trimmed (tmean) mean
105 // of a sample (x) and estimates the variance (tvar)
106 // of that mean.
107 //
108
109 // First check input parameters
110
111 // number of observations
112 if ( n < 2 )
113 {
114 return -1;
115 }
116
117 if ( alpha < 0 || alpha >= 0.5 )
118 // proportion of observations
119 // to be trimmed at each end of the sorted sample
120 {
121 return -2;
122 }
123
124 // Input parameters are good. Let's move on.
125
126 // Insure we use a sample sorted into ascending order.
127
128 Int_t* indices = new Int_t[n];
129
130 TMath::Sort(n,x,indices,kFALSE);
131
132 Double_t* sx = new Double_t[n];
133
134 for ( Int_t i = 0; i < n; ++i )
135 {
136 sx[i] = x[indices[i]];
137 }
138 delete[] indices;
139
140
141 // Number of observations trimmed at each end.
142
143 Int_t k = static_cast<Int_t>(floorf(alpha * n));
144
145 double sum = 0.0;
146
147 for ( Int_t i = k; i < n - k ; ++i )
148 {
149 sum += sx[i];
150 }
151
152 tmean = sum / ( n - 2 * k );
153
154 double t2 = 0.0;
155
156 for ( Int_t i = k; i < n - k; ++i )
157 {
158 t2 += (sx[i] - tmean) * (sx[i] - tmean);
159 }
160
161 tvar = (
162 t2 +
163 k * (sx[k] - tmean) * (sx[k] - tmean) +
164 k * (sx[n - k - 1] - tmean) * (sx[n - k - 1] - tmean)
165 ) / (n * n);
166
167 // get the min and max for the non-rejected values
168 min = DBL_MAX;
169 max = 0.0;
170
171 for ( Int_t i = k; i < n-k; ++i )
172 {
173 min = TMath::Min(min,sx[i]);
174 max = TMath::Max(max,sx[i]);
175 }
176
177 delete[] sx;
178
179 return 0;
180 }
181}
182
04236e67 183//____________________________________________________________________________
b8bd1ab8 184AliMUONQADataMakerRec::AliMUONQADataMakerRec() :
4e25ac79 185AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kMUON), "MUON Quality Assurance Data Maker"),
f587a77d 186fDigitStore(0x0),
187fTriggerStore(0x0),
188fDigitMaker(0x0),
189fClusterStore(0x0),
abcfd6d0 190fTrackerDataMaker(0x0)
04236e67 191{
192 /// ctor
f587a77d 193
5379c4a3 194 AliDebug(AliQAv1::GetQADebugLevel(),"");
d874bd09 195
f587a77d 196 Ctor();
197}
198
199//____________________________________________________________________________
200void
201AliMUONQADataMakerRec::Ctor()
202{
203 /// Init some members
204 fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV1");
205 fDigitMaker = new AliMUONDigitMaker(kTRUE);
04236e67 206}
207
208//____________________________________________________________________________
209AliMUONQADataMakerRec::AliMUONQADataMakerRec(const AliMUONQADataMakerRec& qadm) :
f587a77d 210AliQADataMakerRec(qadm),
f587a77d 211fDigitStore(0x0),
212fTriggerStore(0x0),
213fDigitMaker(0x0),
214fClusterStore(0x0),
abcfd6d0 215fTrackerDataMaker(0x0)
04236e67 216{
217 ///copy ctor
d874bd09 218
5379c4a3 219 AliDebug(AliQAv1::GetQADebugLevel(),"");
d874bd09 220
221
04236e67 222 SetName((const char*)qadm.GetName()) ;
223 SetTitle((const char*)qadm.GetTitle());
7035694f 224
f587a77d 225 // Do not copy the digit store and digit maker, but create its own ones
226
227 Ctor();
228
04236e67 229}
230
231//__________________________________________________________________
232AliMUONQADataMakerRec& AliMUONQADataMakerRec::operator = (const AliMUONQADataMakerRec& qadm )
233{
7035694f 234 /// Assignment operator
235
5379c4a3 236 AliDebug(AliQAv1::GetQADebugLevel(),"");
d874bd09 237
7035694f 238 // check assignment to self
239 if (this == &qadm) return *this;
240
241 this->~AliMUONQADataMakerRec();
242 new(this) AliMUONQADataMakerRec(qadm);
243 return *this;
04236e67 244}
245
246//__________________________________________________________________
247AliMUONQADataMakerRec::~AliMUONQADataMakerRec()
248{
249 /// dtor
f587a77d 250
5379c4a3 251 AliDebug(AliQAv1::GetQADebugLevel(),"");
d874bd09 252
f587a77d 253 AliCodeTimerAuto("");
254
255 delete fDigitStore;
256 delete fTriggerStore;
257 delete fDigitMaker;
c92a8c85 258 delete fClusterStore;
259 delete fTrackerDataMaker;
04236e67 260}
261
262//____________________________________________________________________________
4e25ac79 263void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
04236e67 264{
c92a8c85 265 ///Detector specific actions at end of cycle
266
5bb54f70 267 AliCodeTimerAuto("");
8f29b706 268
c455c5fb 269 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
270 {
6252ceeb 271 if (! IsValidEventSpecie(specie, list) )
8f29b706 272 continue ;
eca4fa66 273 SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ;
4e25ac79 274 if ( task == AliQAv1::kRAWS && fTrackerDataMaker )
5bb54f70 275 {
c455c5fb 276 if ( !GetRawsData(kTrackerBusPatchOccupancy) ) continue;
277
57acd2d2 278 TIter next(list[specie]);
279 TObject* o;
280 Bool_t alreadyThere(kFALSE);
281 while ( ( o = next() ) && !alreadyThere )
282 {
283 TString classname(o->ClassName());
284 if ( classname.Contains("TrackerData") ) alreadyThere = kTRUE;
285 }
286 if (!alreadyThere && fTrackerDataMaker)
287 {
8f29b706 288 AliDebug(AliQAv1::GetQADebugLevel(), "Adding fTrackerData to the list of qa objects");
57acd2d2 289 list[specie]->AddAt(fTrackerDataMaker->Data(),(Int_t)kTrackerData);
290 }
291 if ( fTrackerDataMaker )
292 {
293 TH1* hbp = GetRawsData(kTrackerBusPatchOccupancy);
294 hbp->Reset();
295 TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator());
296 AliMpBusPatch* bp(0x0);
297 AliMUONVTrackerData* data = fTrackerDataMaker->Data();
298 Int_t occDim = 2;
299
300 while ( ( bp = static_cast<AliMpBusPatch*>(nextBP())) )
301 {
302 Int_t busPatchId = bp->GetId();
303 Int_t bin = hbp->FindBin(busPatchId);
8f29b706 304 hbp->SetBinContent(bin,data->BusPatch(busPatchId,occDim)*100.0); // occupancy, in percent
57acd2d2 305 }
8f29b706 306
307 BeautifyTrackerBusPatchOccupancy(*hbp);
57acd2d2 308 }
5bb54f70 309 }
2d114b34 310
311 // Normalize RecPoints histos
4e25ac79 312 if ( task == AliQAv1::kRECPOINTS ) {
2d114b34 313
c455c5fb 314 if (!GetRecPointsData(kTrackerClusterChargePerChMean)) continue;
315
2d114b34 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);
322
323 // loop over chambers
324 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
325
eca4fa66 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());
332
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());
339
340 // loop over DE into chamber iCh
341 AliMpDEIterator it;
342 it.First(iCh);
343 while ( !it.IsDone()) {
344
345 Int_t iDE = it.CurrentDEId();
346
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());
352
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());
358
359 it.Next();
360 }
361
2d114b34 362 }
363
364 }
365
5a240757 366 // Normalize ESD histos
4e25ac79 367 if ( task == AliQAv1::kESDS ) {
c92a8c85 368
c455c5fb 369 if (!GetESDsData(kESDnClustersPerTrack)) continue;
370
5a240757 371 Double_t nTracks = GetESDsData(kESDnClustersPerTrack)->GetEntries();
372 if (nTracks <= 0) continue;
373
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);
d1e6fdee 386 TH1* hESDLocalChi2PerChMean = GetESDsData(kESDLocalChi2PerChMean);
5a240757 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);
d1e6fdee 395 TH1* hESDLocalChi2PerDEMean = GetESDsData(kESDLocalChi2PerDEMean);
abcfd6d0 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);
d1e6fdee 407 TH1* hESDSumLocalChi2PerDE = GetESDsData(kESDSumLocalChi2PerDE);
408
5a240757 409 hESDnClustersPerCh->Reset();
410 hESDnClustersPerDE->Reset();
abcfd6d0 411 hESDnClustersPerCh->Add(hESDnTotClustersPerCh, 1./nTracks);
412 hESDnClustersPerDE->Add(hESDnTotClustersPerDE, 1./nTracks);
c92a8c85 413
5a240757 414 // loop over chambers
415 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
416
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());
423
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());
430
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());
437
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());
444
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());
449
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());
454
d1e6fdee 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());
459
5a240757 460 // loop over DE into chamber iCh
461 AliMpDEIterator it;
462 it.First(iCh);
463 while ( !it.IsDone()) {
464
465 Int_t iDE = it.CurrentDEId();
466
abcfd6d0 467 Double_t nClusters = hESDnTotClustersPerDE->GetBinContent(iDE+1);
5a240757 468 if (nClusters > 1) {
469
abcfd6d0 470 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1)/nClusters);
5a240757 471 hESDClusterChargePerDE->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
472
abcfd6d0 473 Double_t meanResX = hESDSumResidualXPerDE->GetBinContent(iDE+1)/nClusters;
5a240757 474 hESDResidualXPerDEMean->SetBinContent(iDE+1, meanResX);
475 hESDResidualXPerDEMean->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(nClusters));
abcfd6d0 476 hESDResidualXPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualX2PerDE->GetBinContent(iDE+1)/nClusters - meanResX*meanResX));
5a240757 477 hESDResidualXPerDESigma->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(2.*nClusters));
478
abcfd6d0 479 Double_t meanResY = hESDSumResidualYPerDE->GetBinContent(iDE+1)/nClusters;
5a240757 480 hESDResidualYPerDEMean->SetBinContent(iDE+1, meanResY);
481 hESDResidualYPerDEMean->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(nClusters));
abcfd6d0 482 hESDResidualYPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualY2PerDE->GetBinContent(iDE+1)/nClusters - meanResY*meanResY));
5a240757 483 hESDResidualYPerDESigma->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(2.*nClusters));
484
abcfd6d0 485 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)/nClusters);
5a240757 486 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, sigmaLocalChi2X/TMath::Sqrt(nClusters));
487
abcfd6d0 488 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1)/nClusters);
5a240757 489 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, sigmaLocalChi2Y/TMath::Sqrt(nClusters));
490
d1e6fdee 491 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1)/nClusters);
492 hESDLocalChi2PerDEMean->SetBinError(iDE+1, sigmaLocalChi2/TMath::Sqrt(nClusters));
493
5a240757 494 } else {
495
abcfd6d0 496 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1));
5a240757 497 hESDClusterChargePerDE->SetBinError(iDE+1, hESDClusterChargeInCh->GetXaxis()->GetXmax());
498
abcfd6d0 499 hESDResidualXPerDEMean->SetBinContent(iDE+1, hESDSumResidualXPerDE->GetBinContent(iDE+1));
5a240757 500 hESDResidualXPerDEMean->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
501 hESDResidualXPerDESigma->SetBinContent(iDE+1, 0.);
502 hESDResidualXPerDESigma->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
503
abcfd6d0 504 hESDResidualYPerDEMean->SetBinContent(iDE+1, hESDSumResidualYPerDE->GetBinContent(iDE+1));
5a240757 505 hESDResidualYPerDEMean->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
506 hESDResidualYPerDESigma->SetBinContent(iDE+1, 0.);
507 hESDResidualYPerDESigma->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
508
abcfd6d0 509 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1));
5a240757 510 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, hESDLocalChi2XInCh->GetXaxis()->GetXmax());
511
abcfd6d0 512 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1));
5a240757 513 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, hESDLocalChi2YInCh->GetXaxis()->GetXmax());
514
d1e6fdee 515 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1));
516 hESDLocalChi2PerDEMean->SetBinError(iDE+1, hESDLocalChi2InCh->GetXaxis()->GetXmax());
517
5a240757 518 }
519
abcfd6d0 520 Double_t nFullClusters = hESDnTotFullClustersPerDE->GetBinContent(iDE+1);
5a240757 521 if (nFullClusters > 1) {
522
abcfd6d0 523 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1)/nFullClusters);
5a240757 524 hESDClusterSizePerDE->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nFullClusters));
525
526 } else {
527
abcfd6d0 528 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1));
5a240757 529 hESDClusterSizePerDE->SetBinError(iDE+1, hESDClusterSizeInCh->GetXaxis()->GetXmax());
530
531 }
532
533 it.Next();
534 }
535
435844ac 536 }
5a240757 537
435844ac 538 }
5a240757 539
719914e0 540 // Display trigger histos in a more user friendly way
541 DisplayTriggerInfo(task);
77bd5fcf 542 } // loop on specie
8f29b706 543
c92a8c85 544 // do the QA checking
4e25ac79 545 AliQAChecker::Instance()->Run(AliQAv1::kMUON, task, list) ;
04236e67 546}
547
548//____________________________________________________________________________
549void AliMUONQADataMakerRec::InitRaws()
550{
551 /// create Raws histograms in Raws subdir
f587a77d 552
5bb54f70 553 AliCodeTimerAuto("");
554
7d297381 555 const Bool_t expert = kTRUE ;
556 const Bool_t saveCorr = kTRUE ;
557 const Bool_t image = kTRUE ;
719914e0 558
559 TString boardName = "Local board Id";
5bb54f70 560
43b113b8 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(),
568 234, 0.5, 234.5,
569 16, -0.5, 15.5);
570 h3->GetXaxis()->SetTitle(boardName.Data());
571 h3->GetYaxis()->SetTitle("Strip");
572 Add2RawsList(h3, kTriggerScalers + AliMpConstants::NofTriggerChambers()*iCath + iChamber, expert, !image, !saveCorr);
573 }
574 }
f587a77d 575
576 AliMUONTriggerDisplay triggerDisplay;
f587a77d 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++){
43b113b8 580 histoName = Form("hScalersDisplay%sChamber%i", cathName.Data(), 11+iChamber);
719914e0 581 histoTitle = Form("Chamber %i - %s: Hit rate from scalers (Hz/cm^{2})", 11+iChamber, cathName.Data());
f587a77d 582 TH2F* h5 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips,
c92a8c85 583 iCath, iChamber, histoTitle);
7d297381 584 Add2RawsList(h5, kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber, !expert, image, !saveCorr);
f587a77d 585 }
586 }
49e110ec 587
719914e0 588 FillTriggerDCSHistos();
49e110ec 589
719914e0 590 TH1F* h10 = new TH1F("hTriggerScalersTime", "Acquisition time from trigger scalers", 1, 0.5, 1.5);
eb3886c8 591 h10->GetXaxis()->SetBinLabel(1, "One-bin histogram: bin is filled at each scaler event.");
592 h10->GetYaxis()->SetTitle("Cumulated scaler time (s)");
719914e0 593 Add2RawsList(h10, kTriggerScalersTime, !expert, !image, !saveCorr);
f587a77d 594
8f29b706 595 Int_t bpmin(999999);
596 Int_t bpmax(0);
597
5bb54f70 598 TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
8f29b706 599 AliMpBusPatch* bp(0x0);
600 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
5bb54f70 601 {
8f29b706 602 bpmin = TMath::Min(bpmin,bp->GetId());
603 bpmax = TMath::Max(bpmax,bp->GetId());
5bb54f70 604 }
605
8f29b706 606 Double_t xmin = bpmin-0.5;
607 Double_t xmax = bpmax+0.5;
608 Int_t nbins = bpmax-bpmin+1;
5bb54f70 609
8f29b706 610 TH1* hbp = new TH1F("hTrackerBusPatchOccupancy","Occupancy of bus patches",nbins,xmin,xmax);
611
612 TH1* hbpnpads = new TH1F("kTrackerBusPatchNofPads","Number of pads per bus patch",nbins,xmin,xmax);
613
614 TH1* hbpnmanus = new TH1F("kTrackerBusPatchNofManus","Number of manus per bus patch",nbins,xmin,xmax);
615
7d297381 616 Add2RawsList(hbp,kTrackerBusPatchOccupancy, !expert, image, !saveCorr);
8f29b706 617 Add2RawsList(hbpnpads,kTrackerBusPatchNofPads, expert, !image, !saveCorr);
618 Add2RawsList(hbpnmanus,kTrackerBusPatchNofManus, expert, !image, !saveCorr);
de1d4a53 619
620 const Bool_t histogram(kFALSE);
b6f591ae 621
8f29b706 622 if(!fTrackerDataMaker) fTrackerDataMaker = new AliMUONTrackerDataMaker(GetMUONRecoParam(),
b6f591ae 623 AliCDBManager::Instance()->GetRun(),
624 0x0,
ed66881d 625 "",
b6f591ae 626 "NOGAIN",
627 histogram,
628 0.0,0.0);
de1d4a53 629
630 fTrackerDataMaker->Data()->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level
631
632 fTrackerDataMaker->SetRunning(kTRUE);
f587a77d 633}
04236e67 634
44ed7a66 635//__________________________________________________________________
636void AliMUONQADataMakerRec::InitDigits()
637{
638 /// Initialized Digits spectra
639 const Bool_t expert = kTRUE ;
640 const Bool_t image = kTRUE ;
641
db72ff3b 642 TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits;Detection element Id;Counts", 1400, 100, 1500);
44ed7a66 643 Add2DigitsList(h0, 0, !expert, image);
644
db72ff3b 645 TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits;ACD value;Counts", 4096, 0, 4095);
646 Add2DigitsList(h1, 1, !expert, image);
44ed7a66 647}
648
f587a77d 649//____________________________________________________________________________
650void AliMUONQADataMakerRec::InitRecPoints()
651{
652 /// create Reconstructed Points histograms in RecPoints subdir
5bb54f70 653
654 AliCodeTimerAuto("");
655
f587a77d 656 InitRecPointsTrigger();
657 InitRecPointsTracker();
658}
659
660//____________________________________________________________________________
661void AliMUONQADataMakerRec::InitRecPointsTracker()
662{
2d114b34 663 /// create Reconstructed Points histograms in RecPoints subdir for the
664 /// MUON tracker subsystem.
7d297381 665 const Bool_t expert = kTRUE ;
666 const Bool_t image = kTRUE ;
2d114b34 667
5bb54f70 668 AliCodeTimerAuto("");
669
2d114b34 670 TH1I *h1I;
671 TH1F *h1F;
672 TH2F *h2F;
5bb54f70 673
2d114b34 674 // histograms per chamber
675 Int_t nCh = AliMpConstants::NofTrackingChambers();
676 for ( Int_t i = 0; i < nCh; ++i )
677 {
db72ff3b 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);
7d297381 679 Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerChamber+i, expert, !image);
2d114b34 680
4eb3ad98 681 h1I = new TH1I(Form("hTrackerClusterChargeForChamber%d",i+1), Form("cluster charge distribution in chamber %d;charge (fC);Counts",i+1), 100,0,1000);
7d297381 682 Add2RecPointsList(h1I,kTrackerClusterChargePerChamber+i, expert, !image);
2d114b34 683
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);
7d297381 686 Add2RecPointsList(h2F, kTrackerClusterHitMapPerChamber+i, expert, !image);
2d114b34 687 }
688
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);
d1e6fdee 691 Add2RecPointsList(h1I,kTrackerNumberOfClustersPerChamber, !expert, image);
2d114b34 692
693 h1F = new TH1F("hTrackerClusterMultiplicityPerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh,-0.5,nCh-0.5);
694 h1F->SetOption("P");
695 h1F->SetMarkerStyle(kFullDotMedium);
696 h1F->SetMarkerColor(kRed);
d1e6fdee 697 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChMean, !expert, image);
2d114b34 698
699 h1F = new TH1F("hTrackerClusterMultiplicityPerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh,-0.5,nCh-0.5);
700 h1F->SetOption("P");
701 h1F->SetMarkerStyle(kFullDotMedium);
702 h1F->SetMarkerColor(kRed);
d1e6fdee 703 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChSigma, !expert, image);
2d114b34 704
4eb3ad98 705 h1F = new TH1F("hTrackerClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (fC)", nCh,-0.5,nCh-0.5);
2d114b34 706 h1F->SetOption("P");
707 h1F->SetMarkerStyle(kFullDotMedium);
708 h1F->SetMarkerColor(kRed);
d1e6fdee 709 Add2RecPointsList(h1F, kTrackerClusterChargePerChMean, !expert, image);
2d114b34 710
4eb3ad98 711 h1F = new TH1F("hTrackerClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (fC)", nCh,-0.5,nCh-0.5);
2d114b34 712 h1F->SetOption("P");
713 h1F->SetMarkerStyle(kFullDotMedium);
714 h1F->SetMarkerColor(kRed);
d1e6fdee 715 Add2RecPointsList(h1F, kTrackerClusterChargePerChSigma, !expert, image);
2d114b34 716
717 // histograms per DE
718 Int_t ndes(0);
719 AliMpDEIterator it;
720 it.First();
721 while ( !it.IsDone())
722 {
723 Int_t detElemId = it.CurrentDEId();
724
725 if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
726 {
727 ndes = TMath::Max(ndes,detElemId);
728
729 h1I = new TH1I(Form("hTrackerClusterMultiplicityForDE%04d",detElemId), Form("cluster size distribution in detection element %d;size (n_{pads})",detElemId), 100,0,100);
7d297381 730 Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerDE+detElemId, expert, !image);
2d114b34 731
4eb3ad98 732 h1I = new TH1I(Form("hTrackerClusterChargeForDE%04d",detElemId), Form("cluster charge distribution in detection element %d;charge (fC)",detElemId), 100,0,1000);
7d297381 733 Add2RecPointsList(h1I,kTrackerClusterChargePerDE+detElemId, expert, !image);
2d114b34 734 }
735
736 it.Next();
737 }
738
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);
7d297381 741 Add2RecPointsList(h1I, kTrackerNumberOfClustersPerDE, !expert, image);
2d114b34 742
743 h1F = new TH1F("hTrackerClusterMultiplicityPerDEMean", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", ndes+1,-0.5,ndes+0.5);
744 h1F->SetOption("P");
745 h1F->SetMarkerStyle(kFullDotMedium);
746 h1F->SetMarkerColor(kRed);
d1e6fdee 747 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerDEMean, !expert, image);
2d114b34 748
4eb3ad98 749 h1F = new TH1F("hTrackerClusterChargePerDEMean", "cluster mean charge per DE;DetElem ID;<charge> (fC)", ndes+1,-0.5,ndes+0.5);
2d114b34 750 h1F->SetOption("P");
751 h1F->SetMarkerStyle(kFullDotMedium);
752 h1F->SetMarkerColor(kRed);
d1e6fdee 753 Add2RecPointsList(h1F, kTrackerClusterChargePerDEMean, !expert, image);
04236e67 754}
755
756//____________________________________________________________________________
f587a77d 757void AliMUONQADataMakerRec::InitRecPointsTrigger()
04236e67 758{
f587a77d 759 /// create Reconstructed Points histograms in RecPoints subdir for the
760 /// MUON Trigger subsystem.
761
7d297381 762 const Bool_t expert = kTRUE ;
763 const Bool_t image = kTRUE ;
719914e0 764
765 TString boardName = "Local board Id";
43b113b8 766
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(),
774 234, 0.5, 234.5,
775 16, -0.5, 15.5);
776 h0->GetXaxis()->SetTitle(boardName.Data());
777 h0->GetYaxis()->SetTitle("Strip");
778 Add2RecPointsList(h0, kTriggerDigits + AliMpConstants::NofTriggerChambers()*iCath + iChamber, expert, !image);
779 }
780 }
2346e1ad 781
782 TH1F* h2 = new TH1F("hTriggeredBoards", "Triggered boards", 234, 0.5, 234.5);
7d297381 783 Add2RecPointsList(h2, kTriggeredBoards, expert, !image);
2346e1ad 784
aef183f7 785 AliMUONTriggerDisplay triggerDisplay;
aef183f7 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++){
43b113b8 789 histoName = Form("hTriggerDigitsDisplay%sChamber%i", cathName.Data(), 11+iChamber);
719914e0 790 histoTitle = Form("Chamber %i - %s: Occupancy per strip (counts/event)", 11+iChamber, cathName.Data());
aef183f7 791 TH2F* h3 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips,
792 iCath, iChamber, histoTitle);
7d297381 793 Add2RecPointsList(h3, kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber, !expert, image);
aef183f7 794 }
795 }
796
797 TH2F* h4 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto("hFiredBoardsDisplay", AliMUONTriggerDisplay::kDisplayBoards,
719914e0 798 0, 0, "Local board triggers / event");
7d297381 799 Add2RecPointsList(h4, kTriggerBoardsDisplay, !expert, image);
719914e0 800
77bd5fcf 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));
719914e0 804 h5->GetYaxis()->SetTitle("Number of analyzed events");
805 Add2RecPointsList(h5, kNAnalyzedEvents, !expert, image);
04236e67 806}
807
808
809//____________________________________________________________________________
810void AliMUONQADataMakerRec::InitESDs()
811{
c92a8c85 812 ///create ESDs histograms in ESDs subdir
5bb54f70 813
7d297381 814 const Bool_t expert = kTRUE ;
815 const Bool_t image = kTRUE ;
5bb54f70 816
c92a8c85 817 Int_t nCh = AliMUONConstants::NTrackingCh();
818 Int_t nDE = 1100;
819
820 // track info
5a240757 821 TH1F* hESDnTracks = new TH1F("hESDnTracks", "number of tracks;n_{tracks}", 20, 0., 20.);
7d297381 822 Add2ESDsList(hESDnTracks, kESDnTracks, !expert, image);
04236e67 823
5a240757 824 TH1F* hESDMatchTrig = new TH1F("hESDMatchTrig", "number of tracks matched with trigger;n_{tracks}", 20, 0., 20.);
7d297381 825 Add2ESDsList(hESDMatchTrig, kESDMatchTrig, !expert, image);
c92a8c85 826
5a240757 827 TH1F* hESDMomentum = new TH1F("hESDMomentum", "momentum distribution;p (GeV/c)", 300, 0., 300);
d1e6fdee 828 Add2ESDsList(hESDMomentum, kESDMomentum, !expert, image);
04236e67 829
5a240757 830 TH1F* hESDPt = new TH1F("hESDPt", "transverse momentum distribution;p_{t} (GeV/c)", 200, 0., 50);
d1e6fdee 831 Add2ESDsList(hESDPt, kESDPt, !expert, image);
04236e67 832
5a240757 833 TH1F* hESDRapidity = new TH1F("hESDRapidity", "rapidity distribution;rapidity", 200, -4.5, -2.);
d1e6fdee 834 Add2ESDsList(hESDRapidity, kESDRapidity, !expert, image);
b62881f2 835
5a240757 836 TH1F* hESDChi2 = new TH1F("hESDChi2", "normalized #chi^{2} distribution;#chi^{2} / ndf", 500, 0., 50.);
d1e6fdee 837 Add2ESDsList(hESDChi2, kESDChi2, !expert, image);
c92a8c85 838
5a240757 839 TH1F* hESDProbChi2 = new TH1F("hESDProbChi2", "distribution of probability of #chi^{2};prob(#chi^{2})", 100, 0., 1.);
d1e6fdee 840 Add2ESDsList(hESDProbChi2, kESDProbChi2, !expert, image);
841
842 TH1F* hESDThetaX = new TH1F("hESDThetaX", "#theta_{X} distribution;#theta_{X} (degree)", 360, -180., 180);
843 Add2ESDsList(hESDThetaX, kESDThetaX, !expert, image);
844
845 TH1F* hESDThetaY = new TH1F("hESDThetaY", "#theta_{Y} distribution;#theta_{Y} (degree)", 360, -180., 180);
846 Add2ESDsList(hESDThetaY, kESDThetaY, !expert, image);
5a240757 847
c92a8c85 848 // cluster info
849 for (Int_t i = 0; i < nCh; i++) {
850 Float_t rMax = AliMUONConstants::Rmax(i/2);
5a240757 851 TH2F* hESDClusterHitMap = new TH2F(Form("hESDClusterHitMap%d",i+1), Form("cluster position distribution in chamber %d;X (cm);Y (cm)",i+1),
c92a8c85 852 100, -rMax, rMax, 100, -rMax, rMax);
7d297381 853 Add2ESDsList(hESDClusterHitMap, kESDClusterHitMap+i, expert, !image);
c92a8c85 854 }
855
5a240757 856 TH1F* hESDnClustersPerTrack = new TH1F("hESDnClustersPerTrack", "number of associated clusters per track;n_{clusters}", 20, 0., 20.);
7d297381 857 Add2ESDsList(hESDnClustersPerTrack, kESDnClustersPerTrack, !expert, image);
c92a8c85 858
2d114b34 859 TH1F* hESDnClustersPerCh = new TH1F("hESDnClustersPerCh", "averaged number of clusters per chamber per track;chamber ID;<n_{clusters}>", nCh, -0.5, nCh-0.5);
c92a8c85 860 hESDnClustersPerCh->SetFillColor(kRed);
d1e6fdee 861 Add2ESDsList(hESDnClustersPerCh, kESDnClustersPerCh, !expert, image);
c92a8c85 862
2d114b34 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);
c92a8c85 864 hESDnClustersPerDE->SetFillColor(kRed);
d1e6fdee 865 Add2ESDsList(hESDnClustersPerDE, kESDnClustersPerDE, !expert, image);
c92a8c85 866
c92a8c85 867 for (Int_t i = 0; i < nCh; i++) {
4eb3ad98 868 TH1F* hESDClusterChargeInCh = new TH1F(Form("hESDClusterChargeInCh%d",i+1), Form("cluster charge distribution in chamber %d;charge (fC)",i+1), 100, 0., 1000.);
7d297381 869 Add2ESDsList(hESDClusterChargeInCh, kESDClusterChargeInCh+i, expert, !image);
c92a8c85 870 }
871
4eb3ad98 872 TH1F* hESDClusterChargePerChMean = new TH1F("hESDClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (fC)", nCh, -0.5, nCh-0.5);
5a240757 873 hESDClusterChargePerChMean->SetOption("P");
874 hESDClusterChargePerChMean->SetMarkerStyle(kFullDotMedium);
875 hESDClusterChargePerChMean->SetMarkerColor(kRed);
d1e6fdee 876 Add2ESDsList(hESDClusterChargePerChMean, kESDClusterChargePerChMean, !expert, image);
5a240757 877
4eb3ad98 878 TH1F* hESDClusterChargePerChSigma = new TH1F("hESDClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (fC)", nCh, -0.5, nCh-0.5);
5a240757 879 hESDClusterChargePerChSigma->SetOption("P");
880 hESDClusterChargePerChSigma->SetMarkerStyle(kFullDotMedium);
881 hESDClusterChargePerChSigma->SetMarkerColor(kRed);
d1e6fdee 882 Add2ESDsList(hESDClusterChargePerChSigma, kESDClusterChargePerChSigma, !expert, image);
5a240757 883
4eb3ad98 884 TH1F* hESDClusterChargePerDE = new TH1F("hESDClusterChargePerDE", "cluster mean charge per DE;DetElem ID;<charge> (fC)", nDE+1, -0.5, nDE+0.5);
c92a8c85 885 hESDClusterChargePerDE->SetOption("P");
886 hESDClusterChargePerDE->SetMarkerStyle(kFullDotMedium);
887 hESDClusterChargePerDE->SetMarkerColor(kRed);
d1e6fdee 888 Add2ESDsList(hESDClusterChargePerDE, kESDClusterChargePerDE, !expert, image);
c92a8c85 889
c92a8c85 890 for (Int_t i = 0; i < nCh; i++) {
5a240757 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.);
7d297381 892 Add2ESDsList(hESDClusterSizeInCh, kESDClusterSizeInCh+i, expert, !image);
b62881f2 893 }
b1341ab0 894
2d114b34 895 TH1F* hESDClusterSizePerChMean = new TH1F("hESDClusterSizePerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh, -0.5, nCh-0.5);
5a240757 896 hESDClusterSizePerChMean->SetOption("P");
897 hESDClusterSizePerChMean->SetMarkerStyle(kFullDotMedium);
898 hESDClusterSizePerChMean->SetMarkerColor(kRed);
d1e6fdee 899 Add2ESDsList(hESDClusterSizePerChMean, kESDClusterSizePerChMean, !expert, image);
c92a8c85 900
2d114b34 901 TH1F* hESDClusterSizePerChSigma = new TH1F("hESDClusterSizePerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh, -0.5, nCh-0.5);
5a240757 902 hESDClusterSizePerChSigma->SetOption("P");
903 hESDClusterSizePerChSigma->SetMarkerStyle(kFullDotMedium);
904 hESDClusterSizePerChSigma->SetMarkerColor(kRed);
d1e6fdee 905 Add2ESDsList(hESDClusterSizePerChSigma, kESDClusterSizePerChSigma, !expert, image);
c92a8c85 906
2d114b34 907 TH1F* hESDClusterSizePerDE = new TH1F("hESDClusterSizePerDE", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", nDE+1, -0.5, nDE+0.5);
5a240757 908 hESDClusterSizePerDE->SetOption("P");
909 hESDClusterSizePerDE->SetMarkerStyle(kFullDotMedium);
910 hESDClusterSizePerDE->SetMarkerColor(kRed);
d1e6fdee 911 Add2ESDsList(hESDClusterSizePerDE, kESDClusterSizePerDE, !expert, image);
c92a8c85 912
5a240757 913 // cluster - track info
c92a8c85 914 for (Int_t i = 0; i < nCh; i++) {
5a240757 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.);
7d297381 916 Add2ESDsList(hESDResidualXInCh, kESDResidualXInCh+i, expert, !image);
c92a8c85 917
5a240757 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.);
7d297381 919 Add2ESDsList(hESDResidualYInCh, kESDResidualYInCh+i, expert, !image);
5a240757 920
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);
7d297381 922 Add2ESDsList(hESDLocalChi2XInCh, kESDLocalChi2XInCh+i, expert, !image);
5a240757 923
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);
7d297381 925 Add2ESDsList(hESDLocalChi2YInCh, kESDLocalChi2YInCh+i, expert, !image);
d1e6fdee 926
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);
c92a8c85 929 }
930
2d114b34 931 TH1F* hESDResidualXPerChMean = new TH1F("hESDResidualXPerChMean", "cluster-track residual-X per Ch: mean;chamber ID;<#Delta_{X}> (cm)", nCh, -0.5, nCh-0.5);
5a240757 932 hESDResidualXPerChMean->SetOption("P");
933 hESDResidualXPerChMean->SetMarkerStyle(kFullDotMedium);
934 hESDResidualXPerChMean->SetMarkerColor(kRed);
d1e6fdee 935 Add2ESDsList(hESDResidualXPerChMean, kESDResidualXPerChMean, !expert, image);
5a240757 936
2d114b34 937 TH1F* hESDResidualYPerChMean = new TH1F("hESDResidualYPerChMean", "cluster-track residual-Y per Ch: mean;chamber ID;<#Delta_{Y}> (cm)", nCh, -0.5, nCh-0.5);
5a240757 938 hESDResidualYPerChMean->SetOption("P");
939 hESDResidualYPerChMean->SetMarkerStyle(kFullDotMedium);
940 hESDResidualYPerChMean->SetMarkerColor(kRed);
d1e6fdee 941 Add2ESDsList(hESDResidualYPerChMean, kESDResidualYPerChMean, !expert, image);
5a240757 942
2d114b34 943 TH1F* hESDResidualXPerChSigma = new TH1F("hESDResidualXPerChSigma", "cluster-track residual-X per Ch: sigma;chamber ID;#sigma_{X} (cm)", nCh, -0.5, nCh-0.5);
5a240757 944 hESDResidualXPerChSigma->SetOption("P");
945 hESDResidualXPerChSigma->SetMarkerStyle(kFullDotMedium);
946 hESDResidualXPerChSigma->SetMarkerColor(kRed);
d1e6fdee 947 Add2ESDsList(hESDResidualXPerChSigma, kESDResidualXPerChSigma, !expert, image);
5a240757 948
2d114b34 949 TH1F* hESDResidualYPerChSigma = new TH1F("hESDResidualYPerChSigma", "cluster-track residual-Y per Ch: sigma;chamber ID;#sigma_{Y} (cm)", nCh, -0.5, nCh-0.5);
5a240757 950 hESDResidualYPerChSigma->SetOption("P");
951 hESDResidualYPerChSigma->SetMarkerStyle(kFullDotMedium);
952 hESDResidualYPerChSigma->SetMarkerColor(kRed);
d1e6fdee 953 Add2ESDsList(hESDResidualYPerChSigma, kESDResidualYPerChSigma, !expert, image);
5a240757 954
4eb3ad98 955 TH1F* hESDLocalChi2XPerChMean = new TH1F("hESDLocalChi2XPerCh", "local chi2-X per Ch: mean;chamber ID;<local #chi^{2}_{X}>", nCh, -0.5, nCh-0.5);
5a240757 956 hESDLocalChi2XPerChMean->SetOption("P");
957 hESDLocalChi2XPerChMean->SetMarkerStyle(kFullDotMedium);
958 hESDLocalChi2XPerChMean->SetMarkerColor(kRed);
d1e6fdee 959 Add2ESDsList(hESDLocalChi2XPerChMean, kESDLocalChi2XPerChMean, !expert, image);
5a240757 960
4eb3ad98 961 TH1F* hESDLocalChi2YPerChMean = new TH1F("hESDLocalChi2YPerCh", "local chi2-Y per Ch: mean;chamber ID;<local #chi^{2}_{Y}>", nCh, -0.5, nCh-0.5);
5a240757 962 hESDLocalChi2YPerChMean->SetOption("P");
963 hESDLocalChi2YPerChMean->SetMarkerStyle(kFullDotMedium);
964 hESDLocalChi2YPerChMean->SetMarkerColor(kRed);
d1e6fdee 965 Add2ESDsList(hESDLocalChi2YPerChMean, kESDLocalChi2YPerChMean, !expert, image);
966
4eb3ad98 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);
d1e6fdee 968 hESDLocalChi2PerChMean->SetOption("P");
969 hESDLocalChi2PerChMean->SetMarkerStyle(kFullDotMedium);
970 hESDLocalChi2PerChMean->SetMarkerColor(kRed);
971 Add2ESDsList(hESDLocalChi2PerChMean, kESDLocalChi2PerChMean, !expert, image);
5a240757 972
2d114b34 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);
c92a8c85 974 hESDResidualXPerDEMean->SetOption("P");
975 hESDResidualXPerDEMean->SetMarkerStyle(kFullDotMedium);
976 hESDResidualXPerDEMean->SetMarkerColor(kRed);
d1e6fdee 977 Add2ESDsList(hESDResidualXPerDEMean, kESDResidualXPerDEMean, !expert, image);
c92a8c85 978
2d114b34 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);
c92a8c85 980 hESDResidualYPerDEMean->SetOption("P");
981 hESDResidualYPerDEMean->SetMarkerStyle(kFullDotMedium);
982 hESDResidualYPerDEMean->SetMarkerColor(kRed);
d1e6fdee 983 Add2ESDsList(hESDResidualYPerDEMean, kESDResidualYPerDEMean, !expert, image);
c92a8c85 984
2d114b34 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);
c92a8c85 986 hESDResidualXPerDESigma->SetOption("P");
987 hESDResidualXPerDESigma->SetMarkerStyle(kFullDotMedium);
988 hESDResidualXPerDESigma->SetMarkerColor(kRed);
d1e6fdee 989 Add2ESDsList(hESDResidualXPerDESigma, kESDResidualXPerDESigma, !expert, image);
c92a8c85 990
2d114b34 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);
c92a8c85 992 hESDResidualYPerDESigma->SetOption("P");
993 hESDResidualYPerDESigma->SetMarkerStyle(kFullDotMedium);
994 hESDResidualYPerDESigma->SetMarkerColor(kRed);
d1e6fdee 995 Add2ESDsList(hESDResidualYPerDESigma, kESDResidualYPerDESigma, !expert, image);
c92a8c85 996
4eb3ad98 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);
5a240757 998 hESDLocalChi2XPerDEMean->SetOption("P");
999 hESDLocalChi2XPerDEMean->SetMarkerStyle(kFullDotMedium);
1000 hESDLocalChi2XPerDEMean->SetMarkerColor(kRed);
d1e6fdee 1001 Add2ESDsList(hESDLocalChi2XPerDEMean, kESDLocalChi2XPerDEMean, !expert, image);
5a240757 1002
4eb3ad98 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);
5a240757 1004 hESDLocalChi2YPerDEMean->SetOption("P");
1005 hESDLocalChi2YPerDEMean->SetMarkerStyle(kFullDotMedium);
1006 hESDLocalChi2YPerDEMean->SetMarkerColor(kRed);
d1e6fdee 1007 Add2ESDsList(hESDLocalChi2YPerDEMean, kESDLocalChi2YPerDEMean, !expert, image);
1008
4eb3ad98 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);
d1e6fdee 1010 hESDLocalChi2PerDEMean->SetOption("P");
1011 hESDLocalChi2PerDEMean->SetMarkerStyle(kFullDotMedium);
1012 hESDLocalChi2PerDEMean->SetMarkerColor(kRed);
1013 Add2ESDsList(hESDLocalChi2PerDEMean, kESDLocalChi2PerDEMean, !expert, image);
5a240757 1014
abcfd6d0 1015 // intermediate histograms
2d114b34 1016 TH1F* hESDnTotClustersPerCh = new TH1F("hESDnTotClustersPerCh", "total number of associated clusters per chamber;chamber ID;#Sigma(n_{clusters})", nCh, -0.5, nCh-0.5);
7d297381 1017 Add2ESDsList(hESDnTotClustersPerCh, kESDnTotClustersPerCh, expert, !image);
2d114b34 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);
7d297381 1019 Add2ESDsList(hESDnTotClustersPerDE, kESDnTotClustersPerDE, expert, !image);
2d114b34 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);
7d297381 1021 Add2ESDsList(hESDnTotFullClustersPerDE, kESDnTotFullClustersPerDE, expert, !image);
4eb3ad98 1022 TH1F* hESDSumClusterChargePerDE = new TH1F("hESDSumClusterChargePerDE", "sum of cluster charge per DE;DetElem ID;#Sigma(charge) (fC)", nDE+1, -0.5, nDE+0.5);
7d297381 1023 Add2ESDsList(hESDSumClusterChargePerDE, kESDSumClusterChargePerDE, expert, !image);
2d114b34 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);
7d297381 1025 Add2ESDsList(hESDSumClusterSizePerDE, kESDSumClusterSizePerDE, expert, !image);
2d114b34 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);
7d297381 1027 Add2ESDsList(hESDSumResidualXPerDE, kESDSumResidualXPerDE, expert, !image);
2d114b34 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);
7d297381 1029 Add2ESDsList(hESDSumResidualYPerDE, kESDSumResidualYPerDE, expert, !image);
2d114b34 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);
7d297381 1031 Add2ESDsList(hESDSumResidualX2PerDE, kESDSumResidualX2PerDE, expert, !image);
2d114b34 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);
7d297381 1033 Add2ESDsList(hESDSumResidualY2PerDE, kESDSumResidualY2PerDE, expert, !image);
2d114b34 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);
7d297381 1035 Add2ESDsList(hESDSumLocalChi2XPerDE, kESDSumLocalChi2XPerDE, expert, !image);
2d114b34 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);
7d297381 1037 Add2ESDsList(hESDSumLocalChi2YPerDE, kESDSumLocalChi2YPerDE, expert, !image);
d1e6fdee 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);
04236e67 1040}
1041
1042//____________________________________________________________________________
1043void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader)
1044{
1045 /// make QA for rawdata
b1341ab0 1046
eca4fa66 1047 // Check id histograms already created for this Event Specie
77bd5fcf 1048
1049 AliDebug(AliQAv1::GetQADebugLevel(),
1050 Form("RAW event type %s", AliRawEventHeaderBase::GetTypeName(rawReader->GetType())));
eca4fa66 1051
f587a77d 1052 if ( rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent )
1053 {
04236e67 1054 rawReader->Reset();
f587a77d 1055 MakeRawsTracker(rawReader);
1056 }
04236e67 1057
719914e0 1058 if ( rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent ||
1059 rawReader->GetType() == AliRawEventHeaderBase::kCalibrationEvent )
1060 {
1061 rawReader->Reset();
1062 MakeRawsTrigger(rawReader);
1063 }
f587a77d 1064}
2346e1ad 1065
f587a77d 1066//____________________________________________________________________________
1067void AliMUONQADataMakerRec::MakeRawsTracker(AliRawReader* rawReader)
1068{
1069 /// make QA for rawdata tracker
de1d4a53 1070
bb22d2a6 1071 /// forces init
1072 GetRawsData(kTrackerBusPatchOccupancy);
1073
b6f591ae 1074 ((AliMUONTrackerDataMaker*)fTrackerDataMaker)->SetRawReader(rawReader);
f587a77d 1075
1076 fTrackerDataMaker->ProcessEvent();
1077}
2346e1ad 1078
f587a77d 1079//____________________________________________________________________________
1080void AliMUONQADataMakerRec::MakeRawsTrigger(AliRawReader* rawReader)
1081{
1082 /// make QA for rawdata trigger
1083
2346e1ad 1084 // Get trigger scalers
1085
1086 Int_t loCircuit=0;
1087 AliMpCDB::LoadDDLStore();
1088
1089 AliMUONRawStreamTrigger rawStreamTrig(rawReader);
1090 while (rawStreamTrig.NextDDL())
1091 {
1092 // If not a scaler event, do nothing
1093 Bool_t scalerEvent = rawReader->GetDataHeader()->GetL1TriggerMessage() & 0x1;
719914e0 1094 if ( !scalerEvent ) continue;
2346e1ad 1095
77bd5fcf 1096 AliDebug(AliQAv1::GetQADebugLevel(),"Filling trigger scalers");
1097
2346e1ad 1098 AliMUONDDLTrigger* ddlTrigger = rawStreamTrig.GetDDLTrigger();
1099 AliMUONDarcHeader* darcHeader = ddlTrigger->GetDarcHeader();
1100
eb3886c8 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);
1105 }
1106
2346e1ad 1107 Int_t nReg = darcHeader->GetRegHeaderEntries();
1108
1109 for(Int_t iReg = 0; iReg < nReg ;iReg++)
1110 { //reg loop
1111
1112 // crate info
1113 AliMpTriggerCrate* crate = AliMpDDLStore::Instance()->
1114 GetTriggerCrate(rawStreamTrig.GetDDL(), iReg);
1115
1116 AliMUONRegHeader* regHeader = darcHeader->GetRegHeaderEntry(iReg);
1117
1118 // loop over local structures
1119 Int_t nLocal = regHeader->GetLocalEntries();
1120 for(Int_t iLocal = 0; iLocal < nLocal; iLocal++)
1121 {
1122 AliMUONLocalStruct* localStruct = regHeader->GetLocalEntry(iLocal);
1123
1124 // if card exist
1125 if (!localStruct) continue;
1126
1127 loCircuit = crate->GetLocalBoardId(localStruct->GetId());
1128
1129 if ( !loCircuit ) continue; // empty slot
1130
1131 AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit, false);
1132
1133 // skip copy cards
1134 if( !localBoard->IsNotified())
1135 continue;
1136
1137 Int_t cathode = localStruct->GetComptXY()%2;
1138
2346e1ad 1139 // loop over strips
1140 for (Int_t ibitxy = 0; ibitxy < 16; ++ibitxy) {
1141 if(localStruct->GetXY1(ibitxy) > 0)
43b113b8 1142 ((TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*cathode + 0))
1143 ->Fill(loCircuit, ibitxy, 2*localStruct->GetXY1(ibitxy));
2346e1ad 1144 if(localStruct->GetXY2(ibitxy) > 0)
43b113b8 1145 ((TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*cathode + 1))
1146 ->Fill(loCircuit, ibitxy, 2*localStruct->GetXY2(ibitxy));
2346e1ad 1147 if(localStruct->GetXY3(ibitxy) > 0)
43b113b8 1148 ((TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*cathode + 2))
1149 ->Fill(loCircuit, ibitxy, 2*localStruct->GetXY3(ibitxy));
2346e1ad 1150 if(localStruct->GetXY4(ibitxy) > 0)
43b113b8 1151 ((TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*cathode + 3))
1152 ->Fill(loCircuit, ibitxy, 2*localStruct->GetXY4(ibitxy));
2346e1ad 1153 } // loop on strips
1154 } // iLocal
1155 } // iReg
1156 } // NextDDL
04236e67 1157}
1158
44ed7a66 1159//__________________________________________________________________
1160void AliMUONQADataMakerRec::MakeDigits(TTree* digitsTree)
1161{
1162 /// makes data from Digits
eca4fa66 1163
77bd5fcf 1164 // Do nothing in case of calibration event
1165 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
1166
44ed7a66 1167 if (!fDigitStore)
1168 fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
1169 fDigitStore->Connect(*digitsTree, false);
1170 digitsTree->GetEvent(0);
1171
1172 TIter next(fDigitStore->CreateIterator());
1173
1174 AliMUONVDigit* dig = 0x0;
1175
1176 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
1177 {
1178 GetDigitsData(0)->Fill(dig->DetElemId());
1179 GetDigitsData(1)->Fill(dig->ADC());
1180 }
1181}
1182
04236e67 1183//____________________________________________________________________________
1184void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree)
1185{
f587a77d 1186 /// Fill histograms from treeR
77bd5fcf 1187
1188 // Do nothing in case of calibration event
1189 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
f587a77d 1190
77bd5fcf 1191 GetRecPointsData(kNAnalyzedEvents)->Fill(1.);
719914e0 1192
bb22d2a6 1193 MakeRecPointsTracker(clustersTree);
1194 MakeRecPointsTrigger(clustersTree);
f587a77d 1195}
1196
1197//____________________________________________________________________________
1198void AliMUONQADataMakerRec::MakeRecPointsTracker(TTree* clustersTree)
1199{
1200 /// Fill histograms related to tracker clusters
1201
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
1207 // to QA them...
1208
1209 if (!fClusterStore)
1210 {
1211 AliCodeTimerAuto("ClusterStore creation");
1212 fClusterStore = AliMUONVClusterStore::Create(*clustersTree);
1213 if (!fClusterStore)
1214 {
f587a77d 1215 return;
1216 }
1217 }
1218
1219 AliCodeTimerAuto("");
1220
1221 fClusterStore->Connect(*clustersTree,kFALSE);
1222 clustersTree->GetEvent(0);
1223
1224 TIter next(fClusterStore->CreateIterator());
1225 AliMUONVCluster* cluster;
1226
1227 while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) )
1228 {
1229 Int_t detElemId = cluster->GetDetElemId();
1230 Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
1231
1232 GetRecPointsData(kTrackerNumberOfClustersPerDE)->Fill(detElemId);
1233 GetRecPointsData(kTrackerClusterChargePerDE+detElemId)->Fill(cluster->GetCharge());
1234 GetRecPointsData(kTrackerClusterMultiplicityPerDE+detElemId)->Fill(cluster->GetNDigits());
b1341ab0 1235
f587a77d 1236 GetRecPointsData(kTrackerNumberOfClustersPerChamber)->Fill(chamberId);
1237 GetRecPointsData(kTrackerClusterChargePerChamber+chamberId)->Fill(cluster->GetCharge());
1238 GetRecPointsData(kTrackerClusterMultiplicityPerChamber+chamberId)->Fill(cluster->GetNDigits());
2d114b34 1239 GetRecPointsData(kTrackerClusterHitMapPerChamber+chamberId)->Fill(cluster->GetX(),cluster->GetY());
f587a77d 1240
1241 }
1242
1243 fClusterStore->Clear();
1244}
1245
1246//____________________________________________________________________________
1247void AliMUONQADataMakerRec::MakeRecPointsTrigger(TTree* clustersTree)
1248{
1249 /// makes data from trigger response
1250
7035694f 1251 // Fired pads info
1252 fDigitStore->Clear();
1253
1254 if (!fTriggerStore) fTriggerStore = AliMUONVTriggerStore::Create(*clustersTree);
1255 fTriggerStore->Clear();
1256 fTriggerStore->Connect(*clustersTree, false);
04236e67 1257 clustersTree->GetEvent(0);
04236e67 1258
7035694f 1259 AliMUONLocalTrigger* locTrg;
1260 TIter nextLoc(fTriggerStore->CreateLocalIterator());
1261
1262 while ( ( locTrg = static_cast<AliMUONLocalTrigger*>(nextLoc()) ) )
1263 {
1264 if (locTrg->IsNull()) continue;
1265
1266 TArrayS xyPattern[2];
1267 locTrg->GetXPattern(xyPattern[0]);
1268 locTrg->GetYPattern(xyPattern[1]);
1269
1270 Int_t nBoard = locTrg->LoCircuit();
2346e1ad 1271
d72d7b9e 1272 Bool_t xTrig=locTrg->IsTrigX();
1273 Bool_t yTrig=locTrg->IsTrigY();
2346e1ad 1274
1275 if (xTrig && yTrig)
1276 ((TH1F*)GetRecPointsData(kTriggeredBoards))->Fill(nBoard);
1277
1278 fDigitMaker->TriggerDigits(nBoard, xyPattern, *fDigitStore);
7035694f 1279 }
04236e67 1280
7035694f 1281 TIter nextDigit(fDigitStore->CreateIterator());
1282 AliMUONVDigit* mDigit;
1283 while ( ( mDigit = static_cast<AliMUONVDigit*>(nextDigit()) ) )
04236e67 1284 {
7035694f 1285 Int_t detElemId = mDigit->DetElemId();
2346e1ad 1286 Int_t ch = detElemId/100;
1287 Int_t localBoard = mDigit->ManuId();
1288 Int_t channel = mDigit->ManuChannel();
7035694f 1289 Int_t cathode = mDigit->Cathode();
43b113b8 1290 Int_t iChamber = ch - 11;
b62881f2 1291
43b113b8 1292 ((TH2F*)GetRecPointsData(kTriggerDigits + AliMpConstants::NofTriggerChambers()*cathode + iChamber))
1293 ->Fill(localBoard, channel);
04236e67 1294 }
1295}
1296
1297//____________________________________________________________________________
1298void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd)
1299{
c92a8c85 1300 /// make QA data from ESDs
77bd5fcf 1301
1302 // Do nothing in case of calibration event
1303 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
c92a8c85 1304
c92a8c85 1305 // load ESD event in the interface
1306 AliMUONESDInterface esdInterface;
ac624e6b 1307 if (GetMUONRecoParam()) AliMUONESDInterface::ResetTracker(GetMUONRecoParam());
c92a8c85 1308 else AliError("Unable to get recoParam: use default ones for residual calculation");
1309 esdInterface.LoadEvent(*esd);
1310
1311 GetESDsData(kESDnTracks)->Fill(esdInterface.GetNTracks());
1312
1313 Int_t nTrackMatchTrig = 0;
1314
1315 // loop over tracks
1316 Int_t nTracks = (Int_t) esd->GetNumberOfMuonTracks();
1317 for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
1318
1319 // get the ESD track and skip "ghosts"
1320 AliESDMuonTrack* esdTrack = esd->GetMuonTrack(iTrack);
1321 if (!esdTrack->ContainTrackerData()) continue;
1322
1323 // get corresponding MUON track
1324 AliMUONTrack* track = esdInterface.FindTrack(esdTrack->GetUniqueID());
1325
1326 if (esdTrack->ContainTriggerData()) nTrackMatchTrig++;
1327
1328 GetESDsData(kESDMomentum)->Fill(esdTrack->P());
1329 GetESDsData(kESDPt)->Fill(esdTrack->Pt());
1330 GetESDsData(kESDRapidity)->Fill(esdTrack->Y());
1331 GetESDsData(kESDChi2)->Fill(track->GetNormalizedChi2());
5a240757 1332 GetESDsData(kESDProbChi2)->Fill(TMath::Prob(track->GetGlobalChi2(),track->GetNDF()));
d1e6fdee 1333 GetESDsData(kESDThetaX)->Fill(esdTrack->GetThetaXUncorrected() / TMath::Pi() * 180.);
1334 GetESDsData(kESDThetaY)->Fill(esdTrack->GetThetaYUncorrected() / TMath::Pi() * 180.);
c92a8c85 1335 GetESDsData(kESDnClustersPerTrack)->Fill(track->GetNClusters());
1336
1337 // loop over clusters
1338 AliMUONTrackParam* trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->First());
1339 while (trackParam) {
b1fea02e 1340
c92a8c85 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();
d1e6fdee 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();
b1fea02e 1351
c92a8c85 1352 GetESDsData(kESDClusterHitMap+chId)->Fill(cluster->GetX(), cluster->GetY());
1353
abcfd6d0 1354 GetESDsData(kESDnTotClustersPerCh)->Fill(chId);
1355 GetESDsData(kESDnTotClustersPerDE)->Fill(deID);
c92a8c85 1356
c92a8c85 1357 GetESDsData(kESDClusterChargeInCh+chId)->Fill(cluster->GetCharge());
abcfd6d0 1358 GetESDsData(kESDSumClusterChargePerDE)->Fill(deID, cluster->GetCharge());
c92a8c85 1359
1360 if (cluster->GetNDigits() > 0) { // discard clusters with pad not stored in ESD
abcfd6d0 1361 GetESDsData(kESDnTotFullClustersPerDE)->Fill(deID);
5a240757 1362 GetESDsData(kESDClusterSizeInCh+chId)->Fill(cluster->GetNDigits());
abcfd6d0 1363 GetESDsData(kESDSumClusterSizePerDE)->Fill(deID, cluster->GetNDigits());
b62881f2 1364 }
c92a8c85 1365
c92a8c85 1366 GetESDsData(kESDResidualXInCh+chId)->Fill(residualX);
1367 GetESDsData(kESDResidualYInCh+chId)->Fill(residualY);
abcfd6d0 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);
5a240757 1372
1373 GetESDsData(kESDLocalChi2XInCh+chId)->Fill(localChi2X);
1374 GetESDsData(kESDLocalChi2YInCh+chId)->Fill(localChi2Y);
d1e6fdee 1375 GetESDsData(kESDLocalChi2InCh+chId)->Fill(localChi2);
abcfd6d0 1376 GetESDsData(kESDSumLocalChi2XPerDE)->Fill(deID, localChi2X);
1377 GetESDsData(kESDSumLocalChi2YPerDE)->Fill(deID, localChi2Y);
d1e6fdee 1378 GetESDsData(kESDSumLocalChi2PerDE)->Fill(deID, localChi2);
c92a8c85 1379
1380 trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->After(trackParam));
04236e67 1381 }
c92a8c85 1382
1383 }
1384
1385 GetESDsData(kESDMatchTrig)->Fill(nTrackMatchTrig);
1386
04236e67 1387}
1388
1389//____________________________________________________________________________
1390void AliMUONQADataMakerRec::StartOfDetectorCycle()
1391{
1392 /// Detector specific actions at start of cycle
1393
1394}
2346e1ad 1395
1396//____________________________________________________________________________
4e25ac79 1397void AliMUONQADataMakerRec::DisplayTriggerInfo(AliQAv1::TASKINDEX_t task)
2346e1ad 1398{
1399 //
1400 /// Display trigger information in a user-friendly way:
1401 /// from local board and strip numbers to their position on chambers
1402 //
eca4fa66 1403
49e110ec 1404
4e25ac79 1405 if(task!=AliQAv1::kRECPOINTS && task!=AliQAv1::kRAWS) return;
2346e1ad 1406
c455c5fb 1407 // check we get histograms, otherwise return right now
1408 if ( task == AliQAv1::kRECPOINTS )
1409 {
43b113b8 1410 if ( !GetRecPointsData(kTriggerDigits) ) return;
c455c5fb 1411 }
1412
1413 if ( task == AliQAv1::kRAWS )
1414 {
43b113b8 1415 if ( !GetRawsData(kTriggerScalers) ) return;
c455c5fb 1416 }
1417
aef183f7 1418 AliMUONTriggerDisplay triggerDisplay;
1419
43b113b8 1420 TH2F* histoStrips=0x0;
2346e1ad 1421 TH2F* histoDisplayStrips=0x0;
719914e0 1422 AliMUONTriggerDisplay::EDisplayOption displayOption = AliMUONTriggerDisplay::kDefaultDisplay;
1423 if(task == AliQAv1::kRAWS) displayOption = AliMUONTriggerDisplay::kNormalizeToArea;
2346e1ad 1424
aef183f7 1425 for (Int_t iCath = 0; iCath < AliMpConstants::NofCathodes(); iCath++)
43b113b8 1426 {
aef183f7 1427 for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++)
2346e1ad 1428 {
4e25ac79 1429 if(task==AliQAv1::kRECPOINTS){
43b113b8 1430 histoStrips = (TH2F*)GetRecPointsData(kTriggerDigits + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
1431 }
1432 else if(task==AliQAv1::kRAWS){
1433 histoStrips = (TH2F*)GetRawsData(kTriggerScalers + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
1434 }
1435
1436 if(histoStrips->GetEntries()==0) continue; // No events found => No need to display
1437
1438 if(task==AliQAv1::kRECPOINTS){
aef183f7 1439 histoDisplayStrips = (TH2F*)GetRecPointsData(kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
2346e1ad 1440 }
4e25ac79 1441 else if(task==AliQAv1::kRAWS){
aef183f7 1442 histoDisplayStrips = (TH2F*)GetRawsData(kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
2346e1ad 1443 }
43b113b8 1444
1445 triggerDisplay.FillDisplayHistogram(histoStrips, histoDisplayStrips,
1446 AliMUONTriggerDisplay::kDisplayStrips, iCath, iChamber, displayOption);
719914e0 1447
1448 Float_t scaleValue = 0.;
4e25ac79 1449 if(task==AliQAv1::kRAWS) {
719914e0 1450 scaleValue = ((TH1F*)GetRawsData(kTriggerScalersTime))->GetBinContent(1);
eb3886c8 1451 }
719914e0 1452 else if ( task == AliQAv1::kRECPOINTS ) {
77bd5fcf 1453 scaleValue = GetRecPointsData(kNAnalyzedEvents)->GetBinContent(1);
719914e0 1454 }
1455 if(scaleValue>0.) histoDisplayStrips->Scale(1./scaleValue);
2346e1ad 1456 } // iChamber
1457 } // iCath
2346e1ad 1458
4e25ac79 1459 if(task==AliQAv1::kRECPOINTS){
49e110ec 1460 TH1F* histoBoards = (TH1F*)GetRecPointsData(kTriggeredBoards);
1461 TH2F* histoDisplayBoards = (TH2F*)GetRecPointsData(kTriggerBoardsDisplay);
1462 triggerDisplay.FillDisplayHistogram(histoBoards, histoDisplayBoards, AliMUONTriggerDisplay::kDisplayBoards, 0, 0);
77bd5fcf 1463 Float_t scaleValue = GetRecPointsData(kNAnalyzedEvents)->GetBinContent(1);
719914e0 1464 if(scaleValue>0.) histoDisplayBoards->Scale(1./scaleValue);
49e110ec 1465 }
1466}
1467
1468
1469//_____________________________________________________________________________
1470Bool_t
1471AliMUONQADataMakerRec::FillTriggerDCSHistos()
1472{
1473 /// Get HV and currents values for one trigger chamber
1474
1475 AliCodeTimerAuto("");
1476
49e110ec 1477 AliMUONCalibrationData calibrationData(AliCDBManager::Instance()->GetRun());
1478
1479 TMap* triggerDcsMap = calibrationData.TriggerDCS();
1480
2d114b34 1481 if ( !triggerDcsMap )
1482 {
1483 AliError("Cannot fill DCS histos, as triggerDcsMap is NULL");
1484 return kFALSE;
1485 }
1486
1487 AliMpDEIterator deIt;
1488
1489 deIt.First();
1490
49e110ec 1491 AliMpDCSNamer triggerDcsNamer("TRIGGER");
1492
1493 TH2* currHisto = 0x0;
719914e0 1494 Int_t histoIndex = 0;
1495 TString histoName, histoTitle;
49e110ec 1496
1497 Bool_t error = kFALSE;
719914e0 1498 Bool_t expert = kTRUE;
1499 Bool_t saveCorr = kTRUE;
1500 Bool_t image = kTRUE;
49e110ec 1501
1502 while ( !deIt.IsDone() )
1503 {
1504 Int_t detElemId = deIt.CurrentDEId();
1505
1506 if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStationTrigger) {
1507
1508 Int_t iChamber = AliMpDEManager::GetChamberId(detElemId);
1509 Int_t slat = detElemId%100;
1510
1511 for(Int_t iMeas=0; iMeas<AliMpDCSNamer::kNDCSMeas; iMeas++){
1512 TString currAlias = triggerDcsNamer.DCSChannelName(detElemId, 0, iMeas);
1513
5379c4a3 1514 AliDebug(AliQAv1::GetQADebugLevel(), Form("\nDetElemId %i dcsAlias %s", detElemId, currAlias.Data()));
49e110ec 1515
1516 TPair* triggerDcsPair = static_cast<TPair*>(triggerDcsMap->FindObject(currAlias.Data()));
1517
1518 if (!triggerDcsPair)
1519 {
1520 AliError(Form("Did not find expected alias (%s) for DE %d",
1521 currAlias.Data(),detElemId));
1522 error = kTRUE;
1523 }
1524 else
1525 {
1526 TObjArray* values = static_cast<TObjArray*>(triggerDcsPair->Value());
1527 if (!values)
1528 {
1529 AliError(Form("Could not get values for alias %s",currAlias.Data()));
1530 error = kTRUE;
1531 }
1532 else
1533 {
1534 TIter next(values);
719914e0 1535 AliDCSValue* val = 0x0;
1536
1537 Int_t ich = iChamber - AliMpConstants::NofTrackingChambers();
1538
1539 switch(iMeas){
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);
1544 break;
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);
1549 break;
1550 }
1551
1552 currHisto = (TH2F*) GetRawsData(histoIndex);
1553
1554 if(!currHisto){
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;
1559 }
1560 for(Int_t ientry=0; ientry<npoints; ientry++){
1561 val = static_cast<AliDCSValue*>(values->At(ientry));
1562 axisTime[ientry] = val->GetTimeStamp();
1563 }
1564 axisTime[npoints] = val->GetTimeStamp() + 100;
1565
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);
1574 }
49e110ec 1575
1576 while ( ( val = static_cast<AliDCSValue*>(next()) ) )
1577 {
1578 Float_t hvi = val->GetFloat();
1579
5379c4a3 1580 AliDebug(AliQAv1::GetQADebugLevel(), Form("Value %f", hvi));
719914e0 1581
1582 currHisto->Fill(1.0001 * val->GetTimeStamp(), slat, hvi);
49e110ec 1583 } // loop on values
1584 } // if (!values)
1585 } // if (!triggerDcsPair)
1586 } // loop on measured types (HV and currents)
1587 } // if (stationType == kStationTrigger)
1588
1589 deIt.Next();
1590 }
1591 return error;
2346e1ad 1592}
de1d4a53 1593
1594//____________________________________________________________________________
1595AliMUONVTrackerData* AliMUONQADataMakerRec::GetTrackerData() const
1596{
cddcc1f3 1597/// Return tracker data
de1d4a53 1598
1599 return fTrackerDataMaker->Data();
1600
1601}
8f29b706 1602
1603//____________________________________________________________________________
1604void
1605AliMUONQADataMakerRec::BeautifyTrackerBusPatchOccupancy(TH1& hbp)
1606{
1607 /// Put labels, limits and so on on the TrackerBusPatchOccupancy histogram
1608
1609 hbp.SetXTitle("Absolute Bus Patch Id");
1610 hbp.SetYTitle("Occupancy (percent)");
1611 hbp.SetStats(kFALSE);
1612
1613 Double_t xmin = hbp.GetXaxis()->GetXmin();
1614 Double_t xmax = hbp.GetXaxis()->GetXmax();
1615
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"
1618
1619 TLine* line = new TLine(xmin,occError,xmax,occError);
1620 line->SetLineColor(2);
1621 line->SetLineWidth(3);
1622
1623 hbp.GetListOfFunctions()->Add(line);
1624
1625 TH1* hnpads = GetRawsData(kTrackerBusPatchNofPads);
1626 hnpads->SetStats(kFALSE);
1627 TH1* hnmanus = GetRawsData(kTrackerBusPatchNofManus);
1628 hnmanus->SetStats(kFALSE);
1629
1630 TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
1631 AliMpBusPatch* bp(0x0);
1632 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
1633 {
1634 Int_t n(0);
1635 for ( Int_t imanu = 0; imanu < bp->GetNofManus(); ++imanu )
1636 {
1637 Int_t manuId = bp->GetManuId(imanu);
1638 AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(bp->GetDEId());
1639 n += de->NofChannelsInManu(manuId);
1640 }
1641 hnpads->Fill(bp->GetId(),n*1.0);
1642 hnmanus->Fill(bp->GetId(),bp->GetNofManus()*1.0);
1643 }
1644
1645 next.Reset();
1646
1647 Int_t nMissingPads(0);
1648 Int_t nPads(0);
1649 Int_t nBusPatches(0);
1650 Int_t nMissingBusPatches(0);
1651
1652 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
1653 {
1654 Int_t bin = hbp.FindBin(bp->GetId());
1655 Int_t n = hnpads->GetBinContent(bin);
1656
1657 ++nBusPatches;
1658
1659 nPads += n;
1660
1661 if ( hbp.GetBinContent(bin) <= 0 )
1662 {
1663 nMissingPads += n;
1664 ++nMissingBusPatches;
1665 }
1666 }
1667
1668 next.Reset();
1669
1670 Double_t* x = new Double_t[nBusPatches];
1671 Int_t n(0);
1672 Int_t nBusPatchesAboveLimit(0);
1673
1674 while ( ( bp = static_cast<AliMpBusPatch*>(next())) )
1675 {
1676 Int_t bin = hbp.FindBin(bp->GetId());
1677 if ( hbp.GetBinContent(bin) > 0 )
1678 {
1679 x[n] = hbp.GetBinContent(bin);
1680 ++n;
1681 }
1682 if ( hbp.GetBinContent(bin) > occError )
1683 {
1684 ++nBusPatchesAboveLimit;
1685 }
1686 }
1687
1688 Double_t alpha(0.1); // trim 10% of data
1689 Double_t tmean,tvar;
1690 Double_t ymin,ymax;
1691
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);
1696
1697 if ( ok < 0 )
1698 {
1699 ymax = occMax;
1700 }
1701 else
1702 {
1703 ymax = TMath::Max(ymax,occMax);
1704 }
1705
1706 hbp.SetMaximum(ymax*1.4);
1707
1708 TPaveText* text = new TPaveText(0.55,0.85,0.99,0.99,"NDC");
1709
1710 if (ok < 0 )
1711 {
1712 text->AddText("Could not compute truncated mean. Not enough events ?");
1713 text->SetFillColor(2);
1714 }
1715 else if (!nPads || !nBusPatches)
1716 {
1717 text->AddText("Could not get the total number of pads. ERROR !!!");
1718 text->SetFillColor(2);
1719 }
1720 else
1721 {
1722 Float_t missingPadFraction = nMissingPads*100.0/nPads;
1723 Float_t missingBusPatchFraction = nMissingBusPatches*100.0/nBusPatches;
1724 Float_t aboveLimitFraction = nBusPatchesAboveLimit*100.0/nBusPatches;
1725
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));
1730
1731 if ( missingPadFraction > 10.0 || aboveLimitFraction > 5.0 )
1732 {
1733 text->SetFillColor(2);
1734 }
1735 else
1736 {
1737 text->SetFillColor(3);
1738 }
1739 }
1740
1741 hbp.GetListOfFunctions()->Add(text);
1742}
1743