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