-
Notifications
You must be signed in to change notification settings - Fork 0
/
AnalysisObject.hh
42 lines (39 loc) · 1.13 KB
/
AnalysisObject.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef ANALYSISOBJECT_HH
#define ANALYSISOBJECT_HH
#include "TVectorD.h"
#include "TMatrixD.h"
#include "TString.h"
#include <iostream>
class AnalysisObject {
public:
AnalysisObject( UInt_t n ) : points(n), values(n), errors(n), nevents(0.0) {}
virtual ~AnalysisObject() {}
virtual TVectorD getPoints() { return points; }
virtual TVectorD getValues() { return values; }
virtual TVectorD getErrors( const TString & opt="" ) {
TVectorD result= errors;
if( opt.Index( "m" ) >= 0 ) {
if( errorMatrix.GetNoElements() > 0 ) {
for( Int_t i= 0; i < errorMatrix.GetNrows(); i++ ) {
result[i]= sqrt( errorMatrix[i][i] );
}
}
else {
std::cout << "AnalysisObject::getErrors: error matrix empty" << std::endl;
}
}
return result;
}
virtual TMatrixD getErrorMatrix() { return errorMatrix; }
virtual Double_t getNEvents() { return nevents; }
virtual TString getPointStr( Int_t, Int_t, Int_t ) = 0;
virtual TString getPointLabel( Int_t ) = 0;
virtual TVectorD getPointsCenter() = 0;
protected:
TVectorD points;
TVectorD values;
TVectorD errors;
TMatrixD errorMatrix;
Double_t nevents;
};
#endif