1 | #ifndef MARS_MFMagicCuts
|
---|
2 | #define MARS_MFMagicCuts
|
---|
3 |
|
---|
4 | #ifndef MARS_MFilter
|
---|
5 | #include "MFilter.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef ROOT_TArrayD
|
---|
9 | #include <TArrayD.h>
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | class MParList;
|
---|
13 |
|
---|
14 | class MHillas;
|
---|
15 | class MHillasSrc;
|
---|
16 | class MHillasExt;
|
---|
17 | class MNewImagePar;
|
---|
18 | class MParameterD;
|
---|
19 | class MPointingPos;
|
---|
20 | class MHMatrix;
|
---|
21 |
|
---|
22 | class MFMagicCuts : public MFilter
|
---|
23 | {
|
---|
24 | public:
|
---|
25 | // Possible kind of theta cuts
|
---|
26 | enum ThetaCut_t {
|
---|
27 | kNone =BIT(0),
|
---|
28 | kOn =BIT(1),
|
---|
29 | kOff =BIT(2),
|
---|
30 | kWobble=kOn|kOff
|
---|
31 | };
|
---|
32 | // Possible kind of hadronness cuts
|
---|
33 | enum HadronnessCut_t {
|
---|
34 | kNoCut =BIT(0),
|
---|
35 | kArea =BIT(1),
|
---|
36 | kHadronness=BIT(2),
|
---|
37 | kAll =kArea|kHadronness
|
---|
38 | };
|
---|
39 |
|
---|
40 | private:
|
---|
41 | // Elements for mapping. kLastElement must not be used and must be
|
---|
42 | // the last on in the list. It is used as counter for fMap.
|
---|
43 | enum {
|
---|
44 | kESize, kEAlpha, kEAlphaAnti, kEArea, kEDist, kEDistAnti,
|
---|
45 | kEM3Long, kEM3LongAnti, kEWdivL, kELeakage, kESrcSign, kEHadronness,
|
---|
46 | kLastElement
|
---|
47 | };
|
---|
48 |
|
---|
49 | MHillas *fHil; //! Pointer to MHillas container
|
---|
50 | MHillasSrc *fHilSrc; //! Pointer to MHillasSrc container
|
---|
51 | MHillasSrc *fHilAnti; //! Pointer to MHillasSrc container called MHillasSrcAnti
|
---|
52 | MHillasExt *fHilExt; //! Pointer to MHillasExt container
|
---|
53 | MNewImagePar *fNewImgPar; //! Pointer to MHillasExt container
|
---|
54 | MParameterD *fThetaSq; //! Pointer to MParameterD container called ThetaSq
|
---|
55 | MParameterD *fDisp; //! Pointer to MParameterD container called Disp
|
---|
56 | MParameterD *fHadronness; //! Pointer to MParameterD container called Hadronness
|
---|
57 |
|
---|
58 | Float_t fMm2Deg; //! Conversion factor from mm to deg, from MGeomCam
|
---|
59 | Bool_t fResult; //! Result of the filter evaluation
|
---|
60 |
|
---|
61 | Int_t fMap[kLastElement]; //! Mapping table for fast optimization
|
---|
62 | MHMatrix *fMatrix; //! Matrix thorugh which the mapped elements are accessed
|
---|
63 |
|
---|
64 | TArrayD fVariables; // Coefficients of cuts
|
---|
65 |
|
---|
66 | ThetaCut_t fThetaCut; // Which kind of theta cut should be evaluated
|
---|
67 | HadronnessCut_t fHadronnessCut; // Which kind of hadronness cut should be evaluated
|
---|
68 |
|
---|
69 | // MTask
|
---|
70 | Int_t PreProcess(MParList *pList);
|
---|
71 | Int_t Process();
|
---|
72 |
|
---|
73 | // MFilter
|
---|
74 | Bool_t IsExpressionTrue() const { return fResult; }
|
---|
75 |
|
---|
76 | // MFMagicCuts
|
---|
77 | Double_t GetVal(Int_t i) const;
|
---|
78 | TString GetParam(Int_t i) const;
|
---|
79 | Double_t GetThetaSq(Double_t p, Double_t wl, Double_t d, Double_t a) const;
|
---|
80 |
|
---|
81 | public:
|
---|
82 | MFMagicCuts(const char *name=NULL, const char *title=NULL);
|
---|
83 |
|
---|
84 | // Getter
|
---|
85 | Double_t GetThetaSqCut() const;
|
---|
86 |
|
---|
87 | // Setter
|
---|
88 | void SetThetaCut(ThetaCut_t c) { fThetaCut=c; }
|
---|
89 | void SetHadronnessCut(HadronnessCut_t c) { fHadronnessCut=c; }
|
---|
90 |
|
---|
91 | // MFMagicCuts
|
---|
92 | void InitMapping(MHMatrix *mat);
|
---|
93 | void StopMapping() { InitMapping(NULL); }
|
---|
94 |
|
---|
95 | Bool_t CoefficentsRead(const char *fname);
|
---|
96 | Bool_t CoefficentsWrite(const char *fname) const;
|
---|
97 |
|
---|
98 | // MParContainer
|
---|
99 | void SetVariables(const TArrayD &arr);
|
---|
100 |
|
---|
101 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
|
---|
102 |
|
---|
103 | // TObject
|
---|
104 | void Print(Option_t *o="") const;
|
---|
105 |
|
---|
106 | ClassDef(MFMagicCuts, 1) // A filter to evaluate the MagicCuts
|
---|
107 | };
|
---|
108 |
|
---|
109 | #endif
|
---|