Changeset 17048 for branches


Ignore:
Timestamp:
08/27/13 14:17:00 (11 years ago)
Author:
ftemme
Message:
Changed the writing of several header keys for the fitsoutput of ceres from hardcoded values to values from a given runheader, the call of SetupHeaderKeys() is commented out, cause the setting of the header keys should be during MWriteFitsFile::ReInit(), cause the Runheader is not initialized at the moment of the previous call
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Mars_MC/mjobs/MJSimulation.cc

    r17011 r17048  
    261261}
    262262
    263 void MJSimulation::SetupHeaderKeys(MWriteFitsFile &write) const
     263void MJSimulation::SetupHeaderKeys(MWriteFitsFile &write,MRawRunHeader &header) const
    264264{
     265    const MTime now(-1);
     266    write.SetHeaderKey("ISMC",true,"Bool if File is Montecarlo File");
    265267    write.SetHeaderKey("TELESCOP", "FACT", "");
    266268    write.SetHeaderKey("PACKAGE", "MARS Cheobs", "");
     
    268270    write.SetHeaderKey("CREATOR", "Ceres", "");
    269271    write.SetHeaderKey("EXTREL", 1., "");
    270     write.SetHeaderKey("COMPILED", "1970-01-01T00:00:00", "");
     272    write.SetHeaderKey("COMPILED", __DATE__" "__TIME__, "");
    271273    write.SetHeaderKey("REVISION", "0", "");
    272274    write.SetHeaderKey("ORIGIN", "FACT", "");
    273     write.SetHeaderKey("DATE", "1970-01-01T00:00:00", "");
    274     write.SetHeaderKey("NIGHT", 19700101, "");
     275    write.SetHeaderKey("DATE", now.GetStringFmt("%Y-%m-%dT%H:%M:%S").Data(), "");
     276    write.SetHeaderKey("NIGHT", now.GetNightAsInt(), "");
    275277    write.SetHeaderKey("TIMESYS", "UTC", "");
    276278    write.SetHeaderKey("TIMEUNIT", "d", "");
    277279    write.SetHeaderKey("MJDREF", 40587, "");
    278     write.SetHeaderKey("BLDVER", 1, "");
    279     write.SetHeaderKey("RUNID", 1, "");
     280    //write.SetHeaderKey("BLDVER", 1, "");
     281    write.SetHeaderKey("RUNID", header.GetRunNumber(), "");
    280282    write.SetHeaderKey("NBOARD", 40, "");
    281     write.SetHeaderKey("NPIX", 1440, "");
    282     write.SetHeaderKey("NROI", 150, "");
     283    write.SetHeaderKey("NPIX", header.GetNumPixel(), "");
     284    write.SetHeaderKey("NROI", header.GetNumSamplesHiGain(), "");
    283285    write.SetHeaderKey("NROITM", 0, "");
    284286    write.SetHeaderKey("TMSHIFT", 0, "");
    285287    write.SetHeaderKey("CAMERA", "MGeomCamFACT", "");
    286288    write.SetHeaderKey("DAQ", "DRS4", "");
    287     write.SetHeaderKey("ADCRANGE", 2000, "Dynamic range in mV");
    288     write.SetHeaderKey("ADC", 12, "Resolution in bits");
    289     write.SetHeaderKey("RUNTYPE", "data", "");
    290     write.SetHeaderKey("ID", 777, "Board  0: Board ID");
    291     write.SetHeaderKey("FMVER", 532, "Board  0: Firmware Version");
    292     write.SetHeaderKey("DNA", "0", "");
    293     write.SetHeaderKey("BOARD", 0, "");
    294     write.SetHeaderKey("PRESC", 40, "");
    295     write.SetHeaderKey("PHASE", 0, "");
    296     write.SetHeaderKey("DAC0", 26500, "");
    297     write.SetHeaderKey("DAC1", 0, "");
    298     write.SetHeaderKey("DAC2", 0, "");
    299     write.SetHeaderKey("DAC3", 0, "");
    300     write.SetHeaderKey("DAC4", 28800, "");
    301     write.SetHeaderKey("DAC5", 28800, "");
    302     write.SetHeaderKey("DAC6", 28800, "");
    303     write.SetHeaderKey("DAC7", 28800, "");
    304     write.SetHeaderKey("REFCLK", 2000.0768, "");
     289
     290    // FTemme: ADCRANGE and ADC have to be calculated, using the values for
     291    // the fadctype.
     292//    write.SetHeaderKey("ADCRANGE", 2000, "Dynamic range in mV");
     293//    write.SetHeaderKey("ADC", 12, "Resolution in bits");
     294
     295    switch(header.GetRunType())
     296    {
     297    case MRawRunHeader::kRTData|MRawRunHeader::kRTMonteCarlo:
     298        write.SetHeaderKey("RUNTYPE", "data", "");
     299        break;
     300    case MRawRunHeader::kRTPedestal|MRawRunHeader::kRTMonteCarlo:
     301        write.SetHeaderKey("RUNTYPE", "pedestal", "");
     302        break;
     303    case MRawRunHeader::kRTCalibration|MRawRunHeader::kRTMonteCarlo:
     304        write.SetHeaderKey("RUNTYPE", "calibration", "");
     305        break;
     306    }
     307//    write.SetHeaderKey("ID", 777, "Board  0: Board ID");
     308//    write.SetHeaderKey("FMVER", 532, "Board  0: Firmware Version");
     309//    write.SetHeaderKey("DNA", "0", "");
     310//    write.SetHeaderKey("BOARD", 0, "");
     311//    write.SetHeaderKey("PRESC", 40, "");
     312//    write.SetHeaderKey("PHASE", 0, "");
     313//    write.SetHeaderKey("DAC0", 26500, "");
     314//    write.SetHeaderKey("DAC1", 0, "");
     315//    write.SetHeaderKey("DAC2", 0, "");
     316//    write.SetHeaderKey("DAC3", 0, "");
     317//    write.SetHeaderKey("DAC4", 28800, "");
     318//    write.SetHeaderKey("DAC5", 28800, "");
     319//    write.SetHeaderKey("DAC6", 28800, "");
     320//    write.SetHeaderKey("DAC7", 28800, "");
     321    write.SetHeaderKey("REFCLK", header.GetFreqSampling(), "");
    305322    write.SetHeaderKey("DRSCALIB", false, "");
    306     write.SetHeaderKey("TSTARTI", 0, "");
    307     write.SetHeaderKey("TSTARTF", 0., "");
    308     write.SetHeaderKey("TSTOPI", 0, "");
    309     write.SetHeaderKey("TSTOPF", 0., "");
    310     write.SetHeaderKey("DATE-OBS", "1970-01-01T00:00:00", "");
    311     write.SetHeaderKey("DATE-END", "1970-01-01T00:00:00", "");
    312     write.SetHeaderKey("NTRG", 0, "");
    313     write.SetHeaderKey("NTRGPED", 0, "");
    314     write.SetHeaderKey("NTRGLPE", 0, "");
    315     write.SetHeaderKey("NTRGTIM", 0, "");
    316     write.SetHeaderKey("NTRGLPI", 0, "");
    317     write.SetHeaderKey("NTRGEXT1", 0, "");
    318     write.SetHeaderKey("NTRGEXT2", 0, "");
    319     write.SetHeaderKey("NTRGMISC", 0, "");
     323//    write.SetHeaderKey("TSTARTI", 0, "");
     324//    write.SetHeaderKey("TSTARTF", 0., "");
     325//    write.SetHeaderKey("TSTOPI", 0, "");
     326//    write.SetHeaderKey("TSTOPF", 0., "");
     327//    write.SetHeaderKey("DATE-OBS", "1970-01-01T00:00:00", "");
     328//    write.SetHeaderKey("DATE-END", "1970-01-01T00:00:00", "");
     329//    write.SetHeaderKey("NTRG", 0, "");
     330//    write.SetHeaderKey("NTRGPED", 0, "");
     331//    write.SetHeaderKey("NTRGLPE", 0, "");
     332//    write.SetHeaderKey("NTRGTIM", 0, "");
     333//    write.SetHeaderKey("NTRGLPI", 0, "");
     334//    write.SetHeaderKey("NTRGEXT1", 0, "");
     335//    write.SetHeaderKey("NTRGEXT2", 0, "");
     336//    write.SetHeaderKey("NTRGMISC", 0, "");
    320337}
    321338
     
    326343    write.VetoColumn("MRawEvtData.fLoGainFadcSamples");
    327344    write.VetoColumn("MRawEvtData.fABFlags");
    328     write.VetoColumn("MRawEvtData.fIsSigned");
    329345    write.VetoColumn("MRawEvtHeader.fNumTrigLvl2");
    330     write.VetoColumn("MRawEvtHeader.fTrigPattern");
     346    //write.VetoColumn("MRawEvtHeader.fTrigPattern");
    331347    write.VetoColumn("MRawEvtHeader.fNumLoGainOn");
    332348}
     
    630646    MTask &write3a = fWriteFitsFile ? static_cast<MTask&>(write3af) : static_cast<MTask&>(write3ar);
    631647
    632     SetupHeaderKeys(write3af);
     648    //SetupHeaderKeys(write3af,header);
    633649    SetupVetoColumns(write3af);
    634650
Note: See TracChangeset for help on using the changeset viewer.