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

Last change on this file since 7738 was 7191, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 3.2 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 kAll =kArea
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, kEM3Long,
44 kEM3LongAnti, kEM3Trans, kEDistAnti, kEWdivL, //kEZd,
45 kELeakage, kESrcSign, //kEDelta, //kEMeanX, kEMeanY, kEDelta,
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
57 Float_t fMm2Deg; //! Conversion factor from mm to deg, from MGeomCam
58 Bool_t fResult; //! Result of the filter evaluation
59
60 Int_t fMap[kLastElement]; //! Mapping table for fast optimization
61 MHMatrix *fMatrix; //! Matrix thorugh which the mapped elements are accessed
62
63 TArrayD fVariables; // Coefficients of cuts
64
65 ThetaCut_t fThetaCut; // Which kind of theta cut should be evaluated
66 HadronnessCut_t fHadronnessCut; // Which kind of hadronness cut should be evaluated
67
68 // MTask
69 Int_t PreProcess(MParList *pList);
70 Int_t Process();
71
72 // MFilter
73 Bool_t IsExpressionTrue() const { return fResult; }
74
75 // MFMagicCuts
76 Double_t GetVal(Int_t i) const;
77 TString GetParam(Int_t i) const;
78 Double_t GetThetaSq(Double_t p, Double_t wl, Double_t d, Double_t a) const;
79
80public:
81 MFMagicCuts(const char *name=NULL, const char *title=NULL);
82
83 // Getter
84 Double_t GetThetaSqCut() const;
85
86 // Setter
87 void SetThetaCut(ThetaCut_t c) { fThetaCut=c; }
88 void SetHadronnessCut(HadronnessCut_t c) { fHadronnessCut=c; }
89
90 // MFMagicCuts
91 void InitMapping(MHMatrix *mat);
92 void StopMapping() { InitMapping(NULL); }
93
94 Bool_t CoefficentsRead(const char *fname);
95 Bool_t CoefficentsWrite(const char *fname) const;
96
97 // MParContainer
98 void SetVariables(const TArrayD &arr);
99
100 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
101
102 // TObject
103 void Print(Option_t *o="") const;
104
105 ClassDef(MFMagicCuts, 1) // A filter to evaluate the MagicCuts
106};
107
108#endif
Note: See TracBrowser for help on using the repository browser.