/[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.6 by pam-rm2, Thu Nov 30 15:46:45 2006 UTC revision 1.14 by mocchiut, Thu Dec 11 10:08:18 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.;    cutoff = -1000.;
18      Eij.Zero();
19      Sij.Zero();
20    }
21    
22    // Euler angles (local field reference frame)  void OrbitalInfoTrkVar::Delete(Option_t *t){
23    thetamag = -1000.;    //  if ( Eij ) Eij->Delete();
24    phimag = -1000.;    //  if ( Sij ) Sij->Delete();
25    ethamag = -1000.;  }
26    
27    std::fill_n(goodAttitude, 5, 0);  OrbitalInfo::OrbitalInfo(){
28      OrbitalInfoTrk = 0; //ELENA
29      this->Clear();
30  }  }
31    
32    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    void OrbitalInfo::Delete(Option_t *t){ //ELENA
47      //
48      //  if ( Iij ) Iij->Delete();
49      if(OrbitalInfoTrk){
50        OrbitalInfoTrk->Delete(); //ELENA
51        delete OrbitalInfoTrk;  //ELENA
52      }
53      //
54    }; //ELENA
55    
56    void OrbitalInfo::Set(){//ELENA
57      if ( !OrbitalInfoTrk ) OrbitalInfoTrk = new TClonesArray("OrbitalInfoTrkVar",2); //ELENA}  
58      //  if ( !Iij ) Iij = new TMatrixD(3,3);
59    }//ELENA
60    
61    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    
75  void OrbitalInfo::Clear(){  void OrbitalInfo::Clear(Option_t *t){
76      //
77      if ( OrbitalInfoTrk ) OrbitalInfoTrk->Delete();
78      //
79    absTime = 0;    absTime = 0;
80    OBT = 0;    OBT = 0;
81    pkt_num = 0;    pkt_num = 0;
# Line 66  void OrbitalInfo::Clear(){ Line 91  void OrbitalInfo::Clear(){
91    BB0 = -1000.;    BB0 = -1000.;
92    L = -1000.;    L = -1000.;
93    
94    londip = -1000.;  //   londip = -1000.;
95    latdip = -1000.;  //   latdip = -1000.;
96    altdip = -1000.;  //   altdip = -1000.;
97    
98    loncgm = -1000.;  //   loncgm = -1000.;
99    latcgm = -1000.;  //   latcgm = -1000.;
100    altcgm = -1000.;  //   altcgm = -1000.;
101    
102    loncbm = -1000.;  //   loncbm = -1000.;
103    latcbm = -1000.;  //   latcbm = -1000.;
104    altcbm = -1000.;  //   altcbm = -1000.;
105    
106    std::fill_n(cutoff, 20, 0.);    //  std::fill_n(cutoff, 20, 0.);
107      //  std::fill_n(cutoff, 2, 0.);
108      cutoffsvl = 0.;
109    
110    // Quaternions    // Quaternions
111    q0 = -1000.;    q0 = -1000.;
# Line 92  void OrbitalInfo::Clear(){ Line 119  void OrbitalInfo::Clear(){
119    etha = -1000.;    etha = -1000.;
120    
121    // Euler angles (local field reference frame)    // Euler angles (local field reference frame)
122    thetamag = -1000.;    //  thetamag = -1000.;
123    phimag = -1000.;    //  phimag = -1000.;
124    ethamag = -1000.;    //  ethamag = -1000.;
125    
126      //  pamzenitangle = -1000.;
127      //  pamBangle = -1000.;
128      Iij.Zero();
129    
130    std::fill_n(goodAttitude, 5, 0);    mode = 0;
131      //  std::fill_n(goodAttitude, 5, 0);
132  }  }
133    
134  /**  /**
# Line 118  void OrbitalInfo::GetLevel2Struct(cOrbit Line 150  void OrbitalInfo::GetLevel2Struct(cOrbit
150    l2->BB0 = BB0;    l2->BB0 = BB0;
151    l2->L = L;    l2->L = L;
152    
153    l2->londip = londip;  //   l2->londip = londip;
154    l2->latdip = latdip;  //   l2->latdip = latdip;
155    l2->altdip = altdip;  //   l2->altdip = altdip;
156    
157    l2->loncgm = loncgm;  //   l2->loncgm = loncgm;
158    l2->latcgm = latcgm;  //   l2->latcgm = latcgm;
159    l2->altcgm = altcgm;  //   l2->altcgm = altcgm;
160    
161    l2->loncbm = loncbm;  //   l2->loncbm = loncbm;
162    l2->latcbm = latcbm;  //   l2->latcbm = latcbm;
163    l2->altcbm = altcbm;  //   l2->altcbm = altcbm;
164    
165    memcpy(l2->cutoff, cutoff, sizeof(cutoff));    l2->cutoffsvl = cutoffsvl;
166    //  memcpy(l2->cutoffsvl, cutoffsvl, sizeof(cutoffsvl));
167    
168    // Quaternions    // Quaternions
169    l2->q0 = q0;    l2->q0 = q0;
# Line 143  void OrbitalInfo::GetLevel2Struct(cOrbit Line 176  void OrbitalInfo::GetLevel2Struct(cOrbit
176    l2->phi = phi;    l2->phi = phi;
177    l2->etha = etha;    l2->etha = etha;
178    
179      l2->mode = mode;
180    // Euler angles (local field reference frame)    // Euler angles (local field reference frame)
181    l2->thetamag = thetamag;  //   l2->thetamag = thetamag;
182    l2->phimag = phimag;  //   l2->phimag = phimag;
183    l2->ethamag = ethamag;  //   l2->ethamag = ethamag;
184    
185    memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));  //   memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));
186  }  }
187    
188  void OrbitalInfo::SetFromLevel2Struct(cOrbitalInfo *l2){  void OrbitalInfo::SetFromLevel2Struct(cOrbitalInfo *l2){
# Line 167  void OrbitalInfo::SetFromLevel2Struct(cO Line 201  void OrbitalInfo::SetFromLevel2Struct(cO
201    BB0 = l2->BB0;    BB0 = l2->BB0;
202    L = l2->L;    L = l2->L;
203    
204    londip = l2->londip;  //   londip = l2->londip;
205    latdip = l2->latdip;  //   latdip = l2->latdip;
206    altdip = l2->altdip;  //   altdip = l2->altdip;
207    
208    loncgm = l2->loncgm;  //   loncgm = l2->loncgm;
209    latcgm = l2->latcgm;  //   latcgm = l2->latcgm;
210    altcgm = l2->altcgm;  //   altcgm = l2->altcgm;
211    
212    loncbm = l2->loncbm;  //   loncbm = l2->loncbm;
213    latcbm = l2->latcbm;  //   latcbm = l2->latcbm;
214    altcbm = l2->altcbm;  //   altcbm = l2->altcbm;
215    
216    memcpy(cutoff, l2->cutoff, sizeof(l2->cutoff));  //  memcpy(cutoff, l2->cutoff, sizeof(l2->cutoff));
217      l2->cutoffsvl = cutoffsvl;
218    
219    // Quaternions    // Quaternions
220    q0 = l2->q0;    q0 = l2->q0;
# Line 192  void OrbitalInfo::SetFromLevel2Struct(cO Line 227  void OrbitalInfo::SetFromLevel2Struct(cO
227    phi = l2->phi;    phi = l2->phi;
228    etha = l2->etha;    etha = l2->etha;
229    
230      mode = l2->mode;
231    // Euler angles (local field reference frame)    // Euler angles (local field reference frame)
232    thetamag = l2->thetamag;  //   thetamag = l2->thetamag;
233    phimag = l2->phimag;  //   phimag = l2->phimag;
234    ethamag = l2->ethamag;  //   ethamag = l2->ethamag;
235    
236    memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));  //   memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));
237  }  }
238    
 ClassImp(OrbitalInfo)  

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.23