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

Last change on this file since 3126 was 3064, checked in by gaug, 21 years ago
*** empty log message ***
File size: 2.1 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
32protected:
33 void CalcMaxRadius();
34 void CalcNumSectors();
35 void InitOuterRing();
36 void InitGeometry()
37 {
38 CalcNumSectors();
39 CalcMaxRadius();
40 CalcPixRatio();
41 InitOuterRing();
42 }
43
44
45public:
46 MGeomCam();
47 MGeomCam(UInt_t npix, Float_t dist, const char *name=NULL, const char *title=NULL);
48
49 virtual TObject *Clone(const char *newname=NULL) const;
50
51 void CalcPixRatio();
52 // FIXME, workaround: this function is made public just to allow
53 // the use of some camera files from the 0.7 beta version in which the
54 // array containing pixel ratios is not initialized.
55
56 Float_t GetCameraDist() const { return fCamDist; }
57 Float_t GetConvMm2Deg() const { return fConvMm2Deg; }
58
59 UInt_t GetNumPixels() const { return fNumPixels; }
60 Float_t GetMaxRadius() const { return fMaxRadius; }
61 UInt_t GetNumSectors() const { return fNumSectors; }
62 Float_t GetPixRatio(UInt_t i) const;
63 Float_t GetPixRatioSqrt(UInt_t i) const;
64
65 MGeomPix &operator[](Int_t i);
66 MGeomPix &operator[](Int_t i) const;
67
68 virtual void Print(Option_t *opt=NULL) const;
69
70 ClassDef(MGeomCam, 2) // Geometry base class for the camera
71};
72
73#endif
Note: See TracBrowser for help on using the repository browser.