screen.cc
1 #include <math.h>
2 #include <iostream>
3 
4 #include "vector.hh"
5 #include "position.hh"
6 #include "screen.hh"
7 
9  if( !(a%2) )
10  a++; // force 'a' odd to set screen steps correctly
11 
12  //std::cerr << "Generating default screen" << std::endl;
13  fedgeLength=1.;
14  fcentralPoint = Position(1.,1.,1.);
15  fnormal = Vector(1.,1.,1.);
16  funit_x = Vector(1.,1.,1.);
17  funit_y = Vector(1.,1.,1.);
18 
19  fNsamples = a;
20 };
21 
22 
23 void Screen::SetNsamples(int i){
24  fNsamples = i;
25 };
26 
27 
29  return fNsamples;
30 };
31 
32 
33 void Screen::SetEdgeLength(double a){
34  fedgeLength = a;
35 };
36 
37 
39  fcentralPoint = a;
40 };
41 
43  fcosineProjectionFactor = a;
44 };
45 
46 
48  return fcosineProjectionFactor;
49 };
50 
52  fnormal = a.Unit();
53 };
54 
56  funit_x = a;
57 };
58 
60  funit_y = a;
61 };
62 
64  return fedgeLength;
65 };
66 
67 
69  return fcentralPoint;
70 };
71 
72 
74  return fnormal;
75 };
76 
77 
79  return funit_x;
80 };
81 
82 
84  return funit_y;
85 };
86 
87 
88 double Screen::CalcXindex(int i){
89  return (double) (i % (fNsamples));
90 };
91 
92 
93 double Screen::CalcYindex(int i){
94  return (double) floor(i / (fNsamples));
95 };
96 
97 
99  Position pos;
100 
101 
102  // this picks points that are NOT on the edge
103  pos = fcentralPoint // base
104  //- 0.5*fedgeLength*funit_x - 0.5*fedgeLength*fcosineProjectionFactor*funit_y // shift to a corner
105  //+ (1./(2.*(double)(fNsamples)))*fedgeLength*(funit_x + fcosineProjectionFactor*funit_y) // move off the edge
106  //+ (xindex/((double)(fNsamples)))*fedgeLength*funit_x // move by x-increment
107  //+ (yindex/((double)(fNsamples)))*fedgeLength*fcosineProjectionFactor*funit_y; // move by y-increment with the cosine projection correction
108  + i * fedgeLength*funit_x
109  + j * fedgeLength*funit_y;
110 
111  return pos;
112 };
113 
114 
115 void Screen::AddVmmhz_freq(double A){
116  //here i refers to the 'screen' loop
117  fVmmhz_freq.push_back(A);
118 };
119 
120 
121 double Screen::GetVmmhz_freq(int i){
122  return fVmmhz_freq[i];
123 };
124 
125 
126 void Screen::AddVmmhz0(double A){
127  fVmmhz0.push_back(A);
128 };
129 
130 double Screen::GetVmmhz0(int i){
131  return fVmmhz0[i];
132 };
133 
134 void Screen::AddViewangle(double A){
135  fViewangle.push_back(A);
136 };
137 
138 double Screen::GetViewangle(int i){
139  return fViewangle[i];
140 };
141 
142 
143 void Screen::AddDelay(double A){
144  fDelays.push_back(A);
145 };
146 
147 
148 double Screen::GetDelay(int i){
149  return fDelays[i];
150 };
151 
152 
154  fNvalidpoints = i;
155 };
156 
157 
159  return fNvalidpoints;
160 };
161 
162 
164  fVec2blns.push_back(v);
165 };
166 
167 
169  return fVec2blns[i];
170 };
171 
172 
174  fPols.push_back(v);
175 };
176 
177 
179  return fPols[i];
180 };
181 
182 
184  fImpactPt.push_back(p);
185 };
186 
187 
189  return fImpactPt[i];
190 };
191 
192 
193 void Screen::AddWeight(double a){
194  fWeight.push_back(a);
195 };
196 
197 double Screen::GetWeight(int i){
198  return fWeight[i];
199 };
200 
201 void Screen::SetWeightNorm(double a){
202  fWeightNorm = a;
203 };
204 
206  return fWeightNorm;
207 };
208 
210  fIncAngles.push_back(A);
211 };
212 
214  return fIncAngles[i];
215 };
216 
218  fTransAngles.push_back(A);
219 };
220 
222  return fTransAngles[i];
223 };
224 
225 void Screen::AddFacetLength(double A){
226  fFacetLength.push_back(A);
227 };
228 
230  return fFacetLength[i];
231 };
232 
234  fTcoeff_parl_polparl.push_back(A);
235 };
236 
238  return fTcoeff_parl_polparl[i];
239 };
240 
242  fTcoeff_perp_polparl.push_back(A);
243 };
244 
246  return fTcoeff_perp_polparl[i];
247 };
248 
250  fTcoeff_parl_polperp.push_back(A);
251 };
252 
254  return fTcoeff_parl_polperp[i];
255 };
256 
258  fTcoeff_perp_polperp.push_back(A);
259 };
260 
262  return fTcoeff_perp_polperp[i];
263 };
264 
266  // reset these in icemc:
267  // Nsamples
268  // edge length
269  // central point
270  // normal
271  // cosine projection factor
272  // unit x /y vectors
273 
274  //need to reset everything else, like the vectors...
275  fNvalidpoints = 0;
276 
277  fVmmhz_freq.clear();
278  fVmmhz0.clear();
279  fViewangle.clear();
280  fDelays.clear();
281  fVec2blns.clear();
282  fPols.clear();
283  fImpactPt.clear();
284  fWeight.clear();
285  fWeightNorm = 1.;
286  fIncAngles.clear();
287  fTransAngles.clear();
288  fFacetLength.clear();
289  fTcoeff_parl_polparl.clear();
290  fTcoeff_perp_polparl.clear();
291  fTcoeff_parl_polperp.clear();
292  fTcoeff_perp_polperp.clear();
293 };
294 
void AddTparallel_polPerpendicular(double A)
Appends a parallel transmission coefficient value to the fTcoeff_parl array.
Definition: screen.cc:249
void SetUnitX(Vector a)
Sets an orientation vector of the screen.
Definition: screen.cc:55
double GetTperpendicular_polParallel(int i)
Get the perpendicular transmission coefficient value stored at the specified index.
Definition: screen.cc:245
Vector GetUnitY()
Gets another orientation vector.
Definition: screen.cc:83
void AddTperpendicular_polParallel(double A)
Appends a perpendicular transmission coefficient value to the fTcoeff_perp array. ...
Definition: screen.cc:241
void AddTparallel_polParallel(double A)
Appends a parallel transmission coefficient value to the fTcoeff_parl array.
Definition: screen.cc:233
void SetNvalidPoints(int i)
Sets the total number of points on the screen.
Definition: screen.cc:153
void SetNormal(Vector a)
Sets the screen normal.
Definition: screen.cc:51
void AddViewangle(double A)
Appends a viewangle value to the fViewangle array.
Definition: screen.cc:134
void AddPol(Vector v)
Appends a vector to the fPols array.
Definition: screen.cc:173
double GetViewangle(int i)
Get the viewangle value stored at the specified index.
Definition: screen.cc:138
Screen(int a)
Creates an instance of a screen.
Definition: screen.cc:8
void SetCosineProjectionFactor(double a)
Sets the projection factor of the screen relative to the specular RF exit point.
Definition: screen.cc:42
double GetVmmhz0(int i)
Gets the Vmmhz0 value stored at the specified index.
Definition: screen.cc:130
void AddVec2bln(Vector v)
Appends a vector to the fVec2blns array.
Definition: screen.cc:163
double GetTparallel_polParallel(int i)
Get the parallel transmission coefficient value stored at the specified index.
Definition: screen.cc:237
void SetCentralPoint(Position a)
Sets the position of the central point of the screen.
Definition: screen.cc:38
void SetUnitY(Vector a)
Sets another orientation vector of the screen.
Definition: screen.cc:59
void SetWeightNorm(double a)
Sets the normalization factor for the weights (so they sum to 1)
Definition: screen.cc:201
double GetVmmhz_freq(int i)
Get the Vmmhz value stored at the specified index.
Definition: screen.cc:121
double CalcXindex(int i)
Calculates the X index of the screen corresponding to the specified counter value.
Definition: screen.cc:88
double GetTransmissionAngle(int i)
Get the transmission angle value stored at the specified index.
Definition: screen.cc:221
double GetNvalidPoints()
Gets the total number of points.
Definition: screen.cc:158
void AddImpactPt(Position p)
Appends a vector to the fImpactPt array.
Definition: screen.cc:183
void SetNsamples(int i)
Sets number of grid divisions for the base screen.
Definition: screen.cc:23
void AddFacetLength(double A)
Appends a facet edge length value to the fFacetLength array.
Definition: screen.cc:225
double GetTperpendicular_polPerpendicular(int i)
Get the perpendicular transmission coefficient value stored at the specified index.
Definition: screen.cc:261
double GetCosineProjectionFactor()
Gets the projection factor.
Definition: screen.cc:47
This class is a 3-vector that represents a position on the Earth&#39;s surface.
Definition: position.hh:26
double CalcYindex(int i)
Calculates the Y index of the screen corresponding to the specified counter value.
Definition: screen.cc:93
void AddVmmhz0(double A)
Appends a Vmmhz value (for the lowest Anita frequency) to the fVmmhz0 array.
Definition: screen.cc:126
int GetNsamples()
Gets number of grid divisions for the base screen.
Definition: screen.cc:28
Vector GetVec2bln(int i)
Gets the to-balloon vector at the specified index.
Definition: screen.cc:168
double GetFacetLength(int i)
Get the facet edge length value stored at the specified index.
Definition: screen.cc:229
double GetDelay(int i)
Get the delay value stores at the specified index.
Definition: screen.cc:148
Position GetCentralPoint()
Gets the position of the screen&#39;s central point.
Definition: screen.cc:68
void AddWeight(double a)
Appends a weight value to the fWeight array.
Definition: screen.cc:193
double GetEdgeLength()
Gets the screen length.
Definition: screen.cc:63
Vector GetUnitX()
Gets an orientation vector.
Definition: screen.cc:78
void AddVmmhz_freq(double A)
Appends a Vmmhz value to the fVmmhz_freq array.
Definition: screen.cc:115
double GetIncidenceAngle(int i)
Get the incidence angle value stored at the specified index.
Definition: screen.cc:213
double GetWeightNorm()
Gets the weight normalization factor.
Definition: screen.cc:205
Position GetPosition(int i, int j)
Calculates the physical position of the screen corresponding to the specified counter value...
Definition: screen.cc:98
void SetEdgeLength(double a)
Sets the physical length of a side of the screen.
Definition: screen.cc:33
void AddTperpendicular_polPerpendicular(double A)
Appends a perpendicular transmission coefficient value to the fTcoeff_perp array. ...
Definition: screen.cc:257
This class represents a three-vector. Operators are overloaded to provide for the familiar operations...
Definition: vector.hh:27
void ResetParameters()
Resets the following screen parameters (fNvalidpoints,fVmmhz_freq,fVmmhz0,fViewangle,fDelays,fVec2blns,fPols,fImpactPt,fWeight,fWeightNorm)
Definition: screen.cc:265
void AddIncidenceAngle(double A)
Appends an incidence angle value to the fIncAngles array.
Definition: screen.cc:209
Vector GetNormal()
Gets the screen normal.
Definition: screen.cc:73
Position GetImpactPt(int i)
Gets the position at the specified index.
Definition: screen.cc:188
Vector GetPol(int i)
Gets the polarization vector at the specified index.
Definition: screen.cc:178
double GetTparallel_polPerpendicular(int i)
Get the parallel transmission coefficient value stored at the specified index.
Definition: screen.cc:253
void AddDelay(double A)
Appends a delay value to the fDelays array.
Definition: screen.cc:143
double GetWeight(int i)
Gets the weight value at the specified index.
Definition: screen.cc:197
void AddTransmissionAngle(double A)
Appends a transmission angle value to the fTransAngles array.
Definition: screen.cc:217