1 | #ifndef MARS_MMovieWrite
|
---|
2 | #define MARS_MMovieWrite
|
---|
3 |
|
---|
4 | #ifndef MARS_MTask
|
---|
5 | #include "MTask.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class TH1;
|
---|
9 | class TASImage;
|
---|
10 |
|
---|
11 | class MGeomCam;
|
---|
12 | class MMovieData;
|
---|
13 | class MSignalCam;
|
---|
14 | class MPedestalCam;
|
---|
15 | class MRawEvtHeader;
|
---|
16 | class MRawRunHeader;
|
---|
17 | class MBadPixelsCam;
|
---|
18 |
|
---|
19 | class MMovieWrite : public MTask
|
---|
20 | {
|
---|
21 | private:
|
---|
22 | MRawRunHeader *fRun; //! Header with run number and sampling frequency
|
---|
23 | MRawEvtHeader *fHead; //! Header with event number
|
---|
24 | MGeomCam *fCam; //! Camera geometry necessary for the histograms
|
---|
25 | MSignalCam *fSig; //! Input signal to display cleaned and uncleaned event
|
---|
26 | MBadPixelsCam *fBad; //! Information about bad pixels
|
---|
27 | MPedestalCam *fPed; //! Fundamental pedestal for palette and cleaning
|
---|
28 |
|
---|
29 | MMovieData *fIn; //! Input data with splines for all pixels
|
---|
30 |
|
---|
31 | FILE *fPipe; //! Ouput pipe to player or encoder
|
---|
32 |
|
---|
33 | Float_t fTargetLength; // [s] Target length for stream of one event (+1 frame)
|
---|
34 | Float_t fThreshold; // Threshold for cleaning
|
---|
35 | UInt_t fNumEvents; // Maximum number of events to encode
|
---|
36 |
|
---|
37 | TString fFilename; // name of output file
|
---|
38 |
|
---|
39 | // MTask
|
---|
40 | Int_t PreProcess(MParList *plist);
|
---|
41 | Int_t Process();
|
---|
42 | Int_t PostProcess();
|
---|
43 |
|
---|
44 | // MParContainer
|
---|
45 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
46 |
|
---|
47 | // MMovieWrite
|
---|
48 | Bool_t OpenPipe();
|
---|
49 | Bool_t CheckPipe();
|
---|
50 |
|
---|
51 | Double_t GetMedianPedestalRms() const;
|
---|
52 |
|
---|
53 | void Clean(TH1 &h, Double_t rms) const;
|
---|
54 | void TreatBadPixels(TH1 &h) const;
|
---|
55 |
|
---|
56 | Int_t SetPalette(Double_t rms, const TH1 &h) const;
|
---|
57 | void DeletePalette(Int_t colidx) const;
|
---|
58 |
|
---|
59 | void UpdateImage(TASImage &img, TVirtualPad &pad);
|
---|
60 |
|
---|
61 | Bool_t WriteImage(TASImage &img);
|
---|
62 | Bool_t WriteImage(TASImage &img, TVirtualPad &pad);
|
---|
63 | //Bool_t WriteImage(TVirtualPad &pad);
|
---|
64 |
|
---|
65 | Bool_t Process(TH1 &h, TVirtualPad &c);
|
---|
66 |
|
---|
67 | public:
|
---|
68 | MMovieWrite(const char *name=NULL, const char *title=NULL);
|
---|
69 | ~MMovieWrite();
|
---|
70 |
|
---|
71 | void SetFilename(const char *f) { fFilename = f; }
|
---|
72 | void SetNumEvents(Int_t n) { fNumEvents = n; }
|
---|
73 | void SetThreshold(Float_t f) { fThreshold = f; }
|
---|
74 | void SetTargetLength(Float_t l) { fTargetLength = l; }
|
---|
75 |
|
---|
76 | ClassDef(MMovieWrite, 0) // Task to encode a movie
|
---|
77 | };
|
---|
78 |
|
---|
79 | #endif
|
---|