/[PAMELA software]/DarthVader/OrbitalInfo/src/OrbitalInfo.cpp
ViewVC logotype

Contents of /DarthVader/OrbitalInfo/src/OrbitalInfo.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (show annotations) (download)
Tue Nov 11 10:46:44 2008 UTC (16 years, 1 month ago) by mocchiut
Branch: MAIN
Changes since 1.12: +55 -41 lines
New cutoff calculation, important changes to the class

1 #include <OrbitalInfo.h>
2
3 using namespace std;
4
5 ClassImp(OrbitalInfoTrkVar);
6 ClassImp(OrbitalInfo);
7
8 OrbitalInfoTrkVar::OrbitalInfoTrkVar(){
9 this->Clear();
10 // Eij = new TMatrixD(3,3);
11 // Sij = new TMatrixD(3,3);
12 }
13
14 void OrbitalInfoTrkVar::Clear(Option_t *t){
15 trkseqno = 0;
16 pitch = -1000.;
17 Eij.Zero();
18 Sij.Zero();
19 }
20
21 void OrbitalInfoTrkVar::Delete(Option_t *t){
22 // if ( Eij ) Eij->Delete();
23 // if ( Sij ) Sij->Delete();
24 }
25
26 OrbitalInfo::OrbitalInfo(){
27 OrbitalInfoTrk = 0; //ELENA
28 this->Clear();
29 }
30
31 void OrbitalInfo::Delete(Option_t *t){ //ELENA
32 //
33 // if ( Iij ) Iij->Delete();
34 if(OrbitalInfoTrk){
35 OrbitalInfoTrk->Delete(); //ELENA
36 delete OrbitalInfoTrk; //ELENA
37 }
38 //
39 }; //ELENA
40
41 void OrbitalInfo::Set(){//ELENA
42 if ( !OrbitalInfoTrk ) OrbitalInfoTrk = new TClonesArray("OrbitalInfoTrkVar",2); //ELENA}
43 // if ( !Iij ) Iij = new TMatrixD(3,3);
44 }//ELENA
45
46 OrbitalInfoTrkVar *OrbitalInfo::GetOrbitalInfoTrkVar(Int_t itrk){
47 //
48 if(itrk >= ntrk()){
49 printf(" OrbitalInfo ERROR: track related variables set %i does not exists! \n",itrk);
50 printf(" stored track related variables = %i \n",ntrk());
51 return(NULL);
52 }
53 //
54 if(!OrbitalInfoTrk)return 0; //ELENA
55 TClonesArray &t = *(OrbitalInfoTrk);
56 OrbitalInfoTrkVar *orbtrack = (OrbitalInfoTrkVar*)t[itrk];
57 return orbtrack;
58 }
59
60 void OrbitalInfo::Clear(Option_t *t){
61 //
62 if ( OrbitalInfoTrk ) OrbitalInfoTrk->Delete();
63 //
64 absTime = 0;
65 OBT = 0;
66 pkt_num = 0;
67
68 lon = -1000.;
69 lat = -1000.;
70 alt = -1000.;
71
72 Bnorth = -1000.;
73 Beast = -1000.;
74 Bdown = -1000.;
75 Babs = -1000.;
76 BB0 = -1000.;
77 L = -1000.;
78
79 // londip = -1000.;
80 // latdip = -1000.;
81 // altdip = -1000.;
82
83 // loncgm = -1000.;
84 // latcgm = -1000.;
85 // altcgm = -1000.;
86
87 // loncbm = -1000.;
88 // latcbm = -1000.;
89 // altcbm = -1000.;
90
91 // std::fill_n(cutoff, 20, 0.);
92 // std::fill_n(cutoff, 2, 0.);
93 cutoffsvl = 0.;
94
95 // Quaternions
96 q0 = -1000.;
97 q1 = -1000.;
98 q2 = -1000.;
99 q3 = -1000.;
100
101 // Euler angles (nadir reference frame)
102 theta = -1000.;
103 phi = -1000.;
104 etha = -1000.;
105
106 // Euler angles (local field reference frame)
107 // thetamag = -1000.;
108 // phimag = -1000.;
109 // ethamag = -1000.;
110
111 // pamzenitangle = -1000.;
112 // pamBangle = -1000.;
113 Iij.Zero();
114
115 mode = 0;
116 // std::fill_n(goodAttitude, 5, 0);
117 }
118
119 /**
120 * Fills a struct cOrbitalInfo with values from a OrbitalInfo object (to put data into a F77 common).
121 */
122 void OrbitalInfo::GetLevel2Struct(cOrbitalInfo *l2) const{
123 l2->abstime = absTime;
124 l2->obt = OBT;
125 l2->pkt_num = pkt_num;
126
127 l2->lon = lon;
128 l2->lat = lat;
129 l2->alt = alt;
130
131 l2->Bnorth = Bnorth;
132 l2->Beast = Beast;
133 l2->Bdown = Bdown;
134 l2->Babs = Babs;
135 l2->BB0 = BB0;
136 l2->L = L;
137
138 // l2->londip = londip;
139 // l2->latdip = latdip;
140 // l2->altdip = altdip;
141
142 // l2->loncgm = loncgm;
143 // l2->latcgm = latcgm;
144 // l2->altcgm = altcgm;
145
146 // l2->loncbm = loncbm;
147 // l2->latcbm = latcbm;
148 // l2->altcbm = altcbm;
149
150 l2->cutoffsvl = cutoffsvl;
151 // memcpy(l2->cutoffsvl, cutoffsvl, sizeof(cutoffsvl));
152
153 // Quaternions
154 l2->q0 = q0;
155 l2->q1 = q1;
156 l2->q2 = q2;
157 l2->q3 = q3;
158
159 // Euler angles (nadir reference frame)
160 l2->theta = theta;
161 l2->phi = phi;
162 l2->etha = etha;
163
164 l2->mode = mode;
165 // Euler angles (local field reference frame)
166 // l2->thetamag = thetamag;
167 // l2->phimag = phimag;
168 // l2->ethamag = ethamag;
169
170 // memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));
171 }
172
173 void OrbitalInfo::SetFromLevel2Struct(cOrbitalInfo *l2){
174 absTime = l2->abstime;
175 OBT = l2->obt;
176 pkt_num = l2->pkt_num;
177
178 lon = l2->lon;
179 lat = l2->lat;
180 alt = l2->alt;
181
182 l2->Bnorth = Bnorth;
183 l2->Beast = Beast;
184 l2->Bdown = Bdown;
185 l2->Babs = Babs;
186 BB0 = l2->BB0;
187 L = l2->L;
188
189 // londip = l2->londip;
190 // latdip = l2->latdip;
191 // altdip = l2->altdip;
192
193 // loncgm = l2->loncgm;
194 // latcgm = l2->latcgm;
195 // altcgm = l2->altcgm;
196
197 // loncbm = l2->loncbm;
198 // latcbm = l2->latcbm;
199 // altcbm = l2->altcbm;
200
201 // memcpy(cutoff, l2->cutoff, sizeof(l2->cutoff));
202 l2->cutoffsvl = cutoffsvl;
203
204 // Quaternions
205 q0 = l2->q0;
206 q1 = l2->q1;
207 q2 = l2->q2;
208 q3 = l2->q3;
209
210 // Euler angles (nadir reference frame)
211 theta = l2->theta;
212 phi = l2->phi;
213 etha = l2->etha;
214
215 mode = l2->mode;
216 // Euler angles (local field reference frame)
217 // thetamag = l2->thetamag;
218 // phimag = l2->phimag;
219 // ethamag = l2->ethamag;
220
221 // memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));
222 }
223

  ViewVC Help
Powered by ViewVC 1.1.23