Ignore:
Timestamp:
08/24/04 18:15:29 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r4722 r4723  
    440440
    441441}
    442 
    443 
    444 Bool_t MJPedestal::WriteResult()
     442/*
     443Bool_t MJPedestal::WriteEventloop(MEvtLoop &evtloop) const
    445444{
    446445    if (fOutputPath.IsNull())
     
    452451
    453452    TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJPedestal", 9);
     453    if (!file.IsOpen())
     454    {
     455        *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
     456        return kFALSE;
     457    }
     458
     459    if (evtloop.Write(fName)<=0)
     460    {
     461        *fLog << err << "Unable to write MEvtloop to " << oname << endl;
     462        return kFALSE;
     463    }
     464
     465    return kTRUE;
     466}
     467*/
     468Bool_t MJPedestal::WriteResult()
     469{
     470    if (fOutputPath.IsNull())
     471        return kTRUE;
     472
     473    const TString oname(GetOutputFile());
     474
     475    *fLog << inf << "Writing to file: " << oname << endl;
     476
     477    TFile file(oname, "UPDATE", "File created by MJPedestal", 9);
    454478    if (!file.IsOpen())
    455479    {
     
    527551        return;
    528552
    529     TString e1 = fEnv->GetValue("MJPedestal.OutputPath", "");
     553    TString e1 = fEnv->GetValue(Form("%s.OutputPath", fName.Data()), "");
    530554    if (!e1.IsNull())
    531555    {
     
    534558    }
    535559
    536     SetMaxEvents(fEnv->GetValue("MJPedestal.MaxEvents", fMaxEvents));
    537     SetOverwrite(fEnv->GetValue("MJPedestal.AllowOverwrite", fOverwrite));
    538 
    539     fUseData = fEnv->GetValue("MJPedestal.UseData", fUseData);
     560    SetMaxEvents(fEnv->GetValue(Form("%s.MaxEvents", fName.Data()), fMaxEvents));
     561    SetOverwrite(fEnv->GetValue(Form("%s.AllowOverwrite", fName.Data()), fOverwrite));
     562
     563    fUseData = fEnv->GetValue(Form("%s.UseData", fName.Data()), fUseData);
    540564}
    541565
     
    570594    MTaskList tlist;
    571595    plist.AddToList(&tlist);
     596    plist.AddToList(this); // take care of fDisplay!
    572597
    573598    MReadMarsFile read("Events");
     
    640665        evtloop.ReadEnv(*fEnv);
    641666
     667    //    if (!WriteEventloop(evtloop))
     668    //        return kFALSE;
     669
    642670    // Execute first analysis
    643671    if (!evtloop.Eventloop(fMaxEvents))
     
    654682        return kFALSE;
    655683
    656     *fLog << inf << GetDescriptor() << ": Done." << endl;
     684    *fLog << all << GetDescriptor() << ": Done." << endl;
    657685
    658686    return kTRUE;
Note: See TracChangeset for help on using the changeset viewer.