| 1 | #ifndef CAOS_MCaos
|
|---|
| 2 | #define CAOS_MCaos
|
|---|
| 3 |
|
|---|
| 4 | #ifndef MARS_MParContainer
|
|---|
| 5 | #include "MParContainer.h"
|
|---|
| 6 | #endif
|
|---|
| 7 | #ifndef CAOS_Leds
|
|---|
| 8 | #include "Leds.h"
|
|---|
| 9 | #endif
|
|---|
| 10 | #ifndef CAOS_Ring
|
|---|
| 11 | #include "Ring.h"
|
|---|
| 12 | #endif
|
|---|
| 13 |
|
|---|
| 14 | #ifndef COSY_PixClient
|
|---|
| 15 | #include "PixClient.h" // byte
|
|---|
| 16 | #endif
|
|---|
| 17 |
|
|---|
| 18 | class TFile;
|
|---|
| 19 | class TH1F;
|
|---|
| 20 | class TH2F;
|
|---|
| 21 | class TGraph;
|
|---|
| 22 |
|
|---|
| 23 | class MTime;
|
|---|
| 24 | class ZdAz;
|
|---|
| 25 |
|
|---|
| 26 | class MCaos : public MParContainer
|
|---|
| 27 | {
|
|---|
| 28 | private:
|
|---|
| 29 | TFile *fFile; // File we may write data to
|
|---|
| 30 |
|
|---|
| 31 | Leds fPositions;
|
|---|
| 32 |
|
|---|
| 33 | Leds *fLeds;
|
|---|
| 34 | Double_t fEvtTime;
|
|---|
| 35 | Double_t fZenithDist;
|
|---|
| 36 | Double_t fAzimuth;
|
|---|
| 37 |
|
|---|
| 38 | TH1F *fHistpr;
|
|---|
| 39 | TH2F **fHistled;
|
|---|
| 40 | TH1F *fHistallw;
|
|---|
| 41 | TH1F **fHistw;
|
|---|
| 42 |
|
|---|
| 43 | TH2F *fHistprxpry;
|
|---|
| 44 |
|
|---|
| 45 | TGraph *fGraphprx;
|
|---|
| 46 | TGraph *fGraphpry;
|
|---|
| 47 | TGraph *fGraphw;
|
|---|
| 48 | TGraph *fGraphr;
|
|---|
| 49 |
|
|---|
| 50 | Short_t fMinNumberLeds; // minimum number of detected leds required
|
|---|
| 51 | Double_t fMinRadius; // minimum radius for cut in ring radius
|
|---|
| 52 | Double_t fMaxRadius; // maximum radius for cut in ring radius
|
|---|
| 53 | UShort_t fSizeBox; // Size of the search box (side length in units of pixels)
|
|---|
| 54 | Double_t fCut; // Cleaning level (sigma above noise)
|
|---|
| 55 | Double_t fArcsecPerPixel; // Conversion from arcseconds to pixel
|
|---|
| 56 |
|
|---|
| 57 | Int_t fNumDetectedLEDs;
|
|---|
| 58 | Int_t fNumDetectedRings;
|
|---|
| 59 |
|
|---|
| 60 | public:
|
|---|
| 61 | MCaos(const char *name=0, const char *title=0)
|
|---|
| 62 | : fFile(NULL), fHistpr(NULL), fMinNumberLeds(5),
|
|---|
| 63 | fMinRadius(265), fMaxRadius(268), fSizeBox(19), fCut(3.0)
|
|---|
| 64 | {
|
|---|
| 65 | fLeds = new Leds;
|
|---|
| 66 | }
|
|---|
| 67 |
|
|---|
| 68 | ~MCaos()
|
|---|
| 69 | {
|
|---|
| 70 | CloseFile();
|
|---|
| 71 | DeleteHistograms();
|
|---|
| 72 | delete fLeds;
|
|---|
| 73 | }
|
|---|
| 74 |
|
|---|
| 75 | void AddPosition(Float_t x, Float_t y, Float_t dx, Float_t dy)
|
|---|
| 76 | {
|
|---|
| 77 | fPositions.Add(x, y, dx, dy);
|
|---|
| 78 | }
|
|---|
| 79 |
|
|---|
| 80 | void ReadResources(const char *name="leds.txt");
|
|---|
| 81 |
|
|---|
| 82 | void OpenFile();
|
|---|
| 83 | void CloseFile();
|
|---|
| 84 |
|
|---|
| 85 | void SetMinNumberLeds(Short_t n)
|
|---|
| 86 | {
|
|---|
| 87 | fMinNumberLeds = n;
|
|---|
| 88 | }
|
|---|
| 89 |
|
|---|
| 90 | void SetMinRadius(Double_t min) { fMinRadius=min; }
|
|---|
| 91 | void SetMaxRadius(Double_t max) { fMaxRadius=max; }
|
|---|
| 92 |
|
|---|
| 93 | void InitHistograms();
|
|---|
| 94 | void DeleteHistograms();
|
|---|
| 95 | void ShowHistograms();
|
|---|
| 96 | void ResetHistograms();
|
|---|
| 97 |
|
|---|
| 98 | Int_t GetNumDetectedLEDs() const { return fNumDetectedLEDs; }
|
|---|
| 99 | Int_t GetNumDetectedRings() const { return fNumDetectedRings; }
|
|---|
| 100 |
|
|---|
| 101 | Double_t GetArcsecPerPixel() const { return fArcsecPerPixel; }
|
|---|
| 102 |
|
|---|
| 103 | Ring Run(byte *img, bool printl, bool printr, const ZdAz &pos,
|
|---|
| 104 | const MTime &t);
|
|---|
| 105 |
|
|---|
| 106 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
|
|---|
| 107 | };
|
|---|
| 108 |
|
|---|
| 109 | #endif
|
|---|