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 MHn;
|
---|
15 | class MTask;
|
---|
16 | class MParList;
|
---|
17 | class MDataSet;
|
---|
18 | class MHEnergyEst;
|
---|
19 | class MAlphaFitter;
|
---|
20 | class MStatusArray;
|
---|
21 | class MWriteRootFile;
|
---|
22 | class MHCollectionArea;
|
---|
23 | class MMcSpectrumWeight;
|
---|
24 |
|
---|
25 | class MJSpectrum : public MJob
|
---|
26 | {
|
---|
27 | private:
|
---|
28 | MTask *fCutQ;
|
---|
29 | MTask *fCut0;
|
---|
30 | MTask *fCut1;
|
---|
31 | MTask *fCut2;
|
---|
32 | MTask *fCut3;
|
---|
33 | MTask *fCutS;
|
---|
34 | MTask *fEstimateEnergy;
|
---|
35 | MTask *fCalcHadronness;
|
---|
36 | MTask *fCalcDisp;
|
---|
37 |
|
---|
38 | Bool_t fForceTheta;
|
---|
39 | Bool_t fForceRunTime;
|
---|
40 |
|
---|
41 | // Setup Histograms
|
---|
42 | void SetupHistEvtDist(MHn &hist) const;
|
---|
43 | void SetupHistEnergyEst(MHn &hist) const;
|
---|
44 | void SetupHistDisp(MHn &hist) const;
|
---|
45 | void SetupHistEnergyRes(MHn &hist) const;
|
---|
46 |
|
---|
47 | // Read Input
|
---|
48 | Bool_t ReadTask(MTask* &task, const char *name, Bool_t mustexist=kTRUE) const;
|
---|
49 | Float_t ReadInput(MParList &plist, TH1D &h1, TH1D &size);
|
---|
50 | Bool_t AnalyzeMC(const MDataSet &set, Float_t &impactmax, Float_t &emin/*, Float_t emax*/) const;
|
---|
51 | Bool_t ReadOrigMCDistribution(const MDataSet &set, TH1 &h, MMcSpectrumWeight &w) const;
|
---|
52 | void GetThetaDistribution(TH1D &temp1, TH2D &temp2) const;
|
---|
53 | Bool_t Refill(MParList &plist, TH1D &h) /*const*/;
|
---|
54 | Bool_t InitWeighting(const MDataSet &set, MMcSpectrumWeight &w) const;
|
---|
55 |
|
---|
56 | // Write output
|
---|
57 | void SetupWriter(MWriteRootFile *write/*, const char *name*/) const;
|
---|
58 |
|
---|
59 | // Display Output
|
---|
60 | void PrintSetup(const MAlphaFitter &fit) const;
|
---|
61 | Bool_t DisplayResult(const TH2D &mh1) const;
|
---|
62 | //Bool_t IntermediateLoop(MParList &plist, MH3 &h1, TH1D &temp1, const MDataSet &set, MMcSpectrumWeight &w) const;
|
---|
63 | TArrayD FitSpectrum(TH1D &spectrum) const;
|
---|
64 | TArrayD DisplaySpectrum(MHCollectionArea &area, TH1D &excess, MHEnergyEst &hest, Double_t ontime) const;
|
---|
65 | Bool_t DisplaySize(MParList &plist, Double_t scale) const;
|
---|
66 | void DisplayCutEfficiency(const MHCollectionArea &area0, const MHCollectionArea &area1) const;
|
---|
67 | Bool_t PlotSame(MStatusArray &arr, MParList &plist, const char *name, const char *tab, const char *plot, Double_t scale) const;
|
---|
68 |
|
---|
69 | public:
|
---|
70 | MJSpectrum(const char *name=NULL, const char *title=NULL);
|
---|
71 | ~MJSpectrum();
|
---|
72 |
|
---|
73 | Bool_t Process(const MDataSet &set);
|
---|
74 |
|
---|
75 | void ForceTheta(Bool_t b=kTRUE) { fForceTheta=b; }
|
---|
76 | void ForceRunTime(Bool_t b=kTRUE) { fForceRunTime=b; }
|
---|
77 |
|
---|
78 | void SetEnergyEstimator(const MTask *task);
|
---|
79 |
|
---|
80 | static TString FormString(const TF1 &f, Byte_t type=0);
|
---|
81 |
|
---|
82 | ClassDef(MJSpectrum, 0) // Proh'gram to calculate spectrum
|
---|
83 | };
|
---|
84 |
|
---|
85 | #endif
|
---|