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