/[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.10 by mocchiut, Mon Nov 26 08:01:13 2007 UTC revision 1.16 by pam-mep, Fri Mar 28 20:47:15 2014 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;  
4    
5    lon = 0.;  ClassImp(OrbitalInfoTrkVar);
6    lat = 0.;  ClassImp(OrbitalInfo);
   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.;  
7    
8    std::fill_n(cutoff, 20, 0.);  OrbitalInfoTrkVar::OrbitalInfoTrkVar(){
9      this->Clear();
10      //  Eij = new TMatrixD(3,3);
11      //  Sij = new TMatrixD(3,3);
12    }
13    
14    // Quaternions  void OrbitalInfoTrkVar::Clear(Option_t *t){
15    q0 = -1000.;    trkseqno = 0;
16    q1 = -1000.;    pitch = -1000.;
17    q2 = -1000.;    sunangle = -1000;
18    q3 = -1000.;    sunmagangle = -1000;
19      cutoff = -1000.;
20      Eij.Zero();
21      Sij.Zero();
22    }
23    
24    // Euler angles (nadir reference frame)  void OrbitalInfoTrkVar::Delete(Option_t *t){
25    theta = -1000.;    //  if ( Eij ) Eij->Delete();
26    phi = -1000.;    //  if ( Sij ) Sij->Delete();
27    etha = -1000.;  }
28    
29  //   // Euler angles (local field reference frame)  OrbitalInfo::OrbitalInfo(){
30  //   thetamag = -1000.;    OrbitalInfoTrk = 0; //ELENA
31  //   phimag = -1000.;    this->Clear();
 //   ethamag = -1000.;  
   mode = 0;  
 //  std::fill_n(goodAttitude, 5, 0);  
32  }  }
33    
34    OrbitalInfoTrkVar::OrbitalInfoTrkVar(const OrbitalInfoTrkVar &t){
35      //
36      trkseqno = t.trkseqno;  
37      //
38      pitch = t.pitch;
39      cutoff = t.cutoff;
40      sunangle=t.sunangle;
41      sunmagangle=t.sunmagangle;
42      //
43      Eij.ResizeTo(t.Eij);  
44      Eij = t.Eij;  
45      Sij.ResizeTo(t.Sij);  
46      Sij = t.Sij;  
47      //
48    };
49    
50    void OrbitalInfo::Delete(Option_t *t){ //ELENA
51      //
52      //  if ( Iij ) Iij->Delete();
53      if(OrbitalInfoTrk){
54        OrbitalInfoTrk->Delete(); //ELENA
55        delete OrbitalInfoTrk;  //ELENA
56      }
57      //
58    }; //ELENA
59    
60    void OrbitalInfo::Set(){//ELENA
61      if ( !OrbitalInfoTrk ) OrbitalInfoTrk = new TClonesArray("OrbitalInfoTrkVar",2); //ELENA}  
62      //  if ( !Iij ) Iij = new TMatrixD(3,3);
63    }//ELENA
64    
65    OrbitalInfoTrkVar *OrbitalInfo::GetOrbitalInfoTrkVar(Int_t itrk){
66      //    
67      if(itrk >= ntrk()){
68        printf(" OrbitalInfo ERROR: track related variables set %i does not exists! \n",itrk);
69        printf("                    stored track related variables = %i \n",ntrk());
70        return(NULL);
71      }  
72      //
73      if(!OrbitalInfoTrk)return 0; //ELENA
74      TClonesArray &t = *(OrbitalInfoTrk);
75      OrbitalInfoTrkVar *orbtrack = (OrbitalInfoTrkVar*)t[itrk];
76      return orbtrack;
77    }
78    
79  void OrbitalInfo::Clear(Option_t *t){  void OrbitalInfo::Clear(Option_t *t){
80      //
81      if ( OrbitalInfoTrk ) OrbitalInfoTrk->Delete();
82      //
83    absTime = 0;    absTime = 0;
84    OBT = 0;    OBT = 0;
85    pkt_num = 0;    pkt_num = 0;
# Line 58  void OrbitalInfo::Clear(Option_t *t){ Line 87  void OrbitalInfo::Clear(Option_t *t){
87    lon = -1000.;    lon = -1000.;
88    lat = -1000.;    lat = -1000.;
89    alt = -1000.;    alt = -1000.;
90      V.SetXYZ(-1000.,-1000.,-1000.);
91    
92    Bnorth = -1000.;    Bnorth = -1000.;
93    Beast = -1000.;    Beast = -1000.;
94    Bdown = -1000.;    Bdown = -1000.;
95    Babs = -1000.;    Babs = -1000.;
96      M = -1000;
97    BB0 = -1000.;    BB0 = -1000.;
98    L = -1000.;    L = -1000.;
99    
100    londip = -1000.;     londip = -1000.;
101    latdip = -1000.;     latdip = -1000.;
   altdip = -1000.;  
   
   loncgm = -1000.;  
   latcgm = -1000.;  
   altcgm = -1000.;  
   
   loncbm = -1000.;  
   latcbm = -1000.;  
   altcbm = -1000.;  
102    
103    std::fill_n(cutoff, 20, 0.);    //  std::fill_n(cutoff, 20, 0.);
104      //  std::fill_n(cutoff, 2, 0.);
105      cutoffsvl = 0.;
106    
107    // Quaternions    // Quaternions
108    q0 = -1000.;    q0 = -1000.;
# Line 91  void OrbitalInfo::Clear(Option_t *t){ Line 115  void OrbitalInfo::Clear(Option_t *t){
115    phi = -1000.;    phi = -1000.;
116    etha = -1000.;    etha = -1000.;
117    
118    // Euler angles (local field reference frame)    Iij.Zero();
   //  thetamag = -1000.;  
   //  phimag = -1000.;  
   //  ethamag = -1000.;  
119    
120    mode = 0;    mode = 0;
121      qkind = -1000;
122      errq =  -1000;
123      azim =  -1000;
124    //  std::fill_n(goodAttitude, 5, 0);    //  std::fill_n(goodAttitude, 5, 0);
125  }  }
126    
# Line 111  void OrbitalInfo::GetLevel2Struct(cOrbit Line 135  void OrbitalInfo::GetLevel2Struct(cOrbit
135    l2->lon = lon;    l2->lon = lon;
136    l2->lat = lat;    l2->lat = lat;
137    l2->alt = alt;    l2->alt = alt;
138      l2->V = V;
139    
140    l2->Bnorth = Bnorth;    l2->Bnorth = Bnorth;
141    l2->Beast = Beast;    l2->Beast = Beast;
142    l2->Bdown = Bdown;    l2->Bdown = Bdown;
143    l2->Babs = Babs;    l2->Babs = Babs;
144      l2->M = M;
145    l2->BB0 = BB0;    l2->BB0 = BB0;
146    l2->L = L;    l2->L = L;
147    
148    l2->londip = londip;     l2->londip = londip;
149    l2->latdip = latdip;     l2->latdip = latdip;
   l2->altdip = altdip;  
   
   l2->loncgm = loncgm;  
   l2->latcgm = latcgm;  
   l2->altcgm = altcgm;  
   
   l2->loncbm = loncbm;  
   l2->latcbm = latcbm;  
   l2->altcbm = altcbm;  
