1 | #ifndef MARS_MFSoftwareTrigger
|
---|
2 | #define MARS_MFSoftwareTrigger
|
---|
3 |
|
---|
4 | #ifndef MARS_MFilter
|
---|
5 | #include "MFilter.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class MMcEvt;
|
---|
9 | class MGeomCam;
|
---|
10 | class MCerPhotEvt;
|
---|
11 | class MCerPhotPix;
|
---|
12 | class MArrivalTime;
|
---|
13 |
|
---|
14 | class MFSoftwareTrigger : public MFilter
|
---|
15 | {
|
---|
16 | public:
|
---|
17 | enum TriggerType_t {
|
---|
18 | kSinglePixelNeighbors,
|
---|
19 | kAnyPattern/*,
|
---|
20 | kMagicLvl1*/
|
---|
21 | };
|
---|
22 |
|
---|
23 | private:
|
---|
24 | const MGeomCam *fCam; // Camera Geometry
|
---|
25 | const MCerPhotEvt *fEvt; // Cerenkov Photon Event
|
---|
26 | const MArrivalTime *fTme;
|
---|
27 |
|
---|
28 | Float_t fThreshold; // nuber of minimum required photons
|
---|
29 | Float_t fTimeWindow; // Window for time coincidence
|
---|
30 | Byte_t fNumNeighbors; // number of required neighbours
|
---|
31 |
|
---|
32 | Int_t fCut[2];
|
---|
33 |
|
---|
34 | Bool_t fResult;
|
---|
35 |
|
---|
36 | TriggerType_t fType;
|
---|
37 |
|
---|
38 | enum {
|
---|
39 | kWasChecked = BIT(21),
|
---|
40 | kAboveThreshold = BIT(22),
|
---|
41 | kIsCoincident = BIT(23)
|
---|
42 | };
|
---|
43 |
|
---|
44 | Int_t PreProcess(MParList *pList);
|
---|
45 | Int_t Process();
|
---|
46 | Int_t PostProcess();
|
---|
47 |
|
---|
48 | void ResetBits(Int_t bits) const;
|
---|
49 | Bool_t CheckPixel(const MCerPhotPix &pix) const;
|
---|
50 | Bool_t SwTrigger() const;
|
---|
51 | Bool_t SwCoincidence() const;
|
---|
52 | //Int_t CheckCoincidence(Int_t idx, Float_t tm0) const;
|
---|
53 | //Bool_t MagicLvl1Trigger() const;
|
---|
54 | Int_t CountPixels(Int_t idx, Float_t tm) const;
|
---|
55 | Bool_t ClusterTrigger() const;
|
---|
56 |
|
---|
57 | Bool_t IsExpressionTrue() const { return fResult; }
|
---|
58 |
|
---|
59 | public:
|
---|
60 | MFSoftwareTrigger(const char *name=NULL, const char *title=NULL);
|
---|
61 |
|
---|
62 | void SetThreshold(Float_t min) { fThreshold = min; }
|
---|
63 | void SetNumNeighbors(Byte_t num) { fNumNeighbors = num; }
|
---|
64 | void SetTimeWindow(Float_t win=-1) { fTimeWindow = win; }
|
---|
65 | void SetTriggerType(TriggerType_t type) { fType = type; }
|
---|
66 |
|
---|
67 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
|
---|
68 |
|
---|
69 | ClassDef(MFSoftwareTrigger, 0) // Filter for software trigger
|
---|
70 | };
|
---|
71 |
|
---|
72 | #endif
|
---|