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

Diff of /DarthVader/OrbitalInfo/src/OrbitalInfo.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by mocchiut, Tue Mar 20 20:56:29 2007 UTC revision 1.13 by mocchiut, Tue Nov 11 10:46:44 2008 UTC
# Line 1  Line 1 
1  #include <OrbitalInfo.h>  #include <OrbitalInfo.h>
2    
3  OrbitalInfo::OrbitalInfo(){  using namespace std;
   absTime = 0;  
   OBT = 0;  
   pkt_num = 0;  
   
   lon = 0.;  
   lat = 0.;  
   alt = 0.;  
   
   Bnorth = 0.;  
   Beast = 0.;  
   Bdown = 0.;  
   Babs = 0.;  
   BB0 = 0.;  
   L = 0.;  
   
   londip = -1000.;  
   latdip = -1000.;  
   altdip = -1000.;  
   
   loncgm = -1000.;  
   latcgm = -1000.;  
   altcgm = -1000.;  
   
   loncbm = -1000.;  
   latcbm = -1000.;  
   altcbm = -1000.;  
4    
5    std::fill_n(cutoff, 20, 0.);  ClassImp(OrbitalInfoTrkVar);
6    ClassImp(OrbitalInfo);
7    
8    // Quaternions  OrbitalInfoTrkVar::OrbitalInfoTrkVar(){
9    q0 = -1000.;    this->Clear();
10    q1 = -1000.;    //  Eij = new TMatrixD(3,3);
11    q2 = -1000.;    //  Sij = new TMatrixD(3,3);
12    q3 = -1000.;  }
13    
14    // Euler angles (nadir reference frame)  void OrbitalInfoTrkVar::Clear(Option_t *t){
15    theta = -1000.;    trkseqno = 0;
16    phi = -1000.;    pitch = -1000.;
17    etha = -1000.;    Eij.Zero();
18      Sij.Zero();
19    }
20    
21    // Euler angles (local field reference frame)  void OrbitalInfoTrkVar::Delete(Option_t *t){
22    thetamag = -1000.;    //  if ( Eij ) Eij->Delete();
23    phimag = -1000.;    //  if ( Sij ) Sij->Delete();
24    ethamag = -1000.;  }
25    
26    std::fill_n(goodAttitude, 5, 0);  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(){  void OrbitalInfo::Clear(Option_t *t){
61      //
62      if ( OrbitalInfoTrk ) OrbitalInfoTrk->Delete();
63      //
64    absTime = 0;    absTime = 0;
65    OBT = 0;    OBT = 0;
66    pkt_num = 0;    pkt_num = 0;
# Line 66  void OrbitalInfo::Clear(){ Line 76  void OrbitalInfo::Clear(){
76    BB0 = -1000.;    BB0 = -1000.;
77    L = -1000.;    L = -1000.;
78    
79    londip = -1000.;  //   londip = -1000.;
80    latdip = -1000.;  //   latdip = -1000.;
81    altdip = -1000.;  //   altdip = -1000.;
82    
83    loncgm = -1000.;  //   loncgm = -1000.;
84    latcgm = -1000.;  //   latcgm = -1000.;
85    altcgm = -1000.;  //   altcgm = -1000.;
86    
87    loncbm = -1000.;  //   loncbm = -1000.;
88    latcbm = -1000.;  //   latcbm = -1000.;
89    altcbm = -1000.;  //   altcbm = -1000.;
90    
91    std::fill_n(cutoff, 20, 0.);    //  std::fill_n(cutoff, 20, 0.);
92      //  std::fill_n(cutoff, 2, 0.);
93      cutoffsvl = 0.;
94    
95    // Quaternions    // Quaternions
96    q0 = -1000.;    q0 = -1000.;
# Line 92  void OrbitalInfo::Clear(){ Line 104  void OrbitalInfo::Clear(){
104    etha = -1000.;    etha = -1000.;
105    
106    // Euler angles (local field reference frame)    // Euler angles (local field reference frame)
107    thetamag = -1000.;    //  thetamag = -1000.;
108    phimag = -1000.;    //  phimag = -1000.;
109    ethamag = -1000.;    //  ethamag = -1000.;
110    
111      //  pamzenitangle = -1000.;
112      //  pamBangle = -1000.;
113      Iij.Zero();
114    
115    std::fill_n(goodAttitude, 5, 0);    mode = 0;
116      //  std::fill_n(goodAttitude, 5, 0);
117  }  }
118    
119  /**  /**
# Line 118  void OrbitalInfo::GetLevel2Struct(cOrbit Line 135  void OrbitalInfo::GetLevel2Struct(cOrbit
135    l2->BB0 = BB0;    l2->BB0 = BB0;
136    l2->L = L;    l2->L = L;
137    
138    l2->londip = londip;  //   l2->londip = londip;
139    l2->latdip = latdip;  //   l2->latdip = latdip;
140    l2->altdip = altdip;  //   l2->altdip = altdip;
141    
142    l2->loncgm = loncgm;  //   l2->loncgm = loncgm;
143    l2->latcgm = latcgm;  //   l2->latcgm = latcgm;
144    l2->altcgm = altcgm;  //   l2->altcgm = altcgm;
145    
146    l2->loncbm = loncbm;  //   l2->loncbm = loncbm;
147    l2->latcbm = latcbm;  //   l2->latcbm = latcbm;
148    l2->altcbm = altcbm;  //   l2->altcbm = altcbm;
149    
150    memcpy(l2->cutoff, cutoff, sizeof(cutoff));    l2->cutoffsvl = cutoffsvl;
151    //  memcpy(l2->cutoffsvl, cutoffsvl, sizeof(cutoffsvl));
152    
153    // Quaternions    // Quaternions
154    l2->q0 = q0;    l2->q0 = q0;
# Line 143  void OrbitalInfo::GetLevel2Struct(cOrbit Line 161  void OrbitalInfo::GetLevel2Struct(cOrbit
161    l2->phi = phi;    l2->phi = phi;
162    l2->etha = etha;    l2->etha = etha;
163    
164      l2->mode = mode;
165    // Euler angles (local field reference frame)    // Euler angles (local field reference frame)
166    l2->thetamag = thetamag;  //   l2->thetamag = thetamag;
167    l2->phimag = phimag;  //   l2->phimag = phimag;
168    l2->ethamag = ethamag;  //   l2->ethamag = ethamag;
169    
170    memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));  //   memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));
171  }  }
172    
173  void OrbitalInfo::SetFromLevel2Struct(cOrbitalInfo *l2){  void OrbitalInfo::SetFromLevel2Struct(cOrbitalInfo *l2){
# Line 167  void OrbitalInfo::SetFromLevel2Struct(cO Line 186  void OrbitalInfo::SetFromLevel2Struct(cO
186    BB0 = l2->BB0;    BB0 = l2->BB0;
187    L = l2->L;    L = l2->L;
188    
189    londip = l2->londip;  //   londip = l2->londip;
190    latdip = l2->latdip;  //   latdip = l2->latdip;
191    altdip = l2->altdip;  //   altdip = l2->altdip;
192    
193    loncgm = l2->loncgm;  //   loncgm = l2->loncgm;
194    latcgm = l2->latcgm;  //   latcgm = l2->latcgm;
195    altcgm = l2->altcgm;  //   altcgm = l2->altcgm;
196    
197    loncbm = l2->loncbm;  //   loncbm = l2->loncbm;
198    latcbm = l2->latcbm;  //   latcbm = l2->latcbm;
199    altcbm = l2->altcbm;  //   altcbm = l2->altcbm;
200    
201    memcpy(cutoff, l2->cutoff, sizeof(l2->cutoff));  //  memcpy(cutoff, l2->cutoff, sizeof(l2->cutoff));
202      l2->cutoffsvl = cutoffsvl;
203    
204    // Quaternions    // Quaternions
205    q0 = l2->q0;    q0 = l2->q0;
# Line 192  void OrbitalInfo::SetFromLevel2Struct(cO Line 212  void OrbitalInfo::SetFromLevel2Struct(cO
212    phi = l2->phi;    phi = l2->phi;
213    etha = l2->etha;    etha = l2->etha;
214    
215      mode = l2->mode;
216    // Euler angles (local field reference frame)    // Euler angles (local field reference frame)
217    thetamag = l2->thetamag;  //   thetamag = l2->thetamag;
218    phimag = l2->phimag;  //   phimag = l2->phimag;
219    ethamag = l2->ethamag;  //   ethamag = l2->ethamag;
220    
221    memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));  //   memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));
222  }  }
223    
 ClassImp(OrbitalInfo)  

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.23