]>
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" | |
a0dc65b4 | 31 | #include "AliMUONRecoParam.h" |
f587a77d | 32 | #include "AliMUONRegHeader.h" |
33 | #include "AliMUONTrackerCalibratedDataMaker.h" | |
aef183f7 | 34 | #include "AliMUONTriggerDisplay.h" |
f587a77d | 35 | #include "AliMUONVCluster.h" |
36 | #include "AliMUONVClusterStore.h" | |
37 | #include "AliMUONVDigit.h" | |
38 | #include "AliMUONVDigitStore.h" | |
39 | #include "AliMUONVTrackerData.h" | |
40 | #include "AliMUONVTriggerStore.h" | |
41 | #include "AliMpCDB.h" | |
2346e1ad | 42 | #include "AliMpConstants.h" |
f587a77d | 43 | #include "AliMpDDLStore.h" |
44 | #include "AliMpDEIterator.h" | |
45 | #include "AliMpDEManager.h" | |
b1341ab0 | 46 | #include "AliMpLocalBoard.h" |
f587a77d | 47 | #include "AliMpStationType.h" |
48 | #include "AliMpTriggerCrate.h" | |
49 | #include "AliRawEventHeaderBase.h" | |
2346e1ad | 50 | |
b1341ab0 | 51 | // --- AliRoot header files --- |
f587a77d | 52 | #include "AliCDBManager.h" |
53 | #include "AliCDBStorage.h" | |
b1341ab0 | 54 | #include "AliESDEvent.h" |
55 | #include "AliESDMuonTrack.h" | |
56 | #include "AliESDMuonCluster.h" | |
57 | #include "AliLog.h" | |
58 | #include "AliRawReader.h" | |
59 | #include "AliQAChecker.h" | |
f587a77d | 60 | #include "AliCodeTimer.h" |
b1341ab0 | 61 | |
62 | // --- ROOT system --- | |
63 | #include <TClonesArray.h> | |
64 | #include <TFile.h> | |
65 | #include <TH1F.h> | |
66 | #include <TH1I.h> | |
67 | #include <TH2F.h> | |
68 | #include <TH3F.h> | |
69 | #include <TLorentzVector.h> | |
70 | #include <Riostream.h> | |
04236e67 | 71 | |
72 | //----------------------------------------------------------------------------- | |
73 | /// \class AliMUONQADataMakerRec | |
74 | /// | |
75 | /// MUON base class for quality assurance data (histo) maker | |
76 | /// | |
f587a77d | 77 | /// \author C. Finck, D. Stocco, L. Aphecetche |
04236e67 | 78 | |
79 | /// \cond CLASSIMP | |
80 | ClassImp(AliMUONQADataMakerRec) | |
81 | /// \endcond | |
82 | ||
83 | //____________________________________________________________________________ | |
a0dc65b4 | 84 | AliMUONQADataMakerRec::AliMUONQADataMakerRec(const AliMUONRecoParam* recoParam) : |
f587a77d | 85 | AliQADataMakerRec(AliQA::GetDetName(AliQA::kMUON), "MUON Quality Assurance Data Maker"), |
86 | fIsInitRaws(kFALSE), | |
87 | fIsInitRecPointsTracker(kFALSE), | |
88 | fIsInitRecPointsTrigger(kFALSE), | |
89 | fIsInitESDs(kFALSE), | |
90 | fDigitStore(0x0), | |
91 | fTriggerStore(0x0), | |
92 | fDigitMaker(0x0), | |
93 | fClusterStore(0x0), | |
a0dc65b4 | 94 | fTrackerDataMaker(0x0), |
95 | fRecoParam(recoParam) | |
04236e67 | 96 | { |
97 | /// ctor | |
f587a77d | 98 | |
99 | Ctor(); | |
100 | } | |
101 | ||
102 | //____________________________________________________________________________ | |
103 | void | |
104 | AliMUONQADataMakerRec::Ctor() | |
105 | { | |
106 | /// Init some members | |
107 | fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV1"); | |
108 | fDigitMaker = new AliMUONDigitMaker(kTRUE); | |
04236e67 | 109 | } |
110 | ||
111 | //____________________________________________________________________________ | |
112 | AliMUONQADataMakerRec::AliMUONQADataMakerRec(const AliMUONQADataMakerRec& qadm) : | |
f587a77d | 113 | AliQADataMakerRec(qadm), |
114 | fIsInitRaws(kFALSE), | |
115 | fIsInitRecPointsTracker(kFALSE), | |
116 | fIsInitRecPointsTrigger(kFALSE), | |
117 | fIsInitESDs(kFALSE), | |
118 | fDigitStore(0x0), | |
119 | fTriggerStore(0x0), | |
120 | fDigitMaker(0x0), | |
121 | fClusterStore(0x0), | |
122 | fTrackerDataMaker(0x0) | |
04236e67 | 123 | { |
124 | ///copy ctor | |
125 | SetName((const char*)qadm.GetName()) ; | |
126 | SetTitle((const char*)qadm.GetTitle()); | |
7035694f | 127 | |
f587a77d | 128 | // Do not copy the digit store and digit maker, but create its own ones |
129 | ||
130 | Ctor(); | |
131 | ||
04236e67 | 132 | } |
133 | ||
134 | //__________________________________________________________________ | |
135 | AliMUONQADataMakerRec& AliMUONQADataMakerRec::operator = (const AliMUONQADataMakerRec& qadm ) | |
136 | { | |
7035694f | 137 | /// Assignment operator |
138 | ||
139 | // check assignment to self | |
140 | if (this == &qadm) return *this; | |
141 | ||
142 | this->~AliMUONQADataMakerRec(); | |
143 | new(this) AliMUONQADataMakerRec(qadm); | |
144 | return *this; | |
04236e67 | 145 | } |
146 | ||
147 | //__________________________________________________________________ | |
148 | AliMUONQADataMakerRec::~AliMUONQADataMakerRec() | |
149 | { | |
150 | /// dtor | |
f587a77d | 151 | |
152 | AliCodeTimerAuto(""); | |
153 | ||
154 | delete fDigitStore; | |
155 | delete fTriggerStore; | |
156 | delete fDigitMaker; | |
157 | delete fClusterStore; | |
158 | delete fTrackerDataMaker; | |
04236e67 | 159 | } |
160 | ||
161 | //____________________________________________________________________________ | |
92a357bf | 162 | void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray* list) |
04236e67 | 163 | { |
f587a77d | 164 | ///Detector specific actions at end of cycle |
165 | ||
166 | // Display trigger histos in a more user friendly way | |
167 | DisplayTriggerInfo(task); | |
168 | ||
169 | if ( task == AliQA::kRAWS ) | |
170 | { | |
171 | TIter next(list); | |
172 | TObject* o; | |
173 | Bool_t alreadyThere(kFALSE); | |
174 | while ( ( o = next() ) && !alreadyThere ) | |
175 | { | |
176 | TString classname(o->ClassName()); | |
177 | if ( classname.Contains("TrackerData") ) alreadyThere = kTRUE; | |
178 | } | |
179 | if (!alreadyThere) list->AddAt(fTrackerDataMaker->Data(),(Int_t)kTrackerData); | |
180 | } | |
181 | ||
182 | // do the QA checking | |
183 | AliQAChecker::Instance()->Run(AliQA::kMUON, task, list) ; | |
04236e67 | 184 | } |
185 | ||
186 | //____________________________________________________________________________ | |
187 | void AliMUONQADataMakerRec::InitRaws() | |
188 | { | |
189 | /// create Raws histograms in Raws subdir | |
f587a77d | 190 | |
191 | if ( ! AliCDBManager::Instance()->GetDefaultStorage() ) | |
192 | { | |
193 | AliError("CDB default storage not set. Cannot work."); | |
194 | fIsInitRaws=kFALSE; | |
195 | } | |
196 | ||
197 | TH3F* h3 = new TH3F("hTriggerScalersBendPlane", "Trigger scalers in bending plane", | |
198 | 4, 10.5, 14.5, | |
199 | 234, 0.5, 234.5, | |
200 | 16, -0.5, 15.5); | |
201 | h3->GetXaxis()->SetTitle("Chamber"); | |
202 | h3->GetYaxis()->SetTitle("Board"); | |
203 | h3->GetZaxis()->SetTitle("Strip"); | |
204 | Add2RawsList(h3, kTriggerScalersBP); | |
205 | ||
206 | TH3F* h4 = new TH3F("hTriggerScalersNonBendPlane", "Trigger scalers in non-bending plane", | |
207 | 4, 10.5, 14.5, | |
208 | 234, 0.5, 234.5, | |
209 | 16, -0.5, 15.5); | |
210 | h4->GetXaxis()->SetTitle("Chamber"); | |
211 | h4->GetYaxis()->SetTitle("Board"); | |
212 | h4->GetZaxis()->SetTitle("Strip"); | |
213 | Add2RawsList(h4, kTriggerScalersNBP); | |
214 | ||
215 | AliMUONTriggerDisplay triggerDisplay; | |
216 | TString histoName, histoTitle; | |
217 | for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){ | |
218 | TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane"; | |
219 | for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){ | |
220 | histoName = Form("hScalers%sChamber%i", cathName.Data(), 11+iChamber); | |
221 | histoTitle = Form("Chamber %i: Scalers %s", 11+iChamber, cathName.Data()); | |
222 | TH2F* h5 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips, | |
223 | iCath, iChamber, histoTitle); | |
224 | Add2RawsList(h5, kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber); | |
225 | } | |
226 | } | |
227 | ||
228 | fIsInitRaws = kTRUE; | |
229 | } | |
04236e67 | 230 | |
f587a77d | 231 | //____________________________________________________________________________ |
232 | void AliMUONQADataMakerRec::InitRecPoints() | |
233 | { | |
234 | /// create Reconstructed Points histograms in RecPoints subdir | |
235 | InitRecPointsTrigger(); | |
236 | InitRecPointsTracker(); | |
237 | } | |
238 | ||
239 | //____________________________________________________________________________ | |
240 | void AliMUONQADataMakerRec::InitRecPointsTracker() | |
241 | { | |
242 | /// create Reconstructed Points histograms in RecPoints subdir for the | |
243 | /// MUON tracker subsystem. | |
244 | ||
245 | AliMpDEIterator it; | |
246 | ||
247 | it.First(); | |
248 | ||
249 | Int_t ndes(0); | |
250 | ||
251 | while ( !it.IsDone()) | |
252 | { | |
253 | Int_t detElemId = it.CurrentDEId(); | |
1c66abf3 | 254 | |
f587a77d | 255 | it.Next(); |
04236e67 | 256 | |
f587a77d | 257 | if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger ) |
258 | { | |
259 | ndes = TMath::Max(ndes,detElemId); | |
2346e1ad | 260 | |
f587a77d | 261 | TH1* h = new TH1I(Form("hTrackerClusterMultiplicityForDE%04d",detElemId), |
262 | Form("Multiplicity of the clusters in detection element %d",detElemId), | |
263 | 100,0,100); | |
264 | ||
265 | h->GetXaxis()->SetTitle("Detection Element Id"); | |
266 | ||
267 | Add2RecPointsList(h,kTrackerClusterMultiplicityPerDE+detElemId); | |
268 | ||
269 | h = new TH1I(Form("hTrackerClusterChargeForDE%04d",detElemId), | |
270 | Form("Charge of the clusters in detection element %d",detElemId), | |
271 | 100,0,1000); | |
2346e1ad | 272 | |
f587a77d | 273 | h->GetXaxis()->SetTitle("Detection Element Id"); |
274 | ||
275 | Add2RecPointsList(h,kTrackerClusterChargePerDE+detElemId); | |
276 | ||
277 | } | |
278 | ||
279 | } | |
280 | ||
281 | TH1* h = new TH1I("hTrackerNumberOfClustersPerDE","Number of clusters per detection element", | |
282 | ndes, -0.5, ndes - 0.5); | |
283 | ||
284 | h->GetXaxis()->SetTitle("Detection Element Id"); | |
285 | ||
286 | Add2RecPointsList(h, kTrackerNumberOfClustersPerDE); | |
287 | ||
288 | for ( Int_t i = 0; i < AliMpConstants::NofTrackingChambers(); ++i ) | |
289 | { | |
290 | TH1* h1 = new TH1I("hTrackerNumberOfClustersPerChamber","Number of clusters per chamber",AliMpConstants::NofTrackingChambers(),-0.5,AliMpConstants::NofTrackingChambers()-0.5); | |
291 | Add2RecPointsList(h1,kTrackerNumberOfClustersPerChamber); | |
292 | h1 = new TH1I(Form("hTrackerClusterMultiplicityForChamber%d",i), | |
293 | Form("Cluster multiplicity for chamber %d",i), | |
294 | 100,0,100); | |
295 | Add2RecPointsList(h1,kTrackerClusterMultiplicityPerChamber+i); | |
296 | h1 = new TH1I(Form("hTrackerClusterChargeForChamber%d",i), | |
297 | Form("Cluster charge for chamber %d",i), | |
298 | 100,0,1000); | |
299 | Add2RecPointsList(h1,kTrackerClusterChargePerChamber+i); | |
300 | } | |
301 | ||
302 | fIsInitRecPointsTracker=kTRUE; | |
04236e67 | 303 | } |
304 | ||
305 | //____________________________________________________________________________ | |
f587a77d | 306 | void AliMUONQADataMakerRec::InitRecPointsTrigger() |
04236e67 | 307 | { |
f587a77d | 308 | /// create Reconstructed Points histograms in RecPoints subdir for the |
309 | /// MUON Trigger subsystem. | |
310 | ||
2346e1ad | 311 | TH3F* h0 = new TH3F("hTriggerDigitsBendPlane", "Trigger digits in bending plane", |
312 | 4, 10.5, 14.5, | |
313 | 234, 0.5, 234.5, | |
314 | 16, -0.5, 15.5); | |
315 | h0->GetXaxis()->SetTitle("Chamber"); | |
316 | h0->GetYaxis()->SetTitle("Board"); | |
317 | h0->GetZaxis()->SetTitle("Strip"); | |
318 | Add2RecPointsList(h0, kTriggerDigitsBendPlane); | |
319 | ||
320 | TH3F* h1 = new TH3F("hTriggerDigitsNonBendPlane", "Trigger digits in non-bending plane", | |
321 | 4, 10.5, 14.5, | |
322 | 234, 0.5, 234.5, | |
323 | 16, -0.5, 15.5); | |
324 | h1->GetXaxis()->SetTitle("Chamber"); | |
325 | h1->GetYaxis()->SetTitle("Board"); | |
326 | h1->GetZaxis()->SetTitle("Strip"); | |
327 | Add2RecPointsList(h1, kTriggerDigitsNonBendPlane); | |
328 | ||
329 | TH1F* h2 = new TH1F("hTriggeredBoards", "Triggered boards", 234, 0.5, 234.5); | |
330 | Add2RecPointsList(h2, kTriggeredBoards); | |
331 | ||
aef183f7 | 332 | AliMUONTriggerDisplay triggerDisplay; |
333 | TString histoName, histoTitle; | |
334 | for(Int_t iCath=0; iCath<AliMpConstants::NofCathodes(); iCath++){ | |
335 | TString cathName = ( iCath==0 ) ? "BendPlane" : "NonBendPlane"; | |
336 | for(Int_t iChamber=0; iChamber<AliMpConstants::NofTriggerChambers(); iChamber++){ | |
337 | histoName = Form("hTriggerDigits%sChamber%i", cathName.Data(), 11+iChamber); | |
338 | histoTitle = Form("Chamber %i: Fired pads %s", 11+iChamber, cathName.Data()); | |
339 | TH2F* h3 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto(histoName, AliMUONTriggerDisplay::kDisplayStrips, | |
340 | iCath, iChamber, histoTitle); | |
341 | Add2RecPointsList(h3, kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber); | |
342 | } | |
343 | } | |
344 | ||
345 | TH2F* h4 = (TH2F*)triggerDisplay.GetEmptyDisplayHisto("hFiredBoardsDisplay", AliMUONTriggerDisplay::kDisplayBoards, | |
346 | 0, 0, "Fired boards"); | |
347 | Add2RecPointsList(h4, kTriggerBoardsDisplay); | |
f587a77d | 348 | |
349 | fIsInitRecPointsTrigger = kTRUE; | |
04236e67 | 350 | } |
351 | ||
352 | ||
353 | //____________________________________________________________________________ | |
354 | void AliMUONQADataMakerRec::InitESDs() | |
355 | { | |
356 | ///create ESDs histograms in ESDs subdir | |
357 | TH1F* h0 = new TH1F("hESDnTracks", "ESDs track number distribution", 30, 0., 30.); | |
b62881f2 | 358 | Add2ESDsList(h0, kESDnTracks); |
04236e67 | 359 | |
360 | TH1F* h1 = new TH1F("hESDMomentum", "ESDs P distribution", 300, 0., 300) ; | |
b62881f2 | 361 | Add2ESDsList(h1, kESDMomentum); |
04236e67 | 362 | |
363 | TH1F* h2 = new TH1F("hESDPt", "ESDs Pt distribution", 200, 0., 50) ; | |
b62881f2 | 364 | Add2ESDsList(h2, kESDPt); |
04236e67 | 365 | |
366 | TH1F* h3 = new TH1F("hESDRapidity", "ESDs rapidity distribution", 200, -4.5,-2.) ; | |
b62881f2 | 367 | Add2ESDsList(h3, kESDRapidity); |
368 | ||
369 | for (Int_t i = 0; i < AliMUONConstants::NTrackingCh(); ++i) | |
370 | { | |
371 | TH2F* h4 = new TH2F(Form("%s%d", "hESDClusterHitMap", i), | |
372 | Form("%s %d", "ESD Clusters hit distribution for chamber", i), | |
373 | 100, -1*AliMUONConstants::Rmax(i/2), AliMUONConstants::Rmax(i/2), | |
374 | 100, -1*AliMUONConstants::Rmax(i/2), AliMUONConstants::Rmax(i/2)); | |
375 | Add2ESDsList(h4, kESDClusterHitMap+i); | |
376 | } | |
b1341ab0 | 377 | |
378 | fIsInitESDs = kTRUE; | |
04236e67 | 379 | } |
380 | ||
381 | //____________________________________________________________________________ | |
382 | void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader) | |
383 | { | |
384 | /// make QA for rawdata | |
b1341ab0 | 385 | |
386 | if ( ! fIsInitRaws ) { | |
387 | AliWarningStream() | |
388 | << "Skipping function due to a failure in Init" << endl; | |
389 | return; | |
390 | } | |
391 | ||
f587a77d | 392 | if ( rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent ) |
393 | { | |
04236e67 | 394 | rawReader->Reset(); |
f587a77d | 395 | MakeRawsTracker(rawReader); |
396 | } | |
04236e67 | 397 | |
f587a77d | 398 | rawReader->Reset(); |
399 | MakeRawsTrigger(rawReader); | |
400 | } | |
2346e1ad | 401 | |
f587a77d | 402 | //____________________________________________________________________________ |
403 | void AliMUONQADataMakerRec::MakeRawsTracker(AliRawReader* rawReader) | |
404 | { | |
405 | /// make QA for rawdata tracker | |
406 | ||
407 | if (!fTrackerDataMaker) | |
408 | { | |
409 | const Bool_t histogram(kFALSE); | |
410 | const Bool_t fastDecoder(kTRUE); | |
411 | ||
412 | // fTrackerDataMaker = new AliMUONTrackerRawDataMaker(rawReader,histogram,fastDecoder,takeRawReaderOwnership); | |
413 | ||
a0dc65b4 | 414 | fTrackerDataMaker = new AliMUONTrackerCalibratedDataMaker(GetRecoParam(), |
415 | AliCDBManager::Instance()->GetRun(), | |
f587a77d | 416 | rawReader, |
417 | AliCDBManager::Instance()->GetDefaultStorage()->GetURI(), | |
418 | "NOGAIN", | |
419 | histogram, | |
420 | 0.0,0.0, | |
421 | fastDecoder); | |
422 | ||
423 | fTrackerDataMaker->Data()->DisableChannelLevel(); // to save up disk space, we only store starting at the manu level | |
424 | ||
425 | fTrackerDataMaker->SetRunning(kTRUE); | |
426 | } | |
427 | ||
428 | ((AliMUONTrackerCalibratedDataMaker*)fTrackerDataMaker)->SetRawReader(rawReader); | |
429 | ||
430 | fTrackerDataMaker->ProcessEvent(); | |
431 | } | |
2346e1ad | 432 | |
f587a77d | 433 | //____________________________________________________________________________ |
434 | void AliMUONQADataMakerRec::MakeRawsTrigger(AliRawReader* rawReader) | |
435 | { | |
436 | /// make QA for rawdata trigger | |
437 | ||
2346e1ad | 438 | // Get trigger scalers |
439 | ||
440 | Int_t loCircuit=0; | |
441 | AliMpCDB::LoadDDLStore(); | |
442 | ||
443 | AliMUONRawStreamTrigger rawStreamTrig(rawReader); | |
444 | while (rawStreamTrig.NextDDL()) | |
445 | { | |
446 | // If not a scaler event, do nothing | |
447 | Bool_t scalerEvent = rawReader->GetDataHeader()->GetL1TriggerMessage() & 0x1; | |
d72d7b9e | 448 | if(!scalerEvent) break; |
2346e1ad | 449 | |
450 | AliMUONDDLTrigger* ddlTrigger = rawStreamTrig.GetDDLTrigger(); | |
451 | AliMUONDarcHeader* darcHeader = ddlTrigger->GetDarcHeader(); | |
452 | ||
453 | Int_t nReg = darcHeader->GetRegHeaderEntries(); | |
454 | ||
455 | for(Int_t iReg = 0; iReg < nReg ;iReg++) | |
456 | { //reg loop | |
457 | ||
458 | // crate info | |
459 | AliMpTriggerCrate* crate = AliMpDDLStore::Instance()-> | |
460 | GetTriggerCrate(rawStreamTrig.GetDDL(), iReg); | |
461 | ||
462 | AliMUONRegHeader* regHeader = darcHeader->GetRegHeaderEntry(iReg); | |
463 | ||
464 | // loop over local structures | |
465 | Int_t nLocal = regHeader->GetLocalEntries(); | |
466 | for(Int_t iLocal = 0; iLocal < nLocal; iLocal++) | |
467 | { | |
468 | AliMUONLocalStruct* localStruct = regHeader->GetLocalEntry(iLocal); | |
469 | ||
470 | // if card exist | |
471 | if (!localStruct) continue; | |
472 | ||
473 | loCircuit = crate->GetLocalBoardId(localStruct->GetId()); | |
474 | ||
475 | if ( !loCircuit ) continue; // empty slot | |
476 | ||
477 | AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit, false); | |
478 | ||
479 | // skip copy cards | |
480 | if( !localBoard->IsNotified()) | |
481 | continue; | |
482 | ||
483 | Int_t cathode = localStruct->GetComptXY()%2; | |
484 | ||
485 | ERaw hindex = (cathode==0) ? kTriggerScalersBP : kTriggerScalersNBP; | |
486 | ||
487 | // loop over strips | |
488 | for (Int_t ibitxy = 0; ibitxy < 16; ++ibitxy) { | |
489 | if(localStruct->GetXY1(ibitxy) > 0) | |
490 | ((TH3F*)GetRawsData(hindex))->Fill(11+0, loCircuit, ibitxy, 2*localStruct->GetXY1(ibitxy)); | |
491 | if(localStruct->GetXY2(ibitxy) > 0) | |
492 | ((TH3F*)GetRawsData(hindex))->Fill(11+1, loCircuit, ibitxy, 2*localStruct->GetXY2(ibitxy)); | |
493 | if(localStruct->GetXY3(ibitxy) > 0) | |
494 | ((TH3F*)GetRawsData(hindex))->Fill(11+2, loCircuit, ibitxy, 2*localStruct->GetXY3(ibitxy)); | |
495 | if(localStruct->GetXY4(ibitxy) > 0) | |
496 | ((TH3F*)GetRawsData(hindex))->Fill(11+3, loCircuit, ibitxy, 2*localStruct->GetXY4(ibitxy)); | |
497 | } // loop on strips | |
498 | } // iLocal | |
499 | } // iReg | |
500 | } // NextDDL | |
04236e67 | 501 | } |
502 | ||
503 | //____________________________________________________________________________ | |
504 | void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree) | |
505 | { | |
f587a77d | 506 | /// Fill histograms from treeR |
507 | ||
508 | if (fIsInitRecPointsTracker) MakeRecPointsTracker(clustersTree); | |
509 | if (fIsInitRecPointsTrigger) MakeRecPointsTrigger(clustersTree); | |
510 | } | |
511 | ||
512 | //____________________________________________________________________________ | |
513 | void AliMUONQADataMakerRec::MakeRecPointsTracker(TTree* clustersTree) | |
514 | { | |
515 | /// Fill histograms related to tracker clusters | |
516 | ||
517 | // First things first : do we have clusters in the TreeR ? | |
518 | // In "normal" production mode, it should be perfectly normal | |
519 | // *not* to have them. | |
520 | // But if for some reason we de-activated the combined tracking, | |
521 | // then we have clusters in TreeR, so let's take that opportunity | |
522 | // to QA them... | |
523 | ||
524 | if (!fClusterStore) | |
525 | { | |
526 | AliCodeTimerAuto("ClusterStore creation"); | |
527 | fClusterStore = AliMUONVClusterStore::Create(*clustersTree); | |
528 | if (!fClusterStore) | |
529 | { | |
530 | fIsInitRecPointsTracker = kFALSE; | |
531 | return; | |
532 | } | |
533 | } | |
534 | ||
535 | AliCodeTimerAuto(""); | |
536 | ||
537 | fClusterStore->Connect(*clustersTree,kFALSE); | |
538 | clustersTree->GetEvent(0); | |
539 | ||
540 | TIter next(fClusterStore->CreateIterator()); | |
541 | AliMUONVCluster* cluster; | |
542 | ||
543 | while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) ) | |
544 | { | |
545 | Int_t detElemId = cluster->GetDetElemId(); | |
546 | Int_t chamberId = AliMpDEManager::GetChamberId(detElemId); | |
547 | ||
548 | GetRecPointsData(kTrackerNumberOfClustersPerDE)->Fill(detElemId); | |
549 | GetRecPointsData(kTrackerClusterChargePerDE+detElemId)->Fill(cluster->GetCharge()); | |
550 | GetRecPointsData(kTrackerClusterMultiplicityPerDE+detElemId)->Fill(cluster->GetNDigits()); | |
b1341ab0 | 551 | |
f587a77d | 552 | GetRecPointsData(kTrackerNumberOfClustersPerChamber)->Fill(chamberId); |
553 | GetRecPointsData(kTrackerClusterChargePerChamber+chamberId)->Fill(cluster->GetCharge()); | |
554 | GetRecPointsData(kTrackerClusterMultiplicityPerChamber+chamberId)->Fill(cluster->GetNDigits()); | |
555 | ||
556 | } | |
557 | ||
558 | fClusterStore->Clear(); | |
559 | } | |
560 | ||
561 | //____________________________________________________________________________ | |
562 | void AliMUONQADataMakerRec::MakeRecPointsTrigger(TTree* clustersTree) | |
563 | { | |
564 | /// makes data from trigger response | |
565 | ||
7035694f | 566 | // Fired pads info |
567 | fDigitStore->Clear(); | |
568 | ||
569 | if (!fTriggerStore) fTriggerStore = AliMUONVTriggerStore::Create(*clustersTree); | |
570 | fTriggerStore->Clear(); | |
571 | fTriggerStore->Connect(*clustersTree, false); | |
04236e67 | 572 | clustersTree->GetEvent(0); |
04236e67 | 573 | |
7035694f | 574 | AliMUONLocalTrigger* locTrg; |
575 | TIter nextLoc(fTriggerStore->CreateLocalIterator()); | |
576 | ||
577 | while ( ( locTrg = static_cast<AliMUONLocalTrigger*>(nextLoc()) ) ) | |
578 | { | |
579 | if (locTrg->IsNull()) continue; | |
580 | ||
581 | TArrayS xyPattern[2]; | |
582 | locTrg->GetXPattern(xyPattern[0]); | |
583 | locTrg->GetYPattern(xyPattern[1]); | |
584 | ||
585 | Int_t nBoard = locTrg->LoCircuit(); | |
2346e1ad | 586 | |
d72d7b9e | 587 | Bool_t xTrig=locTrg->IsTrigX(); |
588 | Bool_t yTrig=locTrg->IsTrigY(); | |
2346e1ad | 589 | |
590 | if (xTrig && yTrig) | |
591 | ((TH1F*)GetRecPointsData(kTriggeredBoards))->Fill(nBoard); | |
592 | ||
593 | fDigitMaker->TriggerDigits(nBoard, xyPattern, *fDigitStore); | |
7035694f | 594 | } |
04236e67 | 595 | |
7035694f | 596 | TIter nextDigit(fDigitStore->CreateIterator()); |
597 | AliMUONVDigit* mDigit; | |
598 | while ( ( mDigit = static_cast<AliMUONVDigit*>(nextDigit()) ) ) | |
04236e67 | 599 | { |
7035694f | 600 | Int_t detElemId = mDigit->DetElemId(); |
2346e1ad | 601 | Int_t ch = detElemId/100; |
602 | Int_t localBoard = mDigit->ManuId(); | |
603 | Int_t channel = mDigit->ManuChannel(); | |
7035694f | 604 | Int_t cathode = mDigit->Cathode(); |
b62881f2 | 605 | ERecPoints hindex |
606 | = ( cathode == 0 ) ? kTriggerDigitsBendPlane : kTriggerDigitsNonBendPlane; | |
607 | ||
2346e1ad | 608 | ((TH3F*)GetRecPointsData(hindex))->Fill(ch, localBoard, channel); |
04236e67 | 609 | } |
610 | } | |
611 | ||
612 | //____________________________________________________________________________ | |
613 | void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd) | |
614 | { | |
615 | /// make QA data from ESDs | |
616 | ||
b1341ab0 | 617 | if ( ! fIsInitESDs ) { |
618 | AliWarningStream() | |
619 | << "Skipping function due to a failure in Init" << endl; | |
620 | return; | |
621 | } | |
622 | ||
04236e67 | 623 | TLorentzVector v1; |
624 | ||
625 | Int_t nTracks = (Int_t)esd->GetNumberOfMuonTracks() ; | |
626 | GetESDsData(0)->Fill(nTracks); | |
627 | ||
628 | for (Int_t iTrack = 0; iTrack < nTracks; ++iTrack) { | |
629 | ||
630 | AliESDMuonTrack* muonTrack = esd->GetMuonTrack(iTrack); | |
b1fea02e | 631 | |
632 | // skip "ghosts" | |
633 | if (!muonTrack->ContainTrackerData()) continue; | |
634 | ||
04236e67 | 635 | muonTrack->LorentzP(v1); |
636 | ||
637 | GetESDsData(1)->Fill(v1.P()); | |
638 | GetESDsData(2)->Fill(v1.Pt()); | |
639 | GetESDsData(3)->Fill(v1.Rapidity()); | |
b62881f2 | 640 | |
641 | TClonesArray clusters = muonTrack->GetClusters(); | |
642 | ||
643 | for (Int_t iCluster = 0; iCluster <clusters.GetEntriesFast(); ++iCluster) { | |
644 | AliESDMuonCluster* cluster = (AliESDMuonCluster*)clusters.At(iCluster); | |
645 | GetESDsData(kESDClusterHitMap+cluster->GetChamberId()) | |
646 | ->Fill(cluster->GetX(), cluster->GetY()); | |
647 | } | |
04236e67 | 648 | } |
649 | } | |
650 | ||
651 | //____________________________________________________________________________ | |
652 | void AliMUONQADataMakerRec::StartOfDetectorCycle() | |
653 | { | |
654 | /// Detector specific actions at start of cycle | |
655 | ||
656 | } | |
2346e1ad | 657 | |
658 | //____________________________________________________________________________ | |
659 | void AliMUONQADataMakerRec::DisplayTriggerInfo(AliQA::TASKINDEX_t task) | |
660 | { | |
661 | // | |
662 | /// Display trigger information in a user-friendly way: | |
663 | /// from local board and strip numbers to their position on chambers | |
664 | // | |
665 | if(task!=AliQA::kRECPOINTS && task!=AliQA::kRAWS) return; | |
666 | ||
aef183f7 | 667 | AliMUONTriggerDisplay triggerDisplay; |
668 | ||
2346e1ad | 669 | TH3F* histoStrips=0x0; |
670 | TH2F* histoDisplayStrips=0x0; | |
2346e1ad | 671 | |
aef183f7 | 672 | for (Int_t iCath = 0; iCath < AliMpConstants::NofCathodes(); iCath++) |
2346e1ad | 673 | { |
2346e1ad | 674 | if(task==AliQA::kRECPOINTS){ |
675 | ERecPoints hindex | |
676 | = ( iCath == 0 ) ? kTriggerDigitsBendPlane : kTriggerDigitsNonBendPlane; | |
677 | histoStrips = (TH3F*)GetRecPointsData(hindex); | |
2346e1ad | 678 | } |
679 | else if(task==AliQA::kRAWS){ | |
680 | ERaw hindex | |
681 | = ( iCath == 0 ) ? kTriggerScalersBP : kTriggerScalersNBP; | |
682 | histoStrips = (TH3F*)GetRawsData(hindex); | |
683 | if(histoStrips->GetEntries()==0) return; // No scalers found | |
684 | } | |
685 | ||
aef183f7 | 686 | for (Int_t iChamber = 0; iChamber < AliMpConstants::NofTriggerChambers(); iChamber++) |
2346e1ad | 687 | { |
2346e1ad | 688 | if(task==AliQA::kRECPOINTS){ |
aef183f7 | 689 | histoDisplayStrips = (TH2F*)GetRecPointsData(kTriggerDigitsDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber); |
2346e1ad | 690 | } |
691 | else if(task==AliQA::kRAWS){ | |
aef183f7 | 692 | histoDisplayStrips = (TH2F*)GetRawsData(kTriggerScalersDisplay + AliMpConstants::NofTriggerChambers()*iCath + iChamber); |
2346e1ad | 693 | } |
aef183f7 | 694 | Int_t bin = histoStrips->GetXaxis()->FindBin(11+iChamber); |
695 | histoStrips->GetXaxis()->SetRange(bin,bin); | |
696 | TH2F* inputHisto = (TH2F*)histoStrips->Project3D("zy"); | |
697 | triggerDisplay.FillDisplayHistogram(inputHisto, histoDisplayStrips, AliMUONTriggerDisplay::kDisplayStrips, iCath, iChamber); | |
2346e1ad | 698 | } // iChamber |
699 | } // iCath | |
2346e1ad | 700 | |
aef183f7 | 701 | if(task!=AliQA::kRECPOINTS) return; |
702 | TH1F* histoBoards = (TH1F*)GetRecPointsData(kTriggeredBoards); | |
703 | TH2F* histoDisplayBoards = (TH2F*)GetRecPointsData(kTriggerBoardsDisplay); | |
704 | triggerDisplay.FillDisplayHistogram(histoBoards, histoDisplayBoards, AliMUONTriggerDisplay::kDisplayBoards, 0, 0); | |
2346e1ad | 705 | } |