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

Annotation of /DarthVader/OrbitalInfo/src/OrbitalInfo.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (hide annotations) (download)
Thu Dec 11 10:08:18 2008 UTC (16 years ago) by mocchiut
Branch: MAIN
CVS Tags: v9r00, v9r01, v6r01, v6r00
Changes since 1.13: +15 -0 lines
Track bug in orbitalinfo fixed

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

  ViewVC Help
Powered by ViewVC 1.1.23