Changed default OCDB from 2009 to 2010
[u/mrichter/AliRoot.git] / MUON / AliMUONQADataMakerRec.cxx
CommitLineData
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
04236e67 21//-----------------------------------------------------------------------------
22/// \class AliMUONQADataMakerRec
23///
24/// MUON base class for quality assurance data (histo) maker
25///
ece56eb9 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 "AliMUONTrackerQADataMakerRec.h"
32#include "AliMUONTriggerQADataMakerRec.h"
33#include "AliQAChecker.h"
34#include "AliRawReader.h"
35#include "AliRawEventHeaderBase.h"
04236e67 36
37/// \cond CLASSIMP
38ClassImp(AliMUONQADataMakerRec)
39/// \endcond
40
41//____________________________________________________________________________
ece56eb9 42AliMUONQADataMakerRec::AliMUONQADataMakerRec(Bool_t tracker, Bool_t trigger) :
4e25ac79 43AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kMUON), "MUON Quality Assurance Data Maker"),
ece56eb9 44fTracker(tracker ? new AliMUONTrackerQADataMakerRec(this) : 0x0),
45fTrigger(trigger ? new AliMUONTriggerQADataMakerRec(this) : 0x0)
04236e67 46{
ece56eb9 47 /// ctor
04236e67 48}
49
50//__________________________________________________________________
51AliMUONQADataMakerRec::~AliMUONQADataMakerRec()
52{
53 /// dtor
ece56eb9 54 delete fTracker;
55 delete fTrigger;
04236e67 56}
57
58//____________________________________________________________________________
4e25ac79 59void AliMUONQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
04236e67 60{
b9bd355c 61 /// Detector specific actions at end of cycle
c92a8c85 62
c455c5fb 63 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
64 {
b9bd355c 65 if (! IsValidEventSpecie(specie, list) ) continue;
66
67 SetEventSpecie(AliRecoParam::ConvertIndex(specie));
c455c5fb 68
ece56eb9 69 if ( task == AliQAv1::kRAWS )
b9bd355c 70 {
ece56eb9 71 if (fTracker) fTracker->EndOfDetectorCycleRaws(specie,list);
72 if (fTrigger) fTrigger->EndOfDetectorCycleRaws(specie,list);
b9bd355c 73 }
74
75 if ( task == AliQAv1::kRECPOINTS )
76 {
77 // normalize recpoints histograms
ece56eb9 78 if (fTracker) fTracker->EndOfDetectorCycleRecPoints(specie,list);
79 if (fTrigger) fTrigger->EndOfDetectorCycleRecPoints(specie,list);
b9bd355c 80 }
81
82 if ( task == AliQAv1::kESDS )
83 {
84 // normalize esds histograms
ece56eb9 85 if (fTracker) fTracker->EndOfDetectorCycleESDs(specie,list);
86 if (fTrigger) fTrigger->EndOfDetectorCycleESDs(specie,list);
b9bd355c 87 }
ece56eb9 88 } // loop on specie
b9bd355c 89
90 // do the QA checking
ece56eb9 91 AliQAChecker::Instance()->Run(AliQAv1::kMUON,task,list,const_cast<AliDetectorRecoParam*>(GetRecoParam()));
04236e67 92}
93
94//____________________________________________________________________________
95void AliMUONQADataMakerRec::InitRaws()
96{
ece56eb9 97 /// create Raws histograms in Raws subdir
df48c8a4 98
ece56eb9 99 if ( fTracker ) fTracker->InitRaws();
100 if ( fTrigger ) fTrigger->InitRaws();
f587a77d 101}
04236e67 102
44ed7a66 103//__________________________________________________________________
104void AliMUONQADataMakerRec::InitDigits()
105{
106 /// Initialized Digits spectra
ece56eb9 107 if ( fTracker ) fTracker->InitDigits();
108 if ( fTrigger ) fTrigger->InitDigits();
44ed7a66 109}
110
f587a77d 111//____________________________________________________________________________
112void AliMUONQADataMakerRec::InitRecPoints()
113{
114 /// create Reconstructed Points histograms in RecPoints subdir
ece56eb9 115 if ( fTracker ) fTracker->InitRecPoints();
116 if ( fTrigger ) fTrigger->InitRecPoints();
04236e67 117}
118
119
120//____________________________________________________________________________
121void AliMUONQADataMakerRec::InitESDs()
122{
c92a8c85 123 ///create ESDs histograms in ESDs subdir
ece56eb9 124 if ( fTracker ) fTracker->InitESDs();
125 if ( fTrigger ) fTrigger->InitESDs();
04236e67 126}
127
128//____________________________________________________________________________
129void AliMUONQADataMakerRec::MakeRaws(AliRawReader* rawReader)
130{
ece56eb9 131 /// make QA for rawdata
b1341ab0 132
ece56eb9 133 // Check id histograms already created for this Event Specie
77bd5fcf 134
ece56eb9 135 if ( fTracker && rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent )
f587a77d 136 {
04236e67 137 rawReader->Reset();
ece56eb9 138 fTracker->MakeRaws(rawReader);
f587a77d 139 }
04236e67 140
ece56eb9 141 if ( fTrigger && (rawReader->GetType() == AliRawEventHeaderBase::kPhysicsEvent ||
142 rawReader->GetType() == AliRawEventHeaderBase::kCalibrationEvent ) )
719914e0 143 {
144 rawReader->Reset();
ece56eb9 145 fTrigger->MakeRaws(rawReader);
719914e0 146 }
f587a77d 147}
2346e1ad 148
ece56eb9 149//__________________________________________________________________
150void AliMUONQADataMakerRec::MakeDigits()
f587a77d 151{
ece56eb9 152 /// makes data from Digits
bb22d2a6 153
ece56eb9 154 AliError("Not implemented");
04236e67 155}
156
44ed7a66 157//__________________________________________________________________
158void AliMUONQADataMakerRec::MakeDigits(TTree* digitsTree)
159{
160 /// makes data from Digits
eca4fa66 161
77bd5fcf 162 // Do nothing in case of calibration event
163 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
164
ece56eb9 165 if ( fTracker ) fTracker->MakeDigits(digitsTree);
166 if ( fTrigger ) fTrigger->MakeDigits(digitsTree);
44ed7a66 167}
168
04236e67 169//____________________________________________________________________________
170void AliMUONQADataMakerRec::MakeRecPoints(TTree* clustersTree)
171{
f587a77d 172 /// Fill histograms from treeR
77bd5fcf 173
174 // Do nothing in case of calibration event
175 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
f587a77d 176
ece56eb9 177 if ( fTracker ) fTracker->MakeRecPoints(clustersTree);
178 if ( fTrigger ) fTrigger->MakeRecPoints(clustersTree);
04236e67 179}
180
181//____________________________________________________________________________
182void AliMUONQADataMakerRec::MakeESDs(AliESDEvent* esd)
183{
c92a8c85 184 /// make QA data from ESDs
77bd5fcf 185
186 // Do nothing in case of calibration event
187 if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib ) return;
c92a8c85 188
ece56eb9 189 if ( fTracker ) fTracker->MakeESDs(esd);
190 if ( fTrigger ) fTrigger->MakeESDs(esd);
b9bd355c 191
ece56eb9 192 }
04236e67 193
194//____________________________________________________________________________
152fe71e 195void AliMUONQADataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
196{
197 /// Reset internals
198
199 for (int spec = 0; spec < AliRecoParam::kNSpecies; ++spec)
200 {
201 if (!AliQAv1::Instance()->IsEventSpecieSet(AliRecoParam::ConvertIndex(spec)))
202 continue;
203
204 if ( task == AliQAv1::kRAWS )
205 {
206 if (fTracker) fTracker->ResetDetectorRaws(fRawsQAList[spec]);
207 if (fTrigger) fTrigger->ResetDetectorRaws(fRawsQAList[spec]);
208 }
209 else if ( task == AliQAv1::kRECPOINTS )
210 {
211 if (fTracker) fTracker->ResetDetectorRecPoints(fRecPointsQAList[spec]);
212 if (fTrigger) fTrigger->ResetDetectorRecPoints(fRecPointsQAList[spec]);
213 }
214 else if ( task == AliQAv1::kESDS )
215 {
216 if (fTracker) fTracker->ResetDetectorESDs(fESDsQAList[spec]);
217 if (fTrigger) fTrigger->ResetDetectorESDs(fESDsQAList[spec]);
218 }
219 else if ( task == AliQAv1::kDIGITS )
220 {
221 if (fTracker) fTracker->ResetDetectorDigits(fDigitsQAList[spec]);
222 if (fTrigger) fTrigger->ResetDetectorDigits(fDigitsQAList[spec]);
223 }
224 else
225 {
226 AliError("Not implemented");
227 }
228 }
229}
230
231//____________________________________________________________________________
04236e67 232void AliMUONQADataMakerRec::StartOfDetectorCycle()
233{
ece56eb9 234 /// Detector specific actions at start of cycle
df48c8a4 235}