1 | #ifndef MARS_MJSpectrum
|
---|
2 | #define MARS_MJSpectrum
|
---|
3 |
|
---|
4 | #ifndef MARS_MJob
|
---|
5 | #include <MJob.h>
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class TF1;
|
---|
9 | class TH1;
|
---|
10 | class TH1D;
|
---|
11 | class TH2D;
|
---|
12 |
|
---|
13 | class MH3;
|
---|
14 | class MTask;
|
---|
15 | class MParList;
|
---|
16 | class MDataSet;
|
---|
17 | class MHEnergyEst;
|
---|
18 | class MAlphaFitter;
|
---|
19 | class MStatusArray;
|
---|
20 | class MHCollectionArea;
|
---|
21 | class MMcSpectrumWeight;
|
---|
22 |
|
---|
23 | class MJSpectrum : public MJob
|
---|
24 | {
|
---|
25 | private:
|
---|
26 | MTask *fCut0;
|
---|
27 | MTask *fCut1;
|
---|
28 | MTask *fCut2;
|
---|
29 | MTask *fCut3;
|
---|
30 | MTask *fEstimateEnergy;
|
---|
31 |
|
---|
32 | Bool_t fRefill;
|
---|
33 | Bool_t fSimpleMode;
|
---|
34 | Bool_t fRawMc;
|
---|
35 | Bool_t fNoThetaWeights;
|
---|
36 |
|
---|
37 | // Read Input
|
---|
38 | Bool_t ReadTask(MTask* &task, const char *name) const;
|
---|
39 | Float_t ReadInput(MParList &plist, TH1D &h1, TH1D &size);
|
---|
40 | Bool_t ReadOrigMCDistribution(const MDataSet &set, TH1 &h, MMcSpectrumWeight &w) const;
|
---|
41 | Bool_t GetThetaDistribution(TH1D &temp1, TH1D &temp2) const;
|
---|
42 | Bool_t Refill(MParList &plist, TH1D &h) const;
|
---|
43 | Bool_t InitWeighting(const MDataSet &set, MMcSpectrumWeight &w) const;
|
---|
44 |
|
---|
45 | // Display Output
|
---|
46 | void PrintSetup(const MAlphaFitter &fit) const;
|
---|
47 | void DisplayResult(const TH2D &mh1) const;
|
---|
48 | Bool_t IntermediateLoop(MParList &plist, MH3 &h1, TH1D &temp1, const MDataSet &set, MMcSpectrumWeight &w) const;
|
---|
49 | TArrayD FitSpectrum(TH1D &spectrum) const;
|
---|
50 | TArrayD DisplaySpectrum(MHCollectionArea &area, TH1D &excess, MHEnergyEst &hest, Double_t ontime) const;
|
---|
51 | Bool_t DisplaySize(MParList &plist, Double_t scale) const;
|
---|
52 | Bool_t PlotSame(MStatusArray &arr, MParList &plist, const char *name, const char *tab, const char *plot, Double_t scale) const;
|
---|
53 |
|
---|
54 | public:
|
---|
55 | MJSpectrum(const char *name=NULL, const char *title=NULL);
|
---|
56 | ~MJSpectrum();
|
---|
57 |
|
---|
58 | Bool_t Process(const MDataSet &set);
|
---|
59 |
|
---|
60 | void EnableRefilling(Bool_t b=kTRUE) { fRefill=b; }
|
---|
61 | void EnableSimpleMode(Bool_t b=kTRUE) { fSimpleMode=b; }
|
---|
62 | void EnableRawMc(Bool_t b=kTRUE) { fRawMc=b; }
|
---|
63 |
|
---|
64 | void SetEnergyEstimator(const MTask *task);
|
---|
65 |
|
---|
66 | static TString FormString(const TF1 &f, Byte_t type=0);
|
---|
67 |
|
---|
68 | ClassDef(MJSpectrum, 0) // Proh'gram to calculate spectrum
|
---|
69 | };
|
---|
70 |
|
---|
71 | #endif
|
---|