1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 // --- MUON header files ---
19 #include "AliMUONQADataMakerRec.h"
21 #include "AliMUON2DMap.h"
22 #include "AliMUONCluster.h"
23 #include "AliMUONConstants.h"
24 #include "AliMUONDDLTrigger.h"
25 #include "AliMUONDarcHeader.h"
26 #include "AliMUONDigitMaker.h"
27 #include "AliMUONLocalStruct.h"
28 #include "AliMUONLocalTrigger.h"
29 #include "AliMUONRawStreamTracker.h"
30 #include "AliMUONRawStreamTrigger.h"
31 #include "AliMUONRegHeader.h"
32 #include "AliMUONTrackerDataMaker.h"
33 #include "AliMUONTriggerDisplay.h"
34 #include "AliMUONVCluster.h"
35 #include "AliMUONVClusterStore.h"
36 #include "AliMUONVDigit.h"
37 #include "AliMUONVDigitStore.h"
38 #include "AliMUONVTrackerData.h"
39 #include "AliMUONVTriggerStore.h"
40 #include "AliMUONTrack.h"
41 #include "AliMUONTrackParam.h"
42 #include "AliMUONESDInterface.h"
43 #include "AliMUONCalibrationData.h"
44 #include "AliMpBusPatch.h"
46 #include "AliMpConstants.h"
47 #include "AliMpDDLStore.h"
48 #include "AliMpDEIterator.h"
49 #include "AliMpDEManager.h"
50 #include "AliMpLocalBoard.h"
51 #include "AliMpStationType.h"
52 #include "AliMpTriggerCrate.h"
53 #include "AliMpDCSNamer.h"
54 #include "AliRawEventHeaderBase.h"
56 // --- AliRoot header files ---
57 #include "AliCDBManager.h"
58 #include "AliCDBStorage.h"
59 #include "AliESDEvent.h"
60 #include "AliESDMuonTrack.h"
61 #include "AliESDMuonCluster.h"
63 #include "AliRawReader.h"
64 #include "AliQAChecker.h"
65 #include "AliCodeTimer.h"
66 #include "AliDCSValue.h"
67 #include "AliMUONVDigit.h"
69 // --- ROOT system ---
70 #include <TClonesArray.h>
76 #include <Riostream.h>
78 //-----------------------------------------------------------------------------
79 /// \class AliMUONQADataMakerRec
81 /// MUON base class for quality assurance data (histo) maker
83 /// \author C. Finck, D. Stocco, L. Aphecetche
86 ClassImp(AliMUONQADataMakerRec)
89 //____________________________________________________________________________
90 AliMUONQADataMakerRec::AliMUONQADataMakerRec() :
91 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kMUON), "MUON Quality Assurance Data Maker"),
96 fTrackerDataMaker(0x0)
100 AliDebug(AliQAv1::GetQADebugLevel(),"");
105 //____________________________________________________________________________
107 AliMUONQADataMakerRec::Ctor()
109 /// Init some members
110 fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV1");
111 fDigitMaker = new AliMUONDigitMaker(kTRUE);
114 //____________________________________________________________________________
115 AliMUONQADataMakerRec::AliMUONQADataMakerRec(const AliMUONQADataMakerRec& qadm) :
116 AliQADataMakerRec(qadm),
121 fTrackerDataMaker(0x0)
125 AliDebug(AliQAv1::GetQADebugLevel(),"");
128 SetName((const char*)qadm.GetName()) ;
129 SetTitle((const char*)qadm.GetTitle());
131 // Do not copy the digit store and digit maker, but create its own ones
137 //__________________________________________________________________
138 AliMUONQADataMakerRec& AliMUONQADataMakerRec::operator = (const AliMUONQADataMakerRec& qadm )
140 /// Assignment operator
142 AliDebug(AliQAv1::GetQADebugLevel(),"");
144 // check assignment to self
145 if (this == &qadm) return *this;
147 this->~AliMUONQADataMakerRec();
148 new(this) AliMUONQADataMakerRec(qadm);
152 //__________________________________________________________________
153 AliMUONQADataMakerRec::~AliMUONQADataMakerRec()
157 AliDebug(AliQAv1::GetQADebugLevel(),"");
159 AliCodeTimerAuto("");
162 delete fTriggerStore;
164 delete fClusterStore;
165 delete fTrackerDataMaker;
168 //____________________________________________________________________________
169 void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
171 ///Detector specific actions at end of cycle
173 AliCodeTimerAuto("");
175 // Display trigger histos in a more user friendly way
176 DisplayTriggerInfo(task);
178 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
180 if (! IsValidEventSpecie(specie, list) )
182 SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ;
183 if ( task == AliQAv1::kRAWS && fTrackerDataMaker )
186 if ( !GetRawsData(kTrackerBusPatchOccupancy) ) continue;
188 TIter next(list[specie]);
190 Bool_t alreadyThere(kFALSE);
191 while ( ( o = next() ) && !alreadyThere )
193 TString classname(o->ClassName());
194 if ( classname.Contains("TrackerData") ) alreadyThere = kTRUE;
196 if (!alreadyThere && fTrackerDataMaker)
198 AliDebug(AliQAv1::GetQADebugLevel(), "Adding fTrackerDataMaker to the list of qa objects");
199 list[specie]->AddAt(fTrackerDataMaker->Data(),(Int_t)kTrackerData);
201 if ( fTrackerDataMaker )
203 TH1* hbp = GetRawsData(kTrackerBusPatchOccupancy);
205 TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator());
206 AliMpBusPatch* bp(0x0);
207 AliMUONVTrackerData* data = fTrackerDataMaker->Data();
210 while ( ( bp = static_cast<AliMpBusPatch*>(nextBP())) )
212 Int_t busPatchId = bp->GetId();
213 Int_t bin = hbp->FindBin(busPatchId);
214 hbp->SetBinContent(bin,data->BusPatch(busPatchId,occDim));
219 // Normalize RecPoints histos
220 if ( task == AliQAv1::kRECPOINTS ) {
222 if (!GetRecPointsData(kTrackerClusterChargePerChMean)) continue;
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);
231 // loop over chambers
232 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
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());
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());
248 // loop over DE into chamber iCh
251 while ( !it.IsDone()) {
253 Int_t iDE = it.CurrentDEId();
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());
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());
274 // Normalize ESD histos
275 if ( task == AliQAv1::kESDS ) {
277 if (!GetESDsData(kESDnClustersPerTrack)) continue;
279 Double_t nTracks = GetESDsData(kESDnClustersPerTrack)->GetEntries();
280 if (nTracks <= 0) continue;
282 TH1* hESDnClustersPerCh = GetESDsData(kESDnClustersPerCh);
283 TH1* hESDnClustersPerDE = GetESDsData(kESDnClustersPerDE);
284 TH1* hESDClusterChargePerChMean = GetESDsData(kESDClusterChargePerChMean);
285 TH1* hESDClusterChargePerChSigma = GetESDsData(kESDClusterChargePerChSigma);
286 TH1* hESDClusterSizePerChMean = GetESDsData(kESDClusterSizePerChMean);
287 TH1* hESDClusterSizePerChSigma = GetESDsData(kESDClusterSizePerChSigma);
288 TH1* hESDResidualXPerChMean = GetESDsData(kESDResidualXPerChMean);
289 TH1* hESDResidualXPerChSigma = GetESDsData(kESDResidualXPerChSigma);
290 TH1* hESDResidualYPerChMean = GetESDsData(kESDResidualYPerChMean);
291 TH1* hESDResidualYPerChSigma = GetESDsData(kESDResidualYPerChSigma);
292 TH1* hESDLocalChi2XPerChMean = GetESDsData(kESDLocalChi2XPerChMean);
293 TH1* hESDLocalChi2YPerChMean = GetESDsData(kESDLocalChi2YPerChMean);
294 TH1* hESDLocalChi2PerChMean = GetESDsData(kESDLocalChi2PerChMean);
295 TH1* hESDClusterChargePerDE = GetESDsData(kESDClusterChargePerDE);
296 TH1* hESDClusterSizePerDE = GetESDsData(kESDClusterSizePerDE);
297 TH1* hESDResidualXPerDEMean = GetESDsData(kESDResidualXPerDEMean);
298 TH1* hESDResidualXPerDESigma = GetESDsData(kESDResidualXPerDESigma);
299 TH1* hESDResidualYPerDEMean = GetESDsData(kESDResidualYPerDEMean);
300 TH1* hESDResidualYPerDESigma = GetESDsData(kESDResidualYPerDESigma);
301 TH1* hESDLocalChi2XPerDEMean = GetESDsData(kESDLocalChi2XPerDEMean);
302 TH1* hESDLocalChi2YPerDEMean = GetESDsData(kESDLocalChi2YPerDEMean);
303 TH1* hESDLocalChi2PerDEMean = GetESDsData(kESDLocalChi2PerDEMean);
304 TH1* hESDnTotClustersPerCh = GetESDsData(kESDnTotClustersPerCh);
305 TH1* hESDnTotClustersPerDE = GetESDsData(kESDnTotClustersPerDE);
306 TH1* hESDnTotFullClustersPerDE = GetESDsData(kESDnTotFullClustersPerDE);
307 TH1* hESDSumClusterChargePerDE = GetESDsData(kESDSumClusterChargePerDE);
308 TH1* hESDSumClusterSizePerDE = GetESDsData(kESDSumClusterSizePerDE);
309 TH1* hESDSumResidualXPerDE = GetESDsData(kESDSumResidualXPerDE);
310 TH1* hESDSumResidualYPerDE = GetESDsData(kESDSumResidualYPerDE);
311 TH1* hESDSumResidualX2PerDE = GetESDsData(kESDSumResidualX2PerDE);
312 TH1* hESDSumResidualY2PerDE = GetESDsData(kESDSumResidualY2PerDE);
313 TH1* hESDSumLocalChi2XPerDE = GetESDsData(kESDSumLocalChi2XPerDE);
314 TH1* hESDSumLocalChi2YPerDE = GetESDsData(kESDSumLocalChi2YPerDE);
315 TH1* hESDSumLocalChi2PerDE = GetESDsData(kESDSumLocalChi2PerDE);
317 hESDnClustersPerCh->Reset();
318 hESDnClustersPerDE->Reset();
319 hESDnClustersPerCh->Add(hESDnTotClustersPerCh, 1./nTracks);
320 hESDnClustersPerDE->Add(hESDnTotClustersPerDE, 1./nTracks);
322 // loop over chambers
323 for (Int_t iCh = 0; iCh < AliMUONConstants::NTrackingCh(); iCh++) {
325 TH1* hESDClusterChargeInCh = GetESDsData(kESDClusterChargeInCh+iCh);
326 Double_t sigmaCharge = hESDClusterChargeInCh->GetRMS();
327 hESDClusterChargePerChMean->SetBinContent(iCh+1, hESDClusterChargeInCh->GetMean());
328 hESDClusterChargePerChMean->SetBinError(iCh+1, hESDClusterChargeInCh->GetMeanError());
329 hESDClusterChargePerChSigma->SetBinContent(iCh+1, sigmaCharge);
330 hESDClusterChargePerChSigma->SetBinError(iCh+1, hESDClusterChargeInCh->GetRMSError());
332 TH1* hESDClusterSizeInCh = GetESDsData(kESDClusterSizeInCh+iCh);
333 Double_t sigmaSize = hESDClusterSizeInCh->GetRMS();
334 hESDClusterSizePerChMean->SetBinContent(iCh+1, hESDClusterSizeInCh->GetMean());
335 hESDClusterSizePerChMean->SetBinError(iCh+1, hESDClusterSizeInCh->GetMeanError());
336 hESDClusterSizePerChSigma->SetBinContent(iCh+1, sigmaSize);
337 hESDClusterSizePerChSigma->SetBinError(iCh+1, hESDClusterSizeInCh->GetRMSError());
339 TH1* hESDResidualXInCh = GetESDsData(kESDResidualXInCh+iCh);
340 Double_t sigmaResidualX = hESDResidualXInCh->GetRMS();
341 hESDResidualXPerChMean->SetBinContent(iCh+1, hESDResidualXInCh->GetMean());
342 hESDResidualXPerChMean->SetBinError(iCh+1, hESDResidualXInCh->GetMeanError());
343 hESDResidualXPerChSigma->SetBinContent(iCh+1, sigmaResidualX);
344 hESDResidualXPerChSigma->SetBinError(iCh+1, hESDResidualXInCh->GetRMSError());
346 TH1* hESDResidualYInCh = GetESDsData(kESDResidualYInCh+iCh);
347 Double_t sigmaResidualY = hESDResidualYInCh->GetRMS();
348 hESDResidualYPerChMean->SetBinContent(iCh+1, hESDResidualYInCh->GetMean());
349 hESDResidualYPerChMean->SetBinError(iCh+1, hESDResidualYInCh->GetMeanError());
350 hESDResidualYPerChSigma->SetBinContent(iCh+1, sigmaResidualY);
351 hESDResidualYPerChSigma->SetBinError(iCh+1, hESDResidualYInCh->GetRMSError());
353 TH1* hESDLocalChi2XInCh = GetESDsData(kESDLocalChi2XInCh+iCh);
354 Double_t sigmaLocalChi2X = hESDLocalChi2XInCh->GetRMS();
355 hESDLocalChi2XPerChMean->SetBinContent(iCh+1, hESDLocalChi2XInCh->GetMean());
356 hESDLocalChi2XPerChMean->SetBinError(iCh+1, hESDLocalChi2XInCh->GetMeanError());
358 TH1* hESDLocalChi2YInCh = GetESDsData(kESDLocalChi2YInCh+iCh);
359 Double_t sigmaLocalChi2Y = hESDLocalChi2YInCh->GetRMS();
360 hESDLocalChi2YPerChMean->SetBinContent(iCh+1, hESDLocalChi2YInCh->GetMean());
361 hESDLocalChi2YPerChMean->SetBinError(iCh+1, hESDLocalChi2YInCh->GetMeanError());
363 TH1* hESDLocalChi2InCh = GetESDsData(kESDLocalChi2InCh+iCh);
364 Double_t sigmaLocalChi2 = hESDLocalChi2InCh->GetRMS();
365 hESDLocalChi2PerChMean->SetBinContent(iCh+1, hESDLocalChi2InCh->GetMean());
366 hESDLocalChi2PerChMean->SetBinError(iCh+1, hESDLocalChi2InCh->GetMeanError());
368 // loop over DE into chamber iCh
371 while ( !it.IsDone()) {
373 Int_t iDE = it.CurrentDEId();
375 Double_t nClusters = hESDnTotClustersPerDE->GetBinContent(iDE+1);
378 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1)/nClusters);
379 hESDClusterChargePerDE->SetBinError(iDE+1, sigmaCharge/TMath::Sqrt(nClusters));
381 Double_t meanResX = hESDSumResidualXPerDE->GetBinContent(iDE+1)/nClusters;
382 hESDResidualXPerDEMean->SetBinContent(iDE+1, meanResX);
383 hESDResidualXPerDEMean->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(nClusters));
384 hESDResidualXPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualX2PerDE->GetBinContent(iDE+1)/nClusters - meanResX*meanResX));
385 hESDResidualXPerDESigma->SetBinError(iDE+1, sigmaResidualX/TMath::Sqrt(2.*nClusters));
387 Double_t meanResY = hESDSumResidualYPerDE->GetBinContent(iDE+1)/nClusters;
388 hESDResidualYPerDEMean->SetBinContent(iDE+1, meanResY);
389 hESDResidualYPerDEMean->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(nClusters));
390 hESDResidualYPerDESigma->SetBinContent(iDE+1, TMath::Sqrt(hESDSumResidualY2PerDE->GetBinContent(iDE+1)/nClusters - meanResY*meanResY));
391 hESDResidualYPerDESigma->SetBinError(iDE+1, sigmaResidualY/TMath::Sqrt(2.*nClusters));
393 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1)/nClusters);
394 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, sigmaLocalChi2X/TMath::Sqrt(nClusters));
396 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1)/nClusters);
397 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, sigmaLocalChi2Y/TMath::Sqrt(nClusters));
399 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1)/nClusters);
400 hESDLocalChi2PerDEMean->SetBinError(iDE+1, sigmaLocalChi2/TMath::Sqrt(nClusters));
404 hESDClusterChargePerDE->SetBinContent(iDE+1, hESDSumClusterChargePerDE->GetBinContent(iDE+1));
405 hESDClusterChargePerDE->SetBinError(iDE+1, hESDClusterChargeInCh->GetXaxis()->GetXmax());
407 hESDResidualXPerDEMean->SetBinContent(iDE+1, hESDSumResidualXPerDE->GetBinContent(iDE+1));
408 hESDResidualXPerDEMean->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
409 hESDResidualXPerDESigma->SetBinContent(iDE+1, 0.);
410 hESDResidualXPerDESigma->SetBinError(iDE+1, hESDResidualXInCh->GetXaxis()->GetXmax());
412 hESDResidualYPerDEMean->SetBinContent(iDE+1, hESDSumResidualYPerDE->GetBinContent(iDE+1));
413 hESDResidualYPerDEMean->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
414 hESDResidualYPerDESigma->SetBinContent(iDE+1, 0.);
415 hESDResidualYPerDESigma->SetBinError(iDE+1, hESDResidualYInCh->GetXaxis()->GetXmax());
417 hESDLocalChi2XPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2XPerDE->GetBinContent(iDE+1));
418 hESDLocalChi2XPerDEMean->SetBinError(iDE+1, hESDLocalChi2XInCh->GetXaxis()->GetXmax());
420 hESDLocalChi2YPerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2YPerDE->GetBinContent(iDE+1));
421 hESDLocalChi2YPerDEMean->SetBinError(iDE+1, hESDLocalChi2YInCh->GetXaxis()->GetXmax());
423 hESDLocalChi2PerDEMean->SetBinContent(iDE+1, hESDSumLocalChi2PerDE->GetBinContent(iDE+1));
424 hESDLocalChi2PerDEMean->SetBinError(iDE+1, hESDLocalChi2InCh->GetXaxis()->GetXmax());
428 Double_t nFullClusters = hESDnTotFullClustersPerDE->GetBinContent(iDE+1);
429 if (nFullClusters > 1) {
431 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1)/nFullClusters);
432 hESDClusterSizePerDE->SetBinError(iDE+1, sigmaSize/TMath::Sqrt(nFullClusters));
436 hESDClusterSizePerDE->SetBinContent(iDE+1, hESDSumClusterSizePerDE->GetBinContent(iDE+1));
437 hESDClusterSizePerDE->SetBinError(iDE+1, hESDClusterSizeInCh->GetXaxis()->GetXmax());
448 // Display trigger histos in a more user friendly way
449 DisplayTriggerInfo(task);
452 // do the QA checking
453 AliQAChecker::Instance()->Run(AliQAv1::kMUON, task, list) ;
456 //____________________________________________________________________________
457 void AliMUONQADataMakerRec::InitRaws()
459 /// create Raws histograms in Raws subdir
461 AliCodeTimerAuto("");
463 const Bool_t expert = kTRUE ;
464 const Bool_t saveCorr = kTRUE ;
465 const Bool_t image = kTRUE ;
467 TString boardName = "Local board Id";
469 if ( ! AliCDBManager::Instance()->GetDefaultStorage() )
471 AliError("CDB default storage not set. Cannot work.");
474 TH3F* h3 = new TH3F("hTriggerScalersBendPlane", "Trigger scaler counts in bending plane",
478 h3->GetXaxis()->SetTitle("Chamber");
479 h3->GetXaxis()->SetNdivisions(4);
480 h3->GetYaxis()->SetTitle(boardName.Data());
481 h3->GetZaxis()->SetTitle("Strip");
482 Add2RawsList(h3, kTriggerScalersBP, expert, !image, !saveCorr);
484 TH3F* h4 = new TH3F("hTriggerScalersNonBendPlane", "Trigger scaler counts in non-bending plane",
488 h4->GetXaxis()->SetTitle("Chamber");
489 h4->GetXaxis()->SetNdivisions(4);
490 h4->GetYaxis()->SetTitle(boardName.Data());
491 h4->GetZaxis()->SetTitle("Strip");
492 Add2RawsList(h4, kTriggerScalersNBP, expert, !image, !saveCorr);
494 AliMUONTriggerDisplay triggerDisplay;
495 TString histoName, histoTitle;
496 for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
497 TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
498 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
499 histoName = Form("hScalers%sChamber%i", cathName.Data(), 11+iChamber);
500 histoTitle = Form("Chamber %i - %s: Hit rate from scalers (Hz/cm^{2})", 11+iChamber, cathName.Data());
501 TH2F* h5 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips,
502 iCath, iChamber, histoTitle);
503 Add2RawsList(h5, kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber, !expert, image, !saveCorr);
507 FillTriggerDCSHistos();
509 TH1F* h10 = new TH1F("hTriggerScalersTime", "Acquisition time from trigger scalers", 1, 0.5, 1.5);
510 h10->GetXaxis()->SetBinLabel(1, "One-bin histogram: bin is filled at each scaler event.");
511 h10->GetYaxis()->SetTitle("Cumulated scaler time (s)");
512 Add2RawsList(h10, kTriggerScalersTime, !expert, !image, !saveCorr);
515 TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
521 TH1* hbp = new TH1F("hTrackerBusPatchOccupancy","Occupancy of bus patches",
524 Add2RawsList(hbp,kTrackerBusPatchOccupancy, !expert, image, !saveCorr);
526 const Bool_t histogram(kFALSE);
528 fTrackerDataMaker = new AliMUONTrackerDataMaker(GetMUONRecoParam(),
529 AliCDBManager::Instance()->GetRun(),
531 AliCDBManager::Instance()->GetDefaultStorage()->GetURI(),
536 fTrackerDataMaker->Data()->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level
538 fTrackerDataMaker->SetRunning(kTRUE);
541 //__________________________________________________________________
542 void AliMUONQADataMakerRec::InitDigits()
544 /// Initialized Digits spectra
545 const Bool_t expert = kTRUE ;
546 const Bool_t image = kTRUE ;
548 TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits;Detection element Id;Counts", 1400, 100, 1500);
549 Add2DigitsList(h0, 0, !expert, image);
551 TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits;ACD value;Counts", 4096, 0, 4095);
552 Add2DigitsList(h1, 1, !expert, image);
555 //____________________________________________________________________________
556 void AliMUONQADataMakerRec::InitRecPoints()
558 /// create Reconstructed Points histograms in RecPoints subdir
560 AliCodeTimerAuto("");
562 InitRecPointsTrigger();
563 InitRecPointsTracker();
566 //____________________________________________________________________________
567 void AliMUONQADataMakerRec::InitRecPointsTracker()
569 /// create Reconstructed Points histograms in RecPoints subdir for the
570 /// MUON tracker subsystem.
571 const Bool_t expert = kTRUE ;
572 const Bool_t image = kTRUE ;
574 AliCodeTimerAuto("");
580 // histograms per chamber
581 Int_t nCh = AliMpConstants::NofTrackingChambers();
582 for ( Int_t i = 0; i < nCh; ++i )
584 h1I = new TH1I(Form("hTrackerClusterMultiplicityForChamber%d",i+1), Form("cluster size distribution in chamber %d;size (n_{pads};Counts)",i+1), 100,0,100);
585 Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerChamber+i, expert, !image);
587 h1I = new TH1I(Form("hTrackerClusterChargeForChamber%d",i+1), Form("cluster charge distribution in chamber %d;charge (ADC counts);Counts",i+1), 500,0,5000);
588 Add2RecPointsList(h1I,kTrackerClusterChargePerChamber+i, expert, !image);
590 Float_t rMax = AliMUONConstants::Rmax(i/2);
591 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);
592 Add2RecPointsList(h2F, kTrackerClusterHitMapPerChamber+i, expert, !image);
595 // summary histograms per chamber
596 h1I = new TH1I("hTrackerNumberOfClustersPerChamber", "Number of clusters per chamber;chamber ID;n_{clusters}", nCh,-0.5,nCh-0.5);
597 Add2RecPointsList(h1I,kTrackerNumberOfClustersPerChamber, !expert, image);
599 h1F = new TH1F("hTrackerClusterMultiplicityPerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh,-0.5,nCh-0.5);
601 h1F->SetMarkerStyle(kFullDotMedium);
602 h1F->SetMarkerColor(kRed);
603 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChMean, !expert, image);
605 h1F = new TH1F("hTrackerClusterMultiplicityPerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh,-0.5,nCh-0.5);
607 h1F->SetMarkerStyle(kFullDotMedium);
608 h1F->SetMarkerColor(kRed);
609 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerChSigma, !expert, image);
611 h1F = new TH1F("hTrackerClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (ADC counts)", nCh,-0.5,nCh-0.5);
613 h1F->SetMarkerStyle(kFullDotMedium);
614 h1F->SetMarkerColor(kRed);
615 Add2RecPointsList(h1F, kTrackerClusterChargePerChMean, !expert, image);
617 h1F = new TH1F("hTrackerClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (ADC counts)", nCh,-0.5,nCh-0.5);
619 h1F->SetMarkerStyle(kFullDotMedium);
620 h1F->SetMarkerColor(kRed);
621 Add2RecPointsList(h1F, kTrackerClusterChargePerChSigma, !expert, image);
627 while ( !it.IsDone())
629 Int_t detElemId = it.CurrentDEId();
631 if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
633 ndes = TMath::Max(ndes,detElemId);
635 h1I = new TH1I(Form("hTrackerClusterMultiplicityForDE%04d",detElemId), Form("cluster size distribution in detection element %d;size (n_{pads})",detElemId), 100,0,100);
636 Add2RecPointsList(h1I,kTrackerClusterMultiplicityPerDE+detElemId, expert, !image);
638 h1I = new TH1I(Form("hTrackerClusterChargeForDE%04d",detElemId), Form("cluster charge distribution in detection element %d;charge (ADC counts)",detElemId), 500,0,5000);
639 Add2RecPointsList(h1I,kTrackerClusterChargePerDE+detElemId, expert, !image);
645 // summary histograms per DE
646 h1I = new TH1I("hTrackerNumberOfClustersPerDE", "Number of clusters per detection element;DetElem ID;n_{clusters}", ndes+1,-0.5,ndes+0.5);
647 Add2RecPointsList(h1I, kTrackerNumberOfClustersPerDE, !expert, image);
649 h1F = new TH1F("hTrackerClusterMultiplicityPerDEMean", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", ndes+1,-0.5,ndes+0.5);
651 h1F->SetMarkerStyle(kFullDotMedium);
652 h1F->SetMarkerColor(kRed);
653 Add2RecPointsList(h1F, kTrackerClusterMultiplicityPerDEMean, !expert, image);
655 h1F = new TH1F("hTrackerClusterChargePerDEMean", "cluster mean charge per DE;DetElem ID;<charge> (ADC counts)", ndes+1,-0.5,ndes+0.5);
657 h1F->SetMarkerStyle(kFullDotMedium);
658 h1F->SetMarkerColor(kRed);
659 Add2RecPointsList(h1F, kTrackerClusterChargePerDEMean, !expert, image);
662 //____________________________________________________________________________
663 void AliMUONQADataMakerRec::InitRecPointsTrigger()
665 /// create Reconstructed Points histograms in RecPoints subdir for the
666 /// MUON Trigger subsystem.
668 const Bool_t expert = kTRUE ;
669 const Bool_t image = kTRUE ;
671 TString boardName = "Local board Id";
673 TH3F* h0 = new TH3F("hTriggerDigitsBendPlane", "Counts per strip in bending plane",
677 h0->GetXaxis()->SetTitle("Chamber");
678 h0->GetXaxis()->SetNdivisions(4);
679 h0->GetYaxis()->SetTitle(boardName.Data());
680 h0->GetZaxis()->SetTitle("Strip");
681 Add2RecPointsList(h0, kTriggerDigitsBendPlane, expert, !image);
683 TH3F* h1 = new TH3F("hTriggerDigitsNonBendPlane", "Counts per strip in non-bending plane",
687 h1->GetXaxis()->SetTitle("Chamber");
688 h1->GetXaxis()->SetNdivisions(4);
689 h1->GetYaxis()->SetTitle(boardName.Data());
690 h1->GetZaxis()->SetTitle("Strip");
691 Add2RecPointsList(h1, kTriggerDigitsNonBendPlane, expert, !image);
693 TH1F* h2 = new TH1F("hTriggeredBoards", "Triggered boards", 234, 0.5, 234.5);
694 Add2RecPointsList(h2, kTriggeredBoards, expert, !image);
696 AliMUONTriggerDisplay triggerDisplay;
697 TString histoName, histoTitle;
698 for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){
699 TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane";
700 for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){
701 histoName = Form("hTriggerDigits%sChamber%i", cathName.Data(), 11+iChamber);
702 histoTitle = Form("Chamber %i - %s: Occupancy per strip (counts/event)", 11+iChamber, cathName.Data());
703 TH2F* h3 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips,
704 iCath, iChamber, histoTitle);
705 Add2RecPointsList(h3, kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber, !expert, image);
709 TH2F* h4 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto("hFiredBoardsDisplay", AliMUONTriggerDisplay::kDisplayBoards,
710 0, 0, "Local board triggers / event");
711 Add2RecPointsList(h4, kTriggerBoardsDisplay, !expert, image);
713 Int_t nSpecies = AliRecoParam::kNSpecies;
714 TH1F* h5 = new TH1F("hNAnalyzedEvents", "Number of analyzed events per specie", nSpecies, -0.5, (Float_t)nSpecies - 0.5);
715 for(Int_t ispecie=0; ispecie<nSpecies; ispecie++){
716 h5->GetXaxis()->SetBinLabel(1+ispecie, AliRecoParam::GetEventSpecieName(ispecie));
718 h5->GetYaxis()->SetTitle("Number of analyzed events");
719 Add2RecPointsList(h5, kNAnalyzedEvents, !expert, image);
723 //____________________________________________________________________________
724 void AliMUONQADataMakerRec::InitESDs()
726 ///create ESDs histograms in ESDs subdir
728 const Bool_t expert = kTRUE ;
729 const Bool_t image = kTRUE ;
731 Int_t nCh = AliMUONConstants::NTrackingCh();
735 TH1F* hESDnTracks = new TH1F("hESDnTracks", "number of tracks;n_{tracks}", 20, 0., 20.);
736 Add2ESDsList(hESDnTracks, kESDnTracks, !expert, image);
738 TH1F* hESDMatchTrig = new TH1F("hESDMatchTrig", "number of tracks matched with trigger;n_{tracks}", 20, 0., 20.);
739 Add2ESDsList(hESDMatchTrig, kESDMatchTrig, !expert, image);
741 TH1F* hESDMomentum = new TH1F("hESDMomentum", "momentum distribution;p (GeV/c)", 300, 0., 300);
742 Add2ESDsList(hESDMomentum, kESDMomentum, !expert, image);
744 TH1F* hESDPt = new TH1F("hESDPt", "transverse momentum distribution;p_{t} (GeV/c)", 200, 0., 50);
745 Add2ESDsList(hESDPt, kESDPt, !expert, image);
747 TH1F* hESDRapidity = new TH1F("hESDRapidity", "rapidity distribution;rapidity", 200, -4.5, -2.);
748 Add2ESDsList(hESDRapidity, kESDRapidity, !expert, image);
750 TH1F* hESDChi2 = new TH1F("hESDChi2", "normalized #chi^{2} distribution;#chi^{2} / ndf", 500, 0., 50.);
751 Add2ESDsList(hESDChi2, kESDChi2, !expert, image);
753 TH1F* hESDProbChi2 = new TH1F("hESDProbChi2", "distribution of probability of #chi^{2};prob(#chi^{2})", 100, 0., 1.);
754 Add2ESDsList(hESDProbChi2, kESDProbChi2, !expert, image);
756 TH1F* hESDThetaX = new TH1F("hESDThetaX", "#theta_{X} distribution;#theta_{X} (degree)", 360, -180., 180);
757 Add2ESDsList(hESDThetaX, kESDThetaX, !expert, image);
759 TH1F* hESDThetaY = new TH1F("hESDThetaY", "#theta_{Y} distribution;#theta_{Y} (degree)", 360, -180., 180);
760 Add2ESDsList(hESDThetaY, kESDThetaY, !expert, image);
763 for (Int_t i = 0; i < nCh; i++) {
764 Float_t rMax = AliMUONConstants::Rmax(i/2);
765 TH2F* hESDClusterHitMap = new TH2F(Form("hESDClusterHitMap%d",i+1), Form("cluster position distribution in chamber %d;X (cm);Y (cm)",i+1),
766 100, -rMax, rMax, 100, -rMax, rMax);
767 Add2ESDsList(hESDClusterHitMap, kESDClusterHitMap+i, expert, !image);
770 TH1F* hESDnClustersPerTrack = new TH1F("hESDnClustersPerTrack", "number of associated clusters per track;n_{clusters}", 20, 0., 20.);
771 Add2ESDsList(hESDnClustersPerTrack, kESDnClustersPerTrack, !expert, image);
773 TH1F* hESDnClustersPerCh = new TH1F("hESDnClustersPerCh", "averaged number of clusters per chamber per track;chamber ID;<n_{clusters}>", nCh, -0.5, nCh-0.5);
774 hESDnClustersPerCh->SetFillColor(kRed);
775 Add2ESDsList(hESDnClustersPerCh, kESDnClustersPerCh, !expert, image);
777 TH1F* hESDnClustersPerDE = new TH1F("hESDnClustersPerDE", "averaged number of clusters per DE per track;DetElem ID;<n_{clusters}>", nDE+1, -0.5, nDE+0.5);
778 hESDnClustersPerDE->SetFillColor(kRed);
779 Add2ESDsList(hESDnClustersPerDE, kESDnClustersPerDE, !expert, image);
781 for (Int_t i = 0; i < nCh; i++) {
782 TH1F* hESDClusterChargeInCh = new TH1F(Form("hESDClusterChargeInCh%d",i+1), Form("cluster charge distribution in chamber %d;charge (ADC counts)",i+1), 500, 0., 5000.);
783 Add2ESDsList(hESDClusterChargeInCh, kESDClusterChargeInCh+i, expert, !image);
786 TH1F* hESDClusterChargePerChMean = new TH1F("hESDClusterChargePerChMean", "cluster mean charge per chamber;chamber ID;<charge> (ADC counts)", nCh, -0.5, nCh-0.5);
787 hESDClusterChargePerChMean->SetOption("P");
788 hESDClusterChargePerChMean->SetMarkerStyle(kFullDotMedium);
789 hESDClusterChargePerChMean->SetMarkerColor(kRed);
790 Add2ESDsList(hESDClusterChargePerChMean, kESDClusterChargePerChMean, !expert, image);
792 TH1F* hESDClusterChargePerChSigma = new TH1F("hESDClusterChargePerChSigma", "cluster charge dispersion per chamber;chamber ID;#sigma_{charge} (ADC counts)", nCh, -0.5, nCh-0.5);
793 hESDClusterChargePerChSigma->SetOption("P");
794 hESDClusterChargePerChSigma->SetMarkerStyle(kFullDotMedium);
795 hESDClusterChargePerChSigma->SetMarkerColor(kRed);
796 Add2ESDsList(hESDClusterChargePerChSigma, kESDClusterChargePerChSigma, !expert, image);
798 TH1F* hESDClusterChargePerDE = new TH1F("hESDClusterChargePerDE", "cluster mean charge per DE;DetElem ID;<charge> (ADC counts)", nDE+1, -0.5, nDE+0.5);
799 hESDClusterChargePerDE->SetOption("P");
800 hESDClusterChargePerDE->SetMarkerStyle(kFullDotMedium);
801 hESDClusterChargePerDE->SetMarkerColor(kRed);
802 Add2ESDsList(hESDClusterChargePerDE, kESDClusterChargePerDE, !expert, image);
804 for (Int_t i = 0; i < nCh; i++) {
805 TH1F* hESDClusterSizeInCh = new TH1F(Form("hESDClusterSizeInCh%d",i+1), Form("cluster size distribution in chamber %d;size (n_{pads})",i+1), 200, 0., 200.);
806 Add2ESDsList(hESDClusterSizeInCh, kESDClusterSizeInCh+i, expert, !image);
809 TH1F* hESDClusterSizePerChMean = new TH1F("hESDClusterSizePerChMean", "cluster mean size per chamber;chamber ID;<size> (n_{pads})", nCh, -0.5, nCh-0.5);
810 hESDClusterSizePerChMean->SetOption("P");
811 hESDClusterSizePerChMean->SetMarkerStyle(kFullDotMedium);
812 hESDClusterSizePerChMean->SetMarkerColor(kRed);
813 Add2ESDsList(hESDClusterSizePerChMean, kESDClusterSizePerChMean, !expert, image);
815 TH1F* hESDClusterSizePerChSigma = new TH1F("hESDClusterSizePerChSigma", "cluster size dispersion per chamber;chamber ID;#sigma_{size} (n_{pads})", nCh, -0.5, nCh-0.5);
816 hESDClusterSizePerChSigma->SetOption("P");
817 hESDClusterSizePerChSigma->SetMarkerStyle(kFullDotMedium);
818 hESDClusterSizePerChSigma->SetMarkerColor(kRed);
819 Add2ESDsList(hESDClusterSizePerChSigma, kESDClusterSizePerChSigma, !expert, image);
821 TH1F* hESDClusterSizePerDE = new TH1F("hESDClusterSizePerDE", "cluster mean size per DE;DetElem ID;<size> (n_{pads})", nDE+1, -0.5, nDE+0.5);
822 hESDClusterSizePerDE->SetOption("P");
823 hESDClusterSizePerDE->SetMarkerStyle(kFullDotMedium);
824 hESDClusterSizePerDE->SetMarkerColor(kRed);
825 Add2ESDsList(hESDClusterSizePerDE, kESDClusterSizePerDE, !expert, image);
827 // cluster - track info
828 for (Int_t i = 0; i < nCh; i++) {
829 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.);
830 Add2ESDsList(hESDResidualXInCh, kESDResidualXInCh+i, expert, !image);
832 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.);
833 Add2ESDsList(hESDResidualYInCh, kESDResidualYInCh+i, expert, !image);
835 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);
836 Add2ESDsList(hESDLocalChi2XInCh, kESDLocalChi2XInCh+i, expert, !image);
838 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);
839 Add2ESDsList(hESDLocalChi2YInCh, kESDLocalChi2YInCh+i, expert, !image);
841 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);
842 Add2ESDsList(hESDLocalChi2InCh, kESDLocalChi2InCh+i, expert, !image);
845 TH1F* hESDResidualXPerChMean = new TH1F("hESDResidualXPerChMean", "cluster-track residual-X per Ch: mean;chamber ID;<#Delta_{X}> (cm)", nCh, -0.5, nCh-0.5);
846 hESDResidualXPerChMean->SetOption("P");
847 hESDResidualXPerChMean->SetMarkerStyle(kFullDotMedium);
848 hESDResidualXPerChMean->SetMarkerColor(kRed);
849 Add2ESDsList(hESDResidualXPerChMean, kESDResidualXPerChMean, !expert, image);
851 TH1F* hESDResidualYPerChMean = new TH1F("hESDResidualYPerChMean", "cluster-track residual-Y per Ch: mean;chamber ID;<#Delta_{Y}> (cm)", nCh, -0.5, nCh-0.5);
852 hESDResidualYPerChMean->SetOption("P");
853 hESDResidualYPerChMean->SetMarkerStyle(kFullDotMedium);
854 hESDResidualYPerChMean->SetMarkerColor(kRed);
855 Add2ESDsList(hESDResidualYPerChMean, kESDResidualYPerChMean, !expert, image);
857 TH1F* hESDResidualXPerChSigma = new TH1F("hESDResidualXPerChSigma", "cluster-track residual-X per Ch: sigma;chamber ID;#sigma_{X} (cm)", nCh, -0.5, nCh-0.5);
858 hESDResidualXPerChSigma->SetOption("P");
859 hESDResidualXPerChSigma->SetMarkerStyle(kFullDotMedium);
860 hESDResidualXPerChSigma->SetMarkerColor(kRed);
861 Add2ESDsList(hESDResidualXPerChSigma, kESDResidualXPerChSigma, !expert, image);
863 TH1F* hESDResidualYPerChSigma = new TH1F("hESDResidualYPerChSigma", "cluster-track residual-Y per Ch: sigma;chamber ID;#sigma_{Y} (cm)", nCh, -0.5, nCh-0.5);
864 hESDResidualYPerChSigma->SetOption("P");
865 hESDResidualYPerChSigma->SetMarkerStyle(kFullDotMedium);
866 hESDResidualYPerChSigma->SetMarkerColor(kRed);
867 Add2ESDsList(hESDResidualYPerChSigma, kESDResidualYPerChSigma, !expert, image);
869 TH1F* hESDLocalChi2XPerChMean = new TH1F("hESDLocalChi2XPerChMean", "local chi2-X per Ch: mean;chamber ID;<local #chi^{2}_{X}>", nCh, -0.5, nCh-0.5);
870 hESDLocalChi2XPerChMean->SetOption("P");
871 hESDLocalChi2XPerChMean->SetMarkerStyle(kFullDotMedium);
872 hESDLocalChi2XPerChMean->SetMarkerColor(kRed);
873 Add2ESDsList(hESDLocalChi2XPerChMean, kESDLocalChi2XPerChMean, !expert, image);
875 TH1F* hESDLocalChi2YPerChMean = new TH1F("hESDLocalChi2YPerChMean", "local chi2-Y per Ch: mean;chamber ID;<local #chi^{2}_{Y}>", nCh, -0.5, nCh-0.5);
876 hESDLocalChi2YPerChMean->SetOption("P");
877 hESDLocalChi2YPerChMean->SetMarkerStyle(kFullDotMedium);
878 hESDLocalChi2YPerChMean->SetMarkerColor(kRed);
879 Add2ESDsList(hESDLocalChi2YPerChMean, kESDLocalChi2YPerChMean, !expert, image);
881 TH1F* hESDLocalChi2PerChMean = new TH1F("hESDLocalChi2PerChMean", "local chi2 (~0.5*(#chi^{2}_{X}+#chi^{2}_{Y})) per Ch: mean;chamber ID;<local #chi^{2}>", nCh, -0.5, nCh-0.5);
882 hESDLocalChi2PerChMean->SetOption("P");
883 hESDLocalChi2PerChMean->SetMarkerStyle(kFullDotMedium);
884 hESDLocalChi2PerChMean->SetMarkerColor(kRed);
885 Add2ESDsList(hESDLocalChi2PerChMean, kESDLocalChi2PerChMean, !expert, image);
887 TH1F* hESDResidualXPerDEMean = new TH1F("hESDResidualXPerDEMean", "cluster-track residual-X per DE: mean;DetElem ID;<#Delta_{X}> (cm)", nDE+1, -0.5, nDE+0.5);
888 hESDResidualXPerDEMean->SetOption("P");
889 hESDResidualXPerDEMean->SetMarkerStyle(kFullDotMedium);
890 hESDResidualXPerDEMean->SetMarkerColor(kRed);
891 Add2ESDsList(hESDResidualXPerDEMean, kESDResidualXPerDEMean, !expert, image);
893 TH1F* hESDResidualYPerDEMean = new TH1F("hESDResidualYPerDEMean", "cluster-track residual-Y per DE: mean;DetElem ID;<#Delta_{Y}> (cm)", nDE+1, -0.5, nDE+0.5);
894 hESDResidualYPerDEMean->SetOption("P");
895 hESDResidualYPerDEMean->SetMarkerStyle(kFullDotMedium);
896 hESDResidualYPerDEMean->SetMarkerColor(kRed);
897 Add2ESDsList(hESDResidualYPerDEMean, kESDResidualYPerDEMean, !expert, image);
899 TH1F* hESDResidualXPerDESigma = new TH1F("hESDResidualXPerDESigma", "cluster-track residual-X per DE: sigma;DetElem ID;#sigma_{X} (cm)", nDE+1, -0.5, nDE+0.5);
900 hESDResidualXPerDESigma->SetOption("P");
901 hESDResidualXPerDESigma->SetMarkerStyle(kFullDotMedium);
902 hESDResidualXPerDESigma->SetMarkerColor(kRed);
903 Add2ESDsList(hESDResidualXPerDESigma, kESDResidualXPerDESigma, !expert, image);
905 TH1F* hESDResidualYPerDESigma = new TH1F("hESDResidualYPerDESigma", "cluster-track residual-Y per DE: sigma;DetElem ID;#sigma_{Y} (cm)", nDE+1, -0.5, nDE+0.5);
906 hESDResidualYPerDESigma->SetOption("P");
907 hESDResidualYPerDESigma->SetMarkerStyle(kFullDotMedium);
908 hESDResidualYPerDESigma->SetMarkerColor(kRed);
909 Add2ESDsList(hESDResidualYPerDESigma, kESDResidualYPerDESigma, !expert, image);
911 TH1F* hESDLocalChi2XPerDEMean = new TH1F("hESDLocalChi2XPerDEMean", "local chi2-X per DE: mean;DetElem ID;<local #chi^{2}_{X}>", nDE+1, -0.5, nDE+0.5);
912 hESDLocalChi2XPerDEMean->SetOption("P");
913 hESDLocalChi2XPerDEMean->SetMarkerStyle(kFullDotMedium);
914 hESDLocalChi2XPerDEMean->SetMarkerColor(kRed);
915 Add2ESDsList(hESDLocalChi2XPerDEMean, kESDLocalChi2XPerDEMean, !expert, image);
917 TH1F* hESDLocalChi2YPerDEMean = new TH1F("hESDLocalChi2YPerDEMean", "local chi2-Y per DE: mean;DetElem ID;<local #chi^{2}_{Y}>", nDE+1, -0.5, nDE+0.5);
918 hESDLocalChi2YPerDEMean->SetOption("P");
919 hESDLocalChi2YPerDEMean->SetMarkerStyle(kFullDotMedium);
920 hESDLocalChi2YPerDEMean->SetMarkerColor(kRed);
921 Add2ESDsList(hESDLocalChi2YPerDEMean, kESDLocalChi2YPerDEMean, !expert, image);
923 TH1F* hESDLocalChi2PerDEMean = new TH1F("hESDLocalChi2PerDEMean", "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);
924 hESDLocalChi2PerDEMean->SetOption("P");
925 hESDLocalChi2PerDEMean->SetMarkerStyle(kFullDotMedium);
926 hESDLocalChi2PerDEMean->SetMarkerColor(kRed);
927 Add2ESDsList(hESDLocalChi2PerDEMean, kESDLocalChi2PerDEMean, !expert, image);
929 // intermediate histograms
930 TH1F* hESDnTotClustersPerCh = new TH1F("hESDnTotClustersPerCh", "total number of associated clusters per chamber;chamber ID;#Sigma(n_{clusters})", nCh, -0.5, nCh-0.5);
931 Add2ESDsList(hESDnTotClustersPerCh, kESDnTotClustersPerCh, expert, !image);
932 TH1F* hESDnTotClustersPerDE = new TH1F("hESDnTotClustersPerDE", "total number of associated clusters per DE;DetElem ID;#Sigma(n_{clusters})", nDE+1, -0.5, nDE+0.5);
933 Add2ESDsList(hESDnTotClustersPerDE, kESDnTotClustersPerDE, expert, !image);
934 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);
935 Add2ESDsList(hESDnTotFullClustersPerDE, kESDnTotFullClustersPerDE, expert, !image);
936 TH1F* hESDSumClusterChargePerDE = new TH1F("hESDSumClusterChargePerDE", "sum of cluster charge per DE;DetElem ID;#Sigma(charge) (ADC counts)", nDE+1, -0.5, nDE+0.5);
937 Add2ESDsList(hESDSumClusterChargePerDE, kESDSumClusterChargePerDE, expert, !image);
938 TH1F* hESDSumClusterSizePerDE = new TH1F("hESDSumClusterSizePerDE", "sum of cluster size per DE;DetElem ID;#Sigma(size) (n_{pads})", nDE+1, -0.5, nDE+0.5);
939 Add2ESDsList(hESDSumClusterSizePerDE, kESDSumClusterSizePerDE, expert, !image);
940 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);
941 Add2ESDsList(hESDSumResidualXPerDE, kESDSumResidualXPerDE, expert, !image);
942 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);
943 Add2ESDsList(hESDSumResidualYPerDE, kESDSumResidualYPerDE, expert, !image);
944 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);
945 Add2ESDsList(hESDSumResidualX2PerDE, kESDSumResidualX2PerDE, expert, !image);
946 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);
947 Add2ESDsList(hESDSumResidualY2PerDE, kESDSumResidualY2PerDE, expert, !image);
948 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);
949 Add2ESDsList(hESDSumLocalChi2XPerDE, kESDSumLocalChi2XPerDE, expert, !image);
950 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);
951 Add2ESDsList(hESDSumLocalChi2YPerDE, kESDSumLocalChi2YPerDE, expert, !image);
952 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);
953 Add2ESDsList(hESDSumLocalChi2PerDE, kESDSumLocalChi2PerDE, expert, !image);
956 //____________________________________________________________________________
957 void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader)
959 /// make QA for rawdata
961 // Check id histograms already created for this Event Specie
963 if ( rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent )
966 MakeRawsTracker(rawReader);
969 if ( rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent ||
970 rawReader->GetType() == AliRawEventHeaderBase::kCalibrationEvent )
973 MakeRawsTrigger(rawReader);
977 //____________________________________________________________________________
978 void AliMUONQADataMakerRec::MakeRawsTracker(AliRawReader* rawReader)
980 /// make QA for rawdata tracker
983 GetRawsData(kTrackerBusPatchOccupancy);
985 ((AliMUONTrackerDataMaker*)fTrackerDataMaker)->SetRawReader(rawReader);
987 fTrackerDataMaker->ProcessEvent();
990 //____________________________________________________________________________
991 void AliMUONQADataMakerRec::MakeRawsTrigger(AliRawReader* rawReader)
993 /// make QA for rawdata trigger
995 // Get trigger scalers
998 AliMpCDB::LoadDDLStore();
1000 AliMUONRawStreamTrigger rawStreamTrig(rawReader);
1001 while (rawStreamTrig.NextDDL())
1003 // If not a scaler event, do nothing
1004 Bool_t scalerEvent = rawReader->GetDataHeader()->GetL1TriggerMessage() & 0x1;
1005 if ( !scalerEvent ) continue;
1007 AliMUONDDLTrigger* ddlTrigger = rawStreamTrig.GetDDLTrigger();
1008 AliMUONDarcHeader* darcHeader = ddlTrigger->GetDarcHeader();
1010 if (darcHeader->GetGlobalFlag()){
1011 UInt_t nOfClocks = darcHeader->GetGlobalClock();
1012 Double_t nOfSeconds = ((Double_t) nOfClocks) / 40e6; // 1 clock each 25 ns
1013 ((TH1F*)GetRawsData(kTriggerScalersTime))->Fill(1., nOfSeconds);
1016 Int_t nReg = darcHeader->GetRegHeaderEntries();
1018 for(Int_t iReg = 0; iReg < nReg ;iReg++)
1022 AliMpTriggerCrate* crate = AliMpDDLStore::Instance()->
1023 GetTriggerCrate(rawStreamTrig.GetDDL(), iReg);
1025 AliMUONRegHeader* regHeader = darcHeader->GetRegHeaderEntry(iReg);
1027 // loop over local structures
1028 Int_t nLocal = regHeader->GetLocalEntries();
1029 for(Int_t iLocal = 0; iLocal < nLocal; iLocal++)
1031 AliMUONLocalStruct* localStruct = regHeader->GetLocalEntry(iLocal);
1034 if (!localStruct) continue;
1036 loCircuit = crate->GetLocalBoardId(localStruct->GetId());
1038 if ( !loCircuit ) continue; // empty slot
1040 AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit, false);
1043 if( !localBoard->IsNotified())
1046 Int_t cathode = localStruct->GetComptXY()%2;
1048 ERaw hindex = (cathode==0) ? kTriggerScalersBP : kTriggerScalersNBP;
1051 for (Int_t ibitxy = 0; ibitxy < 16; ++ibitxy) {
1052 if(localStruct->GetXY1(ibitxy) > 0)
1053 ((TH3F*)GetRawsData(hindex))->Fill(11+0, loCircuit, ibitxy, 2*localStruct->GetXY1(ibitxy));
1054 if(localStruct->GetXY2(ibitxy) > 0)
1055 ((TH3F*)GetRawsData(hindex))->Fill(11+1, loCircuit, ibitxy, 2*localStruct->GetXY2(ibitxy));
1056 if(localStruct->GetXY3(ibitxy) > 0)
1057 ((TH3F*)GetRawsData(hindex))->Fill(11+2, loCircuit, ibitxy, 2*localStruct->GetXY3(ibitxy));
1058 if(localStruct->GetXY4(ibitxy) > 0)
1059 ((TH3F*)GetRawsData(hindex))->Fill(11+3, loCircuit, ibitxy, 2*localStruct->GetXY4(ibitxy));
1066 //__________________________________________________________________
1067 void AliMUONQADataMakerRec::MakeDigits(TTree* digitsTree)
1069 /// makes data from Digits
1072 fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
1073 fDigitStore->Connect(*digitsTree, false);
1074 digitsTree->GetEvent(0);
1076 TIter next(fDigitStore->CreateIterator());
1078 AliMUONVDigit* dig = 0x0;
1080 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
1082 GetDigitsData(0)->Fill(dig->DetElemId());
1083 GetDigitsData(1)->Fill(dig->ADC());
1087 //____________________________________________________________________________
1088 void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree)
1090 /// Fill histograms from treeR
1092 GetRecPointsData(kNAnalyzedEvents)->Fill(AliRecoParam::AConvert(fEventSpecie));
1094 MakeRecPointsTracker(clustersTree);
1095 MakeRecPointsTrigger(clustersTree);
1098 //____________________________________________________________________________
1099 void AliMUONQADataMakerRec::MakeRecPointsTracker(TTree* clustersTree)
1101 /// Fill histograms related to tracker clusters
1103 // First things first : do we have clusters in the TreeR ?
1104 // In "normal" production mode, it should be perfectly normal
1105 // *not* to have them.
1106 // But if for some reason we de-activated the combined tracking,
1107 // then we have clusters in TreeR, so let's take that opportunity
1112 AliCodeTimerAuto("ClusterStore creation");
1113 fClusterStore = AliMUONVClusterStore::Create(*clustersTree);
1120 AliCodeTimerAuto("");
1122 fClusterStore->Connect(*clustersTree,kFALSE);
1123 clustersTree->GetEvent(0);
1125 TIter next(fClusterStore->CreateIterator());
1126 AliMUONVCluster* cluster;
1128 while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) )
1130 Int_t detElemId = cluster->GetDetElemId();
1131 Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
1133 GetRecPointsData(kTrackerNumberOfClustersPerDE)->Fill(detElemId);
1134 GetRecPointsData(kTrackerClusterChargePerDE+detElemId)->Fill(cluster->GetCharge());
1135 GetRecPointsData(kTrackerClusterMultiplicityPerDE+detElemId)->Fill(cluster->GetNDigits());
1137 GetRecPointsData(kTrackerNumberOfClustersPerChamber)->Fill(chamberId);
1138 GetRecPointsData(kTrackerClusterChargePerChamber+chamberId)->Fill(cluster->GetCharge());
1139 GetRecPointsData(kTrackerClusterMultiplicityPerChamber+chamberId)->Fill(cluster->GetNDigits());
1140 GetRecPointsData(kTrackerClusterHitMapPerChamber+chamberId)->Fill(cluster->GetX(),cluster->GetY());
1144 fClusterStore->Clear();
1147 //____________________________________________________________________________
1148 void AliMUONQADataMakerRec::MakeRecPointsTrigger(TTree* clustersTree)
1150 /// makes data from trigger response
1153 fDigitStore->Clear();
1155 if (!fTriggerStore) fTriggerStore = AliMUONVTriggerStore::Create(*clustersTree);
1156 fTriggerStore->Clear();
1157 fTriggerStore->Connect(*clustersTree, false);
1158 clustersTree->GetEvent(0);
1160 AliMUONLocalTrigger* locTrg;
1161 TIter nextLoc(fTriggerStore->CreateLocalIterator());
1163 while ( ( locTrg = static_cast<AliMUONLocalTrigger*>(nextLoc()) ) )
1165 if (locTrg->IsNull()) continue;
1167 TArrayS xyPattern[2];
1168 locTrg->GetXPattern(xyPattern[0]);
1169 locTrg->GetYPattern(xyPattern[1]);
1171 Int_t nBoard = locTrg->LoCircuit();
1173 Bool_t xTrig=locTrg->IsTrigX();
1174 Bool_t yTrig=locTrg->IsTrigY();
1177 ((TH1F*)GetRecPointsData(kTriggeredBoards))->Fill(nBoard);
1179 fDigitMaker->TriggerDigits(nBoard, xyPattern, *fDigitStore);
1182 TIter nextDigit(fDigitStore->CreateIterator());
1183 AliMUONVDigit* mDigit;
1184 while ( ( mDigit = static_cast<AliMUONVDigit*>(nextDigit()) ) )
1186 Int_t detElemId = mDigit->DetElemId();
1187 Int_t ch = detElemId/100;
1188 Int_t localBoard = mDigit->ManuId();
1189 Int_t channel = mDigit->ManuChannel();
1190 Int_t cathode = mDigit->Cathode();
1192 = ( cathode == 0 ) ? kTriggerDigitsBendPlane : kTriggerDigitsNonBendPlane;
1194 ((TH3F*)GetRecPointsData(hindex))->Fill(ch, localBoard, channel);
1198 //____________________________________________________________________________
1199 void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd)
1201 /// make QA data from ESDs
1203 // load ESD event in the interface
1204 AliMUONESDInterface esdInterface;
1205 if (GetMUONRecoParam()) AliMUONESDInterface::ResetTracker(GetMUONRecoParam());
1206 else AliError("Unable to get recoParam: use default ones for residual calculation");
1207 esdInterface.LoadEvent(*esd);
1209 GetESDsData(kESDnTracks)->Fill(esdInterface.GetNTracks());
1211 Int_t nTrackMatchTrig = 0;
1214 Int_t nTracks = (Int_t) esd->GetNumberOfMuonTracks();
1215 for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) {
1217 // get the ESD track and skip "ghosts"
1218 AliESDMuonTrack* esdTrack = esd->GetMuonTrack(iTrack);
1219 if (!esdTrack->ContainTrackerData()) continue;
1221 // get corresponding MUON track
1222 AliMUONTrack* track = esdInterface.FindTrack(esdTrack->GetUniqueID());
1224 if (esdTrack->ContainTriggerData()) nTrackMatchTrig++;
1226 GetESDsData(kESDMomentum)->Fill(esdTrack->P());
1227 GetESDsData(kESDPt)->Fill(esdTrack->Pt());
1228 GetESDsData(kESDRapidity)->Fill(esdTrack->Y());
1229 GetESDsData(kESDChi2)->Fill(track->GetNormalizedChi2());
1230 GetESDsData(kESDProbChi2)->Fill(TMath::Prob(track->GetGlobalChi2(),track->GetNDF()));
1231 GetESDsData(kESDThetaX)->Fill(esdTrack->GetThetaXUncorrected() / TMath::Pi() * 180.);
1232 GetESDsData(kESDThetaY)->Fill(esdTrack->GetThetaYUncorrected() / TMath::Pi() * 180.);
1233 GetESDsData(kESDnClustersPerTrack)->Fill(track->GetNClusters());
1235 // loop over clusters
1236 AliMUONTrackParam* trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->First());
1237 while (trackParam) {
1239 AliMUONVCluster* cluster = trackParam->GetClusterPtr();
1240 Int_t chId = cluster->GetChamberId();
1241 Int_t deID = cluster->GetDetElemId();
1242 Double_t residualX = cluster->GetX() - trackParam->GetNonBendingCoor();
1243 Double_t residualY = cluster->GetY() - trackParam->GetBendingCoor();
1244 Double_t sigmaResidualX2 = cluster->GetErrX2() - trackParam->GetCovariances()(0,0);
1245 Double_t sigmaResidualY2 = cluster->GetErrY2() - trackParam->GetCovariances()(2,2);
1246 Double_t localChi2X = (sigmaResidualX2 > 0.) ? residualX*residualX/sigmaResidualX2 : 0.;
1247 Double_t localChi2Y = (sigmaResidualY2 > 0.) ? residualY*residualY/sigmaResidualY2 : 0.;
1248 Double_t localChi2 = 0.5 * trackParam->GetLocalChi2();
1250 GetESDsData(kESDClusterHitMap+chId)->Fill(cluster->GetX(), cluster->GetY());
1252 GetESDsData(kESDnTotClustersPerCh)->Fill(chId);
1253 GetESDsData(kESDnTotClustersPerDE)->Fill(deID);
1255 GetESDsData(kESDClusterChargeInCh+chId)->Fill(cluster->GetCharge());
1256 GetESDsData(kESDSumClusterChargePerDE)->Fill(deID, cluster->GetCharge());
1258 if (cluster->GetNDigits() > 0) { // discard clusters with pad not stored in ESD
1259 GetESDsData(kESDnTotFullClustersPerDE)->Fill(deID);
1260 GetESDsData(kESDClusterSizeInCh+chId)->Fill(cluster->GetNDigits());
1261 GetESDsData(kESDSumClusterSizePerDE)->Fill(deID, cluster->GetNDigits());
1264 GetESDsData(kESDResidualXInCh+chId)->Fill(residualX);
1265 GetESDsData(kESDResidualYInCh+chId)->Fill(residualY);
1266 GetESDsData(kESDSumResidualXPerDE)->Fill(deID, residualX);
1267 GetESDsData(kESDSumResidualYPerDE)->Fill(deID, residualY);
1268 GetESDsData(kESDSumResidualX2PerDE)->Fill(deID, residualX*residualX);
1269 GetESDsData(kESDSumResidualY2PerDE)->Fill(deID, residualY*residualY);
1271 GetESDsData(kESDLocalChi2XInCh+chId)->Fill(localChi2X);
1272 GetESDsData(kESDLocalChi2YInCh+chId)->Fill(localChi2Y);
1273 GetESDsData(kESDLocalChi2InCh+chId)->Fill(localChi2);
1274 GetESDsData(kESDSumLocalChi2XPerDE)->Fill(deID, localChi2X);
1275 GetESDsData(kESDSumLocalChi2YPerDE)->Fill(deID, localChi2Y);
1276 GetESDsData(kESDSumLocalChi2PerDE)->Fill(deID, localChi2);
1278 trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->After(trackParam));
1283 GetESDsData(kESDMatchTrig)->Fill(nTrackMatchTrig);
1287 //____________________________________________________________________________
1288 void AliMUONQADataMakerRec::StartOfDetectorCycle()
1290 /// Detector specific actions at start of cycle
1294 //____________________________________________________________________________
1295 void AliMUONQADataMakerRec::DisplayTriggerInfo(AliQAv1::TASKINDEX_t task)
1298 /// Display trigger information in a user-friendly way:
1299 /// from local board and strip numbers to their position on chambers
1303 if(task!=AliQAv1::kRECPOINTS && task!=AliQAv1::kRAWS) return;
1305 // check we get histograms, otherwise return right now
1306 if ( task == AliQAv1::kRECPOINTS )
1308 if ( !GetRecPointsData(kTriggerDigitsBendPlane) ) return;
1311 if ( task == AliQAv1::kRAWS )
1313 if ( !GetRawsData(kTriggerScalersBP) ) return;
1316 AliMUONTriggerDisplay triggerDisplay;
1318 TH3F* histoStrips=0x0;
1319 TH2F* histoDisplayStrips=0x0;
1320 AliMUONTriggerDisplay::EDisplayOption displayOption = AliMUONTriggerDisplay::kDefaultDisplay;
1321 if(task == AliQAv1::kRAWS) displayOption = AliMUONTriggerDisplay::kNormalizeToArea;
1323 for (Int_t iCath = 0; iCath < AliMpConstants::NofCathodes(); iCath++)
1325 if(task==AliQAv1::kRECPOINTS){
1327 = ( iCath == 0 ) ? kTriggerDigitsBendPlane : kTriggerDigitsNonBendPlane;
1328 histoStrips = (TH3F*)GetRecPointsData(hindex);
1330 else if(task==AliQAv1::kRAWS){
1332 = ( iCath == 0 ) ? kTriggerScalersBP : kTriggerScalersNBP;
1333 histoStrips = (TH3F*)GetRawsData(hindex);
1335 if(histoStrips->GetEntries()==0) continue; // No events found => No need to display
1337 for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++)
1339 if(task==AliQAv1::kRECPOINTS){
1340 histoDisplayStrips = (TH2F*)GetRecPointsData(kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
1342 else if(task==AliQAv1::kRAWS){
1343 histoDisplayStrips = (TH2F*)GetRawsData(kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber);
1345 Int_t bin = histoStrips->GetXaxis()->FindBin(11+iChamber);
1346 histoStrips->GetXaxis()->SetRange(bin,bin);
1347 TH2F* inputHisto = (TH2F*)histoStrips->Project3D("zy");
1348 triggerDisplay.FillDisplayHistogram(inputHisto, histoDisplayStrips, AliMUONTriggerDisplay::kDisplayStrips, iCath, iChamber, displayOption);
1350 Float_t scaleValue = 0.;
1351 if(task==AliQAv1::kRAWS) {
1352 scaleValue = ((TH1F*)GetRawsData(kTriggerScalersTime))->GetBinContent(1);
1354 else if ( task == AliQAv1::kRECPOINTS ) {
1355 Int_t ibin = GetRecPointsData(kNAnalyzedEvents)->FindBin(AliRecoParam::AConvert(fEventSpecie));
1356 scaleValue = GetRecPointsData(kNAnalyzedEvents)->GetBinContent(ibin);
1358 if(scaleValue>0.) histoDisplayStrips->Scale(1./scaleValue);
1362 if(task==AliQAv1::kRECPOINTS){
1363 TH1F* histoBoards = (TH1F*)GetRecPointsData(kTriggeredBoards);
1364 TH2F* histoDisplayBoards = (TH2F*)GetRecPointsData(kTriggerBoardsDisplay);
1365 triggerDisplay.FillDisplayHistogram(histoBoards, histoDisplayBoards, AliMUONTriggerDisplay::kDisplayBoards, 0, 0);
1366 Int_t ibin = GetRecPointsData(kNAnalyzedEvents)->FindBin(AliRecoParam::AConvert(fEventSpecie));
1367 Float_t scaleValue = GetRecPointsData(kNAnalyzedEvents)->GetBinContent(ibin);
1368 if(scaleValue>0.) histoDisplayBoards->Scale(1./scaleValue);
1373 //_____________________________________________________________________________
1375 AliMUONQADataMakerRec::FillTriggerDCSHistos()
1377 /// Get HV and currents values for one trigger chamber
1379 AliCodeTimerAuto("");
1381 AliMUONCalibrationData calibrationData(AliCDBManager::Instance()->GetRun());
1383 TMap* triggerDcsMap = calibrationData.TriggerDCS();
1385 if ( !triggerDcsMap )
1387 AliError("Cannot fill DCS histos, as triggerDcsMap is NULL");
1391 AliMpDEIterator deIt;
1395 AliMpDCSNamer triggerDcsNamer("TRIGGER");
1397 TH2* currHisto = 0x0;
1398 Int_t histoIndex = 0;
1399 TString histoName, histoTitle;
1401 Bool_t error = kFALSE;
1402 Bool_t expert = kTRUE;
1403 Bool_t saveCorr = kTRUE;
1404 Bool_t image = kTRUE;
1406 while ( !deIt.IsDone() )
1408 Int_t detElemId = deIt.CurrentDEId();
1410 if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStationTrigger) {
1412 Int_t iChamber = AliMpDEManager::GetChamberId(detElemId);
1413 Int_t slat = detElemId%100;
1415 for(Int_t iMeas=0; iMeas<AliMpDCSNamer::kNDCSMeas; iMeas++){
1416 TString currAlias = triggerDcsNamer.DCSChannelName(detElemId, 0, iMeas);
1418 AliDebug(AliQAv1::GetQADebugLevel(), Form("\nDetElemId %i dcsAlias %s", detElemId, currAlias.Data()));
1420 TPair* triggerDcsPair = static_cast<TPair*>(triggerDcsMap->FindObject(currAlias.Data()));
1422 if (!triggerDcsPair)
1424 AliError(Form("Did not find expected alias (%s) for DE %d",
1425 currAlias.Data(),detElemId));
1430 TObjArray* values = static_cast<TObjArray*>(triggerDcsPair->Value());
1433 AliError(Form("Could not get values for alias %s",currAlias.Data()));
1439 AliDCSValue* val = 0x0;
1441 Int_t ich = iChamber - AliMpConstants::NofTrackingChambers();
1444 case AliMpDCSNamer::kDCSI:
1445 histoIndex = kTriggerRPCi + ich;
1446 histoName = Form("hRPCIChamber%i", 11+ich);
1447 histoTitle = Form("Chamber %i: RPC Currents (#muA)", 11+ich);
1449 case AliMpDCSNamer::kDCSHV:
1450 histoIndex = kTriggerRPChv + ich;
1451 histoName = Form("hRPCHVChamber%i", 11+ich);
1452 histoTitle = Form("Chamber %i: RPC HV (V)", 11+ich);
1456 currHisto = (TH2F*) GetRawsData(histoIndex);
1459 Int_t npoints = values->GetEntries();
1460 TArrayF axisSlat(18+1), axisTime(npoints+1);
1461 for(Int_t islat=0; islat<=18; islat++){
1462 axisSlat[islat] = -0.5 + (Float_t)islat;
1464 for(Int_t ientry=0; ientry<npoints; ientry++){
1465 val = static_cast<AliDCSValue*>(values->At(ientry));
1466 axisTime[ientry] = val->GetTimeStamp();
1468 axisTime[npoints] = val->GetTimeStamp() + 100;
1470 currHisto = new TH2F(histoName.Data(), histoTitle.Data(),
1471 npoints, axisTime.GetArray(),
1472 18, axisSlat.GetArray());
1473 currHisto->GetXaxis()->SetTitle("Time");
1474 currHisto->GetXaxis()->SetTimeDisplay(1);
1475 //currHisto->GetXaxis()->SetTimeFormat("%d%b%y %H:%M:%S");
1476 currHisto->GetYaxis()->SetTitle("RPC");
1477 Add2RawsList(currHisto, histoIndex, !expert, image, !saveCorr);
1480 while ( ( val = static_cast<AliDCSValue*>(next()) ) )
1482 Float_t hvi = val->GetFloat();
1484 AliDebug(AliQAv1::GetQADebugLevel(), Form("Value %f", hvi));
1486 currHisto->Fill(1.0001 * val->GetTimeStamp(), slat, hvi);
1489 } // if (!triggerDcsPair)
1490 } // loop on measured types (HV and currents)
1491 } // if (stationType == kStationTrigger)
1498 //____________________________________________________________________________
1499 AliMUONVTrackerData* AliMUONQADataMakerRec::GetTrackerData() const
1501 /// Return tracker data
1503 return fTrackerDataMaker->Data();