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