source: trunk/MagicSoft/Mars/mgeom/MGeomCam.h@ 3664

Last change on this file since 3664 was 3547, checked in by gaug, 21 years ago
*** empty log message ***
File size: 2.6 KB
Line 
1#ifndef MARS_MGeomCam
2#define MARS_MGeomCam
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7#ifndef ROOT_TObjArray
8#include <TObjArray.h>
9#endif
10#ifndef ROOT_TArrayF
11#include <TArrayF.h>
12#endif
13
14class MGeomPix;
15
16class MGeomCam : public MParContainer
17{
18private:
19 UInt_t fNumPixels; // Number of pixels in this camera
20
21 Float_t fCamDist; // [m] Average distance of the camera from the mirror
22 Float_t fConvMm2Deg; // conversion factor to convert mm in the camera plain into degrees
23
24 TObjArray fPixels; // Array of singel pixels storing the geometry
25
26 TArrayF fMaxRadius; // maximum radius of the part of the camera with the same pixel size (eg. for GUI layout)
27 TArrayF fMinRadius; // minimum radius of the part of the camera with the same pixel size (eg. for GUI layout)
28 TArrayF fPixRatio; // Array storing the ratio between size of pixel 0 and pixel idx (for speed reasons)
29 TArrayF fPixRatioSqrt; // Array storing the square root ratio between size of pixel 0 and pixel idx (for speed reasons)
30
31 Int_t fNumSectors; // Number of sectors
32 Int_t fNumAreas; // Number of different pixel sizes
33
34protected:
35
36 void CalcMaxRadius();
37 void CalcNumSectors();
38 void CalcNumAreas();
39 void InitOuterRing();
40 void InitGeometry()
41 {
42 CalcNumSectors();
43 CalcNumAreas();
44 CalcMaxRadius();
45 CalcPixRatio();
46 InitOuterRing();
47 }
48
49
50public:
51 MGeomCam();
52 MGeomCam(UInt_t npix, Float_t dist, const char *name=NULL, const char *title=NULL);
53
54 virtual TObject *Clone(const char *newname=NULL) const;
55
56 void CalcPixRatio();
57 // FIXME, workaround: this function is made public just to allow
58 // the use of some camera files from the 0.7 beta version in which the
59 // array containing pixel ratios is not initialized.
60
61 Float_t GetCameraDist() const { return fCamDist; }
62 Float_t GetConvMm2Deg() const { return fConvMm2Deg; }
63
64 UInt_t GetNumPixels() const { return fNumPixels; }
65
66 Float_t GetMaxRadius(const Int_t i=-1) const;
67 Float_t GetMinRadius(const Int_t i=-1) const;
68
69 UInt_t GetNumSectors() const { return fNumSectors; }
70 UInt_t GetNumAreas() const { return fNumAreas; }
71 Float_t GetPixRatio(UInt_t i) const;
72 Float_t GetPixRatioSqrt(UInt_t i) const;
73
74 MGeomPix &operator[](Int_t i);
75 MGeomPix &operator[](Int_t i) const;
76
77 virtual void Print(Option_t *opt=NULL) const;
78
79 ClassDef(MGeomCam, 3) // Geometry base class for the camera
80};
81
82#endif
Note: See TracBrowser for help on using the repository browser.