source: trunk/Mars/mjobs/MJSpectrum.h@ 13833

Last change on this file since 13833 was 9343, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 2.8 KB
Line 
1#ifndef MARS_MJSpectrum
2#define MARS_MJSpectrum
3
4#ifndef MARS_MJob
5#include <MJob.h>
6#endif
7
8class TF1;
9class TH1;
10class TH1D;
11class TH2D;
12
13class MH3;
14class MHn;
15class MTask;
16class MParList;
17class MDataSet;
18class MHEnergyEst;
19class MAlphaFitter;
20class MStatusArray;
21class MWriteRootFile;
22class MHCollectionArea;
23class MMcSpectrumWeight;
24
25class MJSpectrum : public MJob
26{
27private:
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 Bool_t fForceOnTimeFit;
41
42 // Setup Histograms
43 void SetupHistEvtDist(MHn &hist) const;
44 void SetupHistEnergyEst(MHn &hist) const;
45 void SetupHistDisp(MHn &hist) const;
46 void SetupHistEnergyRes(MHn &hist) const;
47
48 // Read Input
49 Bool_t ReadTask(MTask* &task, const char *name, Bool_t mustexist=kTRUE) const;
50 Float_t ReadInput(MParList &plist, TH1D &h1, TH1D &size);
51 Bool_t AnalyzeMC(const MDataSet &set, Float_t &impactmax, Float_t &emin/*, Float_t emax*/) const;
52 Bool_t ReadOrigMCDistribution(const MDataSet &set, TH1 &h, MMcSpectrumWeight &w) const;
53 void GetThetaDistribution(TH1D &temp1, TH2D &temp2) const;
54 TString GetHAlpha() const;
55 Bool_t Refill(MParList &plist, TH1D &h) /*const*/;
56 Bool_t InitWeighting(const MDataSet &set, MMcSpectrumWeight &w) const;
57
58 // Write output
59 void SetupWriter(MWriteRootFile *write/*, const char *name*/) const;
60
61 // Display Output
62 void PrintSetup(const MAlphaFitter &fit) const;
63 Bool_t DisplayResult(const TH2D &mh1) const;
64 //Bool_t IntermediateLoop(MParList &plist, MH3 &h1, TH1D &temp1, const MDataSet &set, MMcSpectrumWeight &w) const;
65 TArrayD FitSpectrum(TH1D &spectrum) const;
66 TArrayD DisplaySpectrum(MHCollectionArea &area, TH1D &excess, MHEnergyEst &hest, Double_t ontime) const;
67 Bool_t DisplaySize(MParList &plist, Double_t scale) const;
68 void DisplayCutEfficiency(const MHCollectionArea &area0, const MHCollectionArea &area1) const;
69 Bool_t PlotSame(MStatusArray &arr, MParList &plist, const char *name, const char *tab, const char *plot, Double_t scale) const;
70
71public:
72 MJSpectrum(const char *name=NULL, const char *title=NULL);
73 ~MJSpectrum();
74
75 Bool_t Process(const MDataSet &set);
76
77 void ForceTheta(Bool_t b=kTRUE) { fForceTheta=b; }
78 void ForceRunTime(Bool_t b=kTRUE) { fForceRunTime=b; }
79 void ForceOnTimeFit(Bool_t b=kTRUE) { fForceOnTimeFit=b; }
80
81 void SetEnergyEstimator(const MTask *task);
82
83 static TString FormFloat(Double_t d);
84 static TString FormFlux(const TF1 &f, const char *unit);
85 static TString FormString(const TF1 &f, Byte_t type=0);
86
87 ClassDef(MJSpectrum, 0) // Proh'gram to calculate spectrum
88};
89
90#endif
Note: See TracBrowser for help on using the repository browser.