added verbosity to QA histograms (Yves)
[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"
b1341ab0 50#include "AliMpLocalBoard.h"
f587a77d 51#include "AliMpStationType.h"
52#include "AliMpTriggerCrate.h"
49e110ec 53#include "AliMpDCSNamer.h"
f587a77d 54#include "AliRawEventHeaderBase.h"
2346e1ad 55
b1341ab0 56// --- AliRoot header files ---
f587a77d 57#include "AliCDBManager.h"
58#include "AliCDBStorage.h"
b1341ab0 59#include "AliESDEvent.h"
60#include "AliESDMuonTrack.h"
61#include "AliESDMuonCluster.h"
62#include "AliLog.h"
63#include "AliRawReader.h"
64#include "AliQAChecker.h"
f587a77d 65#include "AliCodeTimer.h"
49e110ec 66#include "AliDCSValue.h"
44ed7a66 67#include "AliMUONVDigit.h"
b1341ab0 68
69// --- ROOT system ---
70#include <TClonesArray.h>
71#include <TFile.h>
72#include <TH1F.h>
73#include <TH1I.h>
74#include <TH2F.h>
75#include <TH3F.h>
b1341ab0 76#include <Riostream.h>
04236e67 77
78//-----------------------------------------------------------------------------
79/// \class AliMUONQADataMakerRec
80///
81/// MUON base class for quality assurance data (histo) maker
82///
f587a77d 83/// \author C. Finck, D. Stocco, L. Aphecetche
04236e67 84
85/// \cond CLASSIMP
86ClassImp(AliMUONQADataMakerRec)
87/// \endcond
88
89//____________________________________________________________________________
b8bd1ab8 90AliMUONQADataMakerRec::AliMUONQADataMakerRec() :
4e25ac79 91AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kMUON), "MUON Quality Assurance Data Maker"),
f587a77d 92fIsInitRaws(kFALSE),
93fIsInitRecPointsTracker(kFALSE),
94fIsInitRecPointsTrigger(kFALSE),
95fIsInitESDs(kFALSE),
96fDigitStore(0x0),
97fTriggerStore(0x0),
98fDigitMaker(0x0),
99fClusterStore(0x0),
abcfd6d0 100fTrackerDataMaker(0x0)
04236e67 101{
102 /// ctor
f587a77d 103
5379c4a3 104 AliDebug(AliQAv1::GetQADebugLevel(),"");
d874bd09 105
f587a77d 106 Ctor();
107}
108
109//____________________________________________________________________________
110void
111AliMUONQADataMakerRec::Ctor()
112{
113 /// Init some members
114 fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV1");
115 fDigitMaker = new AliMUONDigitMaker(kTRUE);
04236e67 116}
117
118//____________________________________________________________________________
119AliMUONQADataMakerRec::AliMUONQADataMakerRec(const AliMUONQADataMakerRec& qadm) :
f587a77d 120AliQADataMakerRec(qadm),
121fIsInitRaws(kFALSE),
122fIsInitRecPointsTracker(kFALSE),
123fIsInitRecPointsTrigger(kFALSE),
124fIsInitESDs(kFALSE),
125fDigitStore(0x0),
126fTriggerStore(0x0),
127fDigitMaker(0x0),
128fClusterStore(0x0),
abcfd6d0 129fTrackerDataMaker(0x0)
04236e67 130{
131 ///copy ctor
d874bd09 132
5379c4a3 133 AliDebug(AliQAv1::GetQADebugLevel(),"");
d874bd09 134
135
04236e67 136 SetName((const char*)qadm.GetName()) ;
137 SetTitle((const char*)qadm.GetTitle());
7035694f 138
f587a77d 139 // Do not copy the digit store and digit maker, but create its own ones
140
141 Ctor();
142
04236e67 143}
144
145//__________________________________________________________________
146AliMUONQADataMakerRec& AliMUONQADataMakerRec::operator = (const AliMUONQADataMakerRec& qadm )
147{
7035694f 148 /// Assignment operator
149
5379c4a3 150 AliDebug(AliQAv1::GetQADebugLevel(),"");
d874bd09 151
7035694f 152 // check assignment to self
153 if (this == &qadm) return *this;
154
155 this->~AliMUONQADataMakerRec();
156 new(this) AliMUONQADataMakerRec(qadm);
157 return *this;
04236e67 158}
159
160//__________________________________________________________________
161AliMUONQADataMakerRec::~AliMUONQADataMakerRec()
162{
163 /// dtor
f587a77d 164
5379c4a3 165 AliDebug(AliQAv1::GetQADebugLevel(),"");
d874bd09 166
f587a77d 167 AliCodeTimerAuto("");
168
169 delete fDigitStore;
170 delete fTriggerStore;
171 delete fDigitMaker;
c92a8c85 172 delete fClusterStore;
173 delete fTrackerDataMaker;
04236e67 174}
175
176//____________________________________________________________________________
4e25ac79 177void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
04236e67 178{
c92a8c85 179 ///Detector specific actions at end of cycle
180
5bb54f70 181 AliCodeTimerAuto("");
182
c92a8c85 183 // Display trigger histos in a more user friendly way
184 DisplayTriggerInfo(task);
185
57acd2d2 186 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
187 SetEventSpecie(specie) ;
4e25ac79 188 if ( task == AliQAv1::kRAWS && fTrackerDataMaker )
5bb54f70 189 {
57acd2d2 190 TIter next(list[specie]);
191 TObject* o;
192 Bool_t alreadyThere(kFALSE);
193 while ( ( o = next() ) && !alreadyThere )
194 {
195 TString classname(o->ClassName());
196 if ( classname.Contains("TrackerData") ) alreadyThere = kTRUE;
197 }
198 if (!alreadyThere && fTrackerDataMaker)
199 {
5379c4a3 200 AliDebug(AliQAv1::GetQADebugLevel(), "Adding fTrackerDataMaker to the list of qa objects");
57acd2d2 201 list[specie]->AddAt(fTrackerDataMaker->Data(),(Int_t)kTrackerData);
202 }
203 if ( fTrackerDataMaker )
204 {
205 TH1* hbp = GetRawsData(kTrackerBusPatchOccupancy);
206 hbp->Reset();
207 TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator());
208 AliMpBusPatch* bp(0x0);
209 AliMUONVTrackerData* data = fTrackerDataMaker->Data();
210 Int_t occDim = 2;
211
212 while ( ( bp = static_cast<AliMpBusPatch*>(nextBP())) )
213 {
214 Int_t busPatchId = bp->GetId();
215 Int_t bin = hbp->FindBin(busPatchId);
216 hbp->SetBinContent(bin,data->BusPatch(busPatchId,occDim));
217 }
218 }
5bb54f70 219 }
2d114b34 220
221 // Normalize RecPoints histos
4e25ac79 222 if ( task == AliQAv1::kRECPOINTS ) {
2d114b34 223
224 TH1* hTrackerClusterChargePerChMean = GetRecPointsData(kTrackerClusterChargePerChMean);
225 TH1* hTrackerClusterChargePerChSigma = GetRecPointsData(kTrackerClusterChargePerChSigma);
226 TH1* hTrackerClusterMultiplicityPerChMean = GetRecPointsData(kTrackerClusterMultiplicityPerChMean);
227 TH1* hTrackerClusterMultiplicityPerChSigma = GetRecPointsData(kTrackerClusterMultiplicityPerChSigma);
228 TH1* hTrackerClusterChargePerDEMean = GetRecPointsData(kTrackerClusterChargePerDEMean);
229 TH1* hTrackerClusterMultiplicityPerDEMean = GetRecPointsData(kTrackerClusterMultiplicityPerDEMean);
230
231 // loop over chambers
232 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
233
234 TH1* hTrackerClusterChargePerChamber = GetRecPointsData(kTrackerClusterChargePerChamber+iCh);
235 Double_t sigmaCharge = hTrackerClusterChargePerChamber->GetRMS();
236 hTrackerClusterChargePerChMean->SetBinContent(iCh+1, hTrackerClusterChargePerChamber->GetMean());
237 hTrackerClusterChargePerChMean->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetMeanError());
238 hTrackerClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
239 hTrackerClusterChargePerChSigma->SetBinError(iCh+1, hTrackerClusterChargePerChamber->GetRMSError());
240
241 TH1* hTrackerClusterMultiplicityPerChamber = GetRecPointsData(kTrackerClusterMultiplicityPerChamber+iCh);
242 Double_t sigmaSize = hTrackerClusterMultiplicityPerChamber->GetRMS();
243 hTrackerClusterMultiplicityPerChMean->SetBinContent(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMean());
244 hTrackerClusterMultiplicityPerChMean->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetMeanError());
245 hTrackerClusterMultiplicityPerChSigma->SetBinContent(iCh+1, sigmaSize);
246 hTrackerClusterMultiplicityPerChSigma->SetBinError(iCh+1, hTrackerClusterMultiplicityPerChamber->GetRMSError());
247
248 // loop over DE into chamber iCh
249 AliMpDEIterator it;
250 it.First(iCh);
251 while ( !it.IsDone()) {
252
253 Int_t iDE = it.CurrentDEId();
254
255 TH1* hTrackerClusterChargePerDE = GetRecPointsData(kTrackerClusterChargePerDE+iDE);
256 hTrackerClusterChargePerDEMean->SetBinContent(iDE+1, hTrackerClusterChargePerDE->GetMean());
257 Double_t nClusters = hTrackerClusterChargePerDE->GetEntries();
258 if (nClusters > 1) hTrackerClusterChargePerDEMean->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
259 else hTrackerClusterChargePerDEMean->SetBinError(iDE+1, hTrackerClusterChargePerChamber->GetXaxis()->GetXmax());
260
261 TH1* hTrackerClusterMultiplicityPerDE = GetRecPointsData(kTrackerClusterMultiplicityPerDE+iDE);
262 hTrackerClusterMultiplicityPerDEMean->SetBinContent(iDE+1, hTrackerClusterMultiplicityPerDE->GetMean());
263 nClusters = hTrackerClusterMultiplicityPerDE->GetEntries();
264 if (nClusters > 1) hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nClusters));
265 else hTrackerClusterMultiplicityPerDEMean->SetBinError(iDE+1, hTrackerClusterMultiplicityPerChamber->GetXaxis()->GetXmax());
266
267 it.Next();
268 }
269
270 }
271
272 }
273
5a240757 274 // Normalize ESD histos
4e25ac79 275 if ( task == AliQAv1::kESDS ) {
c92a8c85 276
5a240757 277 Double_t nTracks = GetESDsData(kESDnClustersPerTrack)->GetEntries();
278 if (nTracks <= 0) continue;
279
280 TH1* hESDnClustersPerCh = GetESDsData(kESDnClustersPerCh);
281 TH1* hESDnClustersPerDE = GetESDsData(kESDnClustersPerDE);
282 TH1* hESDClusterChargePerChMean = GetESDsData(kESDClusterChargePerChMean);
283 TH1* hESDClusterChargePerChSigma = GetESDsData(kESDClusterChargePerChSigma);
284 TH1* hESDClusterSizePerChMean = GetESDsData(kESDClusterSizePerChMean);
285 TH1* hESDClusterSizePerChSigma = GetESDsData(kESDClusterSizePerChSigma);
286 TH1* hESDResidualXPerChMean = GetESDsData(kESDResidualXPerChMean);
287 TH1* hESDResidualXPerChSigma = GetESDsData(kESDResidualXPerChSigma);
288 TH1* hESDResidualYPerChMean = GetESDsData(kESDResidualYPerChMean);
289 TH1* hESDResidualYPerChSigma = GetESDsData(kESDResidualYPerChSigma);
290 TH1* hESDLocalChi2XPerChMean = GetESDsData(kESDLocalChi2XPerChMean);
291 TH1* hESDLocalChi2YPerChMean = GetESDsData(kESDLocalChi2YPerChMean);
292 TH1* hESDClusterChargePerDE = GetESDsData(kESDClusterChargePerDE);
293 TH1* hESDClusterSizePerDE = GetESDsData(kESDClusterSizePerDE);
294 TH1* hESDResidualXPerDEMean = GetESDsData(kESDResidualXPerDEMean);
295 TH1* hESDResidualXPerDESigma = GetESDsData(kESDResidualXPerDESigma);
296 TH1* hESDResidualYPerDEMean = GetESDsData(kESDResidualYPerDEMean);
297 TH1* hESDResidualYPerDESigma = GetESDsData(kESDResidualYPerDESigma);
298 TH1* hESDLocalChi2XPerDEMean = GetESDsData(kESDLocalChi2XPerDEMean);
299 TH1* hESDLocalChi2YPerDEMean = GetESDsData(kESDLocalChi2YPerDEMean);
abcfd6d0 300 TH1* hESDnTotClustersPerCh = GetESDsData(kESDnTotClustersPerCh);
301 TH1* hESDnTotClustersPerDE = GetESDsData(kESDnTotClustersPerDE);
302 TH1* hESDnTotFullClustersPerDE = GetESDsData(kESDnTotFullClustersPerDE);
303 TH1* hESDSumClusterChargePerDE = GetESDsData(kESDSumClusterChargePerDE);
304 TH1* hESDSumClusterSizePerDE = GetESDsData(kESDSumClusterSizePerDE);
305 TH1* hESDSumResidualXPerDE = GetESDsData(kESDSumResidualXPerDE);
306 TH1* hESDSumResidualYPerDE = GetESDsData(kESDSumResidualYPerDE);
307 TH1* hESDSumResidualX2PerDE = GetESDsData(kESDSumResidualX2PerDE);
308 TH1* hESDSumResidualY2PerDE = GetESDsData(kESDSumResidualY2PerDE);
309 TH1* hESDSumLocalChi2XPerDE = GetESDsData(kESDSumLocalChi2XPerDE);
310 TH1* hESDSumLocalChi2YPerDE = GetESDsData(kESDSumLocalChi2YPerDE);
311
5a240757 312 hESDnClustersPerCh->Reset();
313 hESDnClustersPerDE->Reset();
abcfd6d0 314 hESDnClustersPerCh->Add(hESDnTotClustersPerCh, 1./nTracks);
315 hESDnClustersPerDE->Add(hESDnTotClustersPerDE, 1./nTracks);
c92a8c85 316
5a240757 317 // loop over chambers
318 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
319
320 TH1* hESDClusterChargeInCh = GetESDsData(kESDClusterChargeInCh+iCh);
321 Double_t sigmaCharge = hESDClusterChargeInCh->GetRMS();
322 hESDClusterChargePerChMean->SetBinContent(iCh+1, hESDClusterChargeInCh->GetMean());
323 hESDClusterChargePerChMean->SetBinError(iCh+1, hESDClusterChargeInCh->GetMeanError());
324 hESDClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
325 hESDClusterChargePerChSigma->SetBinError(iCh+1, hESDClusterChargeInCh->GetRMSError());
326
327 TH1* hESDClusterSizeInCh = GetESDsData(kESDClusterSizeInCh+iCh);
328 Double_t sigmaSize = hESDClusterSizeInCh->GetRMS();
329 hESDClusterSizePerChMean->SetBinContent(iCh+1, hESDClusterSizeInCh->GetMean());
330 hESDClusterSizePerChMean->SetBinError(iCh+1, hESDClusterSizeInCh->GetMeanError());
331 hESDClusterSizePerChSigma->SetBinContent(iCh+1, sigmaSize);
332 hESDClusterSizePerChSigma->SetBinError(iCh+1, hESDClusterSizeInCh->GetRMSError());
333
334 TH1* hESDResidualXInCh = GetESDsData(kESDResidualXInCh+iCh);
335 Double_t sigmaResidualX = hESDResidualXInCh->GetRMS();
336 hESDResidualXPerChMean->SetBinContent(iCh+1, hESDResidualXInCh->GetMean());
337 hESDResidualXPerChMean->SetBinError(iCh+1, hESDResidualXInCh->GetMeanError());
338 hESDResidualXPerChSigma->SetBinContent(iCh+1, sigmaResidualX);
339 hESDResidualXPerChSigma->SetBinError(iCh+1, hESDResidualXInCh->GetRMSError());
340
341 TH1* hESDResidualYInCh = GetESDsData(kESDResidualYInCh+iCh);
342 Double_t sigmaResidualY = hESDResidualYInCh->GetRMS();
343 hESDResidualYPerChMean->SetBinContent(iCh+1, hESDResidualYInCh->GetMean());
344 hESDResidualYPerChMean->SetBinError(iCh+1, hESDResidualYInCh->GetMeanError());
345 hESDResidualYPerChSigma->SetBinContent(iCh+1, sigmaResidualY);
346 hESDResidualYPerChSigma->SetBinError(iCh+1, hESDResidualYInCh->GetRMSError());
347
348 TH1* hESDLocalChi2XInCh = GetESDsData(kESDLocalChi2XInCh+iCh);
349 Double_t sigmaLocalChi2X = hESDLocalChi2XInCh->GetRMS();
350 hESDLocalChi2XPerChMean->SetBinContent(iCh+1, hESDLocalChi2XInCh->GetMean());
351 hESDLocalChi2XPerChMean->SetBinError(iCh+1, hESDLocalChi2XInCh->GetMeanError());
352
353 TH1* hESDLocalChi2YInCh = GetESDsData(kESDLocalChi2YInCh+iCh);
354 Double_t sigmaLocalChi2Y = hESDLocalChi2YInCh->GetRMS();
355 hESDLocalChi2YPerChMean->SetBinContent(iCh+1, hESDLocalChi2YInCh->GetMean());
356 hESDLocalChi2YPerChMean->SetBinError(iCh+1, hESDLocalChi2YInCh->GetMeanError());
357
358 // loop over DE into chamber iCh
359 AliMpDEIterator it;
360 it.First(iCh);
361 while ( !it.IsDone()) {
362
363 Int_t iDE = it.CurrentDEId();
364
abcfd6d0 365 Double_t nClusters = hESDnTotClustersPerDE->GetBinContent(iDE+1);
5a240757 366 if (nClusters > 1) {
367
abcfd6d0 368 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1)/nClusters);
5a240757 369 hESDClusterChargePerDE->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
370
abcfd6d0 371 Double_t meanResX = hESDSumResidualXPerDE->GetBinContent(iDE+1)/nClusters;
5a240757 372 hESDResidualXPerDEMean->SetBinContent(iDE+1, meanResX);
373 hESDResidualXPerDEMean->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(nClusters));
abcfd6d0 374 hESDResidualXPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualX2PerDE->GetBinContent(iDE+1)/nClusters - meanResX*meanResX));
5a240757 375 hESDResidualXPerDESigma->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(2.*nClusters));
376
abcfd6d0 377 Double_t meanResY = hESDSumResidualYPerDE->GetBinContent(iDE+1)/nClusters;
5a240757 378 hESDResidualYPerDEMean->SetBinContent(iDE+1, meanResY);
379 hESDResidualYPerDEMean->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(nClusters));
abcfd6d0 380 hESDResidualYPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualY2PerDE->GetBinContent(iDE+1)/nClusters - meanResY*meanResY));
5a240757 381 hESDResidualYPerDESigma->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(2.*nClusters));
382
abcfd6d0 383 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)/nClusters);
5a240757 384 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, sigmaLocalChi2X/TMath::Sqrt(nClusters));
385
abcfd6d0 386 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1)/nClusters);
5a240757 387 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, sigmaLocalChi2Y/TMath::Sqrt(nClusters));
388
389 } else {
390
abcfd6d0 391 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1));
5a240757 392 hESDClusterChargePerDE->SetBinError(iDE+1, hESDClusterChargeInCh->GetXaxis()->GetXmax());
393
abcfd6d0 394 hESDResidualXPerDEMean->SetBinContent(iDE+1, hESDSumResidualXPerDE->GetBinContent(iDE+1));
5a240757 395 hESDResidualXPerDEMean->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
396 hESDResidualXPerDESigma->SetBinContent(iDE+1, 0.);
397 hESDResidualXPerDESigma->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
398
abcfd6d0 399 hESDResidualYPerDEMean->SetBinContent(iDE+1, hESDSumResidualYPerDE->GetBinContent(iDE+1));
5a240757 400 hESDResidualYPerDEMean->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
401 hESDResidualYPerDESigma->SetBinContent(iDE+1, 0.);
402 hESDResidualYPerDESigma->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
403
abcfd6d0 404 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1));
5a240757 405 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, hESDLocalChi2XInCh->GetXaxis()->GetXmax());
406
abcfd6d0 407 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1));
5a240757 408 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, hESDLocalChi2YInCh->GetXaxis()->GetXmax());
409
410 }
411
abcfd6d0 412 Double_t nFullClusters = hESDnTotFullClustersPerDE->GetBinContent(iDE+1);
5a240757 413 if (nFullClusters > 1) {
414
abcfd6d0 415 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1)/nFullClusters);
5a240757 416 hESDClusterSizePerDE->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nFullClusters));
417
418 } else {
419
abcfd6d0 420 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1));
5a240757 421 hESDClusterSizePerDE->SetBinError(iDE+1, hESDClusterSizeInCh->GetXaxis()->GetXmax());
422
423 }
424
425 it.Next();
426 }
427
435844ac 428 }
5a240757 429
435844ac 430 }
5a240757 431
c92a8c85 432 }
5a240757 433
c92a8c85 434 // do the QA checking
4e25ac79 435 AliQAChecker::Instance()->Run(AliQAv1::kMUON, task, list) ;
04236e67 436}
437
438//____________________________________________________________________________
439void AliMUONQADataMakerRec::InitRaws()
440{
441 /// create Raws histograms in Raws subdir
f587a77d 442
5bb54f70 443 AliCodeTimerAuto("");
444
7d297381 445 const Bool_t expert = kTRUE ;
446 const Bool_t saveCorr = kTRUE ;
447 const Bool_t image = kTRUE ;
5bb54f70 448
f587a77d 449 if ( ! AliCDBManager::Instance()->GetDefaultStorage() )
450 {
451 AliError("CDB default storage not set. Cannot work.");
452 fIsInitRaws=kFALSE;
453 }
454
455 TH3F* h3 = new TH3F("hTriggerScalersBendPlane", "Trigger scalers in bending plane",
456 4, 10.5, 14.5,
457 234, 0.5, 234.5,
458 16, -0.5, 15.5);
459 h3->GetXaxis()->SetTitle("Chamber");
460 h3->GetYaxis()->SetTitle("Board");
461 h3->GetZaxis()->SetTitle("Strip");
7d297381 462 Add2RawsList(h3, kTriggerScalersBP, expert, !image, !saveCorr);
f587a77d 463
464 TH3F* h4 = new TH3F("hTriggerScalersNonBendPlane", "Trigger scalers in non-bending plane",
465 4, 10.5, 14.5,
466 234, 0.5, 234.5,
467 16, -0.5, 15.5);
468 h4->GetXaxis()->SetTitle("Chamber");
469 h4->GetYaxis()->SetTitle("Board");
470 h4->GetZaxis()->SetTitle("Strip");
7d297381 471 Add2RawsList(h4, kTriggerScalersNBP, expert, !image, !saveCorr);
f587a77d 472
473 AliMUONTriggerDisplay triggerDisplay;
474 TString histoName, histoTitle;
475 for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
476 TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
477 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
478 histoName = Form("hScalers%sChamber%i", cathName.Data(), 11+iChamber);
479 histoTitle = Form("Chamber %i: Scalers %s", 11+iChamber, cathName.Data());
480 TH2F* h5 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips,
c92a8c85 481 iCath, iChamber, histoTitle);
7d297381 482 Add2RawsList(h5, kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber, !expert, image, !saveCorr);
f587a77d 483 }
484 }
49e110ec 485
486 TH2F* h6 = new TH2F("hTriggerRPCI", "Trigger RPC currents",
487 4, 10.5, 14.5,
488 18, -0.5, 17.5);
489 h6->GetXaxis()->SetTitle("Chamber");
490 h6->GetYaxis()->SetTitle("RPC");
7d297381 491 Add2RawsList(h6, kTriggerRPCi, expert, !image, !saveCorr);
49e110ec 492
493 TH2F* h7 = new TH2F("hTriggerRPCHV", "Trigger RPC HV",
494 4, 10.5, 14.5,
495 18, -0.5, 17.5);
496 h7->GetXaxis()->SetTitle("Chamber");
497 h7->GetYaxis()->SetTitle("RPC");
7d297381 498 Add2RawsList(h7, kTriggerRPChv, expert, !image, !saveCorr);
49e110ec 499
500 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
501 histoName = Form("hRPCIChamber%i", 11+iChamber);
502 histoTitle = Form("Chamber %i: RPC Currents (#muA)", 11+iChamber);
503 TH2F* h8 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplaySlats,
504 0, iChamber, histoTitle);
7d297381 505 Add2RawsList(h8, kTriggerIDisplay + iChamber, !expert, image, !saveCorr);
49e110ec 506 }
507
508 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
509 histoName = Form("hRPCHVChamber%i", 11+iChamber);
510 histoTitle = Form("Chamber %i: RPC HV (V)", 11+iChamber);
511 TH2F* h9 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplaySlats,
512 0, iChamber, histoTitle);
7d297381 513 Add2RawsList(h9, kTriggerHVDisplay + iChamber, !expert, image, !saveCorr);
49e110ec 514 }
515
eb3886c8 516 TH1F* h10 = new TH1F("hTriggerScalersTime", "Trigger scalers acquisition time", 1, 0.5, 1.5);
517 h10->GetXaxis()->SetBinLabel(1, "One-bin histogram: bin is filled at each scaler event.");
518 h10->GetYaxis()->SetTitle("Cumulated scaler time (s)");
7d297381 519 Add2RawsList(h10, kTriggerScalersTime, !expert, image, !saveCorr);
f587a77d 520
5bb54f70 521 Int_t nbp(0);
522 TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
523 while (next())
524 {
525 ++nbp;
526 }
527
528 TH1* hbp = new TH1F("hTrackerBusPatchOccupancy","Occupancy of bus patches",
529 nbp,-0.5,nbp-0.5);
530
7d297381 531 Add2RawsList(hbp,kTrackerBusPatchOccupancy, !expert, image, !saveCorr);
de1d4a53 532
533 const Bool_t histogram(kFALSE);
b6f591ae 534
535 fTrackerDataMaker = new AliMUONTrackerDataMaker(GetRecoParam(),
536 AliCDBManager::Instance()->GetRun(),
537 0x0,
538 AliCDBManager::Instance()->GetDefaultStorage()->GetURI(),
539 "NOGAIN",
540 histogram,
541 0.0,0.0);
de1d4a53 542
543 fTrackerDataMaker->Data()->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level
544
545 fTrackerDataMaker->SetRunning(kTRUE);
5bb54f70 546
f587a77d 547 fIsInitRaws = kTRUE;
548}
04236e67 549
44ed7a66 550//__________________________________________________________________
551void AliMUONQADataMakerRec::InitDigits()
552{
553 /// Initialized Digits spectra
554 const Bool_t expert = kTRUE ;
555 const Bool_t image = kTRUE ;
556
db72ff3b 557 TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits;Detection element Id;Counts", 1400, 100, 1500);
44ed7a66 558 Add2DigitsList(h0, 0, !expert, image);
559
db72ff3b 560 TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits;ACD value;Counts", 4096, 0, 4095);
561 Add2DigitsList(h1, 1, !expert, image);
44ed7a66 562}
563
f587a77d 564//____________________________________________________________________________
565void AliMUONQADataMakerRec::InitRecPoints()
566{
567 /// create Reconstructed Points histograms in RecPoints subdir
5bb54f70 568
569 AliCodeTimerAuto("");
570
f587a77d 571 InitRecPointsTrigger();
572 InitRecPointsTracker();
573}
574
575//____________________________________________________________________________
576void AliMUONQADataMakerRec::InitRecPointsTracker()
577{
2d114b34 578 /// create Reconstructed Points histograms in RecPoints subdir for the
579 /// MUON tracker subsystem.
7d297381 580 const Bool_t expert = kTRUE ;
581 const Bool_t image = kTRUE ;
2d114b34 582
5bb54f70 583 AliCodeTimerAuto("");
584
2d114b34 585 TH1I *h1I;
586 TH1F *h1F;
587 TH2F *h2F;
5bb54f70 588
2d114b34 589 // histograms per chamber
590 Int_t nCh = AliMpConstants::NofTrackingChambers();
591 for ( Int_t i = 0; i < nCh; ++i )
592 {
db72ff3b 593 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 594 Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerChamber+i, expert, !image);
2d114b34 595
db72ff3b 596 h1I = new TH1I(Form("hTrackerClusterChargeForChamber%d",i+1), Form("cluster charge distribution in chamber %d;charge (ADC counts);Counts",i+1), 500,0,5000);
7d297381 597 Add2RecPointsList(h1I,kTrackerClusterChargePerChamber+i, expert, !image);
2d114b34 598
599 Float_t rMax = AliMUONConstants::Rmax(i/2);
600 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 601 Add2RecPointsList(h2F, kTrackerClusterHitMapPerChamber+i, expert, !image);
2d114b34 602 }
603
604 // summary histograms per chamber
605 h1I = new TH1I("hTrackerNumberOfClustersPerChamber", "Number of clusters per chamber;chamber ID;n_{clusters}", nCh,-0.5,nCh-0.5);
7d297381 606 Add2RecPointsList(h1I,kTrackerNumberOfClustersPerChamber, expert, !image);
2d114b34 607
608 h1F = new TH1F("hTrackerClusterMultiplicityPerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh,-0.5,nCh-0.5);
609 h1F->SetOption("P");
610 h1F->SetMarkerStyle(kFullDotMedium);
611 h1F->SetMarkerColor(kRed);
7d297381 612 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChMean, expert, !image);
2d114b34 613
614 h1F = new TH1F("hTrackerClusterMultiplicityPerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh,-0.5,nCh-0.5);
615 h1F->SetOption("P");
616 h1F->SetMarkerStyle(kFullDotMedium);
617 h1F->SetMarkerColor(kRed);
7d297381 618 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChSigma, expert, !image);
2d114b34 619
620 h1F = new TH1F("hTrackerClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (ADC counts)", nCh,-0.5,nCh-0.5);
621 h1F->SetOption("P");
622 h1F->SetMarkerStyle(kFullDotMedium);
623 h1F->SetMarkerColor(kRed);
7d297381 624 Add2RecPointsList(h1F, kTrackerClusterChargePerChMean, expert, !image);
2d114b34 625
626 h1F = new TH1F("hTrackerClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (ADC counts)", nCh,-0.5,nCh-0.5);
627 h1F->SetOption("P");
628 h1F->SetMarkerStyle(kFullDotMedium);
629 h1F->SetMarkerColor(kRed);
7d297381 630 Add2RecPointsList(h1F, kTrackerClusterChargePerChSigma, expert, !image);
2d114b34 631
632 // histograms per DE
633 Int_t ndes(0);
634 AliMpDEIterator it;
635 it.First();
636 while ( !it.IsDone())
637 {
638 Int_t detElemId = it.CurrentDEId();
639
640 if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
641 {
642 ndes = TMath::Max(ndes,detElemId);
643
644 h1I = new TH1I(Form("hTrackerClusterMultiplicityForDE%04d",detElemId), Form("cluster size distribution in detection element %d;size (n_{pads})",detElemId), 100,0,100);
7d297381 645 Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerDE+detElemId, expert, !image);
2d114b34 646
647 h1I = new TH1I(Form("hTrackerClusterChargeForDE%04d",detElemId), Form("cluster charge distribution in detection element %d;charge (ADC counts)",detElemId), 500,0,5000);
7d297381 648 Add2RecPointsList(h1I,kTrackerClusterChargePerDE+detElemId, expert, !image);
2d114b34 649 }
650
651 it.Next();
652 }
653
654 // summary histograms per DE
655 h1I = new TH1I("hTrackerNumberOfClustersPerDE", "Number of clusters per detection element;DetElem ID;n_{clusters}", ndes+1,-0.5,ndes+0.5);
7d297381 656 Add2RecPointsList(h1I, kTrackerNumberOfClustersPerDE, !expert, image);
2d114b34 657
658 h1F = new TH1F("hTrackerClusterMultiplicityPerDEMean", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", ndes+1,-0.5,ndes+0.5);
659 h1F->SetOption("P");
660 h1F->SetMarkerStyle(kFullDotMedium);
661 h1F->SetMarkerColor(kRed);
7d297381 662 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerDEMean, expert, !image);
2d114b34 663
664 h1F = new TH1F("hTrackerClusterChargePerDEMean", "cluster mean charge per DE;DetElem ID;<charge> (ADC counts)", ndes+1,-0.5,ndes+0.5);
665 h1F->SetOption("P");
666 h1F->SetMarkerStyle(kFullDotMedium);
667 h1F->SetMarkerColor(kRed);
7d297381 668 Add2RecPointsList(h1F, kTrackerClusterChargePerDEMean, expert, !image);
2d114b34 669
670 fIsInitRecPointsTracker=kTRUE;
04236e67 671}
672
673//____________________________________________________________________________
f587a77d 674void AliMUONQADataMakerRec::InitRecPointsTrigger()
04236e67 675{
f587a77d 676 /// create Reconstructed Points histograms in RecPoints subdir for the
677 /// MUON Trigger subsystem.
678
7d297381 679 const Bool_t expert = kTRUE ;
680 const Bool_t image = kTRUE ;
5bb54f70 681
2346e1ad 682 TH3F* h0 = new TH3F("hTriggerDigitsBendPlane", "Trigger digits in bending plane",
683 4, 10.5, 14.5,
684 234, 0.5, 234.5,
685 16, -0.5, 15.5);
686 h0->GetXaxis()->SetTitle("Chamber");
687 h0->GetYaxis()->SetTitle("Board");
688 h0->GetZaxis()->SetTitle("Strip");
7d297381 689 Add2RecPointsList(h0, kTriggerDigitsBendPlane, expert, !image);
2346e1ad 690
691 TH3F* h1 = new TH3F("hTriggerDigitsNonBendPlane", "Trigger digits in non-bending plane",
692 4, 10.5, 14.5,
693 234, 0.5, 234.5,
694 16, -0.5, 15.5);
695 h1->GetXaxis()->SetTitle("Chamber");
696 h1->GetYaxis()->SetTitle("Board");
697 h1->GetZaxis()->SetTitle("Strip");
7d297381 698 Add2RecPointsList(h1, kTriggerDigitsNonBendPlane, expert, !image);
2346e1ad 699
700 TH1F* h2 = new TH1F("hTriggeredBoards", "Triggered boards", 234, 0.5, 234.5);
7d297381 701 Add2RecPointsList(h2, kTriggeredBoards, expert, !image);
2346e1ad 702
aef183f7 703 AliMUONTriggerDisplay triggerDisplay;
704 TString histoName, histoTitle;
705 for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
706 TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
707 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
708 histoName = Form("hTriggerDigits%sChamber%i", cathName.Data(), 11+iChamber);
709 histoTitle = Form("Chamber %i: Fired pads %s", 11+iChamber, cathName.Data());
710 TH2F* h3 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips,
711 iCath, iChamber, histoTitle);
7d297381 712 Add2RecPointsList(h3, kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber, !expert, image);
aef183f7 713 }
714 }
715
716 TH2F* h4 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto("hFiredBoardsDisplay", AliMUONTriggerDisplay::kDisplayBoards,
717 0, 0, "Fired boards");
7d297381 718 Add2RecPointsList(h4, kTriggerBoardsDisplay, !expert, image);
f587a77d 719
720 fIsInitRecPointsTrigger = kTRUE;
04236e67 721}
722
723
724//____________________________________________________________________________
725void AliMUONQADataMakerRec::InitESDs()
726{
c92a8c85 727 ///create ESDs histograms in ESDs subdir
5bb54f70 728
7d297381 729 const Bool_t expert = kTRUE ;
730 const Bool_t image = kTRUE ;
5bb54f70 731
c92a8c85 732 Int_t nCh = AliMUONConstants::NTrackingCh();
733 Int_t nDE = 1100;
734
735 // track info
5a240757 736 TH1F* hESDnTracks = new TH1F("hESDnTracks", "number of tracks;n_{tracks}", 20, 0., 20.);
7d297381 737 Add2ESDsList(hESDnTracks, kESDnTracks, !expert, image);
04236e67 738
5a240757 739 TH1F* hESDMatchTrig = new TH1F("hESDMatchTrig", "number of tracks matched with trigger;n_{tracks}", 20, 0., 20.);
7d297381 740 Add2ESDsList(hESDMatchTrig, kESDMatchTrig, !expert, image);
c92a8c85 741
5a240757 742 TH1F* hESDMomentum = new TH1F("hESDMomentum", "momentum distribution;p (GeV/c)", 300, 0., 300);
7d297381 743 Add2ESDsList(hESDMomentum, kESDMomentum, expert, !image);
04236e67 744
5a240757 745 TH1F* hESDPt = new TH1F("hESDPt", "transverse momentum distribution;p_{t} (GeV/c)", 200, 0., 50);
7d297381 746 Add2ESDsList(hESDPt, kESDPt, expert, !image);
04236e67 747
5a240757 748 TH1F* hESDRapidity = new TH1F("hESDRapidity", "rapidity distribution;rapidity", 200, -4.5, -2.);
7d297381 749 Add2ESDsList(hESDRapidity, kESDRapidity, expert, !image);
b62881f2 750
5a240757 751 TH1F* hESDChi2 = new TH1F("hESDChi2", "normalized #chi^{2} distribution;#chi^{2} / ndf", 500, 0., 50.);
7d297381 752 Add2ESDsList(hESDChi2, kESDChi2, expert, !image);
c92a8c85 753
5a240757 754 TH1F* hESDProbChi2 = new TH1F("hESDProbChi2", "distribution of probability of #chi^{2};prob(#chi^{2})", 100, 0., 1.);
7d297381 755 Add2ESDsList(hESDProbChi2, kESDProbChi2, expert, !image);
5a240757 756
c92a8c85 757 // cluster info
758 for (Int_t i = 0; i < nCh; i++) {
759 Float_t rMax = AliMUONConstants::Rmax(i/2);
5a240757 760 TH2F* hESDClusterHitMap = new TH2F(Form("hESDClusterHitMap%d",i+1), Form("cluster position distribution in chamber %d;X (cm);Y (cm)",i+1),
c92a8c85 761 100, -rMax, rMax, 100, -rMax, rMax);
7d297381 762 Add2ESDsList(hESDClusterHitMap, kESDClusterHitMap+i, expert, !image);
c92a8c85 763 }
764
5a240757 765 TH1F* hESDnClustersPerTrack = new TH1F("hESDnClustersPerTrack", "number of associated clusters per track;n_{clusters}", 20, 0., 20.);
7d297381 766 Add2ESDsList(hESDnClustersPerTrack, kESDnClustersPerTrack, !expert, image);
c92a8c85 767
2d114b34 768 TH1F* hESDnClustersPerCh = new TH1F("hESDnClustersPerCh", "averaged number of clusters per chamber per track;chamber ID;<n_{clusters}>", nCh, -0.5, nCh-0.5);
c92a8c85 769 hESDnClustersPerCh->SetFillColor(kRed);
7d297381 770 Add2ESDsList(hESDnClustersPerCh, kESDnClustersPerCh, expert, !image);
c92a8c85 771
2d114b34 772 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 773 hESDnClustersPerDE->SetFillColor(kRed);
7d297381 774 Add2ESDsList(hESDnClustersPerDE, kESDnClustersPerDE, expert, !image);
c92a8c85 775
c92a8c85 776 for (Int_t i = 0; i < nCh; i++) {
5a240757 777 TH1F* hESDClusterChargeInCh = new TH1F(Form("hESDClusterChargeInCh%d",i+1), Form("cluster charge distribution in chamber %d;charge (ADC counts)",i+1), 500, 0., 5000.);
7d297381 778 Add2ESDsList(hESDClusterChargeInCh, kESDClusterChargeInCh+i, expert, !image);
c92a8c85 779 }
780
2d114b34 781 TH1F* hESDClusterChargePerChMean = new TH1F("hESDClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (ADC counts)", nCh, -0.5, nCh-0.5);
5a240757 782 hESDClusterChargePerChMean->SetOption("P");
783 hESDClusterChargePerChMean->SetMarkerStyle(kFullDotMedium);
784 hESDClusterChargePerChMean->SetMarkerColor(kRed);
7d297381 785 Add2ESDsList(hESDClusterChargePerChMean, kESDClusterChargePerChMean, expert, !image);
5a240757 786
2d114b34 787 TH1F* hESDClusterChargePerChSigma = new TH1F("hESDClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (ADC counts)", nCh, -0.5, nCh-0.5);
5a240757 788 hESDClusterChargePerChSigma->SetOption("P");
789 hESDClusterChargePerChSigma->SetMarkerStyle(kFullDotMedium);
790 hESDClusterChargePerChSigma->SetMarkerColor(kRed);
7d297381 791 Add2ESDsList(hESDClusterChargePerChSigma, kESDClusterChargePerChSigma, expert, !image);
5a240757 792
2d114b34 793 TH1F* hESDClusterChargePerDE = new TH1F("hESDClusterChargePerDE", "cluster mean charge per DE;DetElem ID;<charge> (ADC counts)", nDE+1, -0.5, nDE+0.5);
c92a8c85 794 hESDClusterChargePerDE->SetOption("P");
795 hESDClusterChargePerDE->SetMarkerStyle(kFullDotMedium);
796 hESDClusterChargePerDE->SetMarkerColor(kRed);
7d297381 797 Add2ESDsList(hESDClusterChargePerDE, kESDClusterChargePerDE, expert, !image);
c92a8c85 798
c92a8c85 799 for (Int_t i = 0; i < nCh; i++) {
5a240757 800 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 801 Add2ESDsList(hESDClusterSizeInCh, kESDClusterSizeInCh+i, expert, !image);
b62881f2 802 }
b1341ab0 803
2d114b34 804 TH1F* hESDClusterSizePerChMean = new TH1F("hESDClusterSizePerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh, -0.5, nCh-0.5);
5a240757 805 hESDClusterSizePerChMean->SetOption("P");
806 hESDClusterSizePerChMean->SetMarkerStyle(kFullDotMedium);
807 hESDClusterSizePerChMean->SetMarkerColor(kRed);
7d297381 808 Add2ESDsList(hESDClusterSizePerChMean, kESDClusterSizePerChMean, expert, !image);
c92a8c85 809
2d114b34 810 TH1F* hESDClusterSizePerChSigma = new TH1F("hESDClusterSizePerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh, -0.5, nCh-0.5);
5a240757 811 hESDClusterSizePerChSigma->SetOption("P");
812 hESDClusterSizePerChSigma->SetMarkerStyle(kFullDotMedium);
813 hESDClusterSizePerChSigma->SetMarkerColor(kRed);
7d297381 814 Add2ESDsList(hESDClusterSizePerChSigma, kESDClusterSizePerChSigma, expert, !image);
c92a8c85 815
2d114b34 816 TH1F* hESDClusterSizePerDE = new TH1F("hESDClusterSizePerDE", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", nDE+1, -0.5, nDE+0.5);
5a240757 817 hESDClusterSizePerDE->SetOption("P");
818 hESDClusterSizePerDE->SetMarkerStyle(kFullDotMedium);
819 hESDClusterSizePerDE->SetMarkerColor(kRed);
7d297381 820 Add2ESDsList(hESDClusterSizePerDE, kESDClusterSizePerDE, expert, !image);
c92a8c85 821
5a240757 822 // cluster - track info
c92a8c85 823 for (Int_t i = 0; i < nCh; i++) {
5a240757 824 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 825 Add2ESDsList(hESDResidualXInCh, kESDResidualXInCh+i, expert, !image);
c92a8c85 826
5a240757 827 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 828 Add2ESDsList(hESDResidualYInCh, kESDResidualYInCh+i, expert, !image);
5a240757 829
830 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 831 Add2ESDsList(hESDLocalChi2XInCh, kESDLocalChi2XInCh+i, expert, !image);
5a240757 832
833 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 834 Add2ESDsList(hESDLocalChi2YInCh, kESDLocalChi2YInCh+i, expert, !image);
c92a8c85 835 }
836
2d114b34 837 TH1F* hESDResidualXPerChMean = new TH1F("hESDResidualXPerChMean", "cluster-track residual-X per Ch: mean;chamber ID;<#Delta_{X}> (cm)", nCh, -0.5, nCh-0.5);
5a240757 838 hESDResidualXPerChMean->SetOption("P");
839 hESDResidualXPerChMean->SetMarkerStyle(kFullDotMedium);
840 hESDResidualXPerChMean->SetMarkerColor(kRed);
7d297381 841 Add2ESDsList(hESDResidualXPerChMean, kESDResidualXPerChMean, expert, !image);
5a240757 842
2d114b34 843 TH1F* hESDResidualYPerChMean = new TH1F("hESDResidualYPerChMean", "cluster-track residual-Y per Ch: mean;chamber ID;<#Delta_{Y}> (cm)", nCh, -0.5, nCh-0.5);
5a240757 844 hESDResidualYPerChMean->SetOption("P");
845 hESDResidualYPerChMean->SetMarkerStyle(kFullDotMedium);
846 hESDResidualYPerChMean->SetMarkerColor(kRed);
7d297381 847 Add2ESDsList(hESDResidualYPerChMean, kESDResidualYPerChMean, expert, !image);
5a240757 848
2d114b34 849 TH1F* hESDResidualXPerChSigma = new TH1F("hESDResidualXPerChSigma", "cluster-track residual-X per Ch: sigma;chamber ID;#sigma_{X} (cm)", nCh, -0.5, nCh-0.5);
5a240757 850 hESDResidualXPerChSigma->SetOption("P");
851 hESDResidualXPerChSigma->SetMarkerStyle(kFullDotMedium);
852 hESDResidualXPerChSigma->SetMarkerColor(kRed);
7d297381 853 Add2ESDsList(hESDResidualXPerChSigma, kESDResidualXPerChSigma, expert, !image);
5a240757 854
2d114b34 855 TH1F* hESDResidualYPerChSigma = new TH1F("hESDResidualYPerChSigma", "cluster-track residual-Y per Ch: sigma;chamber ID;#sigma_{Y} (cm)", nCh, -0.5, nCh-0.5);
5a240757 856 hESDResidualYPerChSigma->SetOption("P");
857 hESDResidualYPerChSigma->SetMarkerStyle(kFullDotMedium);
858 hESDResidualYPerChSigma->SetMarkerColor(kRed);
7d297381 859 Add2ESDsList(hESDResidualYPerChSigma, kESDResidualYPerChSigma, expert, !image);
5a240757 860
2d114b34 861 TH1F* hESDLocalChi2XPerChMean = new TH1F("hESDLocalChi2XPerChMean", "local chi2-X per Ch: mean;chamber ID;<local #chi^{2}_{X}>", nCh, -0.5, nCh-0.5);
5a240757 862 hESDLocalChi2XPerChMean->SetOption("P");
863 hESDLocalChi2XPerChMean->SetMarkerStyle(kFullDotMedium);
864 hESDLocalChi2XPerChMean->SetMarkerColor(kRed);
7d297381 865 Add2ESDsList(hESDLocalChi2XPerChMean, kESDLocalChi2XPerChMean, expert, !image);
5a240757 866
2d114b34 867 TH1F* hESDLocalChi2YPerChMean = new TH1F("hESDLocalChi2YPerChMean", "local chi2-Y per Ch: mean;chamber ID;<local #chi^{2}_{Y}>", nCh, -0.5, nCh-0.5);
5a240757 868 hESDLocalChi2YPerChMean->SetOption("P");
869 hESDLocalChi2YPerChMean->SetMarkerStyle(kFullDotMedium);
870 hESDLocalChi2YPerChMean->SetMarkerColor(kRed);
7d297381 871 Add2ESDsList(hESDLocalChi2YPerChMean, kESDLocalChi2YPerChMean, expert, !image);
5a240757 872
2d114b34 873 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 874 hESDResidualXPerDEMean->SetOption("P");
875 hESDResidualXPerDEMean->SetMarkerStyle(kFullDotMedium);
876 hESDResidualXPerDEMean->SetMarkerColor(kRed);
7d297381 877 Add2ESDsList(hESDResidualXPerDEMean, kESDResidualXPerDEMean, expert, !image);
c92a8c85 878
2d114b34 879 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 880 hESDResidualYPerDEMean->SetOption("P");
881 hESDResidualYPerDEMean->SetMarkerStyle(kFullDotMedium);
882 hESDResidualYPerDEMean->SetMarkerColor(kRed);
7d297381 883 Add2ESDsList(hESDResidualYPerDEMean, kESDResidualYPerDEMean, expert, !image);
c92a8c85 884
2d114b34 885 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 886 hESDResidualXPerDESigma->SetOption("P");
887 hESDResidualXPerDESigma->SetMarkerStyle(kFullDotMedium);
888 hESDResidualXPerDESigma->SetMarkerColor(kRed);
7d297381 889 Add2ESDsList(hESDResidualXPerDESigma, kESDResidualXPerDESigma, expert, !image);
c92a8c85 890
2d114b34 891 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 892 hESDResidualYPerDESigma->SetOption("P");
893 hESDResidualYPerDESigma->SetMarkerStyle(kFullDotMedium);
894 hESDResidualYPerDESigma->SetMarkerColor(kRed);
7d297381 895 Add2ESDsList(hESDResidualYPerDESigma, kESDResidualYPerDESigma, expert, !image);
c92a8c85 896
2d114b34 897 TH1F* hESDLocalChi2XPerDEMean = new TH1F("hESDLocalChi2XPerDEMean", "local chi2-X per DE: mean;DetElem ID;<local #chi^{2}_{X}>", nDE+1, -0.5, nDE+0.5);
5a240757 898 hESDLocalChi2XPerDEMean->SetOption("P");
899 hESDLocalChi2XPerDEMean->SetMarkerStyle(kFullDotMedium);
900 hESDLocalChi2XPerDEMean->SetMarkerColor(kRed);
7d297381 901 Add2ESDsList(hESDLocalChi2XPerDEMean, kESDLocalChi2XPerDEMean, expert, !image);
5a240757 902
2d114b34 903 TH1F* hESDLocalChi2YPerDEMean = new TH1F("hESDLocalChi2YPerDEMean", "local chi2-Y per DE: mean;DetElem ID;<local #chi^{2}_{Y}>", nDE+1, -0.5, nDE+0.5);
5a240757 904 hESDLocalChi2YPerDEMean->SetOption("P");
905 hESDLocalChi2YPerDEMean->SetMarkerStyle(kFullDotMedium);
906 hESDLocalChi2YPerDEMean->SetMarkerColor(kRed);
7d297381 907 Add2ESDsList(hESDLocalChi2YPerDEMean, kESDLocalChi2YPerDEMean, expert, !image);
5a240757 908
abcfd6d0 909 // intermediate histograms
2d114b34 910 TH1F* hESDnTotClustersPerCh = new TH1F("hESDnTotClustersPerCh", "total number of associated clusters per chamber;chamber ID;#Sigma(n_{clusters})", nCh, -0.5, nCh-0.5);
7d297381 911 Add2ESDsList(hESDnTotClustersPerCh, kESDnTotClustersPerCh, expert, !image);
2d114b34 912 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 913 Add2ESDsList(hESDnTotClustersPerDE, kESDnTotClustersPerDE, expert, !image);
2d114b34 914 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 915 Add2ESDsList(hESDnTotFullClustersPerDE, kESDnTotFullClustersPerDE, expert, !image);
2d114b34 916 TH1F* hESDSumClusterChargePerDE = new TH1F("hESDSumClusterChargePerDE", "sum of cluster charge per DE;DetElem ID;#Sigma(charge) (ADC counts)", nDE+1, -0.5, nDE+0.5);
7d297381 917 Add2ESDsList(hESDSumClusterChargePerDE, kESDSumClusterChargePerDE, expert, !image);
2d114b34 918 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 919 Add2ESDsList(hESDSumClusterSizePerDE, kESDSumClusterSizePerDE, expert, !image);
2d114b34 920 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 921 Add2ESDsList(hESDSumResidualXPerDE, kESDSumResidualXPerDE, expert, !image);
2d114b34 922 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 923 Add2ESDsList(hESDSumResidualYPerDE, kESDSumResidualYPerDE, expert, !image);
2d114b34 924 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 925 Add2ESDsList(hESDSumResidualX2PerDE, kESDSumResidualX2PerDE, expert, !image);
2d114b34 926 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 927 Add2ESDsList(hESDSumResidualY2PerDE, kESDSumResidualY2PerDE, expert, !image);
2d114b34 928 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 929 Add2ESDsList(hESDSumLocalChi2XPerDE, kESDSumLocalChi2XPerDE, expert, !image);
2d114b34 930 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 931 Add2ESDsList(hESDSumLocalChi2YPerDE, kESDSumLocalChi2YPerDE, expert, !image);
5a240757 932
b1341ab0 933 fIsInitESDs = kTRUE;
04236e67 934}
935
936//____________________________________________________________________________
937void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader)
938{
939 /// make QA for rawdata
b1341ab0 940
941 if ( ! fIsInitRaws ) {
942 AliWarningStream()
943 << "Skipping function due to a failure in Init" << endl;
944 return;
945 }
946
f587a77d 947 if ( rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent )
948 {
04236e67 949 rawReader->Reset();
f587a77d 950 MakeRawsTracker(rawReader);
951 }
04236e67 952
f587a77d 953 rawReader->Reset();
954 MakeRawsTrigger(rawReader);
955}
2346e1ad 956
f587a77d 957//____________________________________________________________________________
958void AliMUONQADataMakerRec::MakeRawsTracker(AliRawReader* rawReader)
959{
960 /// make QA for rawdata tracker
de1d4a53 961
b6f591ae 962 ((AliMUONTrackerDataMaker*)fTrackerDataMaker)->SetRawReader(rawReader);
f587a77d 963
964 fTrackerDataMaker->ProcessEvent();
965}
2346e1ad 966
f587a77d 967//____________________________________________________________________________
968void AliMUONQADataMakerRec::MakeRawsTrigger(AliRawReader* rawReader)
969{
970 /// make QA for rawdata trigger
971
2346e1ad 972 // Get trigger scalers
973
974 Int_t loCircuit=0;
975 AliMpCDB::LoadDDLStore();
976
977 AliMUONRawStreamTrigger rawStreamTrig(rawReader);
978 while (rawStreamTrig.NextDDL())
979 {
980 // If not a scaler event, do nothing
981 Bool_t scalerEvent = rawReader->GetDataHeader()->GetL1TriggerMessage() & 0x1;
d72d7b9e 982 if(!scalerEvent) break;
2346e1ad 983
984 AliMUONDDLTrigger* ddlTrigger = rawStreamTrig.GetDDLTrigger();
985 AliMUONDarcHeader* darcHeader = ddlTrigger->GetDarcHeader();
986
eb3886c8 987 if (darcHeader->GetGlobalFlag()){
988 UInt_t nOfClocks = darcHeader->GetGlobalClock();
989 Double_t nOfSeconds = ((Double_t) nOfClocks) / 40e6; // 1 clock each 25 ns
990 ((TH1F*)GetRawsData(kTriggerScalersTime))->Fill(1., nOfSeconds);
991 }
992
2346e1ad 993 Int_t nReg = darcHeader->GetRegHeaderEntries();
994
995 for(Int_t iReg = 0; iReg < nReg ;iReg++)
996 { //reg loop
997
998 // crate info
999 AliMpTriggerCrate* crate = AliMpDDLStore::Instance()->
1000 GetTriggerCrate(rawStreamTrig.GetDDL(), iReg);
1001
1002 AliMUONRegHeader* regHeader = darcHeader->GetRegHeaderEntry(iReg);
1003
1004 // loop over local structures
1005 Int_t nLocal = regHeader->GetLocalEntries();
1006 for(Int_t iLocal = 0; iLocal < nLocal; iLocal++)
1007 {
1008 AliMUONLocalStruct* localStruct = regHeader->GetLocalEntry(iLocal);
1009
1010 // if card exist
1011 if (!localStruct) continue;
1012
1013 loCircuit = crate->GetLocalBoardId(localStruct->GetId());
1014
1015 if ( !loCircuit ) continue; // empty slot
1016
1017 AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit, false);
1018
1019 // skip copy cards
1020 if( !localBoard->IsNotified())
1021 continue;
1022
1023 Int_t cathode = localStruct->GetComptXY()%2;
1024
1025 ERaw hindex = (cathode==0) ? kTriggerScalersBP : kTriggerScalersNBP;
1026
1027 // loop over strips
1028 for (Int_t ibitxy = 0; ibitxy < 16; ++ibitxy) {
1029 if(localStruct->GetXY1(ibitxy) > 0)
1030 ((TH3F*)GetRawsData(hindex))->Fill(11+0, loCircuit, ibitxy, 2*localStruct->GetXY1(ibitxy));
1031 if(localStruct->GetXY2(ibitxy) > 0)
1032 ((TH3F*)GetRawsData(hindex))->Fill(11+1, loCircuit, ibitxy, 2*localStruct->GetXY2(ibitxy));
1033 if(localStruct->GetXY3(ibitxy) > 0)
1034 ((TH3F*)GetRawsData(hindex))->Fill(11+2, loCircuit, ibitxy, 2*localStruct->GetXY3(ibitxy));
1035 if(localStruct->GetXY4(ibitxy) > 0)
1036 ((TH3F*)GetRawsData(hindex))->Fill(11+3, loCircuit, ibitxy, 2*localStruct->GetXY4(ibitxy));
1037 } // loop on strips
1038 } // iLocal
1039 } // iReg
1040 } // NextDDL
04236e67 1041}
1042
44ed7a66 1043//__________________________________________________________________
1044void AliMUONQADataMakerRec::MakeDigits(TTree* digitsTree)
1045{
1046 /// makes data from Digits
1047 if (!fDigitStore)
1048 fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
1049 fDigitStore->Connect(*digitsTree, false);
1050 digitsTree->GetEvent(0);
1051
1052 TIter next(fDigitStore->CreateIterator());
1053
1054 AliMUONVDigit* dig = 0x0;
1055
1056 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
1057 {
1058 GetDigitsData(0)->Fill(dig->DetElemId());
1059 GetDigitsData(1)->Fill(dig->ADC());
1060 }
1061}
1062
04236e67 1063//____________________________________________________________________________
1064void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree)
1065{
f587a77d 1066 /// Fill histograms from treeR
1067
1068 if (fIsInitRecPointsTracker) MakeRecPointsTracker(clustersTree);
1069 if (fIsInitRecPointsTrigger) MakeRecPointsTrigger(clustersTree);
1070}
1071
1072//____________________________________________________________________________
1073void AliMUONQADataMakerRec::MakeRecPointsTracker(TTree* clustersTree)
1074{
1075 /// Fill histograms related to tracker clusters
1076
1077 // First things first : do we have clusters in the TreeR ?
1078 // In "normal" production mode, it should be perfectly normal
1079 // *not* to have them.
1080 // But if for some reason we de-activated the combined tracking,
1081 // then we have clusters in TreeR, so let's take that opportunity
1082 // to QA them...
1083
1084 if (!fClusterStore)
1085 {
1086 AliCodeTimerAuto("ClusterStore creation");
1087 fClusterStore = AliMUONVClusterStore::Create(*clustersTree);
1088 if (!fClusterStore)
1089 {
1090 fIsInitRecPointsTracker = kFALSE;
1091 return;
1092 }
1093 }
1094
1095 AliCodeTimerAuto("");
1096
1097 fClusterStore->Connect(*clustersTree,kFALSE);
1098 clustersTree->GetEvent(0);
1099
1100 TIter next(fClusterStore->CreateIterator());
1101 AliMUONVCluster* cluster;
1102
1103 while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) )
1104 {
1105 Int_t detElemId = cluster->GetDetElemId();
1106 Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
1107
1108 GetRecPointsData(kTrackerNumberOfClustersPerDE)->Fill(detElemId);
1109 GetRecPointsData(kTrackerClusterChargePerDE+detElemId)->Fill(cluster->GetCharge());
1110 GetRecPointsData(kTrackerClusterMultiplicityPerDE+detElemId)->Fill(cluster->GetNDigits());
b1341ab0 1111
f587a77d 1112 GetRecPointsData(kTrackerNumberOfClustersPerChamber)->Fill(chamberId);
1113 GetRecPointsData(kTrackerClusterChargePerChamber+chamberId)->Fill(cluster->GetCharge());
1114 GetRecPointsData(kTrackerClusterMultiplicityPerChamber+chamberId)->Fill(cluster->GetNDigits());
2d114b34 1115 GetRecPointsData(kTrackerClusterHitMapPerChamber+chamberId)->Fill(cluster->GetX(),cluster->GetY());
f587a77d 1116
1117 }
1118
1119 fClusterStore->Clear();
1120}
1121
1122//____________________________________________________________________________
1123void AliMUONQADataMakerRec::MakeRecPointsTrigger(TTree* clustersTree)
1124{
1125 /// makes data from trigger response
1126
7035694f 1127 // Fired pads info
1128 fDigitStore->Clear();
1129
1130 if (!fTriggerStore) fTriggerStore = AliMUONVTriggerStore::Create(*clustersTree);
1131 fTriggerStore->Clear();
1132 fTriggerStore->Connect(*clustersTree, false);
04236e67 1133 clustersTree->GetEvent(0);
04236e67 1134
7035694f 1135 AliMUONLocalTrigger* locTrg;
1136 TIter nextLoc(fTriggerStore->CreateLocalIterator());
1137
1138 while ( ( locTrg = static_cast<AliMUONLocalTrigger*>(nextLoc()) ) )
1139 {
1140 if (locTrg->IsNull()) continue;
1141
1142 TArrayS xyPattern[2];
1143 locTrg->GetXPattern(xyPattern[0]);
1144 locTrg->GetYPattern(xyPattern[1]);
1145
1146 Int_t nBoard = locTrg->LoCircuit();
2346e1ad 1147
d72d7b9e 1148 Bool_t xTrig=locTrg->IsTrigX();
1149 Bool_t yTrig=locTrg->IsTrigY();
2346e1ad 1150
1151 if (xTrig && yTrig)
1152 ((TH1F*)GetRecPointsData(kTriggeredBoards))->Fill(nBoard);
1153
1154 fDigitMaker->TriggerDigits(nBoard, xyPattern, *fDigitStore);
7035694f 1155 }
04236e67 1156
7035694f 1157 TIter nextDigit(fDigitStore->CreateIterator());
1158 AliMUONVDigit* mDigit;
1159 while ( ( mDigit = static_cast<AliMUONVDigit*>(nextDigit()) ) )
04236e67 1160 {
7035694f 1161 Int_t detElemId = mDigit->DetElemId();
2346e1ad 1162 Int_t ch = detElemId/100;
1163 Int_t localBoard = mDigit->ManuId();
1164 Int_t channel = mDigit->ManuChannel();
7035694f 1165 Int_t cathode = mDigit->Cathode();
b62881f2 1166 ERecPoints hindex
1167 = ( cathode == 0 ) ? kTriggerDigitsBendPlane : kTriggerDigitsNonBendPlane;
1168
2346e1ad 1169 ((TH3F*)GetRecPointsData(hindex))->Fill(ch, localBoard, channel);
04236e67 1170 }
1171}
1172
1173//____________________________________________________________________________
1174void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd)
1175{
c92a8c85 1176 /// make QA data from ESDs
1177
1178 if ( ! fIsInitESDs ) {
1179 AliWarningStream()
1180 << "Skipping function due to a failure in Init" << endl;
1181 return;
1182 }
1183
1184 // load ESD event in the interface
1185 AliMUONESDInterface esdInterface;
1186 if (GetRecoParam()) AliMUONESDInterface::ResetTracker(GetRecoParam());
1187 else AliError("Unable to get recoParam: use default ones for residual calculation");
1188 esdInterface.LoadEvent(*esd);
1189
1190 GetESDsData(kESDnTracks)->Fill(esdInterface.GetNTracks());
1191
1192 Int_t nTrackMatchTrig = 0;
1193
1194 // loop over tracks
1195 Int_t nTracks = (Int_t) esd->GetNumberOfMuonTracks();
1196 for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
1197
1198 // get the ESD track and skip "ghosts"
1199 AliESDMuonTrack* esdTrack = esd->GetMuonTrack(iTrack);
1200 if (!esdTrack->ContainTrackerData()) continue;
1201
1202 // get corresponding MUON track
1203 AliMUONTrack* track = esdInterface.FindTrack(esdTrack->GetUniqueID());
1204
1205 if (esdTrack->ContainTriggerData()) nTrackMatchTrig++;
1206
1207 GetESDsData(kESDMomentum)->Fill(esdTrack->P());
1208 GetESDsData(kESDPt)->Fill(esdTrack->Pt());
1209 GetESDsData(kESDRapidity)->Fill(esdTrack->Y());
1210 GetESDsData(kESDChi2)->Fill(track->GetNormalizedChi2());
5a240757 1211 GetESDsData(kESDProbChi2)->Fill(TMath::Prob(track->GetGlobalChi2(),track->GetNDF()));
c92a8c85 1212 GetESDsData(kESDnClustersPerTrack)->Fill(track->GetNClusters());
1213
1214 // loop over clusters
1215 AliMUONTrackParam* trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->First());
1216 while (trackParam) {
b1fea02e 1217
c92a8c85 1218 AliMUONVCluster* cluster = trackParam->GetClusterPtr();
1219 Int_t chId = cluster->GetChamberId();
1220 Int_t deID = cluster->GetDetElemId();
1221 Double_t residualX = cluster->GetX() - trackParam->GetNonBendingCoor();
1222 Double_t residualY = cluster->GetY() - trackParam->GetBendingCoor();
5a240757 1223 Double_t localChi2X = (cluster->GetErrX2() > 0.) ? residualX*residualX/cluster->GetErrX2() : 0.;
1224 Double_t localChi2Y = (cluster->GetErrY2() > 0.) ? residualY*residualY/cluster->GetErrY2() : 0.;
b1fea02e 1225
c92a8c85 1226 GetESDsData(kESDClusterHitMap+chId)->Fill(cluster->GetX(), cluster->GetY());
1227
abcfd6d0 1228 GetESDsData(kESDnTotClustersPerCh)->Fill(chId);
1229 GetESDsData(kESDnTotClustersPerDE)->Fill(deID);
c92a8c85 1230
c92a8c85 1231 GetESDsData(kESDClusterChargeInCh+chId)->Fill(cluster->GetCharge());
abcfd6d0 1232 GetESDsData(kESDSumClusterChargePerDE)->Fill(deID, cluster->GetCharge());
c92a8c85 1233
1234 if (cluster->GetNDigits() > 0) { // discard clusters with pad not stored in ESD
abcfd6d0 1235 GetESDsData(kESDnTotFullClustersPerDE)->Fill(deID);
5a240757 1236 GetESDsData(kESDClusterSizeInCh+chId)->Fill(cluster->GetNDigits());
abcfd6d0 1237 GetESDsData(kESDSumClusterSizePerDE)->Fill(deID, cluster->GetNDigits());
b62881f2 1238 }
c92a8c85 1239
c92a8c85 1240 GetESDsData(kESDResidualXInCh+chId)->Fill(residualX);
1241 GetESDsData(kESDResidualYInCh+chId)->Fill(residualY);
abcfd6d0 1242 GetESDsData(kESDSumResidualXPerDE)->Fill(deID, residualX);
1243 GetESDsData(kESDSumResidualYPerDE)->Fill(deID, residualY);
1244 GetESDsData(kESDSumResidualX2PerDE)->Fill(deID, residualX*residualX);
1245 GetESDsData(kESDSumResidualY2PerDE)->Fill(deID, residualY*residualY);
5a240757 1246
1247 GetESDsData(kESDLocalChi2XInCh+chId)->Fill(localChi2X);
1248 GetESDsData(kESDLocalChi2YInCh+chId)->Fill(localChi2Y);
abcfd6d0 1249 GetESDsData(kESDSumLocalChi2XPerDE)->Fill(deID, localChi2X);
1250 GetESDsData(kESDSumLocalChi2YPerDE)->Fill(deID, localChi2Y);
c92a8c85 1251
1252 trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->After(trackParam));
04236e67 1253 }
c92a8c85 1254
1255 }
1256
1257 GetESDsData(kESDMatchTrig)->Fill(nTrackMatchTrig);
1258
04236e67 1259}
1260
1261//____________________________________________________________________________
1262void AliMUONQADataMakerRec::StartOfDetectorCycle()
1263{
1264 /// Detector specific actions at start of cycle
1265
1266}
2346e1ad 1267
1268//____________________________________________________________________________
4e25ac79 1269void AliMUONQADataMakerRec::DisplayTriggerInfo(AliQAv1::TASKINDEX_t task)
2346e1ad 1270{
1271 //
1272 /// Display trigger information in a user-friendly way:
1273 /// from local board and strip numbers to their position on chambers
1274 //
49e110ec 1275
4e25ac79 1276 if(task!=AliQAv1::kRECPOINTS && task!=AliQAv1::kRAWS) return;
2346e1ad 1277
aef183f7 1278 AliMUONTriggerDisplay triggerDisplay;
1279
2346e1ad 1280 TH3F* histoStrips=0x0;
1281 TH2F* histoDisplayStrips=0x0;
2346e1ad 1282
aef183f7 1283 for (Int_t iCath = 0; iCath < AliMpConstants::NofCathodes(); iCath++)
2346e1ad 1284 {
4e25ac79 1285 if(task==AliQAv1::kRECPOINTS){
2346e1ad 1286 ERecPoints hindex
1287 = ( iCath == 0 ) ? kTriggerDigitsBendPlane : kTriggerDigitsNonBendPlane;
1288 histoStrips = (TH3F*)GetRecPointsData(hindex);
2346e1ad 1289 }
4e25ac79 1290 else if(task==AliQAv1::kRAWS){
2346e1ad 1291 ERaw hindex
1292 = ( iCath == 0 ) ? kTriggerScalersBP : kTriggerScalersNBP;
1293 histoStrips = (TH3F*)GetRawsData(hindex);
49e110ec 1294 if(histoStrips->GetEntries()==0) continue; // No scalers found
2346e1ad 1295 }
1296
aef183f7 1297 for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++)
2346e1ad 1298 {
4e25ac79 1299 if(task==AliQAv1::kRECPOINTS){
aef183f7 1300 histoDisplayStrips = (TH2F*)GetRecPointsData(kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
2346e1ad 1301 }
4e25ac79 1302 else if(task==AliQAv1::kRAWS){
aef183f7 1303 histoDisplayStrips = (TH2F*)GetRawsData(kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
2346e1ad 1304 }
aef183f7 1305 Int_t bin = histoStrips->GetXaxis()->FindBin(11+iChamber);
1306 histoStrips->GetXaxis()->SetRange(bin,bin);
1307 TH2F* inputHisto = (TH2F*)histoStrips->Project3D("zy");
1308 triggerDisplay.FillDisplayHistogram(inputHisto, histoDisplayStrips, AliMUONTriggerDisplay::kDisplayStrips, iCath, iChamber);
4e25ac79 1309 if(task==AliQAv1::kRAWS) {
eb3886c8 1310 Float_t acquisitionTime = ((TH1F*)GetRawsData(kTriggerScalersTime))->GetBinContent(1);
1311 histoDisplayStrips->Scale(1./acquisitionTime);
1312 }
2346e1ad 1313 } // iChamber
1314 } // iCath
2346e1ad 1315
4e25ac79 1316 if(task==AliQAv1::kRAWS){
49e110ec 1317 TH2F* histoI = (TH2F*) GetRawsData(kTriggerRPCi);
1318 TH2F* histoHV = (TH2F*) GetRawsData(kTriggerRPChv);
1319 FillTriggerDCSHistos();
1320 for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++) {
1321 Int_t bin = histoI->GetXaxis()->FindBin(11+iChamber);
1322 TH2F* histoDisplayI = (TH2F*)GetRawsData(kTriggerIDisplay + iChamber);
1323 triggerDisplay.FillDisplayHistogram(histoI->ProjectionY("_px", bin, bin), histoDisplayI, AliMUONTriggerDisplay::kDisplaySlats, 0, iChamber);
1324 TH2F* histoDisplayHV = (TH2F*)GetRawsData(kTriggerHVDisplay + iChamber);
1325 bin = histoHV->GetXaxis()->FindBin(11+iChamber);
1326 triggerDisplay.FillDisplayHistogram(histoHV->ProjectionY("_px", bin, bin), histoDisplayHV, AliMUONTriggerDisplay::kDisplaySlats, 0, iChamber);
1327 }
1328 }
1329
4e25ac79 1330 if(task==AliQAv1::kRECPOINTS){
49e110ec 1331 TH1F* histoBoards = (TH1F*)GetRecPointsData(kTriggeredBoards);
1332 TH2F* histoDisplayBoards = (TH2F*)GetRecPointsData(kTriggerBoardsDisplay);
1333 triggerDisplay.FillDisplayHistogram(histoBoards, histoDisplayBoards, AliMUONTriggerDisplay::kDisplayBoards, 0, 0);
1334 }
1335}
1336
1337
1338//_____________________________________________________________________________
1339Bool_t
1340AliMUONQADataMakerRec::FillTriggerDCSHistos()
1341{
1342 /// Get HV and currents values for one trigger chamber
1343
1344 AliCodeTimerAuto("");
1345
49e110ec 1346 AliMUONCalibrationData calibrationData(AliCDBManager::Instance()->GetRun());
1347
1348 TMap* triggerDcsMap = calibrationData.TriggerDCS();
1349
2d114b34 1350 if ( !triggerDcsMap )
1351 {
1352 AliError("Cannot fill DCS histos, as triggerDcsMap is NULL");
1353 return kFALSE;
1354 }
1355
1356 AliMpDEIterator deIt;
1357
1358 deIt.First();
1359
49e110ec 1360 AliMpDCSNamer triggerDcsNamer("TRIGGER");
1361
1362 TH2* currHisto = 0x0;
1363
1364 Bool_t error = kFALSE;
1365
1366 while ( !deIt.IsDone() )
1367 {
1368 Int_t detElemId = deIt.CurrentDEId();
1369
1370 if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStationTrigger) {
1371
1372 Int_t iChamber = AliMpDEManager::GetChamberId(detElemId);
1373 Int_t slat = detElemId%100;
1374
1375 for(Int_t iMeas=0; iMeas<AliMpDCSNamer::kNDCSMeas; iMeas++){
1376 TString currAlias = triggerDcsNamer.DCSChannelName(detElemId, 0, iMeas);
1377
5379c4a3 1378 AliDebug(AliQAv1::GetQADebugLevel(), Form("\nDetElemId %i dcsAlias %s", detElemId, currAlias.Data()));
49e110ec 1379
1380 TPair* triggerDcsPair = static_cast<TPair*>(triggerDcsMap->FindObject(currAlias.Data()));
1381
1382 if (!triggerDcsPair)
1383 {
1384 AliError(Form("Did not find expected alias (%s) for DE %d",
1385 currAlias.Data(),detElemId));
1386 error = kTRUE;
1387 }
1388 else
1389 {
1390 TObjArray* values = static_cast<TObjArray*>(triggerDcsPair->Value());
1391 if (!values)
1392 {
1393 AliError(Form("Could not get values for alias %s",currAlias.Data()));
1394 error = kTRUE;
1395 }
1396 else
1397 {
1398 TIter next(values);
1399 AliDCSValue* val;
1400
1401 while ( ( val = static_cast<AliDCSValue*>(next()) ) )
1402 {
1403 Float_t hvi = val->GetFloat();
1404
5379c4a3 1405 AliDebug(AliQAv1::GetQADebugLevel(), Form("Value %f", hvi));
49e110ec 1406
1407 switch(iMeas){
1408 case AliMpDCSNamer::kDCSI:
1409 currHisto = (TH2F*) GetRawsData(kTriggerRPCi);
1410 break;
1411 case AliMpDCSNamer::kDCSHV:
1412 currHisto = (TH2F*) GetRawsData(kTriggerRPChv);
1413 break;
1414 }
1415 Int_t binX = currHisto->GetXaxis()->FindBin(iChamber+1);
1416 Int_t binY = currHisto->GetYaxis()->FindBin(slat);
1417 currHisto->SetBinContent(binX, binY, hvi);
1418 } // loop on values
1419 } // if (!values)
1420 } // if (!triggerDcsPair)
1421 } // loop on measured types (HV and currents)
1422 } // if (stationType == kStationTrigger)
1423
1424 deIt.Next();
1425 }
1426 return error;
2346e1ad 1427}
de1d4a53 1428
1429//____________________________________________________________________________
1430AliMUONVTrackerData* AliMUONQADataMakerRec::GetTrackerData() const
1431{
cddcc1f3 1432/// Return tracker data
de1d4a53 1433
1434 return fTrackerDataMaker->Data();
1435
1436}