]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSQAMeanChecker.cxx
removed iostream
[u/mrichter/AliRoot.git] / PHOS / AliPHOSQAMeanChecker.cxx
CommitLineData
66f72ab4 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//_________________________________________________________________________
19// QA checker that compares a number with an average value plus or minus
20// a width
21//*-- Author : Yves Schutz (SUBATECH)
22//////////////////////////////////////////////////////////////////////////////
23
24// --- ROOT system ---
25
26#include "TDatime.h"
27#include "TFolder.h"
28
29// --- Standard library ---
30
31#include <iostream.h>
32// --- AliRoot header files ---
33
34#include "AliPHOSQAMeanChecker.h"
35#include "AliPHOSQAAlarm.h"
36
37ClassImp(AliPHOSQAMeanChecker)
38
39
40//____________________________________________________________________________
41 AliPHOSQAMeanChecker::AliPHOSQAMeanChecker(const char * name) : AliPHOSQAChecker(name,"")
42{
43 // ctor
44 SetTitle("checks against average value +/- width") ;
45}
46
47//____________________________________________________________________________
48 AliPHOSQAMeanChecker::AliPHOSQAMeanChecker(const char * name, Float_t mean, Float_t rms) : AliPHOSQAChecker(name,"")
49{
50 // ctor
51 SetTitle("checks against average value +/- width") ;
52 fMean = mean ;
53 fRms = rms ;
54}
55
56//____________________________________________________________________________
57 AliPHOSQAMeanChecker::~AliPHOSQAMeanChecker()
58{
59 // dtor
60}
61
62//____________________________________________________________________________
63TString AliPHOSQAMeanChecker::CheckingOperation()
64{
65 // The user defined checking operation
66 // Return a non empty string in case the check was not satisfied
67
68 TString rv ;
69
70 Float_t checked = 0. ;
7b7c1533 71 if ( (fCheckable->HasA() == "I") && (fCheckable->HasA() == "F") ) {
99b965a5 72 Error("CheckingOperation", "checker %s says you got the wrong checkable %s \n or the checkable has no value !", GetName(), fCheckable->GetName()) ;
66f72ab4 73 } else {
74 checked = fCheckable->GetValue();
75 if (checked < fMean-fRms || checked > fMean+fRms) {
76 char * tempo = new char[110] ;
77 sprintf(tempo, "-->Checkable : %s :: Checker : %s :: Message : %f outside bond %f +/- %f\n",
78 fCheckable->GetName(), GetName(), checked, fMean, fRms) ;
79 rv = tempo ;
780a31c1 80 delete [] tempo ;
66f72ab4 81 }
82 }
83 return rv ;
84}
85
86//____________________________________________________________________________
87 void AliPHOSQAMeanChecker::Print()
88{
89 // print the name
90
21cd0c07 91 Info("Print", "Checker : %s : %s : Mean = %f Rms = %f", GetName(), GetTitle(), fMean, fRms) ;
66f72ab4 92}