GamR  0.0.0
GammaROOT
Loading...
Searching...
No Matches
TimeWalk.hh
Go to the documentation of this file.
1#ifndef GAMR_PROCESSOR_TIMEWALK_HH
2#define GAMR_PROCESSOR_TIMEWALK_HH
3
4#include <map>
5#include <memory>
6#include <string>
7#include <vector>
8
9#include <Rtypes.h>
10#include <TF1.h>
11#include <TFile.h>
12#include <TGraphErrors.h>
13#include <TH2.h>
14#include <TRandom3.h>
15
16#include <nucleus/Photon.hh>
17
18namespace GamR {
19namespace Processor {
20
21class TimeWalk {
22private:
23 std::vector<Int_t> fDetIds;
24 std::map<std::pair<Int_t, Int_t>, std::unique_ptr<TF1>> fFits;
25 std::map<std::string, std::unique_ptr<GamR::Nucleus::Photon>> fReference;
26 std::map<std::string, std::vector<std::pair<GamR::Nucleus::Photon, Double_t>>> fRelative;
27 std::map<std::string, std::map<std::pair<Int_t, Int_t>, std::unique_ptr<TGraphErrors>>> fGraphs;
28 std::map<std::pair<Int_t, Int_t>, Double_t> fFitResults;
29
30private:
31 class GlobalChiSquare;
32 Int_t AddDataSet(std::string fn);
33
34public:
35 TimeWalk(std::vector<Int_t> ids);
36 ~TimeWalk();
37 Int_t AddPeak(std::string dataset, GamR::Nucleus::Photon photon, Double_t time);
38 void MakeGraphs(Int_t ntoys, Bool_t showmc = kTRUE);
39
40 void Draw(TCanvas *c, Bool_t fits = kFALSE, std::string saveas = "");
41 void Fit();
42};
43
44} // namespace Processor
45} // namespace GamR
46
47#endif
void Draw(TCanvas *c, Bool_t fits=kFALSE, std::string saveas="")
Draws Time Walk graphs.
Definition TimeWalk.cc:83
void MakeGraphs(Int_t ntoys, Bool_t showmc=kTRUE)
Iterating through calibration peaks for each detector pair: calculate the time difference spectrum (w...
Definition TimeWalk.cc:211
TimeWalk(std::vector< Int_t > ids)
TimeWalk Calibration Processor.
Definition TimeWalk.cc:26
Int_t AddPeak(std::string dataset, GamR::Nucleus::Photon photon, Double_t time)
Add a calibration peak to be used to create a data point in the time walk curve.
Definition TimeWalk.cc:188
void Fit()
Conducts a global fit to solve for an absolute time calibration for each detector.
Definition TimeWalk.cc:389
Definition Gain.cc:19