Changeset 9141 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
10/13/08 15:54:30 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9140 r9141  
    4141
    4242   * mreport/MReport.cc:
    43      - implemented a new version fix, namely 20080930
     43     - implemented a new version fix, namely 200809300
    4444
    4545   * mreport/MReportCC.cc:
    46      - implemented interpretation of new format 200805190
     46     - implemented interpretation of new format 200809030
    4747
    4848
  • trunk/MagicSoft/Mars/NEWS

    r9123 r9141  
    33== <cvs> ==
    44
    5   ;Database
     5 ;general
     6
     7   * All command line options after -- are now interpreted as
     8     arguments (usually everything which doesn't start with a minus)
     9     rather than options (usually everything which starts with a
     10     minus). This allows to use file names starting with a -
     11
     12 ;Database
    613
    714   * Added informations about the DC currents (fMinCurrents, fMedCurrents
    8      and fMaxCurrents)
     15     and fMaxCurrents). The values are retrieved from the plots showing
     16     the average DC currents of all pixels versus time.
    917
    1018 ;automatic analyis
     
    2129     now steered via database. Consequently the plots are faster and
    2230     reliable up-to-date.
     31
     32 ;merpp
     33
     34   * Fixed merpping of raw-files (the runheader tree got the name RunHeader
     35     instead of RunHeaders)
     36
     37   * Now allows to merpp files newer than 2008/09/03.
    2338
    2439
  • trunk/MagicSoft/Mars/callisto.cc

    r9024 r9141  
    153153    // Evaluate arguments
    154154    //
    155     MArgs arg(argc, argv, kTRUE);
     155    MArgs arg(argc, argv);
    156156    gLog.Setup(arg);
    157157
  • trunk/MagicSoft/Mars/ganymed.cc

    r9005 r9141  
    116116    // Evaluate arguments
    117117    //
    118     MArgs arg(argc, argv, kTRUE);
     118    MArgs arg(argc, argv);
    119119    gLog.Setup(arg);
    120120
  • trunk/MagicSoft/Mars/mars.cc

    r8954 r9141  
    8989    // Evaluate arguments
    9090    //
    91     MArgs arg(argc, argv, kTRUE);
     91    MArgs arg(argc, argv);
    9292    gLog.Setup(arg);
    9393
  • trunk/MagicSoft/Mars/mbase/MArgs.cc

    r8930 r9141  
    3131//
    3232// Arguments beginning with a trailing '-' are called 'options'.
     33//
    3334// Arguments without a trailing '-' are considered 'arguments'
     35//
     36// All arguments appearing after '--' on the commandline are
     37//  also cosidered as 'arguments'
    3438//
    3539//////////////////////////////////////////////////////////////////////////////
     
    5761//  fArgv: A TList containing all other command line arguments
    5862//
    59 //  If root==kFALSE all root commandline options are deleted from
    60 //  the list, namely: -b
    61 //
    62 MArgs::MArgs(int argc, char **argv, Bool_t root) : fArgc(argc)
     63MArgs::MArgs(int argc, char **argv) : fArgc(argc)
    6364{
    6465    TString cmdline;
     
    7677        fArgv.Add(new MArgsEntry(argv[i]));
    7778    }
    78 
    79     if (root)
    80         return;
    81 
    82     HasOnlyAndRemove("-b");
     79}
     80
     81// --------------------------------------------------------------------------
     82//
     83//  Remove all root commandline options from the list,
     84//  namely: -b, -n, -q, -l, -?, -h, --help, -config
     85//
     86//  Returns the number of found root options (max 8)
     87//
     88Int_t MArgs::RemoveRootArgs()
     89{
     90    Int_t n = 0;
     91
     92    n += HasOnlyAndRemove("-b");
     93    n += HasOnlyAndRemove("-n");
     94    n += HasOnlyAndRemove("-q");
     95    n += HasOnlyAndRemove("-l");
     96    n += HasOnlyAndRemove("-?");
     97    n += HasOnlyAndRemove("-h");
     98    n += HasOnlyAndRemove("--help");
     99    n += HasOnlyAndRemove("-config");
     100
     101    return n;
    83102}
    84103
     
    109128        TString *s = NULL;
    110129        while ((s=dynamic_cast<TString*>(Next())))
    111             if (s->BeginsWith("-"))
     130            if (*s!="--" && s->BeginsWith("-"))
    112131                gLog << *s << endl;
    113132        return;
     
    119138        TString *s = NULL;
    120139        while ((s=dynamic_cast<TString*>(Next())))
    121             if (!s->BeginsWith("-"))
     140            if (*s!="--" && !s->BeginsWith("-"))
    122141                gLog << *s << endl;
    123142        return;
     
    283302    Int_t num = 0;
    284303
    285     TIter Next(&fArgv);
    286     TString *s = NULL;
    287     while ((s=dynamic_cast<TString*>(Next())))
    288     {
    289         if (s->BeginsWith("-"))
     304    Bool_t allarg = kFALSE;
     305
     306    TIter Next(&fArgv);
     307    TString *s = NULL;
     308    while ((s=dynamic_cast<TString*>(Next())))
     309    {
     310        if (*s=="--")
     311        {
     312            allarg = kTRUE;
     313            continue;
     314        }
     315
     316        if (s->BeginsWith("-") && !allarg)
    290317            continue;
    291318
     
    305332    Int_t num = 0;
    306333
    307     TIter Next(&fArgv);
    308     TString *s = NULL;
    309     while ((s=dynamic_cast<TString*>(Next())))
    310         if (!s->BeginsWith("-"))
    311             num++;
     334    Bool_t allarg = kFALSE;
     335
     336    TIter Next(&fArgv);
     337    TString *s = NULL;
     338    while ((s=dynamic_cast<TString*>(Next())))
     339    {
     340        if (*s=="--")
     341        {
     342            allarg = kTRUE;
     343            continue;
     344        }
     345
     346        if (s->BeginsWith("-") && !allarg)
     347            continue;
     348
     349        num++;
     350    }
    312351
    313352    return num;
     
    325364    TString *s = NULL;
    326365    while ((s=dynamic_cast<TString*>(Next())))
     366    {
     367        if (*s=="--")
     368            return num;
     369
    327370        if (s->BeginsWith("-"))
    328371            num++;
     372    }
    329373
    330374    return num;
     
    337381Int_t MArgs::GetNumEntries() const
    338382{
    339     return fArgv.GetSize();
     383    return fArgv.FindObject("--") ? fArgv.GetSize()-1 : fArgv.GetSize();
    340384}
    341385
  • trunk/MagicSoft/Mars/mbase/MArgs.h

    r8930 r9141  
    3131
    3232public:
    33     MArgs(int argc, char **argv, Bool_t root=kFALSE);
     33    MArgs(int argc, char **argv);
    3434
    3535    // TObject
     
    4040
    4141    // MArgs
     42    Int_t    RemoveRootArgs();
     43
    4244    Int_t    GetInt(const TString name) const;
    4345    Double_t GetFloat(const TString name) const;
  • trunk/MagicSoft/Mars/merpp.cc

    r9060 r9141  
    152152        return 2;
    153153    }
     154
     155    arg.RemoveRootArgs();
    154156
    155157    const Bool_t  kDebugMem   = arg.HasOnlyAndRemove("--debug-mem");
  • trunk/MagicSoft/Mars/mhist/MHEvent.cc

    r8999 r9141  
    266266        s += fRawEvtHeader->GetDAQEvtNumber();
    267267    }
     268
    268269    if (fRawEvtHeader && fRawRunHeader)
    269270        s += " of ";
    270271
    271272    if (fRawRunHeader)
    272     {
    273         s += "M";
    274273        s += fRawRunHeader->GetStringID();
    275     }
     274
    276275    if (fTime)
    277276    {
  • trunk/MagicSoft/Mars/mjobs/MJMerpp.cc

    r9028 r9141  
    150150    read.SetForceMode(fForceProcessing);
    151151
    152     write.AddContainer("MRawRunHeader",  "RunHeader");
     152    write.AddContainer("MRawRunHeader",  "RunHeaders");
    153153    write.AddContainer("MTime",          "Events");
    154154    write.AddContainer("MRawEvtHeader",  "Events");
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc

    r9080 r9141  
    492492Bool_t MRawRunHeader::Fixes()
    493493{
    494     if (fFormatVersion>8)
     494    if (fFormatVersion>8 && fRunNumber>326152)
    495495    {
    496496        fNumEvents--;
    497497        fNumEventsRead--;
    498         *fLog << inf << "Format >V8: Stored number of events decreased by 1." << endl;
     498        *fLog << inf << "Format >V8 and No>326152: Stored number of events decreased by 1." << endl;
    499499    }
    500500
  • trunk/MagicSoft/Mars/mreport/MReport.cc

    r8955 r9141  
    167167//    200510250  | 53813.5 |         |  200603190
    168168//    200604010  | 53863.5 |         |  200605080
     169//    200605190  | 54711.5 |         |  200809030
    169170//
    170171Int_t MReport::Interprete(TString &str, const MTime &start, const MTime &stop, Int_t ver)
     
    200201        ver=200605080;
    201202
     203    if (ver==200605190 && GetMjd()>54711.5)
     204        ver=200809030;
     205
    202206    // Interprete body (contents) of report
    203207    const Int_t rc = InterpreteBody(str, ver);
  • trunk/MagicSoft/Mars/mreport/MReportCC.cc

    r8963 r9141  
    114114    if (n!=6)
    115115    {
    116         cout << n << endl;
    117116        *fLog << warn << "WARNING - Wrong number of arguments (should be 6)." << endl;
    118117        return kFALSE;
     
    120119
    121120    str.Remove(0, len);
     121
     122    if (ver>=200809030)
     123    {
     124        if (!CheckTag(str, "SCHEDULE "))
     125            return kFALSE;
     126
     127        str = str.Strip(TString::kBoth);
     128
     129        // [Sourcename] sourcecategory
     130        const Ssiz_t pos1 = str.First(' ');
     131        if (pos1<0)
     132        {
     133            *fLog << warn << "WARNING - Wrong number of arguments (should be 1 or 2)." << endl;
     134            return kFALSE;
     135        }
     136
     137        const TString str1 = str(0, pos1);
     138
     139        str.Remove(0, pos1);
     140        str = str.Strip(TString::kBoth);
     141
     142        if (!str1.IsDigit())
     143        {
     144            const Ssiz_t pos2 = str.First(' ');
     145            if (pos2<0)
     146            {
     147                *fLog << warn << "WARNING - Wrong number of arguments (should be 1 or 2)." << endl;
     148                return kFALSE;
     149            }
     150
     151            const TString str2 = str(0, pos2);
     152
     153            str.Remove(0, pos2);
     154
     155            if (!str2.IsDigit())
     156            {
     157                *fLog << warn << "WARNING - Wrong type of second argument." << endl;
     158                return kFALSE;
     159            }
     160        }
     161    }
    122162
    123163    return kTRUE;
  • trunk/MagicSoft/Mars/readdaq.cc

    r8946 r9141  
    7979    }
    8080
     81    arg.RemoveRootArgs();
     82
    8183    //
    8284    // Set verbosity to highest level.
  • trunk/MagicSoft/Mars/readraw.cc

    r8088 r9141  
    8888        return 2;
    8989    }
     90
     91    arg.RemoveRootArgs();
    9092
    9193    // Set usage of decimal values
  • trunk/MagicSoft/Mars/showlog.cc

    r8011 r9141  
    8080        return 2;
    8181    }
     82
     83    arg.RemoveRootArgs();
    8284
    8385    const Bool_t kNoColors = arg.HasOnly("--no-colors") || arg.HasOnly("-a");
  • trunk/MagicSoft/Mars/showplot.cc

    r9039 r9141  
    148148    // Evaluate arguments
    149149    //
    150     MArgs arg(argc, argv, kTRUE);
     150    MArgs arg(argc, argv);
    151151    gLog.Setup(arg);
    152152
  • trunk/MagicSoft/Mars/sinope.cc

    r8907 r9141  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: sinope.cc,v 1.13 2008-06-02 08:46:36 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: sinope.cc,v 1.14 2008-10-13 14:53:24 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    301301    // Evaluate arguments
    302302    //
    303     MArgs arg(argc, argv, kTRUE);
     303    MArgs arg(argc, argv);
    304304    gLog.Setup(arg);
    305305
  • trunk/MagicSoft/Mars/sponde.cc

    r8989 r9141  
    9494    // Evaluate arguments
    9595    //
    96     MArgs arg(argc, argv, kTRUE);
     96    MArgs arg(argc, argv);
    9797    gLog.Setup(arg);
    9898
  • trunk/MagicSoft/Mars/star.cc

    r9024 r9141  
    102102    // Evaluate arguments
    103103    //
    104     MArgs arg(argc, argv, kTRUE);
     104    MArgs arg(argc, argv);
    105105    gLog.Setup(arg);
    106106
Note: See TracChangeset for help on using the changeset viewer.