150    
151    memcpy(l2->cutoff, cutoff, sizeof(cutoff));    l2->cutoffsvl = cutoffsvl;
152    //  memcpy(l2->cutoffsvl, cutoffsvl, sizeof(cutoffsvl));
153    
154    // Quaternions    // Quaternions
155    l2->q0 = q0;    l2->q0 = q0;
# Line 145  void OrbitalInfo::GetLevel2Struct(cOrbit Line 163  void OrbitalInfo::GetLevel2Struct(cOrbit
163    l2->etha = etha;    l2->etha = etha;
164    
165    l2->mode = mode;    l2->mode = mode;
166    // Euler angles (local field reference frame)    l2->qkind = qkind;
167  //   l2->thetamag = thetamag;    l2->errq = errq;
168  //   l2->phimag = phimag;    l2->azim = azim;
 //   l2->ethamag = ethamag;  
169    
170  //   memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));  //   memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));
171  }  }
# Line 161  void OrbitalInfo::SetFromLevel2Struct(cO Line 178  void OrbitalInfo::SetFromLevel2Struct(cO
178    lon = l2->lon;    lon = l2->lon;
179    lat = l2->lat;    lat = l2->lat;
180    alt = l2->alt;    alt = l2->alt;
181      V = l2->V;
182    
183    l2->Bnorth = Bnorth;    l2->Bnorth = Bnorth;
184    l2->Beast = Beast;    l2->Beast = Beast;
185    l2->Bdown = Bdown;    l2->Bdown = Bdown;
186    l2->Babs = Babs;    l2->Babs = Babs;
187      M = l2->M;
188    BB0 = l2->BB0;    BB0 = l2->BB0;
189    L = l2->L;    L = l2->L;
190    
191    londip = l2->londip;     londip = l2->londip;
192    latdip = l2->latdip;     latdip = l2->latdip;
   altdip = l2->altdip;  
   
   loncgm = l2->loncgm;  
   latcgm = l2->latcgm;  
   altcgm = l2->altcgm;  
   
   loncbm = l2->loncbm;  
   latcbm = l2->latcbm;  
   altcbm = l2->altcbm;  
193    
194    memcpy(cutoff, l2->cutoff, sizeof(l2->cutoff));  //  memcpy(cutoff, l2->cutoff, sizeof(l2->cutoff));
195      l2->cutoffsvl = cutoffsvl;
196    
197    // Quaternions    // Quaternions
198    q0 = l2->q0;    q0 = l2->q0;
# Line 195  void OrbitalInfo::SetFromLevel2Struct(cO Line 206  void OrbitalInfo::SetFromLevel2Struct(cO
206    etha = l2->etha;    etha = l2->etha;
207    
208    mode = l2->mode;    mode = l2->mode;
209    // Euler angles (local field reference frame)    qkind = l2->qkind;
210  //   thetamag = l2->thetamag;    errq = l2->errq;
211  //   phimag = l2->phimag;    azim = l2->azim;
 //   ethamag = l2->ethamag;  
212    
213  //   memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));  //   memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));
214  }  }
215    
 ClassImp(OrbitalInfo)  

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.23