Ignore:
Timestamp:
03/08/03 14:00:30 (22 years ago)
Author:
wittek
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mfileio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc

    r1749 r1809  
    122122{
    123123    const char *name = gSystem->ExpandPathName(txt);
     124
    124125    TString fname(name);
    125126    delete [] name;
     
    336337    // float   frms_pedsig_phot[iMAXNUMPIX];      // standard deviation of the calibrated signals from the pedestal run */
    337338    fPedest->InitSize(iMAXNUMPIX);
     339    *fLog << "PedestalRMS : ";
    338340    for (Int_t i=0; i<iMAXNUMPIX; i++)
     341    {
    339342        (*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;
    340350
    341351    fPedest->SetReadyToSave();
     
    373383     *         be treated further. */
    374384
     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
    375401    *fLog << "File is a ";
    376     *fLog << (outpars.bmontecarlo ? "Monte Carlo" : "Real Data");
     402    *fLog << (fIsMcFile ? "Monte Carlo" : "Real Data");
    377403    *fLog << " file." << endl;
    378 
    379     fIsMcFile = outpars.bmontecarlo==TRUE;
    380 
     404    *fLog << " " << endl;
    381405}
    382406
     
    433457    ProcessRunHeader(outpars);
    434458
     459
    435460    //rwagner: ReInit whenever new run commences
    436461    // rc==-1 means: ReInit didn't work out
     462
    437463    if (!fTaskList->ReInit(fParList))
    438464        return -1;
     
    453479    TString m = cEND_EVENTS_TEMPLATE;
    454480    Int_t p = m.First('%');
     481
    455482
    456483    if (!s.BeginsWith(m(0,p)))
     
    515542
    516543    //
    517     // Check for the existance of a next file to read
     544    // Check for the existence of a next file to read
    518545    //
    519546    TNamed *file = (TNamed*)fFileNames->First();
     
    538565
    539566    if (!CheckHeader(fname))
    540         return kFALSE;
     567    {
     568        *fLog << "OpenNextFile : CheckHeader(fname) is FALSE" << endl;
     569        return kFALSE;
     570    }
    541571
    542572    fIn = new ifstream(fname);
    543573
    544574    *fLog << inf << "-----------------------------------------------------------------------" << endl;
     575
    545576
    546577    switch (ReadRunHeader())
     
    553584        return kFALSE;
    554585      default:
     586        *fLog << "OpenNextFile : after ReadRunHeader, FnumEventsInRun = "
     587              << fNumEventsInRun << endl;
    555588        return kTRUE;
    556589      }
     590
     591
     592
    557593}
    558594
     
    752788void MCT1ReadPreProc::ProcessEvent(const struct eventrecord &event)
    753789{
     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
    754818    //  int   isecs_since_midday; // seconds passed since midday before sunset (JD of run start)
    755819    //  int   isecfrac_200ns;     // fractional part of isecs_since_midday
     
    788852    // actual number of pixels (outputpars.inumpixels) is written out
    789853    // short spixsig_10thphot[iMAXNUMPIX];
     854    //*fLog << "spixsig_10thphot : " << endl;
    790855    for (Int_t i=0; i<iMAXNUMPIX; i++)
    791856    {
     857      //*fLog << event.spixsig_10thphot[i] << " ";
     858
    792859        if (event.spixsig_10thphot[i]==0)
    793860            continue;
     
    796863                         (*fPedest)[i].GetMeanRms());
    797864    }
     865    //*fLog << "" << endl;
     866
    798867    fNphot->SetReadyToSave();
    799868
     
    801870    // int ipreproc_az_arcs;  // "should be" az according to preproc (arcseconds)
    802871
    803     fMcEvt->Fill(0, /*fEvtNum*/
     872    fMcEvt->Fill(event.isecs_since_midday,     //0, /*fEvtNum*/
    804873                 fIsMcFile ? event.imcparticle : 0, /*corsika particle type*/
    805874                 fIsMcFile ? event.fmcenergy_tev*1000 : 0,
     
    867936        // an event
    868937        //
    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])
    870945            return kTRUE;
    871946
     
    874949        // must be an event
    875950        //
     951
    876952        switch (ReadRunFooter())
    877953        {
     
    906982        *fLog << "-----------------------------------------------------------------------" << endl;
    907983
     984
    908985        if (ReadRunHeader() < 0)
    909986        {
     
    911988            return kFALSE;
    912989        }
     990
     991        goto TONI;
     992
    913993        return kTRUE;
    914994    }
  • trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.h

    r1735 r1809  
    4848    UInt_t fNumFilterEvts;  // number of events mentioned in the runs footers
    4949
     50    Float_t savePedRMS[127];
     51
     52
    5053    Bool_t OpenNextFile();
    5154
Note: See TracChangeset for help on using the changeset viewer.