Changeset 8223


Ignore:
Timestamp:
12/11/06 15:30:05 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8219 r8223  
    3131   * mjobs/MJCalibration.cc, mjobs/MJCalibrateSignal.cc, mjobs/MJStar.cc:
    3232     - improved output in case of no files found
     33
     34   * mjobs/MJPedestal.cc, mjobs/MJCalibTest.cc, mjobs/MJCalibration.cc,
     35     mjobs/MJCalibrateSignal.cc, mjobs/MJStar.cc:
     36     - moved output in case of invalid number of runs for a sequence
     37       to MSequence
     38     - stop execution if no or not all files were found
     39
     40   * mjobs/MSequence.cc:
     41     - added some output and return an error if the number of requested
     42       files doesn't match the number of files found.
     43
     44   * mjobs/MDataSet.cc:
     45     - when Setting up dat-runs fails now an error is returned
     46
     47   * mjobs/MJSpectrum.cc, mjobs/MJCut.cc:
     48     - if the number of files set from a sequence doesn't match the number
     49       of files found stop execution
     50
     51   * mjoptim/MJOptimize.cc, mjtrain/MJTrainDisp.cc, mjtrain/MJTrainEnergy.cc:
     52     - stop execution if number of requested and found files mismatch
     53
     54   * mjoptim/MJOptimizeCuts.cc, mjoptim/MJOptimizeDisp.cc,
     55     mjoptim/MJOptimizeEnergy.cc:
     56     - added more informative log output
    3357
    3458
  • trunk/MagicSoft/Mars/NEWS

    r8217 r8223  
    4848     PLEASE ALWAYS USE THIS PLOT FOR ANY KIND OF PRESENTATION!
    4949
     50   - ganymed/optim/train: The cut program, trainings- and optimization
     51     macros could run with less files found than expected from the
     52     sequence-files. No the execution is stopped in this case.
     53
    5054   - sponde: now also allows the uasge of random forest
    5155
  • trunk/MagicSoft/Mars/mjoptim/MJOptimize.cc

    r8091 r8223  
    249249        if (!seq.IsValid())
    250250            return kFALSE;
    251 
    252         seq.SetupDatRuns(files, o->GetTitle(), "I");
     251        if (seq.SetupDatRuns(files, o->GetTitle(), "I")<=0)
     252            return kFALSE;
    253253    }
    254254
  • trunk/MagicSoft/Mars/mjoptim/MJOptimizeCuts.cc

    r7152 r8223  
    299299        return kFALSE;
    300300
     301    *fLog << inf << "Finished processing of " << fname << endl;
     302
    301303    // Copy the result back to be accessible by the user
    302304    if (fit)
  • trunk/MagicSoft/Mars/mjoptim/MJOptimizeDisp.cc

    r7413 r8223  
    202202
    203203    // Print the result
    204     *fLog << inf << "Rule: " << rule << endl;
     204    *fLog << inf << "Finished processing of " << fname << endl;
     205    *fLog << inf << "With Rule: " << rule << endl;
    205206    hist.GetAlphaFitter().Print("result");
    206207
  • trunk/MagicSoft/Mars/mjoptim/MJOptimizeEnergy.cc

    r7169 r8223  
    143143
    144144    // Print the result
    145     *fLog << inf << "Rule: " << rule << endl;
     145    *fLog << inf << "Finished processing of " << fname << endl;
     146    *fLog << inf << "With Rule: " << rule << endl;
    146147    hist.Print();
    147148
  • trunk/MagicSoft/Mars/mjtrain/MJTrainEnergy.cc

    r7700 r8223  
    101101    readtst.DisableAutoScheme();
    102102
    103     set.AddFilesOn(readtrn);
    104     set.AddFilesOff(readtst);
     103    if (!set.AddFilesOn(readtrn))
     104        return kFALSE;
     105    if (!set.AddFilesOff(readtst))
     106        return kFALSE;
    105107
    106108    // ----------------------- Setup Matrix ------------------
  • trunk/MagicSoft/Mars/mjtrain/MJTrainSeparation.cc

    r8170 r8223  
    5757// tasks
    5858#include "MReadMarsFile.h"
     59#include "MReadReports.h"
    5960#include "MContinue.h"
    6061#include "MFillH.h"
     
    7778#include "MFEventSelector.h"
    7879#include "MFilterList.h"
     80
     81// wobble
     82#include "MPointingPos.h"
     83#include "MPointingDevCalc.h"
     84#include "../mastro/MObservatory.h"
     85#include "MSrcPosCalc.h"
     86#include "MSrcPosCorrect.h"
     87#include "../mimage/MHillasCalc.h"
     88
    7989
    8090ClassImp(MJTrainSeparation);
     
    395405{
    396406    TChain chain("OriginalMC");
    397     set.AddFilesOn(chain);
     407    if (!set.AddFilesOn(chain))
     408        return kFALSE;
    398409
    399410    min = chain.GetMinimum("MMcEvtBasic.fEnergy");
     
    411422{
    412423    TChain chain1("Events");
    413     set.AddFilesOff(chain1);
     424    if (!set.AddFilesOff(chain1))
     425        return kFALSE;
    414426
    415427    num = chain1.GetEntries();
     
    421433
    422434    TChain chain("EffectiveOnTime");
    423     set.AddFilesOff(chain);
     435    if (!set.AddFilesOff(chain))
     436        return kFALSE;
    424437
    425438    chain.Draw("MEffectiveOnTime.fVal", "MEffectiveOnTime.fVal", "goff");
     
    447460{
    448461    TChain chain1("Events");
    449     set.AddFilesOn(chain1);
     462    if (!set.AddFilesOn(chain1))
     463        return kFALSE;
    450464
    451465    const Double_t num = chain1.GetEntries();
     
    610624
    611625    // --------------------- Setup files --------------------
    612     MReadMarsFile read1("Events");
     626    MReadReports  read1;//("Events");
    613627    MReadMarsFile read2("Events");
    614628    MReadMarsFile read3("Events");
    615     MReadMarsFile read4("Events");
    616     read1.DisableAutoScheme();
     629    MReadReports  read4;//("Events");
     630    //read1.DisableAutoScheme();
    617631    read2.DisableAutoScheme();
    618632    read3.DisableAutoScheme();
    619     read4.DisableAutoScheme();
     633    //read4.DisableAutoScheme();
     634
     635    read1.AddTree("Events", "MTime.", MReadReports::kMaster);
     636    read4.AddTree("Events", "MTime.", MReadReports::kMaster);
     637    read1.AddTree("Drive",            MReadReports::kRequired);
     638    read4.AddTree("Drive",            MReadReports::kRequired);
     639    read1.AddTree("Starguider",       MReadReports::kRequired);
     640    read4.AddTree("Starguider",       MReadReports::kRequired);
    620641
    621642    // Setup four reading tasks with the on- and off-data of the two datasets
    622     fDataSetTrain.AddFilesOn(read1);
    623     fDataSetTrain.AddFilesOff(read3);
    624 
    625     fDataSetTest.AddFilesOff(read2);
    626     fDataSetTest.AddFilesOn(read4);
     643    if (!fDataSetTrain.AddFilesOn(read1))
     644        return kFALSE;
     645    const Bool_t setrc1 = fDataSetTrain.IsWobbleMode() ?
     646        fDataSetTrain.AddFilesOn(read3) : fDataSetTrain.AddFilesOff(read3);
     647    const Bool_t setrc2 = fDataSetTest.IsWobbleMode() ?
     648        fDataSetTest.AddFilesOn(read2) : fDataSetTest.AddFilesOff(read2);
     649    if (!setrc1  || !setrc2)
     650        return kFALSE;
     651    if (!fDataSetTest.AddFilesOn(read4))
     652        return kFALSE;
    627653
    628654    // ----------------------- Setup RF Matrix ----------------------
     
    656682    had.SetVal(0);
    657683    wgt.SetVal(1);
     684
     685    // How to get source position from off- and on-data?
     686    MPointingPos source("MSourcePos");
     687    MObservatory     obs;
     688    MSrcPosCalc      scalc;
     689    MSrcPosCorrect   scor;
     690    MHillasCalc      hcalcw;
     691    MHillasCalc      hcalcw2;
     692    MPointingDevCalc devcalc;
     693    scalc.SetMode(MSrcPosCalc::kDefault); // kWobble for off-source
     694    hcalcw.SetFlags(MHillasCalc::kCalcHillasSrc);
     695    hcalcw2.SetFlags(MHillasCalc::kCalcHillasSrc);
     696    hcalcw2.SetNameHillasSrc("MHillasSrcAnti");
     697    hcalcw2.SetNameSrcPosCam("MSrcPosAnti");
     698    if (fDataSetTrain.IsWobbleMode())
     699    {
     700        // *******************************************************************
     701        // Possible source position (eg. Wobble Mode)
     702        if (fDataSetTrain.HasSource())
     703        {
     704            if (!fDataSetTrain.GetSourcePos(source))
     705                return -1;
     706            *fLog << all;
     707            source.Print("RaDec");
     708        }
     709        else
     710            *fLog << all << "No source position applied..." << endl;
     711
     712        // La Palma Magic1
     713        plistx.AddToList(&obs);
     714        plistx.AddToList(&source);
     715
     716        TList tlist2;
     717        tlist2.Add(&scalc);
     718        tlist2.Add(&scor);
     719        tlist2.Add(&hcalcw);
     720        tlist2.Add(&hcalcw2);
     721
     722        devcalc.SetStreamId("Starguider");
     723        tlist2.Add(&devcalc);
     724
     725        fill.AddPreTasks(tlist2);
     726        // *******************************************************************
     727    }
    658728
    659729    // Setup the tool class to read the gammas and read them
     
    689759
    690760    MHillasCalc hcalc;
     761    MHillasCalc hcalc2;
    691762    hcalc.SetFlags(MHillasCalc::kCalcHillasSrc);
     763    hcalc2.SetFlags(MHillasCalc::kCalcHillasSrc);
     764    hcalc2.SetNameHillasSrc("MHillasSrcAnti");
     765    hcalc2.SetNameSrcPosCam("MSrcPosAnti");
    692766
    693767    if (fDataSetTrain.IsWobbleMode())
    694768    {
     769        scalc.SetMode(MSrcPosCalc::kWobble); // kWobble for off-source
     770        fPreTasksSet[kTrainOff].AddFirst(&hcalc2);
    695771        fPreTasksSet[kTrainOff].AddFirst(&hcalc);
    696         fPreTasksSet[kTrainOff].AddFirst(&srcrndm);
     772        //fPreTasksSet[kTrainOff].AddFirst(&srcrndm);
     773        fPreTasksSet[kTrainOff].AddFirst(&scor);
     774        fPreTasksSet[kTrainOff].AddFirst(&scalc);
    697775    }
    698776
     
    765843    *fLog << "Run-Time: " << Form("%.1f", clock.RealTime()/60) << "min (CPU: ";
    766844    *fLog << Form("%.1f", clock.CpuTime()/60) << "min)" << endl;
     845    *fLog << endl;
    767846    *fLog << "Output file name: " << out << endl;
    768847
     
    837916    // ----- Setup tasklist -----
    838917    tlist.AddToList(&read2);
     918    if (fDataSetTest.IsWobbleMode())
     919    {
     920        tlist.AddToList(&srcrndm);
     921        tlist.AddToList(&hcalc);
     922    }
    839923    tlist.AddToList(&c1);
    840924    tlist.AddToList(fPreTasksSet[kTestOff]);
     
    876960    // replace the reading task by a new one
    877961    tlist.Replace(&read4);
     962
     963    if (fDataSetTest.IsWobbleMode())
     964    {
     965        // *******************************************************************
     966        // Possible source position (eg. Wobble Mode)
     967        if (fDataSetTest.HasSource())
     968        {
     969            if (!fDataSetTest.GetSourcePos(source))
     970                return -1;
     971            *fLog << all;
     972            source.Print("RaDec");
     973        }
     974        else
     975            *fLog << all << "No source position applied..." << endl;
     976
     977        // La Palma Magic1
     978        plist.AddToList(&obs);
     979        plist.AddToList(&source);
     980
     981        // How to get source position from off- and on-data?
     982        tlist.AddToListAfter(&scalc,  &read4);
     983        tlist.AddToListAfter(&scor,   &scalc);
     984        tlist.AddToListAfter(&hcalcw, &scor);
     985
     986        tlist.AddToList(&devcalc, "Starguider");
     987        // *******************************************************************
     988    }
    878989
    879990    // Add the PreTasksOn directly after the reading task
Note: See TracChangeset for help on using the changeset viewer.