CbmRoot
PairAnalysisSpectrum.h
Go to the documentation of this file.
1 #ifndef PAIRANALYSISSPECTRUM_H
2 #define PAIRANALYSISSPECTRUM_H
3 //#############################################################
4 //# #
5 //# Class PairAnalysisSpectrum #
6 //# Authors: #
7 //# Julian Book, Uni Ffm / Julian.Book@cern.ch #
8 //# #
9 //#############################################################
10 
11 
12 //#include <TTree.h>
13 #include <TGraphErrors.h>
14 #include <TObjArray.h>
15 #include <TString.h>
16 #include <TVectorT.h>
17 
18 #include "PairAnalysisHF.h"
19 #include "PairAnalysisHistos.h"
20 
21 #include "PairAnalysisFunction.h"
22 #include "PairAnalysisSignalExt.h"
23 
24 #include "PairAnalysis.h"
25 
26 class TList;
27 class TObjArray;
28 class TFormula;
29 class TTree;
30 class TH1F;
31 
32 class Extraction : public TObject {
33 public:
34  TString setup = ""; // indentifier key
35  Int_t setupId = -1; // identifier idx
36  Int_t poi = 0; // particle of interest
37  Double_t var = 0.; // value of variable
38  Double_t varE = 0.; // error of variable
39  Double_t s = 0.; // raw signal
40  Double_t sE = 0.; // raw signal error
41  Double_t b = 0.; // background
42  Double_t bE = 0.; // background error
43  Double_t sb = 0.; // SB
44  Double_t sbE = 0.; // SBError
45  Double_t sgn = 0.; // Significance
46  Double_t sgnE = 0.; // SignificanceError
47  TH1F* HistSignal = NULL; // SignalHistogram
48  Double_t eff = 0.; // efficiency
49  Double_t effE = 0.; // efficiency error
50  PairAnalysisSignalExt* signal = NULL; // Signal extraction
51  Double_t sref = 0.; // mc truth signal
52  Double_t srefE = 0.; // mc truth signal error
53  ClassDef(
54  Extraction,
55  1) // mini object that holds members of the PairAnalysisSpectrum TTree
56 };
58 
59  class PairAnalysisSpectrum : public PairAnalysisFunction {
60 
61 public:
62  enum ESystMethod { kBarlow = 0, kSystMax, kSystRMS };
63 
64  PairAnalysisSpectrum();
65  PairAnalysisSpectrum(const char* name, const char* title);
66 
67  virtual ~PairAnalysisSpectrum();
68 
69  // General Setter
70 
71  void SetVariable(TString varType, TVectorD* const binLimits) {
72  fVar = varType;
73  fVarBinning = binLimits;
74  }
75  void SetSystMethod(ESystMethod mthd) { fSystMthd = mthd; }
76 
77  // Input
78  void AddInput(TObjArray* raw,
79  TString identifier,
80  TObjArray* mc = NULL,
81  TObjArray* truth = NULL);
82  void AddMCInput(PairAnalysisHistos* hf) { fMCInput.Add(hf); }
83  void AddExtractor(PairAnalysisSignalExt* sig) {
84  fExtractor.Add((PairAnalysisSignalExt*) sig->Clone());
85  }
86 
87  // Spectrum
88  virtual void DrawSpectrum(const char* varexp,
89  const char* selection = "",
90  Option_t* option = "");
91  Int_t Write(const char*, Int_t, Int_t) { return -1; }
92  Int_t Write(const char*, Int_t, Int_t) const { return -1; }
93 
94  void Fit(TString drawoption = "L");
95 
96  // Processing
97  void Init();
98  void Process();
99 
100  // output
101  virtual void Write();
102 
103 private:
104  // settings
105  Int_t fIdx = 0; // index
106  TString fVar = ""; // variable looked at
107  TVectorD* fVarBinning = NULL; // variable binning
108 
109  // calculation
110  ESystMethod fSystMthd =
111  kSystMax; // method for systematic uncertainty calculation
112 
113  // input
114  TString fInputKeys[100]; // keys to identify the extraction
115  TList fRawInput; // list of input objects for signals (HF, Ntuple, THnSparse)
116  TList fMCInput; // list of input objects for mc (HF, Ntuple, THnSparse)
117  TList fMCTruth; // list of input objects for mc truth
118  TList
119  fExtractor; // list of input objects for signal extraction objects (Ext,Func)
120 
121  // output
122  TTree* fTree = NULL; // tree output
123  TList* fResults = NULL; // final list of inv. mass spectra
124  TObjArray* fExtractions = NULL; // final canvases
125  Extraction* fExt = NULL; // extraction
126 
127  TGraphErrors* fSignal = NULL; // signal graph
128 
129  PairAnalysisSpectrum(const PairAnalysisSpectrum& c);
130  PairAnalysisSpectrum& operator=(const PairAnalysisSpectrum& c);
131 
132  ClassDef(PairAnalysisSpectrum,
133  1) // Build spectra from many signal extractions
134 };
135 
136 #endif
PairAnalysisFunction::operator=
PairAnalysisFunction & operator=(const PairAnalysisFunction &c)
PairAnalysisFunction
Definition: PairAnalysisFunction.h:22
Extraction::sE
Double_t sE
Definition: PairAnalysisSpectrum.h:40
Extraction::b
Double_t b
Definition: PairAnalysisSpectrum.h:41
PairAnalysisSignalExt
Definition: PairAnalysisSignalExt.h:25
Extraction::sb
Double_t sb
Definition: PairAnalysisSpectrum.h:43
Extraction::eff
Double_t eff
Definition: PairAnalysisSpectrum.h:48
Extraction::srefE
Double_t srefE
Definition: PairAnalysisSpectrum.h:52
Extraction::sbE
Double_t sbE
Definition: PairAnalysisSpectrum.h:44
PairAnalysisSignalExt.h
PairAnalysisFunction.h
PairAnalysis.h
Extraction::sref
Double_t sref
Definition: PairAnalysisSpectrum.h:51
Extraction::effE
Double_t effE
Definition: PairAnalysisSpectrum.h:49
Extraction::setupId
Int_t setupId
Definition: PairAnalysisSpectrum.h:35
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
Extraction
Definition: PairAnalysisSpectrum.h:32
Extraction::s
Double_t s
Definition: PairAnalysisSpectrum.h:39
PairAnalysisHF.h
Extraction::varE
Double_t varE
Definition: PairAnalysisSpectrum.h:38
Extraction::poi
Int_t poi
Definition: PairAnalysisSpectrum.h:36
Extraction::signal
PairAnalysisSignalExt * signal
Definition: PairAnalysisSpectrum.h:50
Extraction::sgn
Double_t sgn
Definition: PairAnalysisSpectrum.h:45
Extraction::bE
Double_t bE
Definition: PairAnalysisSpectrum.h:42
Extraction::var
Double_t var
Definition: PairAnalysisSpectrum.h:37
PairAnalysisHistos.h
Extraction::setup
TString setup
Definition: PairAnalysisSpectrum.h:34
Extraction::HistSignal
TH1F * HistSignal
Definition: PairAnalysisSpectrum.h:47
Extraction::sgnE
Double_t sgnE
Definition: PairAnalysisSpectrum.h:46