source: branches/Mars_use_drstimefiles/mimage/MImgCleanTime.h@ 20110

Last change on this file since 20110 was 17833, checked in by tbretz, 11 years ago
First working version.
File size: 1.6 KB
Line 
1#ifndef MARS_MImgCleanTime
2#define MARS_MImgCleanTime
3
4#include <stdint.h>
5#include <list>
6#include <vector>
7
8#ifndef MARS_MTask
9#include "MTask.h"
10#endif
11
12class MGeom;
13class MGeomCam;
14class MSignalPix;
15class MSignalCam;
16
17struct Island
18{
19 uint16_t count;
20 float size;
21 float min;
22 float max;
23
24 Island() : count(0) { }
25 Island(float sz, float tm) : count(1), size(sz), min(tm), max(tm) { }
26
27 void operator+=(const Island &i)
28 {
29 count += i.count;
30 size += i.size;
31 if (i.min<min)
32 min = i.min;
33 if (i.max>max)
34 max = i.max;
35 }
36};
37
38class MImgCleanTime : public MTask
39{
40public:
41 const MGeomCam *fCam; //!
42 MSignalCam *fEvt; //!
43
44 UInt_t fMinCount;
45 Float_t fMinSize;
46 Float_t fDeltaT;
47
48 TString fNameSignalCam; // name of the 'MSignalCam' container
49
50 std::vector<Island> fIslands;
51 std::list<std::pair<uint16_t, uint16_t>> fContacts;
52 std::vector<uint16_t> fLut;
53
54 Island CalcIsland(MSignalPix &, const MGeom &, const uint16_t &);
55
56 // MParContainer
57 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
58
59 Int_t PreProcess(MParList *pList);
60 Int_t Process();
61
62public:
63 MImgCleanTime(const char *name=NULL, const char *title=NULL);
64
65 //void Print(Option_t *o="") const;
66
67 void SetMinCount(UInt_t sz) { fMinCount=sz; }
68 void SetMinSize(Float_t lvl) { fMinSize=lvl; }
69 void SetDeltaT(Float_t dt) { fDeltaT=dt; }
70
71 void SetNameSignalCam(const char *name) { fNameSignalCam = name; }
72
73 ClassDef(MImgCleanTime, 0) // task doing the image cleaning
74};
75
76#endif
Note: See TracBrowser for help on using the repository browser.