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