]>
Commit | Line | Data |
---|---|---|
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" | |
32 | #include "AliMUONTrackerCalibratedDataMaker.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" |
b1341ab0 | 67 | |
68 | // --- ROOT system --- | |
69 | #include <TClonesArray.h> | |
70 | #include <TFile.h> | |
71 | #include <TH1F.h> | |
72 | #include <TH1I.h> | |
73 | #include <TH2F.h> | |
74 | #include <TH3F.h> | |
b1341ab0 | 75 | #include <Riostream.h> |
04236e67 | 76 | |
77 | //----------------------------------------------------------------------------- | |
78 | /// \class AliMUONQADataMakerRec | |
79 | /// | |
80 | /// MUON base class for quality assurance data (histo) maker | |
81 | /// | |
f587a77d | 82 | /// \author C. Finck, D. Stocco, L. Aphecetche |
04236e67 | 83 | |
84 | /// \cond CLASSIMP | |
85 | ClassImp(AliMUONQADataMakerRec) | |
86 | /// \endcond | |
87 | ||
88 | //____________________________________________________________________________ | |
b8bd1ab8 | 89 | AliMUONQADataMakerRec::AliMUONQADataMakerRec() : |
f587a77d | 90 | AliQADataMakerRec(AliQA::GetDetName(AliQA::kMUON), "MUON Quality Assurance Data Maker"), |
91 | fIsInitRaws(kFALSE), | |
92 | fIsInitRecPointsTracker(kFALSE), | |
93 | fIsInitRecPointsTrigger(kFALSE), | |
94 | fIsInitESDs(kFALSE), | |
95 | fDigitStore(0x0), | |
96 | fTriggerStore(0x0), | |
97 | fDigitMaker(0x0), | |
98 | fClusterStore(0x0), | |
b8bd1ab8 | 99 | fTrackerDataMaker(0x0) |
04236e67 | 100 | { |
101 | /// ctor | |
f587a77d | 102 | |
d874bd09 | 103 | AliDebug(1,""); |
104 | ||
f587a77d | 105 | Ctor(); |
106 | } | |
107 | ||
108 | //____________________________________________________________________________ | |
109 | void | |
110 | AliMUONQADataMakerRec::Ctor() | |
111 | { | |
112 | /// Init some members | |
113 | fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV1"); | |
114 | fDigitMaker = new AliMUONDigitMaker(kTRUE); | |
04236e67 | 115 | } |
116 | ||
117 | //____________________________________________________________________________ | |
118 | AliMUONQADataMakerRec::AliMUONQADataMakerRec(const AliMUONQADataMakerRec& qadm) : | |
f587a77d | 119 | AliQADataMakerRec(qadm), |
120 | fIsInitRaws(kFALSE), | |
121 | fIsInitRecPointsTracker(kFALSE), | |
122 | fIsInitRecPointsTrigger(kFALSE), | |
123 | fIsInitESDs(kFALSE), | |
124 | fDigitStore(0x0), | |
125 | fTriggerStore(0x0), | |
126 | fDigitMaker(0x0), | |
127 | fClusterStore(0x0), | |
128 | fTrackerDataMaker(0x0) | |
04236e67 | 129 | { |
130 | ///copy ctor | |
d874bd09 | 131 | |
132 | AliDebug(1,""); | |
133 | ||
134 | ||
04236e67 | 135 | SetName((const char*)qadm.GetName()) ; |
136 | SetTitle((const char*)qadm.GetTitle()); | |
7035694f | 137 | |
f587a77d | 138 | // Do not copy the digit store and digit maker, but create its own ones |
139 | ||
140 | Ctor(); | |
141 | ||
04236e67 | 142 | } |
143 | ||
144 | //__________________________________________________________________ | |
145 | AliMUONQADataMakerRec& AliMUONQADataMakerRec::operator = (const AliMUONQADataMakerRec& qadm ) | |
146 | { | |
7035694f | 147 | /// Assignment operator |
148 | ||
d874bd09 | 149 | AliDebug(1,""); |
150 | ||
7035694f | 151 | // check assignment to self |
152 | if (this == &qadm) return *this; | |
153 | ||
154 | this->~AliMUONQADataMakerRec(); | |
155 | new(this) AliMUONQADataMakerRec(qadm); | |
156 | return *this; | |
04236e67 | 157 | } |
158 | ||
159 | //__________________________________________________________________ | |
160 | AliMUONQADataMakerRec::~AliMUONQADataMakerRec() | |
161 | { | |
162 | /// dtor | |
f587a77d | 163 | |
d874bd09 | 164 | AliDebug(1,""); |
165 | ||
f587a77d | 166 | AliCodeTimerAuto(""); |
167 | ||
168 | delete fDigitStore; | |
169 | delete fTriggerStore; | |
170 | delete fDigitMaker; | |
c92a8c85 | 171 | delete fClusterStore; |
172 | delete fTrackerDataMaker; | |
04236e67 | 173 | } |
174 | ||
175 | //____________________________________________________________________________ | |
57acd2d2 | 176 | void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray** list) |
04236e67 | 177 | { |
c92a8c85 | 178 | ///Detector specific actions at end of cycle |
179 | ||
5bb54f70 | 180 | AliCodeTimerAuto(""); |
181 | ||
c92a8c85 | 182 | // Display trigger histos in a more user friendly way |
183 | DisplayTriggerInfo(task); | |
184 | ||
57acd2d2 | 185 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { |
186 | SetEventSpecie(specie) ; | |
187 | if ( task == AliQA::kRAWS && fTrackerDataMaker ) | |
5bb54f70 | 188 | { |
57acd2d2 | 189 | TIter next(list[specie]); |
190 | TObject* o; | |
191 | Bool_t alreadyThere(kFALSE); | |
192 | while ( ( o = next() ) && !alreadyThere ) | |
193 | { | |
194 | TString classname(o->ClassName()); | |
195 | if ( classname.Contains("TrackerData") ) alreadyThere = kTRUE; | |
196 | } | |
197 | if (!alreadyThere && fTrackerDataMaker) | |
198 | { | |
199 | AliInfo("Adding fTrackerDataMaker to the list of qa objects"); | |
200 | list[specie]->AddAt(fTrackerDataMaker->Data(),(Int_t)kTrackerData); | |
201 | } | |
202 | if ( fTrackerDataMaker ) | |
203 | { | |
204 | TH1* hbp = GetRawsData(kTrackerBusPatchOccupancy); | |
205 | hbp->Reset(); | |
206 | TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator()); | |
207 | AliMpBusPatch* bp(0x0); | |
208 | AliMUONVTrackerData* data = fTrackerDataMaker->Data(); | |
209 | Int_t occDim = 2; | |
210 | ||
211 | while ( ( bp = static_cast<AliMpBusPatch*>(nextBP())) ) | |
212 | { | |
213 | Int_t busPatchId = bp->GetId(); | |
214 | Int_t bin = hbp->FindBin(busPatchId); | |
215 | hbp->SetBinContent(bin,data->BusPatch(busPatchId,occDim)); | |
216 | } | |
217 | } | |
5bb54f70 | 218 | } |
c92a8c85 | 219 | |
57acd2d2 | 220 | if ( task == AliQA::kESDS ) { |
221 | // Normalize ESD histos | |
222 | TH1* h; | |
223 | Int_t bin; | |
224 | AliMpDEIterator it; | |
225 | it.First(); | |
226 | while ( !it.IsDone()) { | |
c92a8c85 | 227 | |
57acd2d2 | 228 | Int_t detElemId = it.CurrentDEId(); |
c92a8c85 | 229 | |
57acd2d2 | 230 | if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger ) { |
c92a8c85 | 231 | |
57acd2d2 | 232 | h = GetESDsData(kESDnClustersPerDE); |
233 | Double_t nClusters = h->GetBinContent(h->GetXaxis()->FindFixBin((Double_t)detElemId)); | |
c92a8c85 | 234 | |
435844ac | 235 | if (nClusters > 0) { |
f587a77d | 236 | |
57acd2d2 | 237 | h = GetESDsData(kESDClusterChargePerDE); |
238 | bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); | |
435844ac | 239 | h->SetBinContent(bin, h->GetBinContent(bin)/nClusters); |
f587a77d | 240 | |
57acd2d2 | 241 | h = GetESDsData(kESDClusterMultPerDE); |
242 | bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); | |
435844ac | 243 | h->SetBinContent(bin, h->GetBinContent(bin)/nClusters); |
c92a8c85 | 244 | |
57acd2d2 | 245 | h = GetESDsData(kESDResidualXPerDEMean); |
246 | bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); | |
247 | Double_t meanResX = h->GetBinContent(bin)/nClusters; | |
435844ac | 248 | h->SetBinContent(bin, meanResX); |
f587a77d | 249 | |
57acd2d2 | 250 | h = GetESDsData(kESDResidualYPerDEMean); |
251 | bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); | |
252 | Double_t meanResY = h->GetBinContent(bin)/nClusters; | |
435844ac | 253 | h->SetBinContent(bin, meanResY); |
c92a8c85 | 254 | |
57acd2d2 | 255 | h = GetESDsData(kESDResidualXPerDESigma); |
256 | bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); | |
257 | if (nClusters > 1) h->SetBinContent(bin, TMath::Sqrt(h->GetBinContent(bin)/nClusters - meanResX*meanResX)); | |
258 | else h->SetBinContent(bin, 0.); | |
c92a8c85 | 259 | |
57acd2d2 | 260 | h = GetESDsData(kESDResidualYPerDESigma); |
261 | bin = h->GetXaxis()->FindFixBin((Double_t)detElemId); | |
262 | if (nClusters > 1) h->SetBinContent(bin, TMath::Sqrt(h->GetBinContent(bin)/nClusters - meanResY*meanResY)); | |
263 | else h->SetBinContent(bin, 0.); | |
435844ac | 264 | } |
c92a8c85 | 265 | |
435844ac | 266 | } |
c92a8c85 | 267 | |
435844ac | 268 | it.Next(); |
269 | } | |
c92a8c85 | 270 | |
435844ac | 271 | Double_t nTracks = GetESDsData(kESDnClustersPerTrack)->GetEntries(); |
272 | if (nTracks > 0) { | |
273 | GetESDsData(kESDnClustersPerCh)->Scale(1./nTracks); | |
274 | GetESDsData(kESDnClustersPerDE)->Scale(1./nTracks); | |
275 | } | |
c92a8c85 | 276 | } |
57acd2d2 | 277 | } |
c92a8c85 | 278 | // do the QA checking |
279 | AliQAChecker::Instance()->Run(AliQA::kMUON, task, list) ; | |
04236e67 | 280 | } |
281 | ||
282 | //____________________________________________________________________________ | |
283 | void AliMUONQADataMakerRec::InitRaws() | |
284 | { | |
285 | /// create Raws histograms in Raws subdir | |
f587a77d | 286 | |
5bb54f70 | 287 | AliCodeTimerAuto(""); |
288 | ||
289 | Bool_t forExpert(kTRUE); | |
290 | ||
f587a77d | 291 | if ( ! AliCDBManager::Instance()->GetDefaultStorage() ) |
292 | { | |
293 | AliError("CDB default storage not set. Cannot work."); | |
294 | fIsInitRaws=kFALSE; | |
295 | } | |
296 | ||
297 | TH3F* h3 = new TH3F("hTriggerScalersBendPlane", "Trigger scalers in bending plane", | |
298 | 4, 10.5, 14.5, | |
299 | 234, 0.5, 234.5, | |
300 | 16, -0.5, 15.5); | |
301 | h3->GetXaxis()->SetTitle("Chamber"); | |
302 | h3->GetYaxis()->SetTitle("Board"); | |
303 | h3->GetZaxis()->SetTitle("Strip"); | |
5bb54f70 | 304 | Add2RawsList(h3, kTriggerScalersBP,forExpert); |
f587a77d | 305 | |
306 | TH3F* h4 = new TH3F("hTriggerScalersNonBendPlane", "Trigger scalers in non-bending plane", | |
307 | 4, 10.5, 14.5, | |
308 | 234, 0.5, 234.5, | |
309 | 16, -0.5, 15.5); | |
310 | h4->GetXaxis()->SetTitle("Chamber"); | |
311 | h4->GetYaxis()->SetTitle("Board"); | |
312 | h4->GetZaxis()->SetTitle("Strip"); | |
5bb54f70 | 313 | Add2RawsList(h4, kTriggerScalersNBP,forExpert); |
f587a77d | 314 | |
315 | AliMUONTriggerDisplay triggerDisplay; | |
316 | TString histoName, histoTitle; | |
317 | for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){ | |
318 | TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane"; | |
319 | for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){ | |
320 | histoName = Form("hScalers%sChamber%i", cathName.Data(), 11+iChamber); | |
321 | histoTitle = Form("Chamber %i: Scalers %s", 11+iChamber, cathName.Data()); | |
322 | TH2F* h5 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips, | |
c92a8c85 | 323 | iCath, iChamber, histoTitle); |
49e110ec | 324 | Add2RawsList(h5, kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber,!forExpert); |
f587a77d | 325 | } |
326 | } | |
49e110ec | 327 | |
328 | TH2F* h6 = new TH2F("hTriggerRPCI", "Trigger RPC currents", | |
329 | 4, 10.5, 14.5, | |
330 | 18, -0.5, 17.5); | |
331 | h6->GetXaxis()->SetTitle("Chamber"); | |
332 | h6->GetYaxis()->SetTitle("RPC"); | |
333 | Add2RawsList(h6, kTriggerRPCi, forExpert); | |
334 | ||
335 | TH2F* h7 = new TH2F("hTriggerRPCHV", "Trigger RPC HV", | |
336 | 4, 10.5, 14.5, | |
337 | 18, -0.5, 17.5); | |
338 | h7->GetXaxis()->SetTitle("Chamber"); | |
339 | h7->GetYaxis()->SetTitle("RPC"); | |
340 | Add2RawsList(h7, kTriggerRPChv, forExpert); | |
341 | ||
342 | for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){ | |
343 | histoName = Form("hRPCIChamber%i", 11+iChamber); | |
344 | histoTitle = Form("Chamber %i: RPC Currents (#muA)", 11+iChamber); | |
345 | TH2F* h8 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplaySlats, | |
346 | 0, iChamber, histoTitle); | |
347 | Add2RawsList(h8, kTriggerIDisplay + iChamber, !forExpert); | |
348 | } | |
349 | ||
350 | for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){ | |
351 | histoName = Form("hRPCHVChamber%i", 11+iChamber); | |
352 | histoTitle = Form("Chamber %i: RPC HV (V)", 11+iChamber); | |
353 | TH2F* h9 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplaySlats, | |
354 | 0, iChamber, histoTitle); | |
355 | Add2RawsList(h9, kTriggerHVDisplay + iChamber, !forExpert); | |
356 | } | |
357 | ||
f587a77d | 358 | |
5bb54f70 | 359 | Int_t nbp(0); |
360 | TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator()); | |
361 | while (next()) | |
362 | { | |
363 | ++nbp; | |
364 | } | |
365 | ||
366 | TH1* hbp = new TH1F("hTrackerBusPatchOccupancy","Occupancy of bus patches", | |
367 | nbp,-0.5,nbp-0.5); | |
368 | ||
369 | Add2RawsList(hbp,kTrackerBusPatchOccupancy,!forExpert); | |
370 | ||
f587a77d | 371 | fIsInitRaws = kTRUE; |
372 | } | |
04236e67 | 373 | |
f587a77d | 374 | //____________________________________________________________________________ |
375 | void AliMUONQADataMakerRec::InitRecPoints() | |
376 | { | |
377 | /// create Reconstructed Points histograms in RecPoints subdir | |
5bb54f70 | 378 | |
379 | AliCodeTimerAuto(""); | |
380 | ||
f587a77d | 381 | InitRecPointsTrigger(); |
382 | InitRecPointsTracker(); | |
383 | } | |
384 | ||
385 | //____________________________________________________________________________ | |
386 | void AliMUONQADataMakerRec::InitRecPointsTracker() | |
387 | { | |
388 | /// create Reconstructed Points histograms in RecPoints subdir for the | |
389 | /// MUON tracker subsystem. | |
390 | ||
5bb54f70 | 391 | AliCodeTimerAuto(""); |
392 | ||
393 | Bool_t forExpert(kTRUE); | |
394 | ||
f587a77d | 395 | AliMpDEIterator it; |
396 | ||
397 | it.First(); | |
398 | ||
399 | Int_t ndes(0); | |
400 | ||
401 | while ( !it.IsDone()) | |
402 | { | |
403 | Int_t detElemId = it.CurrentDEId(); | |
1c66abf3 | 404 | |
f587a77d | 405 | it.Next(); |
04236e67 | 406 | |
f587a77d | 407 | if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger ) |
408 | { | |
409 | ndes = TMath::Max(ndes,detElemId); | |
2346e1ad | 410 | |
f587a77d | 411 | TH1* h = new TH1I(Form("hTrackerClusterMultiplicityForDE%04d",detElemId), |
c92a8c85 | 412 | Form("Multiplicity of the clusters in detection element %d",detElemId), |
413 | 100,0,100); | |
f587a77d | 414 | |
415 | h->GetXaxis()->SetTitle("Detection Element Id"); | |
416 | ||
5bb54f70 | 417 | Add2RecPointsList(h,kTrackerClusterMultiplicityPerDE+detElemId,forExpert); |
f587a77d | 418 | |
419 | h = new TH1I(Form("hTrackerClusterChargeForDE%04d",detElemId), | |
c92a8c85 | 420 | Form("Charge of the clusters in detection element %d",detElemId), |
421 | 100,0,1000); | |
2346e1ad | 422 | |
f587a77d | 423 | h->GetXaxis()->SetTitle("Detection Element Id"); |
424 | ||
5bb54f70 | 425 | Add2RecPointsList(h,kTrackerClusterChargePerDE+detElemId,forExpert); |
f587a77d | 426 | |
427 | } | |
428 | ||
429 | } | |
430 | ||
431 | TH1* h = new TH1I("hTrackerNumberOfClustersPerDE","Number of clusters per detection element", | |
5bb54f70 | 432 | ndes, 0.5, ndes + 0.5); |
f587a77d | 433 | |
434 | h->GetXaxis()->SetTitle("Detection Element Id"); | |
435 | ||
5bb54f70 | 436 | Add2RecPointsList(h, kTrackerNumberOfClustersPerDE,!forExpert); |
f587a77d | 437 | |
438 | for ( Int_t i = 0; i < AliMpConstants::NofTrackingChambers(); ++i ) | |
439 | { | |
c92a8c85 | 440 | TH1* h1 = new TH1I("hTrackerNumberOfClustersPerChamber","Number of clusters per chamber", |
441 | AliMpConstants::NofTrackingChambers(),-0.5,AliMpConstants::NofTrackingChambers()-0.5); | |
5bb54f70 | 442 | Add2RecPointsList(h1,kTrackerNumberOfClustersPerChamber,forExpert); |
f587a77d | 443 | h1 = new TH1I(Form("hTrackerClusterMultiplicityForChamber%d",i), |
c92a8c85 | 444 | Form("Cluster multiplicity for chamber %d",i), |
445 | 100,0,100); | |
5bb54f70 | 446 | Add2RecPointsList(h1,kTrackerClusterMultiplicityPerChamber+i,forExpert); |
f587a77d | 447 | h1 = new TH1I(Form("hTrackerClusterChargeForChamber%d",i), |
c92a8c85 | 448 | Form("Cluster charge for chamber %d",i), |
449 | 100,0,1000); | |
5bb54f70 | 450 | Add2RecPointsList(h1,kTrackerClusterChargePerChamber+i,forExpert); |
f587a77d | 451 | } |
452 | ||
453 | fIsInitRecPointsTracker=kTRUE; | |
04236e67 | 454 | } |
455 | ||
456 | //____________________________________________________________________________ | |
f587a77d | 457 | void AliMUONQADataMakerRec::InitRecPointsTrigger() |
04236e67 | 458 | { |
f587a77d | 459 | /// create Reconstructed Points histograms in RecPoints subdir for the |
460 | /// MUON Trigger subsystem. | |
461 | ||
5bb54f70 | 462 | Bool_t forExpert(kTRUE); |
463 | ||
2346e1ad | 464 | TH3F* h0 = new TH3F("hTriggerDigitsBendPlane", "Trigger digits in bending plane", |
465 | 4, 10.5, 14.5, | |
466 | 234, 0.5, 234.5, | |
467 | 16, -0.5, 15.5); | |
468 | h0->GetXaxis()->SetTitle("Chamber"); | |
469 | h0->GetYaxis()->SetTitle("Board"); | |
470 | h0->GetZaxis()->SetTitle("Strip"); | |
5bb54f70 | 471 | Add2RecPointsList(h0, kTriggerDigitsBendPlane,forExpert); |
2346e1ad | 472 | |
473 | TH3F* h1 = new TH3F("hTriggerDigitsNonBendPlane", "Trigger digits in non-bending plane", | |
474 | 4, 10.5, 14.5, | |
475 | 234, 0.5, 234.5, | |
476 | 16, -0.5, 15.5); | |
477 | h1->GetXaxis()->SetTitle("Chamber"); | |
478 | h1->GetYaxis()->SetTitle("Board"); | |
479 | h1->GetZaxis()->SetTitle("Strip"); | |
5bb54f70 | 480 | Add2RecPointsList(h1, kTriggerDigitsNonBendPlane,forExpert); |
2346e1ad | 481 | |
482 | TH1F* h2 = new TH1F("hTriggeredBoards", "Triggered boards", 234, 0.5, 234.5); | |
5bb54f70 | 483 | Add2RecPointsList(h2, kTriggeredBoards,forExpert); |
2346e1ad | 484 | |
aef183f7 | 485 | AliMUONTriggerDisplay triggerDisplay; |
486 | TString histoName, histoTitle; | |
487 | for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){ | |
488 | TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane"; | |
489 | for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){ | |
490 | histoName = Form("hTriggerDigits%sChamber%i", cathName.Data(), 11+iChamber); | |
491 | histoTitle = Form("Chamber %i: Fired pads %s", 11+iChamber, cathName.Data()); | |
492 | TH2F* h3 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips, | |
493 | iCath, iChamber, histoTitle); | |
49e110ec | 494 | Add2RecPointsList(h3, kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber,!forExpert); |
aef183f7 | 495 | } |
496 | } | |
497 | ||
498 | TH2F* h4 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto("hFiredBoardsDisplay", AliMUONTriggerDisplay::kDisplayBoards, | |
499 | 0, 0, "Fired boards"); | |
49e110ec | 500 | Add2RecPointsList(h4, kTriggerBoardsDisplay,!forExpert); |
f587a77d | 501 | |
502 | fIsInitRecPointsTrigger = kTRUE; | |
04236e67 | 503 | } |
504 | ||
505 | ||
506 | //____________________________________________________________________________ | |
507 | void AliMUONQADataMakerRec::InitESDs() | |
508 | { | |
c92a8c85 | 509 | ///create ESDs histograms in ESDs subdir |
5bb54f70 | 510 | |
511 | Bool_t forExpert(kTRUE); | |
512 | ||
c92a8c85 | 513 | Int_t nCh = AliMUONConstants::NTrackingCh(); |
514 | Int_t nDE = 1100; | |
515 | ||
516 | // track info | |
517 | TH1F* hESDnTracks = new TH1F("hESDnTracks", "number of tracks", 20, 0., 20.); | |
5bb54f70 | 518 | Add2ESDsList(hESDnTracks, kESDnTracks,!forExpert); |
04236e67 | 519 | |
c92a8c85 | 520 | TH1F* hESDMatchTrig = new TH1F("hESDMatchTrig", "number of tracks matched with trigger", 20, 0., 20.); |
5bb54f70 | 521 | Add2ESDsList(hESDMatchTrig, kESDMatchTrig,!forExpert); |
c92a8c85 | 522 | |
523 | TH1F* hESDMomentum = new TH1F("hESDMomentum", "P distribution", 300, 0., 300); | |
5bb54f70 | 524 | Add2ESDsList(hESDMomentum, kESDMomentum,forExpert); |
04236e67 | 525 | |
c92a8c85 | 526 | TH1F* hESDPt = new TH1F("hESDPt", "Pt distribution", 200, 0., 50); |
5bb54f70 | 527 | Add2ESDsList(hESDPt, kESDPt,forExpert); |
04236e67 | 528 | |
c92a8c85 | 529 | TH1F* hESDRapidity = new TH1F("hESDRapidity", "rapidity distribution", 200, -4.5, -2.); |
5bb54f70 | 530 | Add2ESDsList(hESDRapidity, kESDRapidity,forExpert); |
b62881f2 | 531 | |
c92a8c85 | 532 | TH1F* hESDChi2 = new TH1F("hESDChi2", "normalized chi2 distribution", 500, 0., 50.); |
5bb54f70 | 533 | Add2ESDsList(hESDChi2, kESDChi2,forExpert); |
c92a8c85 | 534 | |
535 | // cluster info | |
536 | for (Int_t i = 0; i < nCh; i++) { | |
537 | Float_t rMax = AliMUONConstants::Rmax(i/2); | |
538 | TH2F* hESDClusterHitMap = new TH2F(Form("hESDClusterHitMap%d",i+1), Form("cluster position distribution in chamber %d",i+1), | |
539 | 100, -rMax, rMax, 100, -rMax, rMax); | |
5bb54f70 | 540 | Add2ESDsList(hESDClusterHitMap, kESDClusterHitMap+i,forExpert); |
c92a8c85 | 541 | } |
542 | ||
543 | TH1F* hESDnClustersPerTrack = new TH1F("hESDnClustersPerTrack", "number of clusters per track", 20, 0., 20.); | |
5bb54f70 | 544 | Add2ESDsList(hESDnClustersPerTrack, kESDnClustersPerTrack,!forExpert); |
c92a8c85 | 545 | |
546 | TH1F* hESDnClustersPerCh = new TH1F("hESDnClustersPerCh", "number of clusters per chamber per track;chamber ID", nCh, 0, nCh); | |
547 | hESDnClustersPerCh->SetFillColor(kRed); | |
5bb54f70 | 548 | Add2ESDsList(hESDnClustersPerCh, kESDnClustersPerCh,forExpert); |
c92a8c85 | 549 | |
550 | TH1F* hESDnClustersPerDE = new TH1F("hESDnClustersPerDE", "number of clusters per DE per track;DetElem ID", nDE, 0, nDE); | |
551 | hESDnClustersPerDE->SetFillColor(kRed); | |
5bb54f70 | 552 | Add2ESDsList(hESDnClustersPerDE, kESDnClustersPerDE,forExpert); |
c92a8c85 | 553 | |
554 | TH1F* hESDClusterCharge = new TH1F("hESDClusterCharge", "cluster charge distribution", 500, 0., 5000.); | |
5bb54f70 | 555 | Add2ESDsList(hESDClusterCharge, kESDClusterCharge,forExpert); |
c92a8c85 | 556 | |
557 | for (Int_t i = 0; i < nCh; i++) { | |
558 | TH1F* hESDClusterChargeInCh = new TH1F(Form("hESDClusterChargeInCh%d",i+1), Form("cluster charge distribution in chamber %d",i+1), 500, 0., 5000.); | |
5bb54f70 | 559 | Add2ESDsList(hESDClusterChargeInCh, kESDClusterChargeInCh+i,forExpert); |
c92a8c85 | 560 | } |
561 | ||
562 | TH1F* hESDClusterChargePerDE = new TH1F("hESDClusterChargePerDE", "cluster mean charge per DE;DetElem ID", nDE, 0, nDE); | |
563 | hESDClusterChargePerDE->SetOption("P"); | |
564 | hESDClusterChargePerDE->SetMarkerStyle(kFullDotMedium); | |
565 | hESDClusterChargePerDE->SetMarkerColor(kRed); | |
5bb54f70 | 566 | Add2ESDsList(hESDClusterChargePerDE, kESDClusterChargePerDE,forExpert); |
c92a8c85 | 567 | |
568 | TH1F* hESDClusterMult = new TH1F("hESDClusterMult", "cluster multiplicity distribution", 200, 0., 200.); | |
5bb54f70 | 569 | Add2ESDsList(hESDClusterMult, kESDClusterMult,forExpert); |
c92a8c85 | 570 | |
571 | for (Int_t i = 0; i < nCh; i++) { | |
572 | TH1F* hESDClusterMultInCh = new TH1F(Form("hESDClusterMultInCh%d",i+1), Form("cluster multiplicity distribution in chamber %d",i+1), 200, 0., 200.); | |
5bb54f70 | 573 | Add2ESDsList(hESDClusterMultInCh, kESDClusterMultInCh+i,forExpert); |
b62881f2 | 574 | } |
b1341ab0 | 575 | |
c92a8c85 | 576 | TH1F* hESDClusterMultPerDE = new TH1F("hESDClusterMultPerDE", "cluster mean multiplicity per DE;DetElem ID", nDE, 0, nDE); |
577 | hESDClusterMultPerDE->SetOption("P"); | |
578 | hESDClusterMultPerDE->SetMarkerStyle(kFullDotMedium); | |
579 | hESDClusterMultPerDE->SetMarkerColor(kRed); | |
5bb54f70 | 580 | Add2ESDsList(hESDClusterMultPerDE, kESDClusterMultPerDE,forExpert); |
c92a8c85 | 581 | |
582 | // cluster - track info | |
583 | TH1F* hESDResidualX = new TH1F("hESDResidualX", "cluster-track residual-X distribution", 1000, -5., 5.); | |
5bb54f70 | 584 | Add2ESDsList(hESDResidualX, kESDResidualX,forExpert); |
c92a8c85 | 585 | |
586 | TH1F* hESDResidualY = new TH1F("hESDResidualY", "cluster-track residual-Y distribution", 1000, -1., 1.); | |
5bb54f70 | 587 | Add2ESDsList(hESDResidualY, kESDResidualY,forExpert); |
c92a8c85 | 588 | |
589 | for (Int_t i = 0; i < nCh; i++) { | |
590 | TH1F* hESDResidualXInCh = new TH1F(Form("hESDResidualXInCh%d",i+1), Form("cluster-track residual-X distribution in chamber %d",i+1), 1000, -5., 5.); | |
5bb54f70 | 591 | Add2ESDsList(hESDResidualXInCh, kESDResidualXInCh+i,forExpert); |
c92a8c85 | 592 | |
593 | TH1F* hESDResidualYInCh = new TH1F(Form("hESDResidualYInCh%d",i+1), Form("cluster-track residual-Y distribution in chamber %d",i+1), 1000, -1., 1.); | |
5bb54f70 | 594 | Add2ESDsList(hESDResidualYInCh, kESDResidualYInCh+i,forExpert); |
c92a8c85 | 595 | } |
596 | ||
597 | TH1F* hESDResidualXPerDEMean = new TH1F("hESDResidualXPerDEMean", "cluster-track residual-X per DE: mean;DetElem ID", nDE, 0, nDE); | |
598 | hESDResidualXPerDEMean->SetOption("P"); | |
599 | hESDResidualXPerDEMean->SetMarkerStyle(kFullDotMedium); | |
600 | hESDResidualXPerDEMean->SetMarkerColor(kRed); | |
5bb54f70 | 601 | Add2ESDsList(hESDResidualXPerDEMean, kESDResidualXPerDEMean,forExpert); |
c92a8c85 | 602 | |
603 | TH1F* hESDResidualYPerDEMean = new TH1F("hESDResidualYPerDEMean", "cluster-track residual-Y per DE: mean;DetElem ID", nDE, 0, nDE); | |
604 | hESDResidualYPerDEMean->SetOption("P"); | |
605 | hESDResidualYPerDEMean->SetMarkerStyle(kFullDotMedium); | |
606 | hESDResidualYPerDEMean->SetMarkerColor(kRed); | |
5bb54f70 | 607 | Add2ESDsList(hESDResidualYPerDEMean, kESDResidualYPerDEMean,forExpert); |
c92a8c85 | 608 | |
609 | TH1F* hESDResidualXPerDESigma = new TH1F("hESDResidualXPerDESigma", "cluster-track residual-X per DE: sigma;DetElem ID", nDE, 0, nDE); | |
610 | hESDResidualXPerDESigma->SetOption("P"); | |
611 | hESDResidualXPerDESigma->SetMarkerStyle(kFullDotMedium); | |
612 | hESDResidualXPerDESigma->SetMarkerColor(kRed); | |
5bb54f70 | 613 | Add2ESDsList(hESDResidualXPerDESigma, kESDResidualXPerDESigma,forExpert); |
c92a8c85 | 614 | |
615 | TH1F* hESDResidualYPerDESigma = new TH1F("hESDResidualYPerDESigma", "cluster-track residual-Y per DE: sigma;DetElem ID", nDE, 0, nDE); | |
616 | hESDResidualYPerDESigma->SetOption("P"); | |
617 | hESDResidualYPerDESigma->SetMarkerStyle(kFullDotMedium); | |
618 | hESDResidualYPerDESigma->SetMarkerColor(kRed); | |
5bb54f70 | 619 | Add2ESDsList(hESDResidualYPerDESigma, kESDResidualYPerDESigma,forExpert); |
c92a8c85 | 620 | |
b1341ab0 | 621 | fIsInitESDs = kTRUE; |
04236e67 | 622 | } |
623 | ||
624 | //____________________________________________________________________________ | |
625 | void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader) | |
626 | { | |
627 | /// make QA for rawdata | |
b1341ab0 | 628 | |
629 | if ( ! fIsInitRaws ) { | |
630 | AliWarningStream() | |
631 | << "Skipping function due to a failure in Init" << endl; | |
632 | return; | |
633 | } | |
634 | ||
f587a77d | 635 | if ( rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent ) |
636 | { | |
04236e67 | 637 | rawReader->Reset(); |
f587a77d | 638 | MakeRawsTracker(rawReader); |
639 | } | |
04236e67 | 640 | |
f587a77d | 641 | rawReader->Reset(); |
642 | MakeRawsTrigger(rawReader); | |
643 | } | |
2346e1ad | 644 | |
f587a77d | 645 | //____________________________________________________________________________ |
646 | void AliMUONQADataMakerRec::MakeRawsTracker(AliRawReader* rawReader) | |
647 | { | |
648 | /// make QA for rawdata tracker | |
649 | ||
650 | if (!fTrackerDataMaker) | |
651 | { | |
652 | const Bool_t histogram(kFALSE); | |
653 | const Bool_t fastDecoder(kTRUE); | |
654 | ||
655 | // fTrackerDataMaker = new AliMUONTrackerRawDataMaker(rawReader,histogram,fastDecoder,takeRawReaderOwnership); | |
656 | ||
a0dc65b4 | 657 | fTrackerDataMaker = new AliMUONTrackerCalibratedDataMaker(GetRecoParam(), |
c92a8c85 | 658 | AliCDBManager::Instance()->GetRun(), |
659 | rawReader, | |
660 | AliCDBManager::Instance()->GetDefaultStorage()->GetURI(), | |
661 | "NOGAIN", | |
662 | histogram, | |
663 | 0.0,0.0, | |
664 | fastDecoder); | |
f587a77d | 665 | |
666 | fTrackerDataMaker->Data()->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level | |
667 | ||
668 | fTrackerDataMaker->SetRunning(kTRUE); | |
669 | } | |
670 | ||
671 | ((AliMUONTrackerCalibratedDataMaker*)fTrackerDataMaker)->SetRawReader(rawReader); | |
672 | ||
673 | fTrackerDataMaker->ProcessEvent(); | |
674 | } | |
2346e1ad | 675 | |
f587a77d | 676 | //____________________________________________________________________________ |
677 | void AliMUONQADataMakerRec::MakeRawsTrigger(AliRawReader* rawReader) | |
678 | { | |
679 | /// make QA for rawdata trigger | |
680 | ||
2346e1ad | 681 | // Get trigger scalers |
682 | ||
683 | Int_t loCircuit=0; | |
684 | AliMpCDB::LoadDDLStore(); | |
685 | ||
686 | AliMUONRawStreamTrigger rawStreamTrig(rawReader); | |
687 | while (rawStreamTrig.NextDDL()) | |
688 | { | |
689 | // If not a scaler event, do nothing | |
690 | Bool_t scalerEvent = rawReader->GetDataHeader()->GetL1TriggerMessage() & 0x1; | |
d72d7b9e | 691 | if(!scalerEvent) break; |
2346e1ad | 692 | |
693 | AliMUONDDLTrigger* ddlTrigger = rawStreamTrig.GetDDLTrigger(); | |
694 | AliMUONDarcHeader* darcHeader = ddlTrigger->GetDarcHeader(); | |
695 | ||
696 | Int_t nReg = darcHeader->GetRegHeaderEntries(); | |
697 | ||
698 | for(Int_t iReg = 0; iReg < nReg ;iReg++) | |
699 | { //reg loop | |
700 | ||
701 | // crate info | |
702 | AliMpTriggerCrate* crate = AliMpDDLStore::Instance()-> | |
703 | GetTriggerCrate(rawStreamTrig.GetDDL(), iReg); | |
704 | ||
705 | AliMUONRegHeader* regHeader = darcHeader->GetRegHeaderEntry(iReg); | |
706 | ||
707 | // loop over local structures | |
708 | Int_t nLocal = regHeader->GetLocalEntries(); | |
709 | for(Int_t iLocal = 0; iLocal < nLocal; iLocal++) | |
710 | { | |
711 | AliMUONLocalStruct* localStruct = regHeader->GetLocalEntry(iLocal); | |
712 | ||
713 | // if card exist | |
714 | if (!localStruct) continue; | |
715 | ||
716 | loCircuit = crate->GetLocalBoardId(localStruct->GetId()); | |
717 | ||
718 | if ( !loCircuit ) continue; // empty slot | |
719 | ||
720 | AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit, false); | |
721 | ||
722 | // skip copy cards | |
723 | if( !localBoard->IsNotified()) | |
724 | continue; | |
725 | ||
726 | Int_t cathode = localStruct->GetComptXY()%2; | |
727 | ||
728 | ERaw hindex = (cathode==0) ? kTriggerScalersBP : kTriggerScalersNBP; | |
729 | ||
730 | // loop over strips | |
731 | for (Int_t ibitxy = 0; ibitxy < 16; ++ibitxy) { | |
732 | if(localStruct->GetXY1(ibitxy) > 0) | |
733 | ((TH3F*)GetRawsData(hindex))->Fill(11+0, loCircuit, ibitxy, 2*localStruct->GetXY1(ibitxy)); | |
734 | if(localStruct->GetXY2(ibitxy) > 0) | |
735 | ((TH3F*)GetRawsData(hindex))->Fill(11+1, loCircuit, ibitxy, 2*localStruct->GetXY2(ibitxy)); | |
736 | if(localStruct->GetXY3(ibitxy) > 0) | |
737 | ((TH3F*)GetRawsData(hindex))->Fill(11+2, loCircuit, ibitxy, 2*localStruct->GetXY3(ibitxy)); | |
738 | if(localStruct->GetXY4(ibitxy) > 0) | |
739 | ((TH3F*)GetRawsData(hindex))->Fill(11+3, loCircuit, ibitxy, 2*localStruct->GetXY4(ibitxy)); | |
740 | } // loop on strips | |
741 | } // iLocal | |
742 | } // iReg | |
743 | } // NextDDL | |
04236e67 | 744 | } |
745 | ||
746 | //____________________________________________________________________________ | |
747 | void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree) | |
748 | { | |
f587a77d | 749 | /// Fill histograms from treeR |
750 | ||
751 | if (fIsInitRecPointsTracker) MakeRecPointsTracker(clustersTree); | |
752 | if (fIsInitRecPointsTrigger) MakeRecPointsTrigger(clustersTree); | |
753 | } | |
754 | ||
755 | //____________________________________________________________________________ | |
756 | void AliMUONQADataMakerRec::MakeRecPointsTracker(TTree* clustersTree) | |
757 | { | |
758 | /// Fill histograms related to tracker clusters | |
759 | ||
760 | // First things first : do we have clusters in the TreeR ? | |
761 | // In "normal" production mode, it should be perfectly normal | |
762 | // *not* to have them. | |
763 | // But if for some reason we de-activated the combined tracking, | |
764 | // then we have clusters in TreeR, so let's take that opportunity | |
765 | // to QA them... | |
766 | ||
767 | if (!fClusterStore) | |
768 | { | |
769 | AliCodeTimerAuto("ClusterStore creation"); | |
770 | fClusterStore = AliMUONVClusterStore::Create(*clustersTree); | |
771 | if (!fClusterStore) | |
772 | { | |
773 | fIsInitRecPointsTracker = kFALSE; | |
774 | return; | |
775 | } | |
776 | } | |
777 | ||
778 | AliCodeTimerAuto(""); | |
779 | ||
780 | fClusterStore->Connect(*clustersTree,kFALSE); | |
781 | clustersTree->GetEvent(0); | |
782 | ||
783 | TIter next(fClusterStore->CreateIterator()); | |
784 | AliMUONVCluster* cluster; | |
785 | ||
786 | while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) ) | |
787 | { | |
788 | Int_t detElemId = cluster->GetDetElemId(); | |
789 | Int_t chamberId = AliMpDEManager::GetChamberId(detElemId); | |
790 | ||
791 | GetRecPointsData(kTrackerNumberOfClustersPerDE)->Fill(detElemId); | |
792 | GetRecPointsData(kTrackerClusterChargePerDE+detElemId)->Fill(cluster->GetCharge()); | |
793 | GetRecPointsData(kTrackerClusterMultiplicityPerDE+detElemId)->Fill(cluster->GetNDigits()); | |
b1341ab0 | 794 | |
f587a77d | 795 | GetRecPointsData(kTrackerNumberOfClustersPerChamber)->Fill(chamberId); |
796 | GetRecPointsData(kTrackerClusterChargePerChamber+chamberId)->Fill(cluster->GetCharge()); | |
797 | GetRecPointsData(kTrackerClusterMultiplicityPerChamber+chamberId)->Fill(cluster->GetNDigits()); | |
798 | ||
799 | } | |
800 | ||
801 | fClusterStore->Clear(); | |
802 | } | |
803 | ||
804 | //____________________________________________________________________________ | |
805 | void AliMUONQADataMakerRec::MakeRecPointsTrigger(TTree* clustersTree) | |
806 | { | |
807 | /// makes data from trigger response | |
808 | ||
7035694f | 809 | // Fired pads info |
810 | fDigitStore->Clear(); | |
811 | ||
812 | if (!fTriggerStore) fTriggerStore = AliMUONVTriggerStore::Create(*clustersTree); | |
813 | fTriggerStore->Clear(); | |
814 | fTriggerStore->Connect(*clustersTree, false); | |
04236e67 | 815 | clustersTree->GetEvent(0); |
04236e67 | 816 | |
7035694f | 817 | AliMUONLocalTrigger* locTrg; |
818 | TIter nextLoc(fTriggerStore->CreateLocalIterator()); | |
819 | ||
820 | while ( ( locTrg = static_cast<AliMUONLocalTrigger*>(nextLoc()) ) ) | |
821 | { | |
822 | if (locTrg->IsNull()) continue; | |
823 | ||
824 | TArrayS xyPattern[2]; | |
825 | locTrg->GetXPattern(xyPattern[0]); | |
826 | locTrg->GetYPattern(xyPattern[1]); | |
827 | ||
828 | Int_t nBoard = locTrg->LoCircuit(); | |
2346e1ad | 829 | |
d72d7b9e | 830 | Bool_t xTrig=locTrg->IsTrigX(); |
831 | Bool_t yTrig=locTrg->IsTrigY(); | |
2346e1ad | 832 | |
833 | if (xTrig && yTrig) | |
834 | ((TH1F*)GetRecPointsData(kTriggeredBoards))->Fill(nBoard); | |
835 | ||
836 | fDigitMaker->TriggerDigits(nBoard, xyPattern, *fDigitStore); | |
7035694f | 837 | } |
04236e67 | 838 | |
7035694f | 839 | TIter nextDigit(fDigitStore->CreateIterator()); |
840 | AliMUONVDigit* mDigit; | |
841 | while ( ( mDigit = static_cast<AliMUONVDigit*>(nextDigit()) ) ) | |
04236e67 | 842 | { |
7035694f | 843 | Int_t detElemId = mDigit->DetElemId(); |
2346e1ad | 844 | Int_t ch = detElemId/100; |
845 | Int_t localBoard = mDigit->ManuId(); | |
846 | Int_t channel = mDigit->ManuChannel(); | |
7035694f | 847 | Int_t cathode = mDigit->Cathode(); |
b62881f2 | 848 | ERecPoints hindex |
849 | = ( cathode == 0 ) ? kTriggerDigitsBendPlane : kTriggerDigitsNonBendPlane; | |
850 | ||
2346e1ad | 851 | ((TH3F*)GetRecPointsData(hindex))->Fill(ch, localBoard, channel); |
04236e67 | 852 | } |
853 | } | |
854 | ||
855 | //____________________________________________________________________________ | |
856 | void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd) | |
857 | { | |
c92a8c85 | 858 | /// make QA data from ESDs |
859 | ||
860 | if ( ! fIsInitESDs ) { | |
861 | AliWarningStream() | |
862 | << "Skipping function due to a failure in Init" << endl; | |
863 | return; | |
864 | } | |
865 | ||
866 | // load ESD event in the interface | |
867 | AliMUONESDInterface esdInterface; | |
868 | if (GetRecoParam()) AliMUONESDInterface::ResetTracker(GetRecoParam()); | |
869 | else AliError("Unable to get recoParam: use default ones for residual calculation"); | |
870 | esdInterface.LoadEvent(*esd); | |
871 | ||
872 | GetESDsData(kESDnTracks)->Fill(esdInterface.GetNTracks()); | |
873 | ||
874 | Int_t nTrackMatchTrig = 0; | |
875 | ||
876 | // loop over tracks | |
877 | Int_t nTracks = (Int_t) esd->GetNumberOfMuonTracks(); | |
878 | for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) { | |
879 | ||
880 | // get the ESD track and skip "ghosts" | |
881 | AliESDMuonTrack* esdTrack = esd->GetMuonTrack(iTrack); | |
882 | if (!esdTrack->ContainTrackerData()) continue; | |
883 | ||
884 | // get corresponding MUON track | |
885 | AliMUONTrack* track = esdInterface.FindTrack(esdTrack->GetUniqueID()); | |
886 | ||
887 | if (esdTrack->ContainTriggerData()) nTrackMatchTrig++; | |
888 | ||
889 | GetESDsData(kESDMomentum)->Fill(esdTrack->P()); | |
890 | GetESDsData(kESDPt)->Fill(esdTrack->Pt()); | |
891 | GetESDsData(kESDRapidity)->Fill(esdTrack->Y()); | |
892 | GetESDsData(kESDChi2)->Fill(track->GetNormalizedChi2()); | |
893 | GetESDsData(kESDnClustersPerTrack)->Fill(track->GetNClusters()); | |
894 | ||
895 | // loop over clusters | |
896 | AliMUONTrackParam* trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->First()); | |
897 | while (trackParam) { | |
b1fea02e | 898 | |
c92a8c85 | 899 | AliMUONVCluster* cluster = trackParam->GetClusterPtr(); |
900 | Int_t chId = cluster->GetChamberId(); | |
901 | Int_t deID = cluster->GetDetElemId(); | |
902 | Double_t residualX = cluster->GetX() - trackParam->GetNonBendingCoor(); | |
903 | Double_t residualY = cluster->GetY() - trackParam->GetBendingCoor(); | |
b1fea02e | 904 | |
c92a8c85 | 905 | GetESDsData(kESDClusterHitMap+chId)->Fill(cluster->GetX(), cluster->GetY()); |
906 | ||
907 | GetESDsData(kESDnClustersPerCh)->Fill(chId); | |
908 | GetESDsData(kESDnClustersPerDE)->Fill(deID); | |
909 | ||
910 | GetESDsData(kESDClusterCharge)->Fill(cluster->GetCharge()); | |
911 | GetESDsData(kESDClusterChargeInCh+chId)->Fill(cluster->GetCharge()); | |
912 | GetESDsData(kESDClusterChargePerDE)->Fill(deID, cluster->GetCharge()); | |
913 | ||
914 | if (cluster->GetNDigits() > 0) { // discard clusters with pad not stored in ESD | |
915 | GetESDsData(kESDClusterMult)->Fill(cluster->GetNDigits()); | |
916 | GetESDsData(kESDClusterMultInCh+chId)->Fill(cluster->GetNDigits()); | |
917 | GetESDsData(kESDClusterMultPerDE)->Fill(deID, cluster->GetNDigits()); | |
b62881f2 | 918 | } |
c92a8c85 | 919 | |
920 | GetESDsData(kESDResidualX)->Fill(residualX); | |
921 | GetESDsData(kESDResidualY)->Fill(residualY); | |
922 | GetESDsData(kESDResidualXInCh+chId)->Fill(residualX); | |
923 | GetESDsData(kESDResidualYInCh+chId)->Fill(residualY); | |
924 | GetESDsData(kESDResidualXPerDEMean)->Fill(deID, residualX); | |
925 | GetESDsData(kESDResidualYPerDEMean)->Fill(deID, residualY); | |
926 | GetESDsData(kESDResidualXPerDESigma)->Fill(deID, residualX*residualX); | |
927 | GetESDsData(kESDResidualYPerDESigma)->Fill(deID, residualY*residualY); | |
928 | ||
929 | trackParam = static_cast<AliMUONTrackParam*>(track->GetTrackParamAtCluster()->After(trackParam)); | |
04236e67 | 930 | } |
c92a8c85 | 931 | |
932 | } | |
933 | ||
934 | GetESDsData(kESDMatchTrig)->Fill(nTrackMatchTrig); | |
935 | ||
04236e67 | 936 | } |
937 | ||
938 | //____________________________________________________________________________ | |
939 | void AliMUONQADataMakerRec::StartOfDetectorCycle() | |
940 | { | |
941 | /// Detector specific actions at start of cycle | |
942 | ||
943 | } | |
2346e1ad | 944 | |
945 | //____________________________________________________________________________ | |
946 | void AliMUONQADataMakerRec::DisplayTriggerInfo(AliQA::TASKINDEX_t task) | |
947 | { | |
948 | // | |
949 | /// Display trigger information in a user-friendly way: | |
950 | /// from local board and strip numbers to their position on chambers | |
951 | // | |
49e110ec | 952 | |
2346e1ad | 953 | if(task!=AliQA::kRECPOINTS && task!=AliQA::kRAWS) return; |
954 | ||
aef183f7 | 955 | AliMUONTriggerDisplay triggerDisplay; |
956 | ||
2346e1ad | 957 | TH3F* histoStrips=0x0; |
958 | TH2F* histoDisplayStrips=0x0; | |
2346e1ad | 959 | |
aef183f7 | 960 | for (Int_t iCath = 0; iCath < AliMpConstants::NofCathodes(); iCath++) |
2346e1ad | 961 | { |
2346e1ad | 962 | if(task==AliQA::kRECPOINTS){ |
963 | ERecPoints hindex | |
964 | = ( iCath == 0 ) ? kTriggerDigitsBendPlane : kTriggerDigitsNonBendPlane; | |
965 | histoStrips = (TH3F*)GetRecPointsData(hindex); | |
2346e1ad | 966 | } |
967 | else if(task==AliQA::kRAWS){ | |
968 | ERaw hindex | |
969 | = ( iCath == 0 ) ? kTriggerScalersBP : kTriggerScalersNBP; | |
970 | histoStrips = (TH3F*)GetRawsData(hindex); | |
49e110ec | 971 | if(histoStrips->GetEntries()==0) continue; // No scalers found |
2346e1ad | 972 | } |
973 | ||
aef183f7 | 974 | for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++) |
2346e1ad | 975 | { |
2346e1ad | 976 | if(task==AliQA::kRECPOINTS){ |
aef183f7 | 977 | histoDisplayStrips = (TH2F*)GetRecPointsData(kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber); |
2346e1ad | 978 | } |
979 | else if(task==AliQA::kRAWS){ | |
aef183f7 | 980 | histoDisplayStrips = (TH2F*)GetRawsData(kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber); |
2346e1ad | 981 | } |
aef183f7 | 982 | Int_t bin = histoStrips->GetXaxis()->FindBin(11+iChamber); |
983 | histoStrips->GetXaxis()->SetRange(bin,bin); | |
984 | TH2F* inputHisto = (TH2F*)histoStrips->Project3D("zy"); | |
985 | triggerDisplay.FillDisplayHistogram(inputHisto, histoDisplayStrips, AliMUONTriggerDisplay::kDisplayStrips, iCath, iChamber); | |
2346e1ad | 986 | } // iChamber |
987 | } // iCath | |
2346e1ad | 988 | |
49e110ec | 989 | if(task==AliQA::kRAWS){ |
990 | TH2F* histoI = (TH2F*) GetRawsData(kTriggerRPCi); | |
991 | TH2F* histoHV = (TH2F*) GetRawsData(kTriggerRPChv); | |
992 | FillTriggerDCSHistos(); | |
993 | for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++) { | |
994 | Int_t bin = histoI->GetXaxis()->FindBin(11+iChamber); | |
995 | TH2F* histoDisplayI = (TH2F*)GetRawsData(kTriggerIDisplay + iChamber); | |
996 | triggerDisplay.FillDisplayHistogram(histoI->ProjectionY("_px", bin, bin), histoDisplayI, AliMUONTriggerDisplay::kDisplaySlats, 0, iChamber); | |
997 | TH2F* histoDisplayHV = (TH2F*)GetRawsData(kTriggerHVDisplay + iChamber); | |
998 | bin = histoHV->GetXaxis()->FindBin(11+iChamber); | |
999 | triggerDisplay.FillDisplayHistogram(histoHV->ProjectionY("_px", bin, bin), histoDisplayHV, AliMUONTriggerDisplay::kDisplaySlats, 0, iChamber); | |
1000 | } | |
1001 | } | |
1002 | ||
1003 | if(task==AliQA::kRECPOINTS){ | |
1004 | TH1F* histoBoards = (TH1F*)GetRecPointsData(kTriggeredBoards); | |
1005 | TH2F* histoDisplayBoards = (TH2F*)GetRecPointsData(kTriggerBoardsDisplay); | |
1006 | triggerDisplay.FillDisplayHistogram(histoBoards, histoDisplayBoards, AliMUONTriggerDisplay::kDisplayBoards, 0, 0); | |
1007 | } | |
1008 | } | |
1009 | ||
1010 | ||
1011 | //_____________________________________________________________________________ | |
1012 | Bool_t | |
1013 | AliMUONQADataMakerRec::FillTriggerDCSHistos() | |
1014 | { | |
1015 | /// Get HV and currents values for one trigger chamber | |
1016 | ||
1017 | AliCodeTimerAuto(""); | |
1018 | ||
1019 | AliMpDEIterator deIt; | |
1020 | ||
1021 | deIt.First(); | |
1022 | ||
1023 | AliMUONCalibrationData calibrationData(AliCDBManager::Instance()->GetRun()); | |
1024 | ||
1025 | TMap* triggerDcsMap = calibrationData.TriggerDCS(); | |
1026 | ||
1027 | AliMpDCSNamer triggerDcsNamer("TRIGGER"); | |
1028 | ||
1029 | TH2* currHisto = 0x0; | |
1030 | ||
1031 | Bool_t error = kFALSE; | |
1032 | ||
1033 | while ( !deIt.IsDone() ) | |
1034 | { | |
1035 | Int_t detElemId = deIt.CurrentDEId(); | |
1036 | ||
1037 | if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStationTrigger) { | |
1038 | ||
1039 | Int_t iChamber = AliMpDEManager::GetChamberId(detElemId); | |
1040 | Int_t slat = detElemId%100; | |
1041 | ||
1042 | for(Int_t iMeas=0; iMeas<AliMpDCSNamer::kNDCSMeas; iMeas++){ | |
1043 | TString currAlias = triggerDcsNamer.DCSChannelName(detElemId, 0, iMeas); | |
1044 | ||
1045 | AliDebug(2, Form("\nDetElemId %i dcsAlias %s", detElemId, currAlias.Data())); | |
1046 | ||
1047 | TPair* triggerDcsPair = static_cast<TPair*>(triggerDcsMap->FindObject(currAlias.Data())); | |
1048 | ||
1049 | if (!triggerDcsPair) | |
1050 | { | |
1051 | AliError(Form("Did not find expected alias (%s) for DE %d", | |
1052 | currAlias.Data(),detElemId)); | |
1053 | error = kTRUE; | |
1054 | } | |
1055 | else | |
1056 | { | |
1057 | TObjArray* values = static_cast<TObjArray*>(triggerDcsPair->Value()); | |
1058 | if (!values) | |
1059 | { | |
1060 | AliError(Form("Could not get values for alias %s",currAlias.Data())); | |
1061 | error = kTRUE; | |
1062 | } | |
1063 | else | |
1064 | { | |
1065 | TIter next(values); | |
1066 | AliDCSValue* val; | |
1067 | ||
1068 | while ( ( val = static_cast<AliDCSValue*>(next()) ) ) | |
1069 | { | |
1070 | Float_t hvi = val->GetFloat(); | |
1071 | ||
1072 | AliDebug(2, Form("Value %f", hvi)); | |
1073 | ||
1074 | switch(iMeas){ | |
1075 | case AliMpDCSNamer::kDCSI: | |
1076 | currHisto = (TH2F*) GetRawsData(kTriggerRPCi); | |
1077 | break; | |
1078 | case AliMpDCSNamer::kDCSHV: | |
1079 | currHisto = (TH2F*) GetRawsData(kTriggerRPChv); | |
1080 | break; | |
1081 | } | |
1082 | Int_t binX = currHisto->GetXaxis()->FindBin(iChamber+1); | |
1083 | Int_t binY = currHisto->GetYaxis()->FindBin(slat); | |
1084 | currHisto->SetBinContent(binX, binY, hvi); | |
1085 | } // loop on values | |
1086 | } // if (!values) | |
1087 | } // if (!triggerDcsPair) | |
1088 | } // loop on measured types (HV and currents) | |
1089 | } // if (stationType == kStationTrigger) | |
1090 | ||
1091 | deIt.Next(); | |
1092 | } | |
1093 | return error; | |
2346e1ad | 1094 | } |