Changeset 1809 for trunk/MagicSoft/Mars/mfileio
- Timestamp:
- 03/08/03 14:00:30 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mfileio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc
r1749 r1809 122 122 { 123 123 const char *name = gSystem->ExpandPathName(txt); 124 124 125 TString fname(name); 125 126 delete [] name; … … 336 337 // float frms_pedsig_phot[iMAXNUMPIX]; // standard deviation of the calibrated signals from the pedestal run */ 337 338 fPedest->InitSize(iMAXNUMPIX); 339 *fLog << "PedestalRMS : "; 338 340 for (Int_t i=0; i<iMAXNUMPIX; i++) 341 { 339 342 (*fPedest)[i].SetMeanRms(outpars.frms_pedsig_phot[i]); 343 *fLog << outpars.frms_pedsig_phot[i] << " "; 344 345 //$$$$$$$$$$$$$$$$$$$$$$$$$ 346 savePedRMS[i] = outpars.frms_pedsig_phot[i]; 347 //$$$$$$$$$$$$$$$$$$$$$$$$$ 348 } 349 *fLog << endl; 340 350 341 351 fPedest->SetReadyToSave(); … … 373 383 * be treated further. */ 374 384 385 *fLog << "outpars.bmontecarlo = " << outpars.bmontecarlo << endl; 386 *fLog << "outpars.imcparticle = " << outpars.imcparticle << endl; 387 *fLog << "outpars.dsourcera_hours = " << outpars.dsourcera_hours << endl; 388 *fLog << "outpars.dsourcedec_deg = " << outpars.dsourcedec_deg << endl; 389 390 //*fLog << "File is a "; 391 //*fLog << (outpars.bmontecarlo ? "Monte Carlo" : "Real Data"); 392 //*fLog << " file." << endl; 393 394 395 // Next statement commented out because bmontecarlo was set wrongly 396 //fIsMcFile = outpars.bmontecarlo==TRUE; 397 fIsMcFile = (outpars.dsourcera_hours == 0.0 && 398 outpars.dsourcedec_deg == 0.0 && 399 outpars.imcparticle != 0 ); 400 375 401 *fLog << "File is a "; 376 *fLog << ( outpars.bmontecarlo? "Monte Carlo" : "Real Data");402 *fLog << (fIsMcFile ? "Monte Carlo" : "Real Data"); 377 403 *fLog << " file." << endl; 378 379 fIsMcFile = outpars.bmontecarlo==TRUE; 380 404 *fLog << " " << endl; 381 405 } 382 406 … … 433 457 ProcessRunHeader(outpars); 434 458 459 435 460 //rwagner: ReInit whenever new run commences 436 461 // rc==-1 means: ReInit didn't work out 462 437 463 if (!fTaskList->ReInit(fParList)) 438 464 return -1; … … 453 479 TString m = cEND_EVENTS_TEMPLATE; 454 480 Int_t p = m.First('%'); 481 455 482 456 483 if (!s.BeginsWith(m(0,p))) … … 515 542 516 543 // 517 // Check for the exist ance of a next file to read544 // Check for the existence of a next file to read 518 545 // 519 546 TNamed *file = (TNamed*)fFileNames->First(); … … 538 565 539 566 if (!CheckHeader(fname)) 540 return kFALSE; 567 { 568 *fLog << "OpenNextFile : CheckHeader(fname) is FALSE" << endl; 569 return kFALSE; 570 } 541 571 542 572 fIn = new ifstream(fname); 543 573 544 574 *fLog << inf << "-----------------------------------------------------------------------" << endl; 575 545 576 546 577 switch (ReadRunHeader()) … … 553 584 return kFALSE; 554 585 default: 586 *fLog << "OpenNextFile : after ReadRunHeader, FnumEventsInRun = " 587 << fNumEventsInRun << endl; 555 588 return kTRUE; 556 589 } 590 591 592 557 593 } 558 594 … … 752 788 void MCT1ReadPreProc::ProcessEvent(const struct eventrecord &event) 753 789 { 790 if (fRawRunHeader->GetRunNumber() == 1) 791 { 792 *fLog << "eventrecord" << endl; 793 *fLog << "isecs_since_midday = " << event.isecs_since_midday << endl; 794 *fLog << "isecfrac_200ns = " << event.isecfrac_200ns << endl; 795 *fLog << "snot_ok_flags = " << event.snot_ok_flags << endl; 796 *fLog << "ialt_arcs = " << event.ialt_arcs << endl; 797 *fLog << "iaz_arcs = " << event.iaz_arcs << endl; 798 *fLog << "ipreproc_alt_arcs = " << event.ipreproc_alt_arcs << endl; 799 *fLog << "ipreproc_az_arcs = " << event.ipreproc_az_arcs << endl; 800 *fLog << "ifieldrot_arcs = " << event.ifieldrot_arcs << endl; 801 802 *fLog << "srate_millihz = " << event.srate_millihz << endl; 803 *fLog << "fhourangle = " << event.fhourangle << endl; 804 *fLog << "fmcenergy_tev = " << event.fmcenergy_tev << endl; 805 *fLog << "fmcsize_phel = " << event.fmcsize_phel << endl; 806 *fLog << "imcimpact_m = " << event.imcimpact_m << endl; 807 *fLog << "imcparticle = " << event.imcparticle << endl; 808 *fLog << "imctriggerflag = " << event.imctriggerflag << endl; 809 } 810 811 812 for (Int_t i=0; i<iMAXNUMPIX; i++) 813 { 814 (*fPedest)[i].SetMeanRms(savePedRMS[i]); 815 } 816 817 754 818 // int isecs_since_midday; // seconds passed since midday before sunset (JD of run start) 755 819 // int isecfrac_200ns; // fractional part of isecs_since_midday … … 788 852 // actual number of pixels (outputpars.inumpixels) is written out 789 853 // short spixsig_10thphot[iMAXNUMPIX]; 854 //*fLog << "spixsig_10thphot : " << endl; 790 855 for (Int_t i=0; i<iMAXNUMPIX; i++) 791 856 { 857 //*fLog << event.spixsig_10thphot[i] << " "; 858 792 859 if (event.spixsig_10thphot[i]==0) 793 860 continue; … … 796 863 (*fPedest)[i].GetMeanRms()); 797 864 } 865 //*fLog << "" << endl; 866 798 867 fNphot->SetReadyToSave(); 799 868 … … 801 870 // int ipreproc_az_arcs; // "should be" az according to preproc (arcseconds) 802 871 803 fMcEvt->Fill( 0, /*fEvtNum*/872 fMcEvt->Fill(event.isecs_since_midday, //0, /*fEvtNum*/ 804 873 fIsMcFile ? event.imcparticle : 0, /*corsika particle type*/ 805 874 fIsMcFile ? event.fmcenergy_tev*1000 : 0, … … 867 936 // an event 868 937 // 869 if (fIn->peek()!=cEND_EVENTS_TEMPLATE[0]) 938 939 // "goto TONI" was introduced in order to check for a footer record 940 // after reading a run header; this is necessary for runs with 941 // zero events after the filter 942 TONI: 943 944 if (fIn->peek()!=cEND_EVENTS_TEMPLATE[0]) 870 945 return kTRUE; 871 946 … … 874 949 // must be an event 875 950 // 951 876 952 switch (ReadRunFooter()) 877 953 { … … 906 982 *fLog << "-----------------------------------------------------------------------" << endl; 907 983 984 908 985 if (ReadRunHeader() < 0) 909 986 { … … 911 988 return kFALSE; 912 989 } 990 991 goto TONI; 992 913 993 return kTRUE; 914 994 } -
trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.h
r1735 r1809 48 48 UInt_t fNumFilterEvts; // number of events mentioned in the runs footers 49 49 50 Float_t savePedRMS[127]; 51 52 50 53 Bool_t OpenNextFile(); 51 54
Note:
See TracChangeset
for help on using the changeset viewer.