X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSQAChecker.cxx;h=10e9b03511177cf0eb8d8b988f9e2b0d58bb1fd5;hb=94148a9c3b1aae9ccaa5b6bf37863abde25bf9e5;hp=2d4a048312cc9e9a26a26d58802a220f6dc91e0b;hpb=9688c1ddeb34093dbf8265987926402e715ba192;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSQAChecker.cxx b/PHOS/AliPHOSQAChecker.cxx index 2d4a048312c..10e9b035111 100644 --- a/PHOS/AliPHOSQAChecker.cxx +++ b/PHOS/AliPHOSQAChecker.cxx @@ -13,179 +13,32 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ + /* $Id$ */ -//_________________________________________________________________________ -// Base class for a QA checker, to be instanciated as a container of user -// defined tasks -//*-- Author : Yves Schutz (SUBATECH) -////////////////////////////////////////////////////////////////////////////// +/* + Checks the quality assurance. + By comparing with reference data + Y. Schutz CERN July 2007 +*/ // --- ROOT system --- -#include "TROOT.h" -#include "TFolder.h" +#include +#include +#include +#include +#include +#include // --- Standard library --- -#include // --- AliRoot header files --- - +#include "AliLog.h" +#include "AliQAv1.h" +#include "AliQAChecker.h" #include "AliPHOSQAChecker.h" -#include "AliPHOSQAVirtualCheckable.h" ClassImp(AliPHOSQAChecker) +//__________________________________________________________________ -//____________________________________________________________________________ - AliPHOSQAChecker::AliPHOSQAChecker(const char * name, const char * title) : TTask(name,title) -{ - // ctor - // stores checkers in the PHOS QA TTask folder //YSAlice/tasks/QA/PHOS - TTask * aliceQA = (TTask*)gROOT->FindObjectAny("YSAlice/tasks/QA") ; - TTask * phosQA = (TTask*)aliceQA->GetListOfTasks()->FindObject("PHOS") ; - if (phosQA) // PHOS QA Tasks container exists - phosQA->Add(this) ; - else // create //YSAlice/tasks/QA/PHOS - aliceQA->Add(this) ; - - fCheckablesList = new TList() ; -} - -//____________________________________________________________________________ - AliPHOSQAChecker::~AliPHOSQAChecker() -{ - // dtor remove the checker from the task list of the associated checker - - TIter next(fCheckablesList) ; - AliPHOSQAVirtualCheckable * checkable ; - while ( (checkable = (AliPHOSQAVirtualCheckable*)next()) ) - checkable->RemoveChecker(this) ; - ExecuteTasks("D") ; -} - -//____________________________________________________________________________ - void AliPHOSQAChecker::CheckIt(AliPHOSQAVirtualCheckable *ca) -{ - // does the check for the given checkable - - SetCheckable(ca) ; - TList * l = GetListOfTasks() ; - TIter next(l) ; - AliPHOSQAChecker * checker ; - while ( (checker = (AliPHOSQAChecker*)next()) ) - checker->SetCheckable(ca) ; - ExecuteTask("") ; - fCheckable = 0 ; -} - -//____________________________________________________________________________ - void AliPHOSQAChecker::CheckIt() -{ - // does the check for all attached chekables - if ( fCheckablesList->IsEmpty() ) - ExecuteTask("C") ; - else { - TIter next( fCheckablesList ) ; - AliPHOSQAVirtualCheckable * checkable ; - while ( (checkable = (AliPHOSQAVirtualCheckable*)next() ) ) { - fCheckable = checkable ; - ExecuteTask("") ; - } - } -} - -//____________________________________________________________________________ - void AliPHOSQAChecker::Exec(Option_t *option) -{ - // Performs various tasks as indicated by option - // P --> Print - // S --> Status - // C --> does the comparison on all the checkables declared - // --> does the comparison on only one checkable (the one which asks CheckMe() ) - // A --> list the alarms raised in the associated checkables - // R --> reset the alarms - // D --> calls the dtor - - if ( !(strcmp(option,"P")) ) - Print() ; - - else if ( !(strcmp(option,"S")) ) - Status() ; - - else if ( !(strcmp(option,"C")) ) { - TIter next( fCheckablesList ) ; - AliPHOSQAVirtualCheckable * checkable ; - while ( (checkable = (AliPHOSQAVirtualCheckable*)next() ) ) { - fCheckable = checkable ; - TString message = CheckingOperation(); - if ( !message.IsNull() ) { - TDatime dt ; - TString time(dt.AsSQLString()) ; - message = time + message ; - fCheckable->RaiseAlarm(dt.AsSQLString(), fCheckable->GetName(), GetName(), message.Data()) ; - } - } - } - - else if ( !(strcmp(option,"R")) ) { - TIter next( fCheckablesList ) ; - AliPHOSQAVirtualCheckable * checkable ; - while ( (checkable = (AliPHOSQAVirtualCheckable*)next() ) ) { - fCheckable = checkable ; - fCheckable->ResetAlarms() ; - } - } - - else if ( !(strcmp(option,"")) ) { - TString message = CheckingOperation(); - if ( !message.IsNull() ) { - TDatime dt ; - TString time(dt.AsSQLString()) ; - message = time + message ; - fCheckable->RaiseAlarm(dt.AsSQLString(), fCheckable->GetName(), GetName(), message.Data()) ; - } - } - - else if ( !(strcmp(option,"A")) ) - PrintAlarms() ; - - else if ( !(strcmp(option,"D")) ) - Delete() ; -} - -//____________________________________________________________________________ - void AliPHOSQAChecker::Print() -{ - // print the checker and sub-checkers, if any, name. - - cout << "Checker : " << GetName() << endl ; - -} - -//____________________________________________________________________________ - void AliPHOSQAChecker::PrintAlarms() -{ - // Prints the alarms of all attached checkables - cout << "Checker name : " << GetName() << endl ; - if ( !(fCheckablesList->IsEmpty() ) ) { - TIter next( fCheckablesList ) ; - AliPHOSQAVirtualCheckable * checkable ; - while ( (checkable = (AliPHOSQAVirtualCheckable *)next() ) ) - checkable->Alarms() ; - } -} - -//____________________________________________________________________________ - void AliPHOSQAChecker::Status() -{ - // Prints the checkables attached to this checker - if ( fCheckablesList->IsEmpty() ) - cout << "No checkables are checked by " << GetName() << endl ; - else { - cout << "The following checkables are checked by " << GetName() << endl ; - TIter next(fCheckablesList) ; - AliPHOSQAVirtualCheckable * checkable ; - while ( (checkable = (AliPHOSQAVirtualCheckable*)next() ) ) - checkable->Print() ; - } -}