/[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.13 - (hide 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 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.13 Eij.Zero();
18     Sij.Zero();
19 mocchiut 1.11 }
20 pam-rm2 1.6
21 mocchiut 1.13 void OrbitalInfoTrkVar::Delete(Option_t *t){
22     // if ( Eij ) Eij->Delete();
23     // if ( Sij ) Sij->Delete();
24     }
25 pam-rm2 1.6
26 mocchiut 1.11 OrbitalInfo::OrbitalInfo(){
27     OrbitalInfoTrk = 0; //ELENA
28     this->Clear();
29     }
30 pam-rm2 1.6
31 mocchiut 1.11 void OrbitalInfo::Delete(Option_t *t){ //ELENA
32     //
33 mocchiut 1.13 // if ( Iij ) Iij->Delete();
34 mocchiut 1.11 if(OrbitalInfoTrk){
35     OrbitalInfoTrk->Delete(); //ELENA
36     delete OrbitalInfoTrk; //ELENA
37     }
38     //
39     }; //ELENA
40    
41     void OrbitalInfo::Set(){//ELENA
42 mocchiut 1.13 if ( !OrbitalInfoTrk ) OrbitalInfoTrk = new TClonesArray("OrbitalInfoTrkVar",2); //ELENA}
43     // if ( !Iij ) Iij = new TMatrixD(3,3);
44 mocchiut 1.11 }//ELENA
45 mocchiut 1.1
46 mocchiut 1.12 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 mocchiut 1.1
60 mocchiut 1.10 void OrbitalInfo::Clear(Option_t *t){
61 mocchiut 1.11 //
62     if ( OrbitalInfoTrk ) OrbitalInfoTrk->Delete();
63     //
64 mocchiut 1.5 absTime = 0;
65     OBT = 0;
66     pkt_num = 0;
67 pam-rm2 1.6
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 mocchiut 1.13 // 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 pam-rm2 1.6
95     // Quaternions
96     q0 = -1000.;
97     q1 = -1000.;
98     q2 = -1000.;
99     q3 = -1000.;
100    
101     // Euler angles (nadir reference frame)
102 mocchiut 1.8 theta = -1000.;
103     phi = -1000.;
104     etha = -1000.;
105 pam-rm2 1.6
106     // Euler angles (local field reference frame)
107 mocchiut 1.9 // thetamag = -1000.;
108     // phimag = -1000.;
109     // ethamag = -1000.;
110 pam-rm2 1.6
111 mocchiut 1.13 // pamzenitangle = -1000.;
112     // pamBangle = -1000.;
113     Iij.Zero();
114 mocchiut 1.11
115 mocchiut 1.9 mode = 0;
116     // std::fill_n(goodAttitude, 5, 0);
117 mocchiut 1.3 }
118    
119 pam-fi 1.4 /**
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 pam-rm2 1.6
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 mocchiut 1.13 // 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 pam-rm2 1.6
150 mocchiut 1.13 l2->cutoffsvl = cutoffsvl;
151     // memcpy(l2->cutoffsvl, cutoffsvl, sizeof(cutoffsvl));
152 pam-rm2 1.6
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 mocchiut 1.8 l2->theta = theta;
161     l2->phi = phi;
162     l2->etha = etha;
163 pam-rm2 1.6
164 mocchiut 1.9 l2->mode = mode;
165 pam-rm2 1.6 // Euler angles (local field reference frame)
166 mocchiut 1.9 // l2->thetamag = thetamag;
167     // l2->phimag = phimag;
168     // l2->ethamag = ethamag;
169 pam-rm2 1.6
170 mocchiut 1.9 // memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));
171 pam-fi 1.4 }
172    
173     void OrbitalInfo::SetFromLevel2Struct(cOrbitalInfo *l2){
174     absTime = l2->abstime;
175     OBT = l2->obt;
176     pkt_num = l2->pkt_num;
177 pam-rm2 1.6
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 mocchiut 1.13 // 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 pam-rm2 1.6
201 mocchiut 1.13 // memcpy(cutoff, l2->cutoff, sizeof(l2->cutoff));
202     l2->cutoffsvl = cutoffsvl;
203 pam-rm2 1.6
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 mocchiut 1.8 theta = l2->theta;
212     phi = l2->phi;
213     etha = l2->etha;
214 pam-rm2 1.6
215 mocchiut 1.9 mode = l2->mode;
216 pam-rm2 1.6 // Euler angles (local field reference frame)
217 mocchiut 1.9 // thetamag = l2->thetamag;
218     // phimag = l2->phimag;
219     // ethamag = l2->ethamag;
220 pam-rm2 1.6
221 mocchiut 1.9 // memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));
222 pam-fi 1.4 }
223    

  ViewVC Help
Powered by ViewVC 1.1.23