HighLAND
SystematicCovariance.hxx
1 #ifndef SystematicCovariance_h
2 #define SystematicCovariance_h
3 
4 #include "Parameters.hxx"
5 
6 #include "EventVariationBase.hxx"
7 #include "EventWeightBase.hxx"
8 #include "TRandom3.h"
9 #include "TString.h"
10 #include "TFile.h"
11 #include "HLClonesArray.hxx"
12 #include "SystematicManager.hxx"
13 
14 class SystematicManager;
15 
16 ///This class constructs and manipulates the covariance of the systematic uncertainties.
17 
18 
19 struct indexlink
20 {
21  int covarianceindex;
22  int inputindex;
23  int inputcov;
24 };
25 
26 struct covlink
27 {
28  std::vector<double> inputindex;
29  std::vector<double> covarianceindex;
30 };
31 
33 
34  public:
35 
37  virtual ~SystematicCovariance();
38 
39  /// Creates the covariance matrix for the enabled parameters
40  void ConstructCovarianceMatrix(SystematicManager* man);
41 
42  bool IsInList(std::string name, std::vector< std::string > list, int& index);
43 
44  /// Get Cov. Matrix
45  TMatrixT<double>* GetCovarianceMatrix() const {return _covarianceMatrix;}
46 
47 
48  protected:
49  void FillLinks(SystematicBase* syst);
50  void MapIndices();
51 
52  /// The covariance matrix for the enabled systematics
53  TMatrixT<double>* _covarianceMatrix;
54 
55  ///list of file names for covariances
56  std::vector<std::string> listoffiles;
57 
58  ///list of covariances
59  std::vector<TMatrixT<double>*> covariances;
60 
61  ///vector of index links
62  std::vector<indexlink> links;
63 
64  ///vector of covariance links
65  std::vector<covlink> covlinks;
66 
67 };
68 
69 #endif
TMatrixT< double > * GetCovarianceMatrix() const
Get Cov. Matrix.
std::vector< std::string > listoffiles
list of file names for covariances
The maximum number of systematics that is supported.
TMatrixT< double > * _covarianceMatrix
The covariance matrix for the enabled systematics.
std::vector< TMatrixT< double > * > covariances
list of covariances
std::vector< covlink > covlinks
vector of covariance links
std::vector< indexlink > links
vector of index links