1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 #include "AliMUONQAChecker.h"
20 /// \class AliMUONQAChecker
22 /// Implementation of AliQACheckerBase for MCH and MTR
24 /// For the moment we only implement the checking of raw data QA for the tracker
25 /// by looking at the occupancy at the manu level.
26 /// We count the number of manus above a given occupancy threshold, and
27 /// depending on that number, the resulting QA flag is warning, error or fatal.
28 /// (there's no "info" type in this case).
30 /// \author Laurent Aphecetche, Subatech
33 #include "AliMUONVTrackerData.h"
34 #include "AliMpManuIterator.h"
35 #include <TDirectory.h>
38 ClassImp(AliMUONQAChecker)
41 //__________________________________________________________________
42 AliMUONQAChecker::AliMUONQAChecker() :
43 AliQACheckerBase("MUON","MUON Quality Assurance Data Maker")
48 //__________________________________________________________________
49 AliMUONQAChecker::~AliMUONQAChecker()
54 //__________________________________________________________________
55 AliMUONQAChecker::AliMUONQAChecker(const AliMUONQAChecker& qac) :
56 AliQACheckerBase(qac.GetName(), qac.GetTitle())
61 //______________________________________________________________________________
63 AliMUONQAChecker::Check(AliQA::ALITASK_t /*index*/)
67 AliError(Form("This method is not implemented. Should it be ? fDataSubDir = %p (%s)",
68 fDataSubDir, ( fDataSubDir ? fDataSubDir->GetPath() : "")));
72 //______________________________________________________________________________
74 AliMUONQAChecker::Check(AliQA::ALITASK_t index, TObjArray * list)
76 /// Check objects in list
78 if ( index == AliQA::kRAW )
80 return CheckRaws(list);
83 AliWarning(Form("Checker for task %d not implement for the moment",index));
87 //______________________________________________________________________________
89 AliMUONQAChecker::CheckRaws(TObjArray * list)
95 AliMUONVTrackerData* data(0x0);
97 while ( (object=next()) && !data )
99 if (object->InheritsFrom("AliMUONVTrackerData"))
101 data = static_cast<AliMUONVTrackerData*>(object);
107 AliError("Did not find TrackerData in the list !");
111 AliMpManuIterator it;
114 Int_t n50(0); // number of manus with occupancy above 0.5
115 Int_t n75(0); // number of manus with occupancy above 0.75
116 Int_t n(0); // number of manus with some occupancy
118 while ( it.Next(detElemId,manuId) )
120 Float_t occ = data->Manu(detElemId,manuId,2);
122 if (occ >= 0.5 ) ++n50;
123 if (occ >= 0.75 ) ++n75;
126 AliInfo(Form("n %d n50 %d n75 %d",n,n50,n75));
130 AliError("Oups. Got zero occupancy in all manus ?!");
136 AliError(Form("Got %d manus with occupancy above 0.75",n75));
142 AliWarning(Form("Got %d manus with occupancy above 0.5",n50));
149 //______________________________________________________________________________
151 AliMUONQAChecker::SetQA(AliQA::ALITASK_t index, const Double_t value) const
153 /// sets the QA according the return value of the Check
155 AliQA * qa = AliQA::Instance(index);
157 qa->UnSet(AliQA::kFATAL);
158 qa->UnSet(AliQA::kWARNING);
159 qa->UnSet(AliQA::kERROR);
160 qa->UnSet(AliQA::kINFO);
164 qa->Set(AliQA::kINFO);
166 else if ( value == 0.0 )
168 qa->Set(AliQA::kFATAL);
170 else if ( value > 0.5 )
172 qa->Set(AliQA::kWARNING);
176 qa->Set(AliQA::kERROR);