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

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