1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // $Id: EAnglePixelMap.cc 2498 2006-02-22 12:57:29Z thea $ |
---|
3 | // Author: A.Thea |
---|
4 | |
---|
5 | /***************************************************************************** |
---|
6 | * ESAF: Euso Simulation and Analysis Framework * |
---|
7 | * * |
---|
8 | * Id: EAnglePixelMap * |
---|
9 | * Package: SimuEvent * |
---|
10 | * Coordinator: Alessandro.Thea * |
---|
11 | * * |
---|
12 | *****************************************************************************/ |
---|
13 | |
---|
14 | #include "EAnglePixelMap.hh" |
---|
15 | |
---|
16 | ClassImp(EAnglePixelMap) |
---|
17 | |
---|
18 | //_____________________________________________________________________________ |
---|
19 | EAnglePixelMap::EAnglePixelMap() { |
---|
20 | // |
---|
21 | // Constructor |
---|
22 | // |
---|
23 | |
---|
24 | fThetaFOV = 0; |
---|
25 | fSigmaThetaFOV = 0; |
---|
26 | fPhiFOV = 0; |
---|
27 | fSigmaPhiFOV = 0; |
---|
28 | Clear(); |
---|
29 | } |
---|
30 | |
---|
31 | //_____________________________________________________________________________ |
---|
32 | EAnglePixelMap::EAnglePixelMap( Int_t n ) { |
---|
33 | // |
---|
34 | // Constructor |
---|
35 | // |
---|
36 | |
---|
37 | Clear(); |
---|
38 | } |
---|
39 | |
---|
40 | //_____________________________________________________________________________ |
---|
41 | EAnglePixelMap::EAnglePixelMap( const EAnglePixelMap& other ) : TObject() { |
---|
42 | // |
---|
43 | // Copy constructor |
---|
44 | |
---|
45 | other.Copy( *this ); |
---|
46 | } |
---|
47 | |
---|
48 | //_____________________________________________________________________________ |
---|
49 | EAnglePixelMap::~EAnglePixelMap() { |
---|
50 | // dtor |
---|
51 | } |
---|
52 | |
---|
53 | //_____________________________________________________________________________ |
---|
54 | void EAnglePixelMap::Clear( Option_t* opt) { |
---|
55 | // initialize |
---|
56 | |
---|
57 | fNumPixels = 0; |
---|
58 | |
---|
59 | if ( fThetaFOV ) delete [] fThetaFOV; |
---|
60 | if ( fSigmaThetaFOV ) delete [] fSigmaThetaFOV; |
---|
61 | if ( fPhiFOV ) delete [] fPhiFOV; |
---|
62 | if ( fSigmaPhiFOV ) delete [] fSigmaPhiFOV; |
---|
63 | |
---|
64 | fThetaFOV = 0; |
---|
65 | fSigmaThetaFOV = 0; |
---|
66 | fPhiFOV = 0; |
---|
67 | fSigmaPhiFOV = 0; |
---|
68 | |
---|
69 | } |
---|
70 | |
---|
71 | //_____________________________________________________________________________ |
---|
72 | void EAnglePixelMap::Copy( TObject& other ) const { |
---|
73 | // copy |
---|
74 | |
---|
75 | TObject::Copy(other); |
---|
76 | |
---|
77 | ((EAnglePixelMap&)other).Resize( GetNumPixels() ); |
---|
78 | |
---|
79 | for ( Int_t i(0); i < GetNumPixels(); i++ ) { |
---|
80 | ((EAnglePixelMap&)other).fThetaFOV[i] = fThetaFOV[i]; |
---|
81 | ((EAnglePixelMap&)other).fSigmaThetaFOV[i] = fSigmaThetaFOV[i]; |
---|
82 | ((EAnglePixelMap&)other).fPhiFOV[i] = fPhiFOV[i]; |
---|
83 | ((EAnglePixelMap&)other).fSigmaPhiFOV[i] = fSigmaPhiFOV[i]; |
---|
84 | } |
---|
85 | } |
---|
86 | |
---|
87 | //_____________________________________________________________________________ |
---|
88 | Int_t EAnglePixelMap::Resize( Int_t n ) { |
---|
89 | // resize the map to n |
---|
90 | |
---|
91 | Clear(); |
---|
92 | fNumPixels = n; |
---|
93 | |
---|
94 | fThetaFOV = new Float_t[n]; |
---|
95 | fSigmaThetaFOV = new Float_t[n]; |
---|
96 | fPhiFOV = new Float_t[n]; |
---|
97 | fSigmaPhiFOV = new Float_t[n]; |
---|
98 | |
---|
99 | return n; |
---|
100 | } |
---|
101 | |
---|