/[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.7 by mocchiut, Thu Mar 15 12:42:47 2007 UTC revision 1.12 by mocchiut, Fri Oct 31 15:49:00 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.;  
4    
5    loncbm = -1000.;  ClassImp(OrbitalInfoTrkVar);
6    latcbm = -1000.;  ClassImp(OrbitalInfo);
   altcbm = -1000.;  
7    
8    std::fill_n(cutoff, 20, 0.);  OrbitalInfoTrkVar::OrbitalInfoTrkVar(){
9      this->Clear();
10    // Quaternions  }
   q0 = -1000.;  
   q1 = -1000.;  
   q2 = -1000.;  
   q3 = -1000.;  
11    
12    // Euler angles (nadir reference frame)  void OrbitalInfoTrkVar::Clear(Option_t *t){
13  //  theta = -1000.;    trkseqno = 0;
14  //  phi = -1000.;    pitch = -1000.;
15  //  etha = -1000.;  }
16    
   // Euler angles (local field reference frame)  
 //  thetamag = -1000.;  
 //  phimag = -1000.;  
 //  ethamag = -1000.;  
17    
18    std::fill_n(goodAttitude, 5, 0);  OrbitalInfo::OrbitalInfo(){
19      OrbitalInfoTrk = 0; //ELENA
20      this->Clear();
21  }  }
22    
23    void OrbitalInfo::Delete(Option_t *t){ //ELENA
24      //
25      if(OrbitalInfoTrk){
26        OrbitalInfoTrk->Delete(); //ELENA
27        delete OrbitalInfoTrk;  //ELENA
28      }
29      //
30    }; //ELENA
31    
32    void OrbitalInfo::Set(){//ELENA
33      if ( !OrbitalInfoTrk ) OrbitalInfoTrk = new TClonesArray("OrbitalInfoTrkVar",2); //ELENA
34    }//ELENA
35    
36    OrbitalInfoTrkVar *OrbitalInfo::GetOrbitalInfoTrkVar(Int_t itrk){
37      //    
38      if(itrk >= ntrk()){
39        printf(" OrbitalInfo ERROR: track related variables set %i does not exists! \n",itrk);
40        printf("                    stored track related variables = %i \n",ntrk());
41        return(NULL);
42      }  
43      //
44      if(!OrbitalInfoTrk)return 0; //ELENA
45      TClonesArray &t = *(OrbitalInfoTrk);
46      OrbitalInfoTrkVar *orbtrack = (OrbitalInfoTrkVar*)t[itrk];
47      return orbtrack;
48    }
49    
50  void OrbitalInfo::Clear(){  void OrbitalInfo::Clear(Option_t *t){
51      //
52      if ( OrbitalInfoTrk ) OrbitalInfoTrk->Delete();
53      //
54    absTime = 0;    absTime = 0;
55    OBT = 0;    OBT = 0;
56    pkt_num = 0;    pkt_num = 0;
# Line 87  void OrbitalInfo::Clear(){ Line 87  void OrbitalInfo::Clear(){
87    q3 = -1000.;    q3 = -1000.;
88    
89    // Euler angles (nadir reference frame)    // Euler angles (nadir reference frame)
90   // theta = -1000.;    theta = -1000.;
91   // phi = -1000.;    phi = -1000.;
92   // etha = -1000.;    etha = -1000.;
93    
94    // Euler angles (local field reference frame)    // Euler angles (local field reference frame)
95    //thetamag = -1000.;    //  thetamag = -1000.;
96   // phimag = -1000.;    //  phimag = -1000.;
97    //ethamag = -1000.;    //  ethamag = -1000.;
98    
99      pamzenitangle = -1000.;
100      pamBangle = -1000.;
101    
102    
103    std::fill_n(goodAttitude, 5, 0);    mode = 0;
104      //  std::fill_n(goodAttitude, 5, 0);
105  }  }
106    
107  /**  /**
# Line 139  void OrbitalInfo::GetLevel2Struct(cOrbit Line 144  void OrbitalInfo::GetLevel2Struct(cOrbit
144    l2->q3 = q3;    l2->q3 = q3;
145    
146    // Euler angles (nadir reference frame)    // Euler angles (nadir reference frame)
147   // l2->theta = theta;    l2->theta = theta;
148   // l2->phi = phi;    l2->phi = phi;
149   // l2->etha = etha;    l2->etha = etha;
150    
151      l2->mode = mode;
152    // Euler angles (local field reference frame)    // Euler angles (local field reference frame)
153   // l2->thetamag = thetamag;  //   l2->thetamag = thetamag;
154   // l2->phimag = phimag;  //   l2->phimag = phimag;
155   // l2->ethamag = ethamag;  //   l2->ethamag = ethamag;
156    
157    memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));  //   memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));
158  }  }
159    
160  void OrbitalInfo::SetFromLevel2Struct(cOrbitalInfo *l2){  void OrbitalInfo::SetFromLevel2Struct(cOrbitalInfo *l2){
# Line 188  void OrbitalInfo::SetFromLevel2Struct(cO Line 194  void OrbitalInfo::SetFromLevel2Struct(cO
194    q3 = l2->q3;    q3 = l2->q3;
195    
196    // Euler angles (nadir reference frame)    // Euler angles (nadir reference frame)
197    //theta = l2->theta;    theta = l2->theta;
198    //phi = l2->phi;    phi = l2->phi;
199    //etha = l2->etha;    etha = l2->etha;
200    
201      mode = l2->mode;
202    // Euler angles (local field reference frame)    // Euler angles (local field reference frame)
203    //thetamag = l2->thetamag;  //   thetamag = l2->thetamag;
204    //phimag = l2->phimag;  //   phimag = l2->phimag;
205    //ethamag = l2->ethamag;  //   ethamag = l2->ethamag;
206    
207    memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));  //   memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));
208  }  }
209    
 ClassImp(OrbitalInfo)  

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.23