source: branches/Mars_use_drstimefiles/mtemp/mifae/library/MEffAreaAndCoeffCalc.h@ 19365

Last change on this file since 19365 was 6487, checked in by rico, 20 years ago
*** empty log message ***
File size: 2.1 KB
Line 
1#ifndef MARS_MEffAreaAndCoeffCalc
2#define MARS_MEffAreaAndCoeffCalc
3
4#ifndef MARS_MTask
5#include "MTask.h"
6#endif
7
8class TF1;
9class TH1F;
10class TH2F;
11class MHillas;
12class MMcEvt;
13
14#include "TChain.h"
15
16class MEffAreaAndCoeffCalc
17{
18 private:
19
20 TF1* fSpec; // function used to parametrize the spectrum
21
22 Float_t fEmin; // Minimum energy in GeV
23 Float_t fEmax; // Maximum energy in GeV
24 Int_t fEbins; // number of bins to build spectrum
25 Int_t fEsubbins; // number of subbins per big bin (to compute weights, eff areas...)
26
27 Float_t fLogEWmin; // Log Minimum energy for weights (in GeV)
28 Float_t fLogEWmax; // Log Maximum energy for weights (in GeV)
29 Int_t fEWbins; // Number of bins for weights
30
31 Int_t fNTbins; // Number of bins in zenith angle
32 Double_t* fTbin; // array containing bin boundaries (size must be fNTbins+)
33
34 Double_t* fWeight; // array containing weights
35 TH2F* fCoeff; // histogram containing unfolding coefficients
36 TH2F* fEffA; // histogram containing effective areas
37
38 TChain* fCini; // chain for initial MC files (before trigger)
39 TChain* fCcut; // chain for surviving MC events (after cuts)
40
41 MHillas* fHillas; // pointer to the MHillas Branch
42 MMcEvt* fMcEvt; // pointer to the MMcEvt Branch
43
44 // TFile* fFile; // output file (for debugging only)
45
46 protected:
47
48 void FillOriginalSpectrum();
49 void ComputeCoefficients();
50 void ComputeWeights();
51 void ComputeEffectiveAreas();
52
53 public:
54
55 MEffAreaAndCoeffCalc();
56
57 virtual ~MEffAreaAndCoeffCalc();
58
59 void SetFunction(const Char_t* chfunc, Float_t emin=0., Float_t emax=0.);
60 void SetFunction(TF1*);
61 void SetEbins(Int_t i) {fEbins=i;}
62 void SetEsubbins(Int_t i) {fEsubbins=i;}
63 void SetEmin(Float_t x) {fEmin=x;}
64 void SetEmax(Float_t x) {fEmax=x;}
65
66 void SetThetaBinning(Int_t n, const Double_t* binlist);
67
68 void AddFile(const Char_t* name) {fCini->Add(name); fCcut->Add(name);}
69
70 TH2F* GetEffectiveAreaHisto() {return fEffA;}
71 TH2F* GetCoefficientHisto() {return fCoeff;}
72
73 void ComputeAllFactors();
74
75 ClassDef(MEffAreaAndCoeffCalc, 0) // task to compute the Effective areas and Coefficients for the unfolding
76};
77
78#endif
79
Note: See TracBrowser for help on using the repository browser.