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

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