]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - MUON/AliMUONQADataMakerRec.cxx
SetFlag GetFlag lifted to interface
[u/mrichter/AliRoot.git] / MUON / AliMUONQADataMakerRec.cxx
... / ...
CommitLineData
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
16// $Id$
17
18// --- MUON header files ---
19#include "AliMUONQADataMakerRec.h"
20
21//-----------------------------------------------------------------------------
22/// \class AliMUONQADataMakerRec
23///
24/// MUON base class for quality assurance data (histo) maker
25///
26/// It is now only a steering class for the two subclasses AliMUONTrackerQADataMakerRec
27/// and AliMUONTriggerQADataMakerRec
28///
29/// \author C. Finck, D. Stocco, L. Aphecetche, A. Blanc
30
31#include "AliDAQ.h"
32#include "AliMUONTrackerQADataMakerRec.h"
33#include "AliMUONTriggerQADataMakerRec.h"
34#include "AliQAChecker.h"
35#include "AliRawReader.h"
36#include "AliRawEventHeaderBase.h"
37
38/// \cond CLASSIMP
39ClassImp(AliMUONQADataMakerRec)
40/// \endcond
41
42//____________________________________________________________________________
43AliMUONQADataMakerRec::AliMUONQADataMakerRec(Bool_t tracker, Bool_t trigger) :
44AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kMUON), "MUON Quality Assurance Data Maker"),
45fTracker(tracker ? new AliMUONTrackerQADataMakerRec(this) : 0x0),
46fTrigger(trigger ? new AliMUONTriggerQADataMakerRec(this) : 0x0)
47{
48 /// ctor
49 AliInfo(Form("tracker=%d trigger=%d",tracker,trigger));
50}
51
52//__________________________________________________________________
53AliMUONQADataMakerRec::~AliMUONQADataMakerRec()
54{
55 /// dtor
56 delete fTracker;
57 delete fTrigger;
58}
59
60//____________________________________________________________________________
61Int_t AliMUONQADataMakerRec::Add2List(TH1 * hist, const Int_t index, AliQAv1::TASKINDEX_t task, const Bool_t expert, const Bool_t image, const Bool_t saveForCorr)
62{
63 TObjArray** list = GetList(task);
64 if (list)
65 {
66 return Add2List(hist,index,list,expert,image,saveForCorr);
67 }
68 return -1;
69}
70
71//____________________________________________________________________________
72void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
73{
74 /// Detector specific actions at end of cycle
75 //
76 ResetEventTrigClasses(); // RS
77 //
78 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
79 {
80 if (! IsValidEventSpecie(specie, list) ) continue;
81
82 SetEventSpecie(AliRecoParam::ConvertIndex(specie)); // needed by the GetXXXData methods
83
84 if ( task == AliQAv1::kRAWS )
85 {
86 if ( fTracker ) fTracker->EndOfDetectorCycleRaws(specie,list);
87 if ( fTrigger ) fTrigger->EndOfDetectorCycleRaws(specie,list);
88 }
89 else if ( task == AliQAv1::kRECPOINTS )
90 {
91 // normalize recpoints histograms
92 if ( fTracker ) fTracker->EndOfDetectorCycleRecPoints(specie,list);
93 if ( fTrigger ) fTrigger->EndOfDetectorCycleRecPoints(specie,list);
94 }
95 else if ( task == AliQAv1::kESDS )
96 {
97 // normalize esds histograms
98 if ( fTracker ) fTracker->EndOfDetectorCycleESDs(specie,list);
99 if ( fTrigger ) fTrigger->EndOfDetectorCycleESDs(specie,list);
100 }
101 else if ( task == AliQAv1::kDIGITSR )
102 {
103 if ( fTracker ) fTracker->EndOfDetectorCycleDigits(specie,list);
104 if ( fTrigger ) fTrigger->EndOfDetectorCycleDigits(specie,list);
105 }
106 else
107 {
108 AliFatal(Form("Not implemented for task %s",AliQAv1::GetTaskName(task).Data()));
109 }
110 } // loop on specie
111
112 // do the QA checking
113 AliQAChecker::Instance()->Run(AliQAv1::kMUON,task,list,const_cast<AliDetectorRecoParam*>(GetRecoParam()));
114}
115
116//____________________________________________________________________________
117TObject* AliMUONQADataMakerRec::GetData(AliQAv1::TASKINDEX_t task, const Int_t index)
118{
119 TObjArray** list = GetList(task);
120 if (list) return GetData(list,index);
121 return 0x0;
122}
123
124//____________________________________________________________________________
125TObjArray** AliMUONQADataMakerRec::GetList(AliQAv1::TASKINDEX_t task)
126{
127 // enum TASKINDEX_t {
128 // kNULLTASKINDEX=-1, kRAWS, kHITS, kSDIGITS, kDIGITS, kDIGITSR, kRECPOINTS, kTRACKSEGMENTS, kRECPARTICLES, kESDS, kNTASKINDEX };
129 if ( task == AliQAv1::kRAWS )
130 {
131 return fRawsQAList;
132 }
133 else if ( task == AliQAv1::kDIGITS || task == AliQAv1::kDIGITSR )
134 {
135 return fDigitsQAList;
136 }
137 else if ( task == AliQAv1::kRECPOINTS )
138 {
139 return fRecPointsQAList;
140 }
141 else
142 {
143 AliFatal(Form("task %s not supported here yet",AliQAv1::GetTaskName(task).Data()));
144 }
145 return 0x0;
146}
147
148//____________________________________________________________________________
149void AliMUONQADataMakerRec::InitRaws()
150{
151 /// create Raws histograms in Raws subdir
152
153 if ( fTracker ) fTracker->InitRaws();
154 if ( fTrigger ) fTrigger->InitRaws();
155 //
156 ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
157}
158
159//__________________________________________________________________
160void AliMUONQADataMakerRec::InitDigits()
161{
162 /// Initialized Digits spectra
163 if ( fTracker ) fTracker->InitDigits();
164 if ( fTrigger ) fTrigger->InitDigits();
165 //
166 ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
167}
168
169//____________________________________________________________________________
170void AliMUONQADataMakerRec::InitRecPoints()
171{
172 /// create Reconstructed Points histograms in RecPoints subdir
173 if ( fTracker ) fTracker->InitRecPoints();
174 if ( fTrigger ) fTrigger->InitRecPoints();
175 //
176 ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line
177}
178
179
180//____________________________________________________________________________
181void AliMUONQADataMakerRec::InitESDs()
182{
183 ///create ESDs histograms in ESDs subdir
184 if ( fTracker ) fTracker->InitESDs();
185 if ( fTrigger ) fTrigger->InitESDs();
186 //
187 ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line
188}
189
190//____________________________________________________________________________
191void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader)
192{
193 /// make QA for rawdata
194 /// Note that we do not call the sub-datamaker MakeRaws method
195 /// for events where the MCH or MTR is not part of the readout...
196
197 if ( !rawReader || !rawReader->GetDetectorPattern() ) return;
198
199 UInt_t clmask = rawReader->GetDetectorPattern()[0];
200
201 if ( fTracker && rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent )
202 {
203 UInt_t mchMask = AliDAQ::DetectorPattern(" MUONTRK ");
204 if ( clmask & mchMask )
205 {
206 rawReader->Reset();
207 fTracker->MakeRaws(rawReader);
208 }
209 }
210
211 if ( fTrigger && (rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent ||
212 rawReader->GetType() == AliRawEventHeaderBase::kCalibrationEvent ) )
213 {
214 UInt_t mtrMask = AliDAQ::DetectorPattern(" MUONTRG ");
215 if ( clmask & mtrMask )
216 {
217 rawReader->Reset();
218 fTrigger->MakeRaws(rawReader);
219 }
220 }
221 //
222 IncEvCountCycleRaws();
223 IncEvCountTotalRaws();
224 //
225}
226
227//__________________________________________________________________
228void AliMUONQADataMakerRec::MakeDigits()
229{
230 /// makes data from Digits
231
232 AliFatal("Not implemented");
233}
234
235//__________________________________________________________________
236void AliMUONQADataMakerRec::MakeDigits(TTree* digitsTree)
237{
238 /// makes data from Digits
239
240 // Do nothing in case of calibration event
241 if ( GetEventSpecie() == AliRecoParam::kCalib ) return;
242
243 if ( fTracker ) fTracker->MakeDigits(digitsTree);
244 if ( fTrigger ) fTrigger->MakeDigits(digitsTree);
245 //
246 IncEvCountCycleDigits();
247 IncEvCountTotalDigits();
248 //
249}
250
251//____________________________________________________________________________
252void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree)
253{
254 /// Fill histograms from treeR
255
256 // Do nothing in case of calibration event
257 if ( GetEventSpecie() == AliRecoParam::kCalib ) return;
258
259 if ( fTracker ) fTracker->MakeRecPoints(clustersTree);
260 if ( fTrigger ) fTrigger->MakeRecPoints(clustersTree);
261 //
262 IncEvCountCycleRecPoints();
263 IncEvCountTotalRecPoints();
264 //
265}
266
267//____________________________________________________________________________
268void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd)
269{
270 /// make QA data from ESDs
271
272 // Do nothing in case of calibration event
273 if ( GetEventSpecie() == AliRecoParam::kCalib ) return;
274
275 if ( fTracker ) fTracker->MakeESDs(esd);
276 if ( fTrigger ) fTrigger->MakeESDs(esd);
277 //
278 IncEvCountCycleESDs();
279 IncEvCountTotalESDs();
280 //
281 }
282
283//____________________________________________________________________________
284void AliMUONQADataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
285{
286 /// Reset internals
287
288 for (int spec = 0; spec < AliRecoParam::kNSpecies; ++spec)
289 {
290 if (!AliQAv1::Instance()->IsEventSpecieSet(AliRecoParam::ConvertIndex(spec)))
291 continue;
292
293 if ( task == AliQAv1::kRAWS )
294 {
295 if (fTracker) fTracker->ResetDetectorRaws(fRawsQAList[spec]);
296 if (fTrigger) fTrigger->ResetDetectorRaws(fRawsQAList[spec]);
297 }
298 else if ( task == AliQAv1::kRECPOINTS )
299 {
300 if (fTracker) fTracker->ResetDetectorRecPoints(fRecPointsQAList[spec]);
301 if (fTrigger) fTrigger->ResetDetectorRecPoints(fRecPointsQAList[spec]);
302 }
303 else if ( task == AliQAv1::kESDS )
304 {
305 if (fTracker) fTracker->ResetDetectorESDs(fESDsQAList[spec]);
306 if (fTrigger) fTrigger->ResetDetectorESDs(fESDsQAList[spec]);
307 }
308 else if ( task == AliQAv1::kDIGITS )
309 {
310 if (fTracker) fTracker->ResetDetectorDigits(fDigitsQAList[spec]);
311 if (fTrigger) fTrigger->ResetDetectorDigits(fDigitsQAList[spec]);
312 }
313 else
314 {
315 AliFatal(Form("Not implemented for task %s",AliQAv1::GetTaskName(task).Data()));
316 }
317 }
318}
319
320//____________________________________________________________________________
321void AliMUONQADataMakerRec::StartOfDetectorCycle()
322{
323 /// Detector specific actions at start of cycle
324
325}