]>
Commit | Line | Data |
---|---|---|
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 | ||
66f72ab4 | 26 | // --- Standard library --- |
27 | ||
66f72ab4 | 28 | // --- AliRoot header files --- |
29 | ||
30 | #include "AliPHOSQAMeanChecker.h" | |
66f72ab4 | 31 | |
32 | ClassImp(AliPHOSQAMeanChecker) | |
33 | ||
34 | ||
35 | //____________________________________________________________________________ | |
36 | AliPHOSQAMeanChecker::AliPHOSQAMeanChecker(const char * name) : AliPHOSQAChecker(name,"") | |
37 | { | |
38 | // ctor | |
39 | SetTitle("checks against average value +/- width") ; | |
40 | } | |
41 | ||
42 | //____________________________________________________________________________ | |
43 | AliPHOSQAMeanChecker::AliPHOSQAMeanChecker(const char * name, Float_t mean, Float_t rms) : AliPHOSQAChecker(name,"") | |
44 | { | |
45 | // ctor | |
46 | SetTitle("checks against average value +/- width") ; | |
47 | fMean = mean ; | |
48 | fRms = rms ; | |
49 | } | |
50 | ||
51 | //____________________________________________________________________________ | |
52 | AliPHOSQAMeanChecker::~AliPHOSQAMeanChecker() | |
53 | { | |
54 | // dtor | |
55 | } | |
56 | ||
57 | //____________________________________________________________________________ | |
58 | TString AliPHOSQAMeanChecker::CheckingOperation() | |
59 | { | |
60 | // The user defined checking operation | |
61 | // Return a non empty string in case the check was not satisfied | |
62 | ||
63 | TString rv ; | |
64 | ||
65 | Float_t checked = 0. ; | |
7b7c1533 | 66 | if ( (fCheckable->HasA() == "I") && (fCheckable->HasA() == "F") ) { |
6122abe9 | 67 | Error("CheckingOperation", "checker %s says you got the wrong checkable %s or the checkable has no value !", GetName(), fCheckable->GetName()) ; |
66f72ab4 | 68 | } else { |
69 | checked = fCheckable->GetValue(); | |
70 | if (checked < fMean-fRms || checked > fMean+fRms) { | |
71 | char * tempo = new char[110] ; | |
72 | sprintf(tempo, "-->Checkable : %s :: Checker : %s :: Message : %f outside bond %f +/- %f\n", | |
73 | fCheckable->GetName(), GetName(), checked, fMean, fRms) ; | |
74 | rv = tempo ; | |
780a31c1 | 75 | delete [] tempo ; |
66f72ab4 | 76 | } |
77 | } | |
78 | return rv ; | |
79 | } | |
80 | ||
81 | //____________________________________________________________________________ | |
82 | void AliPHOSQAMeanChecker::Print() | |
83 | { | |
84 | // print the name | |
85 | ||
21cd0c07 | 86 | Info("Print", "Checker : %s : %s : Mean = %f Rms = %f", GetName(), GetTitle(), fMean, fRms) ; |
66f72ab4 | 87 | } |