Changeset 9482 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
07/29/09 15:15:59 (15 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9481 r9482  
    2727     - added getter for command line
    2828
    29    * mjobs/MJCalibration.cc, mjobs/MJCut.cc:
     29   * mjobs/MJCalibration.cc, mjobs/MJCut.cc, mjobs/MJSpectrum.cc,
     30     mjobs/MJStar.cc, mjobs/MJCalibrateSignal.cc:
    3031     - write command line to output
    3132
     
    3637     - added efault argumtn to Print()
    3738
    38    * mjobs/MJCalibrateSignal.cc:
    39      - write command line to output
     39   * mjobs/MJStar.cc:
     40     - added a sanity check for empty sequences
     41     - write MCorsikaEvtHeader and MCorsikaRunHeader to output
     42
     43   * mjobs/MJSimulation.cc:
     44     - use a MParameterCalc to calculate and later store the
     45       incident angle
    4046
    4147
  • trunk/MagicSoft/Mars/NEWS

    r9467 r9482  
    1717   * Added a new camera layout MGeomCamFact which is the "four rectangular
    1818     pixels ordered in a hexagonal geometry" layout
     19
     20   * All programs now store the command line as TNamed "CommandLine"
    1921
    2022 ;showplot:
  • trunk/MagicSoft/Mars/callisto.cc

    r9345 r9482  
    441441        job3.SetOverwrite(kOverwrite);
    442442        job3.SetPathOut(kOutpathC);
     443        job3.SetCommandLine(MArgs::GetCommandLine(argc, argv));
    443444        // job2.SetPathIn(kInpathC); // not yet needed
    444445
     
    625626        job4.SetMovieMode(kMovie);
    626627        job4.SetNullOut(kNullOut);
     628        job4.SetCommandLine(MArgs::GetCommandLine(argc, argv));
    627629        if (!seq.IsMonteCarlo())
    628630            job4.SetExtractor(job2.GetExtractor());
  • trunk/MagicSoft/Mars/ceres.cc

    r9441 r9482  
    341341        job.SetForceMode(kForce);
    342342        job.SetMode(opmode);
     343        job.SetCommandLine(MArgs::GetCommandLine(argc, argv));
    343344        // job.SetPathIn(kInpath); // not yet needed
    344345
  • trunk/MagicSoft/Mars/ganymed.cc

    r9345 r9482  
    287287        job.SetNameOutFile(kOutfile);
    288288        job.SetNameSummaryFile(kNameSummary);
     289        job.SetCommandLine(MArgs::GetCommandLine(argc, argv));
    289290        //job.SetNameResultFile(kNameResult);
    290291        job.EnableWriteOnly(kWriteOnly);
  • trunk/MagicSoft/Mars/mbase/MArgs.cc

    r9442 r9482  
    506506    return rc;
    507507}
     508
     509// --------------------------------------------------------------------------
     510//
     511// Return all arguments and options in the order as they are stored
     512// in memory.
     513//
     514TString MArgs::GetCommandLine() const
     515{
     516    TString rc;
     517
     518    TIter Next(&fArgv);
     519    TString *s = NULL;
     520    while ((s=dynamic_cast<TString*>(Next())))
     521    {
     522        rc += *s;
     523        rc += " ";
     524    }
     525
     526    return rc.Strip(TString::kBoth);
     527}
  • trunk/MagicSoft/Mars/mbase/MArgs.h

    r9442 r9482  
    3131
    3232    MArgsEntry *GetArgument(Int_t i) const;
     33    MArgsEntry *GeOption(Int_t i) const;
    3334
    3435public:
     
    7071    Bool_t   RemoveArgument(Int_t i);
    7172
     73    TString  GetCommandLine() const;
     74
     75    static TString GetCommandLine(int argc, char **argv) { return MArgs(argc, argv).GetCommandLine(); }
     76
    7277    ClassDef(MArgs, 0)  //Class to parse command line arguments
    7378};
  • trunk/MagicSoft/Mars/mjobs/MJSimulation.cc

    r9462 r9482  
    7474#include "MFillH.h"
    7575#include "MGeomApply.h"
     76#include "MParameterCalc.h"
    7677#include "MHillasCalc.h"
    7778#include "MImgCleanStd.h"
     
    166167    cont.Add(plist.FindObject("GeomCones"));
    167168
     169    TNamed cmdline("CommandLine", fCommandLine.Data());
     170    cont.Add(&cmdline);
     171
    168172    if (fDisplay)
    169173    {
     
    219223    hist.SetAutoRange();
    220224
    221     TString sin2 = "sin(MCorsikaEvtHeader.fZd)*sin(MCorsikaRunHeader.fZdMin*TMath::DegToRad())";
    222     TString cos2 = "cos(MCorsikaEvtHeader.fZd)*cos(MCorsikaRunHeader.fZdMin*TMath::DegToRad())";
    223     TString cos  = "cos(MCorsikaEvtHeader.fAz-MCorsikaRunHeader.fAzMin*TMath::DegToRad())";
    224 
    225     TString form = "acos("+sin2+"*"+cos+"+"+cos2+")*TMath::RadToDeg()";
    226 
    227     hist.AddHist(form);
     225    hist.AddHist("IncidentAngle.fVal");
    228226    hist.InitName("ViewCone");
    229227    hist.InitTitle("Incident Angle;\\alpha [\\deg]");
     
    243241    write.AddContainer("MRawEvtHeader",       "Events");
    244242    write.AddContainer("MMcEvt",              "Events");
     243    write.AddContainer("IncidentAngle",       "Events", kFALSE);
    245244}
    246245
     
    372371    plist.AddToList(&splinemirror);
    373372    plist.AddToList(&splinecones);
     373
     374    const TString sin2 = "sin(MCorsikaEvtHeader.fZd)*sin(MCorsikaRunHeader.fZdMin*TMath::DegToRad())";
     375    const TString cos2 = "cos(MCorsikaEvtHeader.fZd)*cos(MCorsikaRunHeader.fZdMin*TMath::DegToRad())";
     376    const TString cos  = "cos(MCorsikaEvtHeader.fAz-MCorsikaRunHeader.fAzMin*TMath::DegToRad())";
     377
     378    const TString form = "acos("+sin2+"*"+cos+"+"+cos2+")*TMath::RadToDeg()";
     379
     380    MParameterCalc calcangle(form, "CalcIncidentAngle");
     381    calcangle.SetNameParameter("IncidentAngle");
    374382
    375383    MSimAtmosphere simatm;
     
    637645        if (1)
    638646            tasks.AddToList(&simatm); // Here because before fillh1
     647        tasks.AddToList(&calcangle);
    639648        tasks.AddToList(&fillh1);
    640649        tasks.AddToList(&fillG);
  • trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc

    r9367 r9482  
    19631963    {
    19641964        TNamed ganame("ganymed.root", fPathIn.Data());
     1965        TNamed cmdline("CommandLine", fCommandLine.Data());
    19651966
    19661967        // Write the output
     
    19741975        cont.Add(&hest);
    19751976        cont.Add(&ganame);
     1977        cont.Add(&cmdline);
    19761978
    19771979        if (fDisplay)
  • trunk/MagicSoft/Mars/mjobs/MJStar.cc

    r9434 r9482  
    118118    cont.Add(const_cast<MSequence*>(&fSequence));
    119119
     120    TNamed cmdline("CommandLine", fCommandLine.Data());
     121    cont.Add(&cmdline);
     122
    120123    if (fDisplay)
    121124    {
     
    155158    MDirIter iter;
    156159    if (fSequence.GetRuns(iter, MSequence::kCalibrated)<=0)
     160    {
     161        *fLog << err << "ERROR - Sequence valid but without files." << endl;
    157162        return kFALSE;
     163    }
    158164
    159165    // Setup Parlist
     
    267273    plist.AddToList(&par); // without MTriggerPattern stored in the file
    268274
    269     // For the effective on-time calculation we don't want SUM-only events
     275    // For the effective on-time calculation and the muon statistics
     276    // we don't want SUM-only events
    270277    MFTriggerPattern fsum;
    271278    fsum.SetDefault(kTRUE);
     
    336343        write.AddContainer("MMcEvt",                "Events");
    337344        write.AddContainer("MMcTrig",               "Events", kFALSE);
     345        write.AddContainer("MCorsikaEvtHeader",     "Events", kFALSE);
    338346        write.AddContainer("MSrcPosCam",            "Events");
    339347        // Monte Carlo Run Headers
     
    342350        write.AddContainer("MMcFadcHeader",         "RunHeaders", kFALSE);
    343351        write.AddContainer("MMcConfigRunHeader",    "RunHeaders", kFALSE);
    344         write.AddContainer("MMcCorsikaRunHeader",   "RunHeaders");
     352        write.AddContainer("MMcCorsikaRunHeader",   "RunHeaders", kFALSE);
     353        write.AddContainer("MCorsikaRunHeader",     "RunHeaders", kFALSE);
    345354    }
    346355    else
  • trunk/MagicSoft/Mars/mjobs/MJob.h

    r9245 r9482  
    3838    // FIXME: Split into MJobSequence and MJobDataSet
    3939    MSequence fSequence;      // Sequence
     40
     41    TString   fCommandLine;   // Command line for possible storage
    4042
    4143    const TEnv *GetEnv() const;
     
    7981    void   SetNullOut(Bool_t b=kTRUE) { fNullOut=b; }
    8082
     83    void   SetCommandLine(const TString &s) { fCommandLine = s; }
     84
    8185    // Getter
    8286    TString GetPathOut() const  { return fPathOut; }
  • trunk/MagicSoft/Mars/mtrigger/MTriggerPattern.h

    r9462 r9482  
    1212public:
    1313    enum Pattern_t {
    14 //        kUndefined1  = BIT(0), //  1   1: Level 1 from L2 board
    1514        kTriggerLvl1 = BIT(0), //  1   1: Level 1 from L2 board
    1615        kCalibration = BIT(1), //  2   2: Pulse Trigger
     
    1918        kPinDiode    = BIT(4), // 10  16:
    2019        kSumTrigger  = BIT(5), // 20  32: Flag for an event taken with sum trigger
    21 //        kTriggerLvl1 = BIT(6), // 40  64: Trigger lvl1 directly from L1 without going through L2
    2220        kUndefined1  = BIT(6), // 40  64: Trigger lvl1 directly from L1 without going through L2
    23         kUndefined2  = BIT(7)  // 80 128: Undefined?
     21        kUndefined2  = BIT(7)  // 80 128: Undefined? (L3?)
    2422    };
    2523
     
    3129    MTriggerPattern(const char *name=0, const char *title=0);
    3230
    33     void Print(Option_t *) const;
     31    void Print(Option_t *o="") const;
    3432    void Copy(TObject &obj) const;
    3533
  • trunk/MagicSoft/Mars/sponde.cc

    r9345 r9482  
    258258        job.SetPathOut(kOutfile);
    259259        job.SetPathIn(kInfile);
     260        job.SetCommandLine(MArgs::GetCommandLine(argc, argv));
    260261
    261262        job.ForceTheta(kForceTheta);
  • trunk/MagicSoft/Mars/star.cc

    r9345 r9482  
    246246        job.SetPathOut(kOutpath);
    247247        job.SetNullOut(kNullOut);
     248        job.SetCommandLine(MArgs::GetCommandLine(argc, argv));
    248249        // job.SetPathIn(kInpath); // not yet needed
    249250        if (kNoMuons)
Note: See TracChangeset for help on using the changeset viewer.