/[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.15 by pam-mep, Thu Jun 7 14:04:00 2012 UTC revision 1.19 by pamela, Tue Nov 17 10:10:04 2015 UTC
# Line 14  OrbitalInfoTrkVar::OrbitalInfoTrkVar(){ Line 14  OrbitalInfoTrkVar::OrbitalInfoTrkVar(){
14  void OrbitalInfoTrkVar::Clear(Option_t *t){  void OrbitalInfoTrkVar::Clear(Option_t *t){
15    trkseqno = 0;    trkseqno = 0;
16    pitch = -1000.;    pitch = -1000.;
17      sunangle = -1000;
18      sunmagangle = -1000;
19    cutoff = -1000.;    cutoff = -1000.;
20    Eij.Zero();    Eij.Zero();
21    Sij.Zero();    Sij.Zero();
# Line 35  OrbitalInfoTrkVar::OrbitalInfoTrkVar(con Line 37  OrbitalInfoTrkVar::OrbitalInfoTrkVar(con
37    //    //
38    pitch = t.pitch;    pitch = t.pitch;
39    cutoff = t.cutoff;    cutoff = t.cutoff;
40      sunangle=t.sunangle;
41      sunmagangle=t.sunmagangle;
42    //    //
43    Eij.ResizeTo(t.Eij);      Eij.ResizeTo(t.Eij);  
44    Eij = t.Eij;      Eij = t.Eij;  
# Line 57  void OrbitalInfo::Set(){//ELENA Line 61  void OrbitalInfo::Set(){//ELENA
61    if ( !OrbitalInfoTrk ) OrbitalInfoTrk = new TClonesArray("OrbitalInfoTrkVar",2); //ELENA}      if ( !OrbitalInfoTrk ) OrbitalInfoTrk = new TClonesArray("OrbitalInfoTrkVar",2); //ELENA}  
62    //  if ( !Iij ) Iij = new TMatrixD(3,3);    //  if ( !Iij ) Iij = new TMatrixD(3,3);
63  }//ELENA  }//ELENA
64    //--------------------------------------
65    //
66    //
67    //--------------------------------------
68    void OrbitalInfo::SetTrackArray(TClonesArray *track){//ELENA
69    //    if(track && strcmp(track->GetClass()->GetName(),"OrbitalInfoTrkVar")==0){
70            if(OrbitalInfoTrk)OrbitalInfoTrk->Clear("C");
71            OrbitalInfoTrk = track;
72    //    }
73    }
74    
75  OrbitalInfoTrkVar *OrbitalInfo::GetOrbitalInfoTrkVar(Int_t itrk){  OrbitalInfoTrkVar *OrbitalInfo::GetOrbitalInfoTrkVar(Int_t itrk){
76    //        //    
# Line 71  OrbitalInfoTrkVar *OrbitalInfo::GetOrbit Line 85  OrbitalInfoTrkVar *OrbitalInfo::GetOrbit
85    OrbitalInfoTrkVar *orbtrack = (OrbitalInfoTrkVar*)t[itrk];    OrbitalInfoTrkVar *orbtrack = (OrbitalInfoTrkVar*)t[itrk];
86    return orbtrack;    return orbtrack;
87  }  }
88    /**
89     * Retrieves the tof track matching the seqno-th tracker stored track.
90     *
91     */
92    OrbitalInfoTrkVar *OrbitalInfo::GetOrbitalInfoStoredTrack(int seqno){
93    
94      if( ntrk()==0 ){
95        printf("OrbitalInfo::GetOrbitalInfoStoredTrack(int) : requested tracker SeqNo %i but no OrbitalInforimeter tracks are stored\n",seqno);
96        return NULL;
97      };
98      
99      OrbitalInfoTrkVar *c = 0;
100      Int_t it_tof=0;
101        
102      do {
103        c = GetOrbitalInfoTrkVar(it_tof);
104        it_tof++;
105      } while( c && seqno != c->trkseqno && it_tof < ntrk());      
106      
107      if(!c || seqno != c->trkseqno){
108        c = 0;
109        if(seqno!=-1 ) printf("OrbitalInfo::GetOrbitalInfoStoredTrack(int) : requested tracker SeqNo %i does not match OrbitalInfo stored tracks\n",seqno);
110      };
111      return c;
112        
113    }
114    
115  void OrbitalInfo::Clear(Option_t *t){  void OrbitalInfo::Clear(Option_t *t){
116    //    //
# Line 83  void OrbitalInfo::Clear(Option_t *t){ Line 123  void OrbitalInfo::Clear(Option_t *t){
123    lon = -1000.;    lon = -1000.;
124    lat = -1000.;    lat = -1000.;
125    alt = -1000.;    alt = -1000.;
126      V.SetXYZ(-1000.,-1000.,-1000.);
127    
128    Bnorth = -1000.;    Bnorth = -1000.;
129    Beast = -1000.;    Beast = -1000.;
# Line 92  void OrbitalInfo::Clear(Option_t *t){ Line 133  void OrbitalInfo::Clear(Option_t *t){
133    BB0 = -1000.;    BB0 = -1000.;
134    L = -1000.;    L = -1000.;
135    
136  //   londip = -1000.;     londip = -1000.;
137  //   latdip = -1000.;     latdip = -1000.;
 //   altdip = -1000.;  
   
 //   loncgm = -1000.;  
 //   latcgm = -1000.;  
 //   altcgm = -1000.;  
   
 //   loncbm = -1000.;  
 //   latcbm = -1000.;  
 //   altcbm = -1000.;  
138    
139    //  std::fill_n(cutoff, 20, 0.);    //  std::fill_n(cutoff, 20, 0.);
140    //  std::fill_n(cutoff, 2, 0.);    //  std::fill_n(cutoff, 2, 0.);
# Line 119  void OrbitalInfo::Clear(Option_t *t){ Line 151  void OrbitalInfo::Clear(Option_t *t){
151    phi = -1000.;    phi = -1000.;
152    etha = -1000.;    etha = -1000.;
153    
   // Euler angles (local field reference frame)  
   //  thetamag = -1000.;  
   //  phimag = -1000.;  
   //  ethamag = -1000.;  
   
   //  pamzenitangle = -1000.;  
   //  pamBangle = -1000.;  
154    Iij.Zero();    Iij.Zero();
155    
156    mode = 0;    mode = 0;
157      qkind = -1000;
158      errq =  -1000;
159      azim =  -1000;
160      rtqual =-1000;
161    //  std::fill_n(goodAttitude, 5, 0);    //  std::fill_n(goodAttitude, 5, 0);
162  }  }
163    
# Line 143  void OrbitalInfo::GetLevel2Struct(cOrbit Line 172  void OrbitalInfo::GetLevel2Struct(cOrbit
172    l2->lon = lon;    l2->lon = lon;
173    l2->lat = lat;    l2->lat = lat;
174    l2->alt = alt;    l2->alt = alt;
175      l2->V = V;
176    
177    l2->Bnorth = Bnorth;    l2->Bnorth = Bnorth;
178    l2->Beast = Beast;    l2->Beast = Beast;
# Line 152  void OrbitalInfo::GetLevel2Struct(cOrbit Line 182  void OrbitalInfo::GetLevel2Struct(cOrbit
182    l2->BB0 = BB0;    l2->BB0 = BB0;
183    l2->L = L;    l2->L = L;
184    
185  //   l2->londip = londip;     l2->londip = londip;
186  //   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;  
187    
188    l2->cutoffsvl = cutoffsvl;    l2->cutoffsvl = cutoffsvl;
189  //  memcpy(l2->cutoffsvl, cutoffsvl, sizeof(cutoffsvl));  //  memcpy(l2->cutoffsvl, cutoffsvl, sizeof(cutoffsvl));
# Line 179  void OrbitalInfo::GetLevel2Struct(cOrbit Line 200  void OrbitalInfo::GetLevel2Struct(cOrbit
200    l2->etha = etha;    l2->etha = etha;
201    
202    l2->mode = mode;    l2->mode = mode;
203    // Euler angles (local field reference frame)    l2->qkind = qkind;
204  //   l2->thetamag = thetamag;    l2->errq = errq;
205  //   l2->phimag = phimag;    l2->azim = azim;
206  //   l2->ethamag = ethamag;    l2->rtqual=rtqual;
207    
208      l2->Iij=Iij;
209    
210  //   memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));  //   memcpy(l2->goodAttitude, goodAttitude, sizeof(goodAttitude));
211  }  }
# Line 195  void OrbitalInfo::SetFromLevel2Struct(cO Line 218  void OrbitalInfo::SetFromLevel2Struct(cO
218    lon = l2->lon;    lon = l2->lon;
219    lat = l2->lat;    lat = l2->lat;
220    alt = l2->alt;    alt = l2->alt;
221      V = l2->V;
222    
223    l2->Bnorth = Bnorth;    Bnorth = l2->Bnorth;
224    l2->Beast = Beast;    Beast = l2->Beast;
225    l2->Bdown = Bdown;    Bdown = l2->Bdown;
226    l2->Babs = Babs;    Babs = l2->Babs;
227    M = l2->M;    M = l2->M;
228    BB0 = l2->BB0;    BB0 = l2->BB0;
229    L = l2->L;    L = l2->L;
230    
231  //   londip = l2->londip;     londip = l2->londip;
232  //   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;  
233    
234  //  memcpy(cutoff, l2->cutoff, sizeof(l2->cutoff));  //  memcpy(cutoff, l2->cutoff, sizeof(l2->cutoff));
235    l2->cutoffsvl = cutoffsvl;    l2->cutoffsvl = cutoffsvl;
# Line 231  void OrbitalInfo::SetFromLevel2Struct(cO Line 246  void OrbitalInfo::SetFromLevel2Struct(cO
246    etha = l2->etha;    etha = l2->etha;
247    
248    mode = l2->mode;    mode = l2->mode;
249    // Euler angles (local field reference frame)    qkind = l2->qkind;
250  //   thetamag = l2->thetamag;    errq = l2->errq;
251  //   phimag = l2->phimag;    azim = l2->azim;
252  //   ethamag = l2->ethamag;    rtqual=l2->rtqual;
253    
254      Iij=l2->Iij;
255    
256  //   memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));  //   memcpy(goodAttitude, l2->goodAttitude, sizeof(l2->goodAttitude));
257  }  }

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.23