Ignore:
Timestamp:
03/31/03 10:37:56 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r1850 r1880  
    103103// default constructor - emty
    104104//
    105 MEvtLoop::MEvtLoop() : fParList(NULL), fProgress(NULL)
    106 {
    107     fName = "Evtloop";
     105MEvtLoop::MEvtLoop(const char *name) : fParList(NULL), fProgress(NULL)
     106{
     107    fName = name;
    108108}
    109109
     
    444444// gui elements to a macro-file.
    445445//
    446 
    447446void MEvtLoop::StreamPrimitive(ofstream &out) const
    448447{
    449     out << "   MEvtLoop " << GetUniqueName() << ";" << endl;
    450 }
    451 
     448    out << "   MEvtLoop " << GetUniqueName();
     449    if (fName!="Evtloop")
     450        out << "(\"" << fName << "\")";
     451    out << ";" << endl;
     452}
     453
     454// --------------------------------------------------------------------------
     455//
     456//
    452457void MEvtLoop::SavePrimitive(ofstream &out, Option_t *opt)
    453458{
     
    666671    return n;
    667672}
     673
     674// --------------------------------------------------------------------------
     675//
     676// Read the contents/setup of a parameter container/task from a TEnv
     677// instance (steering card/setup file).
     678// The key to search for in the file should be of the syntax:
     679//    prefix.vname
     680// While vname is a name which is specific for a single setup date
     681// (variable) of this container and prefix is something like:
     682//    evtloopname.name
     683// While name is the name of the containers/tasks in the parlist/tasklist
     684//
     685// eg.  Job4.MImgCleanStd.CleaningLevel1:  3.0
     686//      Job4.MImgCleanStd.CleaningLevel2:  2.5
     687//
     688// If this cannot be found the next step is to search for
     689//      MImgCleanStd.CleaningLevel1:  3.0
     690// And if this doesn't exist, too, we should search for:
     691//      CleaningLevel1:  3.0
     692//
     693// Warning: The programmer is responsible for the names to be unique in
     694//          all Mars classes.
     695//
     696Bool_t MEvtLoop::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     697{
     698    if (!prefix.IsNull())
     699        *fLog << warn << "WARNING - Second argument in MEvtLoop::ReadEnv has no meaning... ignored." << endl;
     700
     701    *fLog << "1: " << "'" << prefix << "'" << (int)print << endl;
     702
     703    prefix = fName;
     704    prefix += ".";
     705
     706    *fLog << inf << "Reading resources for " << prefix /*TEnv::fRcName << " from " << env.GetRcName()*/ << endl;
     707
     708    if (fParList->ReadEnv(env, prefix, print)==kERROR)
     709    {
     710        *fLog << err << "ERROR - Reading Environment file." << endl;
     711        return kFALSE;
     712    }
     713
     714    return kTRUE;
     715}
     716
     717// --------------------------------------------------------------------------
     718//
     719// Write the contents/setup of a parameter container/task to a TEnv
     720// instance (steering card/setup file).
     721// The key to search for in the file should be of the syntax:
     722//    prefix.vname
     723// While vname is a name which is specific for a single setup date
     724// (variable) of this container and prefix is something like:
     725//    evtloopname.name
     726// While name is the name of the containers/tasks in the parlist/tasklist
     727//
     728// eg.  Job4.MImgCleanStd.CleaningLevel1:  3.0
     729//      Job4.MImgCleanStd.CleaningLevel2:  2.5
     730//
     731// If this cannot be found the next step is to search for
     732//      MImgCleanStd.CleaningLevel1:  3.0
     733// And if this doesn't exist, too, we should search for:
     734//      CleaningLevel1:  3.0
     735//
     736// Warning: The programmer is responsible for the names to be unique in
     737//          all Mars classes.
     738//
     739Bool_t MEvtLoop::WriteEnv(TEnv &env, TString prefix, Bool_t print) const
     740{
     741    if (!prefix.IsNull())
     742        *fLog << warn << "WARNING - Second argument in MEvtLoop::WriteEnv has no meaning... ignored." << endl;
     743
     744    prefix = fName;
     745    prefix += ".";
     746
     747    *fLog << inf << "Writing resources: " << prefix /*TEnv::fRcName << " to " << env.GetRcName()*/ << endl;
     748
     749    if (fParList->WriteEnv(env, prefix, print)!=kTRUE)
     750    {
     751        *fLog << err << "ERROR - Writing Environment file." << endl;
     752        return kFALSE;
     753    }
     754
     755    return kTRUE;
     756}
Note: See TracChangeset for help on using the changeset viewer.