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 //_________________________________________________________________________
19 // QA checker that compares a number with an average value plus or minus
21 //*-- Author : Yves Schutz (SUBATECH)
22 //////////////////////////////////////////////////////////////////////////////
24 // --- ROOT system ---
29 // --- Standard library ---
31 // --- AliRoot header files ---
33 #include "AliPHOSQAMeanChecker.h"
34 #include "AliPHOSQAAlarm.h"
36 ClassImp(AliPHOSQAMeanChecker)
39 //____________________________________________________________________________
40 AliPHOSQAMeanChecker::AliPHOSQAMeanChecker(const char * name) : AliPHOSQAChecker(name,"")
43 SetTitle("checks against average value +/- width") ;
46 //____________________________________________________________________________
47 AliPHOSQAMeanChecker::AliPHOSQAMeanChecker(const char * name, Float_t mean, Float_t rms) : AliPHOSQAChecker(name,"")
50 SetTitle("checks against average value +/- width") ;
55 //____________________________________________________________________________
56 AliPHOSQAMeanChecker::~AliPHOSQAMeanChecker()
61 //____________________________________________________________________________
62 TString AliPHOSQAMeanChecker::CheckingOperation()
64 // The user defined checking operation
65 // Return a non empty string in case the check was not satisfied
69 Float_t checked = 0. ;
70 if ( (fCheckable->HasA() == "I") && (fCheckable->HasA() == "F") ) {
71 Error("CheckingOperation", "checker %s says you got the wrong checkable %s or the checkable has no value !", GetName(), fCheckable->GetName()) ;
73 checked = fCheckable->GetValue();
74 if (checked < fMean-fRms || checked > fMean+fRms) {
75 char * tempo = new char[110] ;
76 sprintf(tempo, "-->Checkable : %s :: Checker : %s :: Message : %f outside bond %f +/- %f\n",
77 fCheckable->GetName(), GetName(), checked, fMean, fRms) ;
85 //____________________________________________________________________________
86 void AliPHOSQAMeanChecker::Print()
90 Info("Print", "Checker : %s : %s : Mean = %f Rms = %f", GetName(), GetTitle(), fMean, fRms) ;