Changeset 3296
- Timestamp:
- 02/25/04 07:27:46 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/ONOFFAnalysis.C
r3274 r3296 182 182 //const char *onfile = "*.ON"; 183 183 const char *onfile = "12*.ON"; 184 //const char *onfile = "12410.ON"; 184 185 185 186 const char *mcfile = "/data/MAGIC/mc_eth/magLQE_3/gh/0/0/G_M0_00_0_550*.root"; … … 370 371 outNameImage += "Hillas"; 371 372 outNameImage += typeInput; 372 outNameImage += "1 a.root";373 outNameImage += "1b.root"; 373 374 gLog << "padded data to be written onto : " << outNameImage << endl; 374 375 … … 714 715 contbasic.SetName("SelBasic"); 715 716 716 MFillH fillblind("BlindPixels[MHBlindPixels]", "MBlindPixels");717 fillblind.SetName("HBlind");717 //MFillH fillblind("BlindPixels[MHBlindPixels]", "MBlindPixels"); 718 //fillblind.SetName("HBlind"); 718 719 719 720 MSigmabarCalc sigbarcalc; … … 803 804 804 805 tliston.AddToList(&blind); 805 //tliston.AddToList(&contbasic);806 807 tliston.AddToList(&fillblind);806 tliston.AddToList(&contbasic); 807 808 //tliston.AddToList(&fillblind); 808 809 tliston.AddToList(&sigbarcalc); 809 810 tliston.AddToList(&fillsigtheta); … … 1829 1830 filenameData += "Hillas"; 1830 1831 filenameData += typeInput; 1831 filenameData += "1 .root";1832 filenameData += "1b.root"; 1832 1833 gLog << "filenameData = " << filenameData << endl; 1833 1834 … … 1837 1838 outNameImage += "Hillas"; 1838 1839 outNameImage += typeInput; 1839 outNameImage += "2 .root";1840 outNameImage += "2b.root"; 1840 1841 1841 1842 -
trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc
r3274 r3296 79 79 fRuns = 0; 80 80 fSize = 100; 81 fStars = 1;81 fStars = 0; 82 82 83 83 fRunNr.Set(fSize); … … 88 88 fdPhiTel.Set(fSize); 89 89 90 fDecStar.Set(fStars); 91 fRaStar.Set(fStars); 92 fxStar.ResizeTo(fStars,fSize); 93 fyStar.ResizeTo(fStars,fSize); 94 fdxStar.ResizeTo(fStars,fSize); 95 fdyStar.ResizeTo(fStars,fSize); 90 fDecStar.Set(1); 91 fRaStar.Set(1); 92 fxStar.ResizeTo(1,fSize); 93 fyStar.ResizeTo(1,fSize); 94 fdxStar.ResizeTo(1,fSize); 95 fdyStar.ResizeTo(1,fSize); 96 96 97 } 97 98 … … 137 138 * 360.0 / (24.0 * kRad2Deg); 138 139 140 fStars += 1; 139 141 fDecStar.Set(fStars); 140 142 fDecStar[fStars-1] = (decStarDeg + decStarMin/60.0 + decStarSec/3600.0) … … 167 169 168 170 // convert into radians 169 Int_tfStars = fDecStar.GetSize() + 1;171 fStars = fDecStar.GetSize() + 1; 170 172 fDecStar.Set(fStars); 171 173 fDecStar[fStars-1] = (decStarDeg + decStarMin/60.0 + decStarSec/3600.0) … … 223 225 // 224 226 227 *fLog << all << "---------------------------------" << endl; 225 228 while(1) 226 229 { … … 249 252 *fLog << "all data were read" << endl; 250 253 FixSize(); 254 255 if (fDecSource == 0.0 || fRaSource == 0.0 || fStars == 0) 256 { 257 *fLog << err << "MSourcePosfromStarPos::PreProcess; there are no sky coordinates defined for the source or from stars" 258 << endl; 259 } 260 *fLog << all << "---------------------------------" << endl; 261 251 262 //------------------------------------------------------------- 252 263 … … 287 298 Double_t &dxSource, Double_t &dySource) 288 299 { 300 /* 289 301 *fLog << "MSourcePosfromStarPos::SourcefromStar : printout in degrees" << endl; 290 302 *fLog << " decStar, raStar = " << decStar[0]*kRad2Deg << ", " … … 306 318 *fLog << " xStar, yStar = " << xStar[0] << ", " 307 319 << yStar[0] << endl; 308 320 */ 309 321 310 322 // the units are assumed to be radians for theta, phi, dec and ra … … 324 336 Double_t sinal = a1 * sin(phiTel) * denom; 325 337 326 *fLog << "thetaTel, phiTel, cosal, sinal = " << thetaTel << ", "327 << phiTel << ", " << cosal << ", " << sinal << endl;338 //*fLog << "thetaTel, phiTel, cosal, sinal = " << thetaTel << ", " 339 // << phiTel << ", " << cosal << ", " << sinal << endl; 328 340 329 341 330 342 // calculate coordinates of source in system B (see TDAS 00-11, eqs. (2)) 331 Double_t xB0 = cos(decSource) * cos(raSource); 332 Double_t yB0 = cos(decSource) * sin(raSource); 343 // note that right ascension and hour angle go into opposite directions 344 Double_t xB0 = cos(decSource) * cos(-raSource); 345 Double_t yB0 = cos(decSource) * sin(-raSource); 333 346 Double_t zB0 = -sin(decSource); 334 347 335 *fLog << "xB0, yB0, zB0 = " << xB0 << ", " << yB0 << ", "336 << zB0 << endl;348 //*fLog << "xB0, yB0, zB0 = " << xB0 << ", " << yB0 << ", " 349 // << zB0 << endl; 337 350 338 351 //----------------------------------------------------- … … 351 364 sumwy += weighty; 352 365 353 *fLog << "weightx, weighty = " << weightx << ", " << weighty << endl;366 //*fLog << "weightx, weighty = " << weightx << ", " << weighty << endl; 354 367 355 368 // calculate coordinates of star in system B (see TDAS 00-11, eqs. (2)) 356 Double_t xB = cos(decStar[i]) * cos(raStar[i]); 357 Double_t yB = cos(decStar[i]) * sin(raStar[i]); 369 // note that right ascension and hour angle go into opposite directions 370 Double_t xB = cos(decStar[i]) * cos(-raStar[i]); 371 Double_t yB = cos(decStar[i]) * sin(-raStar[i]); 358 372 Double_t zB = -sin(decStar[i]); 359 373 360 374 361 *fLog << "xB, yB, zB = " << xB << ", " << yB << ", "362 << zB << endl;375 //*fLog << "xB, yB, zB = " << xB << ", " << yB << ", " 376 // << zB << endl; 363 377 364 378 … … 375 389 Double_t z = -(xB*xB0 + yB*yB0 + zB*zB0); 376 390 377 *fLog << "x, y, z = " << x << ", " << y << ", "378 << z << endl;391 //*fLog << "x, y, z = " << x << ", " << y << ", " 392 // << z << endl; 379 393 380 394 … … 383 397 Double_t ytilde = -f/z * (sinal*x + cosal*y); 384 398 385 *fLog << "xtilde, ytile = " << xtilde << ", " << ytilde << endl;399 //*fLog << "xtilde, ytile = " << xtilde << ", " << ytilde << endl; 386 400 387 401 … … 399 413 dySource = 1.0 / sqrt(sumwy); 400 414 401 *fLog << all << "MSourcePosfromStarPos::SourcefromStar; xSource, ySource = " 415 /* 416 Int_t run = fRun->GetRunNumber(); 417 *fLog << all << "MSourcePosfromStarPos::SourcefromStar; run, xSource, ySource = " 418 << run << " : " 402 419 << xSource << " +- " << dxSource << ", " 403 420 << ySource << " +- " << dySource << endl; 421 */ 404 422 } 405 423 … … 411 429 Bool_t MSourcePosfromStarPos::ReInit(MParList *pList) 412 430 { 413 //if (fDecSource == 0.0 || fRaSource == 0.0 || fStars == 0)414 //{415 // *fLog << err << "MSourcePosfromStarPos::ReInit; sky coordinates of star and source are not defined ... aborting"416 // << endl;417 //return kFALSE;418 //}419 431 420 432 Int_t run = fRun->GetRunNumber(); 421 422 *fLog << "MSourcePosfromStarPos::ReInit; run = " << run << endl; 433 *fLog << all << "MSourcePosfromStarPos::ReInit; run = " << run << endl; 423 434 424 435 //------------------------------------------------------------------- … … 437 448 fMcEvt->SetReadyToSave(); 438 449 439 *fLog << "theta, phi = " << thetarad*kRad2Deg << ", "450 *fLog << all << "theta, phi = " << thetarad*kRad2Deg << ", " 440 451 << phirad*kRad2Deg << endl; 441 452 … … 443 454 // Get source position and put it into MSrcPosCam 444 455 445 /*456 446 457 if (fStars > 0) 447 458 { … … 469 480 470 481 *fLog << all << "MSourcePosfromStarPos::ReInit; fRunNr, fxSource, fySource = " 471 << fRunNr[i] << ", " << fxSource << " , " << fySource472 << endl;482 << fRunNr[i] << ", " << fxSource << " +- " << fdxSource 483 << ", " << fySource << " +- " << fdySource << endl; 473 484 474 485 fSrcPos->SetReadyToSave(); 475 486 } 476 */487 477 488 478 489 return kTRUE; … … 483 494 << run << endl; 484 495 485 Double_t thetadeg = 90.0;496 Double_t thetadeg = 25.0; 486 497 Double_t thetarad = thetadeg / kRad2Deg; 487 498 fMcEvt->SetTelescopeTheta(thetarad); … … 500 511 Int_t MSourcePosfromStarPos::Process() 501 512 { 502 Int_t run = fRun->GetRunNumber(); 503 513 //Int_t run = fRun->GetRunNumber(); 504 514 //*fLog << "MSourcePosfromStarPos::Process; run = " << run << endl; 505 515 … … 524 534 { 525 535 *fLog << "MSourcePosfromStarPos::FixSize; fix size of arrays : fRuns = " 526 << fRuns << endl;536 << fRuns << ", fStars = " << fStars << endl; 527 537 528 538 fSize = fRuns; … … 535 545 fdPhiTel.Set(fSize); 536 546 537 fStars = fxStar.GetNrows();538 fxStar.ResizeTo(f Stars, fSize);539 fyStar.ResizeTo(f Stars, fSize);540 fdxStar.ResizeTo(f Stars, fSize);541 fdyStar.ResizeTo(f Stars, fSize);547 Int_t fRows = fxStar.GetNrows(); 548 fxStar.ResizeTo(fRows, fSize); 549 fyStar.ResizeTo(fRows, fSize); 550 fdxStar.ResizeTo(fRows, fSize); 551 fdyStar.ResizeTo(fRows, fSize); 542 552 } 543 553 … … 593 603 *fIn >> ival; 594 604 595 *fLog << fRuns <<"th run : " << ival << endl;605 //*fLog << fRuns <<"th run : " << ival << endl; 596 606 597 607 fRunNr.AddAt(ival, fRuns-1); 598 608 599 *fLog << "check : fRuns, fRunNr[fRuns-1], fRunNr[fRuns] = " << fRuns << ", "600 << fRunNr[fRuns-1] << ", " << fRunNr[fRuns] << endl;609 //*fLog << "check : fRuns, fRunNr[fRuns-1], fRunNr[fRuns] = " << fRuns << ", " 610 // << fRunNr[fRuns-1] << ", " << fRunNr[fRuns] << endl; 601 611 602 612 // read mjdS, hmsS, mjdE, hmsE … … 614 624 *fIn >> val; 615 625 fThetaTel.AddAt(val/kRad2Deg, fRuns-1); 616 *fLog << "val, fThetaTel[fRuns-1] = " << val << ", "617 626 //*fLog << "val, fThetaTel[fRuns-1] = " << val << ", " 627 // << fThetaTel[fRuns-1] << endl; 618 628 619 629 620 630 *fIn >> val; 621 631 fPhiTel.AddAt(val/kRad2Deg, fRuns-1); 622 *fLog << "val, fPhiTel[fRuns-1] = " << val << ", "623 << fPhiTel[fRuns-1] << endl;632 //*fLog << "val, fPhiTel[fRuns-1] = " << val << ", " 633 // << fPhiTel[fRuns-1] << endl; 624 634 625 635 … … 635 645 *fIn >> val; 636 646 fxStar(i, fRuns-1) = val / fMm2Deg;; 637 *fLog << "val, fxStar(i, fRuns-1) = " << val << ", "638 << fxStar(i, fRuns-1) << endl;647 //*fLog << "val, fxStar(i, fRuns-1) = " << val << ", " 648 // << fxStar(i, fRuns-1) << endl; 639 649 640 650 *fIn >> val; 641 651 fyStar(i, fRuns-1) = val / fMm2Deg; 642 *fLog << "val, fyStar(i, fRuns-1) = " << val << ", "643 << fyStar(i, fRuns-1) << endl;652 //*fLog << "val, fyStar(i, fRuns-1) = " << val << ", " 653 // << fyStar(i, fRuns-1) << endl; 644 654 645 655 … … 701 711 702 712 const Bool_t noexist = !(*fIn); 713 703 714 704 715 if (noexist)
Note:
See TracChangeset
for help on using the changeset viewer.