source: trunk/MagicSoft/Mars/mfilter/MFMagicCuts.h@ 9256

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