source: trunk/Mars/mfilter/MFMagicCuts.h@ 20096

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