Ignore:
Timestamp:
03/05/09 16:20:53 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MJMerpp.cc

    r9141 r9388  
    6767}
    6868
    69 MFilter *MJMerpp::SetupCurrents(MReportFileReadCC &read, MWriteRootFile &write) const
     69void MJMerpp::SetupCurrents(MReportFileReadCC &read, MWriteRootFile *write) const
    7070{
    7171    read.SetHasNoHeader();
    7272    read.AddToList("MReportCurrents");
    7373
    74     write.AddContainer("MTimeCurrents",      "Currents");
    75     write.AddContainer("MCameraDC",          "Currents");
    76     write.AddContainer("MReportCurrents",    "Currents");
    77 
    78     return 0;
    79 }
    80 
    81 MFilter *MJMerpp::SetupReports(MReportFileReadCC &read, MWriteRootFile &write) const
     74    if (!write)
     75        return;
     76
     77    write->AddContainer("MTimeCurrents",      "Currents");
     78    write->AddContainer("MCameraDC",          "Currents");
     79    write->AddContainer("MReportCurrents",    "Currents");
     80}
     81
     82MFilter *MJMerpp::SetupReports(MReportFileReadCC &read, MWriteRootFile *write) const
    8283{
    8384    read.SetTelescope(fTelescope);
     
    9596    // AddTree(read, "DAQ",  fOnly);
    9697
     98    if (fReportRun!=(UInt_t)-1)
     99        read.AddToList("MReportRun");
     100
     101    if (!write)
     102        return 0;
     103
    97104    const Bool_t required = fOnly.IsNull();
    98     write.AddContainer("MReportCamera",      "Camera",     required);
    99     write.AddContainer("MTimeCamera",        "Camera",     required);
    100     write.AddContainer("MCameraAUX",         "Camera",     required);
    101     write.AddContainer("MCameraCalibration", "Camera",     required);
    102     write.AddContainer("MCameraCooling",     "Camera",     required);
    103     write.AddContainer("MCameraActiveLoad",  "Camera",     required);
    104     write.AddContainer("MCameraHV",          "Camera",     required);
    105     write.AddContainer("MCameraDC",          "Camera",     required);
    106     write.AddContainer("MCameraLV",          "Camera",     required);
    107     write.AddContainer("MCameraLids",        "Camera",     required);
    108     write.AddContainer("MReportTrigger",     "Trigger",    required);
    109     write.AddContainer("MTimeTrigger",       "Trigger",    required);
    110     write.AddContainer("MTriggerBit",        "Trigger",    required);
    111     write.AddContainer("MTriggerIPR",        "Trigger",    required);
    112     write.AddContainer("MTriggerCell",       "Trigger",    required);
    113     write.AddContainer("MTriggerPrescFact",  "Trigger",    required);
    114     write.AddContainer("MTriggerLiveTime",   "Trigger",    required);
    115     write.AddContainer("MReportDrive",       "Drive",      required);
    116     write.AddContainer("MTimeDrive",         "Drive",      required);
    117     write.AddContainer("MCameraTH",          "Rec",        required);
    118     write.AddContainer("MCameraTD",          "Rec",        required);
    119     write.AddContainer("MCameraRecTemp",     "Rec",        required);
    120     write.AddContainer("MReportRec",         "Rec",        required);
    121     write.AddContainer("MTimeRec",           "Rec",        required);
    122     write.AddContainer("MReportCC",          "CC",         required);
    123     write.AddContainer("MTimeCC",            "CC",         required);
    124     write.AddContainer("MReportStarguider",  "Starguider", required);
    125     write.AddContainer("MTimeStarguider",    "Starguider", required);
    126     write.AddContainer("MReportPyrometer",   "Pyrometer",  required);
    127     write.AddContainer("MTimePyrometer",     "Pyrometer",  required);
    128     // write.AddContainer("MReportDAQ",         "DAQ");
    129     // write.AddContainer("MTimeDAQ",           "DAQ");
     105    write->AddContainer("MReportCamera",      "Camera",     required);
     106    write->AddContainer("MTimeCamera",        "Camera",     required);
     107    write->AddContainer("MCameraAUX",         "Camera",     required);
     108    write->AddContainer("MCameraCalibration", "Camera",     required);
     109    write->AddContainer("MCameraCooling",     "Camera",     required);
     110    write->AddContainer("MCameraActiveLoad",  "Camera",     required);
     111    write->AddContainer("MCameraHV",          "Camera",     required);
     112    write->AddContainer("MCameraDC",          "Camera",     required);
     113    write->AddContainer("MCameraLV",          "Camera",     required);
     114    write->AddContainer("MCameraLids",        "Camera",     required);
     115    write->AddContainer("MReportTrigger",     "Trigger",    required);
     116    write->AddContainer("MTimeTrigger",       "Trigger",    required);
     117    write->AddContainer("MTriggerBit",        "Trigger",    required);
     118    write->AddContainer("MTriggerIPR",        "Trigger",    required);
     119    write->AddContainer("MTriggerCell",       "Trigger",    required);
     120    write->AddContainer("MTriggerPrescFact",  "Trigger",    required);
     121    write->AddContainer("MTriggerLiveTime",   "Trigger",    required);
     122    write->AddContainer("MReportDrive",       "Drive",      required);
     123    write->AddContainer("MTimeDrive",         "Drive",      required);
     124    write->AddContainer("MCameraTH",          "Rec",        required);
     125    write->AddContainer("MCameraTD",          "Rec",        required);
     126    write->AddContainer("MCameraRecTemp",     "Rec",        required);
     127    write->AddContainer("MReportRec",         "Rec",        required);
     128    write->AddContainer("MTimeRec",           "Rec",        required);
     129    write->AddContainer("MReportCC",          "CC",         required);
     130    write->AddContainer("MTimeCC",            "CC",         required);
     131    write->AddContainer("MReportStarguider",  "Starguider", required);
     132    write->AddContainer("MTimeStarguider",    "Starguider", required);
     133    write->AddContainer("MReportPyrometer",   "Pyrometer",  required);
     134    write->AddContainer("MTimePyrometer",     "Pyrometer",  required);
     135    // write->AddContainer("MReportDAQ",         "DAQ");
     136    // write->AddContainer("MTimeDAQ",           "DAQ");
    130137
    131138    if (fReportRun==(UInt_t)-1)
     
    138145                           f1.Data(), f2.Data());
    139146
    140     read.AddToList("MReportRun");
    141 
    142147    MFilter *filter = new MFDataPhrase(f.Data());
    143     write.SetFilter(filter);
     148    write->SetFilter(filter);
    144149    return filter;
    145150}
    146151
    147 void MJMerpp::SetupRaw(MRawFileRead &read, MWriteRootFile &write) const
     152void MJMerpp::SetupRaw(MRawFileRead &read, MWriteRootFile *write) const
    148153{
    149154    read.SetInterleave(fInterleave);
    150155    read.SetForceMode(fForceProcessing);
    151156
    152     write.AddContainer("MRawRunHeader",  "RunHeaders");
    153     write.AddContainer("MTime",          "Events");
    154     write.AddContainer("MRawEvtHeader",  "Events");
    155     write.AddContainer("MRawEvtData",    "Events");
    156     write.AddContainer("MRawEvtData2",   "Events");
    157     write.AddContainer("MRawCrateArray", "Events");
     157    if (!write)
     158        return;
     159
     160    write->AddContainer("MRawRunHeader",  "RunHeaders");
     161    write->AddContainer("MTime",          "Events");
     162    write->AddContainer("MRawEvtHeader",  "Events");
     163    write->AddContainer("MRawEvtData",    "Events");
     164    write->AddContainer("MRawEvtData2",   "Events");
     165    write->AddContainer("MRawCrateArray", "Events");
    158166}
    159167
     
    205213    }
    206214
     215    if (HasNullOut())
     216        return kTRUE;
     217
    207218    const Bool_t fileexist = !gSystem->AccessPathName(fPathOut, kFileExists);
    208219    const Bool_t writeperm = !gSystem->AccessPathName(fPathOut, kWritePermission);
     
    233244    *fLog << inf;
    234245    fLog->Separator(GetDescriptor());
    235     *fLog << "In:  " << fPathIn << endl;;
    236     *fLog << (fUpdate?"Upd":"Out") << ": " << fPathOut << endl;;
     246    *fLog << "In:  " << fPathIn << endl;
     247    if (!HasNullOut())
     248        *fLog << (fUpdate?"Upd":"Out") << ": " << fPathOut << endl;;
    237249    *fLog << endl;
    238250
     
    276288    MTask          *read   = 0;
    277289    MFilter        *filter = 0;
    278     MWriteRootFile *write  = new MWriteRootFile(fPathOut, option, "Magic root-file", fCompression);
     290    MWriteRootFile *write  = HasNullOut() ? 0 : new MWriteRootFile(fPathOut, option, "Magic root-file", fCompression);
    279291
    280292    if (isreport || isdc)
     
    285297
    286298        if (isdc)
    287             filter = SetupCurrents(*r, *write);
     299            SetupCurrents(*r, write);
    288300        else
    289             filter = SetupReports(*r, *write);
     301            filter = SetupReports(*r, write);
    290302
    291303        read = r;
     
    294306    {
    295307        MRawFileRead *r = new MRawFileRead(fPathIn);
    296         SetupRaw(*r, *write);
     308        SetupRaw(*r, write);
    297309        read = r;
    298310    }
     
    302314        tasks.AddToList(filter);
    303315
    304     if (!HasNullOut())
     316    if (write)
    305317        tasks.AddToList(write);
    306318
  • trunk/MagicSoft/Mars/mjobs/MJMerpp.h

    r9020 r9388  
    4242    void AddTree(MReportFileReadCC &read, const TString &rep, const TString &only) const;
    4343
    44     MFilter *SetupCurrents(MReportFileReadCC &read, MWriteRootFile &write) const;
    45     MFilter *SetupReports(MReportFileReadCC &read, MWriteRootFile &write) const;
    46 
    47     void SetupRaw(MRawFileRead &read, MWriteRootFile &write) const;
     44    void     SetupCurrents(MReportFileReadCC &read, MWriteRootFile *write) const;
     45    MFilter *SetupReports(MReportFileReadCC &read, MWriteRootFile *write) const;
     46    void     SetupRaw(MRawFileRead &read, MWriteRootFile *write) const;
    4847
    4948    Bool_t GetTimeFromFile();
Note: See TracChangeset for help on using the changeset viewer.