CovMxManager.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 // CAFAna includes
5 #include "CAFAna/Core/Binning.h"
6 #include "CAFAna/Core/Sample.h"
10 
11 // ROOT includes
12 #include "TRandom3.h"
13 
14 // C++ includes
15 #include <vector>
16 #include <tuple>
17 
18 namespace ana
19 {
20 
21  namespace covmx
22  {
23  typedef std::vector< std::vector<TMatrixD> > Patch;
24  typedef std::pair<Sample, Sample> SamplePair;
25  }
26 
28  {
29 
30  public:
31 
32  CovMxManager(TDirectory* dir, std::vector<covmx::Sample> samples);
33 
34  ~CovMxManager();
35 
36  void AddSystematic(std::vector<covmx::Sample>& samples,
37  const ISyst* syst, size_t patch);
38 
39  std::unique_ptr<covmx::CovarianceMatrix> GetCovarianceMatrix(
40  std::vector<covmx::Sample> samples,
41  std::vector<const ISyst*> systs);
42 
43  // void SetDir(TDirectory* dir) { fTopDir = dir; };
44 
45  static std::unique_ptr<CovMxManager> LoadFrom(TDirectory* dir);
46 
47  private:
48 
49  // Private member functions
50  CovMxManager(TDirectory* dir);
51 
52  void SaveSyst(std::string mxName);
53  void LoadSyst(std::string mxName);
54 
55  TDirectory* fTopDir;
56 
57  std::map<covmx::SamplePair, covmx::Patch> fCovMx;
58  std::vector<unsigned int> fSampleIDs;
59 
60  }; // class CovMxManager
61 
62 } // namespace ana
63 
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
void LoadSyst(string syst)
Definition: PlotXSec.C:371
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
std::unique_ptr< T > LoadFrom(TDirectory *dir, const std::string &label)
Definition: LoadFromFile.h:17
TDirectory * fTopDir
Definition: CovMxManager.h:55
std::pair< Sample, Sample > SamplePair
Definition: CovMxManager.h:24
std::vector< unsigned int > fSampleIDs
Definition: CovMxManager.h:58
std::map< covmx::SamplePair, covmx::Patch > fCovMx
Definition: CovMxManager.h:57
TDirectory * dir
Definition: macro.C:5
std::vector< std::vector< TMatrixD > > Patch
Definition: CovMxManager.h:23
enum BeamMode string