- Timestamp:
- 01/26/05 09:09:09 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mtemp/mmpi
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mmpi/MInterpolatePointingPos.cc
r5943 r6016 63 63 using namespace std; 64 64 65 const Int_t MInterpolatePointingPos::fgNumStartEvents = 1 0000;65 const Int_t MInterpolatePointingPos::fgNumStartEvents = 1; 66 66 // -------------------------------------------------------------------------- 67 67 // … … 150 150 TArrayD dec(fNumStartEvents); 151 151 152 Int_t n= 0;152 Int_t n=1; 153 153 while (tlist.Process()) 154 154 { … … 156 156 MTime* reporttime = (MTime*)plist.FindObject("MTimeDrive"); 157 157 158 if(n== 0)158 if(n==1) 159 159 fFirstDriveTime = *reporttime; 160 160 else 161 161 fLastDriveTime = *reporttime; 162 162 163 // 164 // Update the number of entries 165 // 166 if (n>fNumStartEvents) 167 { 168 reportTime.Set(n); 169 currentZd.Set(n); 170 currentAz.Set(n); 171 nominalZd.Set(n); 172 nominalAz.Set(n); 173 ra.Set(n); 174 dec.Set(n); 175 } 163 176 // 164 177 // Sometimes there are two reports with the same time … … 171 184 } 172 185 173 reportTime[n] = reporttime->GetTime(); 174 currentZd[n] = report->GetCurrentZd(); 175 currentAz[n] = report->GetCurrentAz(); 176 nominalZd[n] = report->GetNominalZd(); 177 nominalAz[n] = report->GetNominalAz(); 178 ra[n] = report->GetRa(); 179 dec[n] = report->GetDec(); 180 181 //cout << " GetTime(): " << reporttime->GetTime() << endl; 182 //cout << " GetCurrentZd(): " << report->GetCurrentZd() << endl; 186 reportTime[n-1] = reporttime->GetTime(); 187 currentZd [n-1] = report->GetCurrentZd(); 188 currentAz [n-1] = report->GetCurrentAz(); 189 nominalZd [n-1] = report->GetNominalZd(); 190 nominalAz [n-1] = report->GetNominalAz(); 191 ra [n-1] = report->GetRa(); 192 dec [n-1] = report->GetDec(); 193 194 if (fDebug) 195 { 196 *fLog << " GetTime(): " << reporttime->GetTime() << endl; 197 *fLog << " GetCurrentZd(): " << report->GetCurrentZd() << endl; 198 } 183 199 n++; 184 200 } … … 186 202 tlist.PrintStatistics(); 187 203 188 *fLog << "["<< GetName() << "]: loaded " << n << " ReportDrive from "204 *fLog << "["<< GetName() << "]: loaded " << n-1 << " ReportDrive from " 189 205 << fFirstDriveTime << " to " << fLastDriveTime << endl << endl; 190 206 191 //192 // Update the number of entries193 //194 reportTime.Set(n);195 currentZd.Set(n);196 currentAz.Set(n);197 nominalZd.Set(n);198 nominalAz.Set(n);199 ra.Set(n);200 dec.Set(n);201 202 207 if (fDebug) 203 208 { … … 210 215 211 216 fSplineZd = new TSpline3("zenith", 212 reportTime.GetArray(), nominalZd.GetArray(), n );217 reportTime.GetArray(), nominalZd.GetArray(), n-1); 213 218 fSplineAz = new TSpline3("azimuth", 214 reportTime.GetArray(), nominalAz.GetArray(), n );219 reportTime.GetArray(), nominalAz.GetArray(), n-1); 215 220 fSplineRa = new TSpline3("RA", 216 reportTime.GetArray(), ra.GetArray(), n );221 reportTime.GetArray(), ra.GetArray(), n-1); 217 222 fSplineDec = new TSpline3("DEC", 218 reportTime.GetArray(), dec.GetArray(), n );223 reportTime.GetArray(), dec.GetArray(), n-1); 219 224 220 225 if (fDebug) … … 232 237 c->Modified(); 233 238 c->Update(); 239 c->SaveAs("pointing.root"); 234 240 } 235 241 return kTRUE; … … 290 296 //const Int_t run = fRunHeader->GetRunNumber(); 291 297 const MTime* StartRunTime = &fRunHeader->GetRunStart(); 292 Double_t time = StartRunTime->GetTime();298 Int_t time = StartRunTime->GetTime(); 293 299 294 300 switch(fTimeMode) … … 305 311 << " outside range of drive reports (" << fFirstDriveTime 306 312 << ", " << fLastDriveTime << ")" << endl; 313 314 if ( *fEvtTime<fFirstDriveTime ) time = fFirstDriveTime.GetTime(); 315 if ( *fEvtTime>fLastDriveTime ) time = fLastDriveTime.GetTime(); 307 316 308 317 *fLog << " PointingPos: time = " << time << " (" << *fEvtTime << ") (zd, az, ra, dec) = (" << fSplineZd->Eval( time )<< ", " <<fSplineAz … … 328 337 if( *fEvtTime<fFirstDriveTime || *fEvtTime>fLastDriveTime) 329 338 { 330 *fLog << err << GetDescriptor() << ": Run time = " 331 << *fEvtTime << " outside range of drive reports (" 332 << fFirstDriveTime << ", "<< fLastDriveTime << ")" << endl; 333 334 *fLog << " PointingPos: time = " << time << " (" << *fEvtTime << ") (zd, az, ra, dec) = (" << fSplineZd->Eval( time )<< ", " <<fSplineAz->Eval( time )<< ", " <<fSplineRa->Eval( time ) << ", " <<fSplineDec->Eval( time )<< ")" << endl; 335 336 if ( *fEvtTime<fFirstDriveTime ) time = fFirstDriveTime.GetTime(); 337 if ( *fEvtTime>fLastDriveTime ) time = fLastDriveTime.GetTime(); 339 if (fDebug) 340 { 341 *fLog << err << GetDescriptor() << ": Run time = " 342 << *fEvtTime << " outside range of drive reports (" 343 << fFirstDriveTime << ", "<< fLastDriveTime << ")" << endl; 344 345 if ( *fEvtTime<fFirstDriveTime ) time = fFirstDriveTime.GetTime(); 346 if ( *fEvtTime>fLastDriveTime ) time = fLastDriveTime.GetTime(); 347 348 *fLog << " PointingPos: time = " << time << " (" << *fEvtTime << ") (zd, az, ra, dec) = (" << fSplineZd->Eval( time )<< ", " <<fSplineAz->Eval( time )<< ", " <<fSplineRa->Eval( time ) << ", " <<fSplineDec->Eval( time )<< ")" << endl; 349 } 350 338 351 //fError = kTRUE; 339 352 //return kFALSE; … … 349 362 // Check that we have drive report for this time 350 363 // 351 if( *StartRunTime<fFirstDriveTime || *StartRunTime>fLastDriveTime) 364 //if( *StartRunTime<fFirstDriveTime || *StartRunTime>fLastDriveTime) 365 if( *StartRunTime>fLastDriveTime) 352 366 { 353 367 *fLog << err << GetDescriptor() << ": Run time " << *StartRunTime
Note:
See TracChangeset
for help on using the changeset viewer.