Changeset 1525 for trunk/MagicSoft


Ignore:
Timestamp:
09/16/02 10:35:17 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1511 r1525  
    11                                                                  -*-*- END -*-*-
     2
     3 2002/09/16: Thomas Bretz
     4
     5   * macros/rootlogon.C:
     6     - added SetMakeSharedLib to make it work correctly on linux
     7
     8   * manalysis/AnalysisLinkDef.h, manalysis/Makefile:
     9     - added MEnergyEstParam
     10     - added MMatrixLoop
     11
     12   * manalysis/MEnergyEstParam.[h,cc], manalysis/MMatrixLoop.[h,cc]:
     13     - added
     14
     15   * manalysis/MEnergyEst.h:
     16     - added fImpact provisionally
     17     - changed to 'no-storage'
     18
     19   * manalysis/MHillas.[h,cc], manalysis/MHillasExt.[h,cc],
     20     manalysis/MHillasSrc.[h,cc]:
     21     - added set function to support Thomas Schweitzers Image files
     22
     23   * mbase/MFilter.cc:
     24     - small changes to output
     25
     26   * mbase/MLog.[h,cc]:
     27     - added IsNull to switch off output completely
     28
     29   * mbase/MParList.[h,cc]:
     30     - added Remove function
     31     - added IsOwner function
     32     - changes to SavePrimitive
     33     - kDoNotReset-support
     34
     35   * mbase/MTaskList.cc:
     36     - make sure, that in sub-tasklist the parameterlist isn't reset
     37
     38   * mdata/MDataLinkDef.h, mdata/Makefile:
     39     - added MDataElement
     40     - added mhist-path
     41
     42   * mdata/MDataChain.[h,cc]:
     43     - added support for MDataElement
     44
     45   * mhist/MH3.[h,cc]:
     46     - added enums for log-scale
     47     - set logscale automatic when drawing
     48     - added 'only' option to draw functions
     49     - set colors when 'col' option is given
     50
     51   * mhist/MHHillas.cc:
     52     - better hist range for fCenter
     53
     54   * mhist/MHMatrix.[h,cc]:
     55     - made default name and title a static class member
     56     - changed AddColumn now returning the new comlumn index
     57     - added Fill to fill Matrix from file
     58     - added locking
     59     - added IsValid
     60     - added GetNumRows
     61     - added SetNumRow
     62     - added []-operator
     63     - added GetNumRow
     64
     65   * mhist/MHStarMap.cc:
     66     - fixed some comments
     67
    268
    369 2002/09/02: Thomas Bretz
  • trunk/MagicSoft/Mars/manalysis/MEnergyEst.cc

    r1211 r1525  
    3434#include "MEnergyEst.h"
    3535
     36#include "MLog.h"
     37#include "MLogManip.h"
     38
    3639ClassImp(MEnergyEst);
    3740
     
    4649}
    4750
     51void MEnergyEst::Print(Option_t *o) const
     52{
     53    *fLog << all << GetDescriptor() << ": Eest = " << (int)fEnergy << "GeV \t Ir = " << (int)(fImpact/100) << "m" << endl;
     54}
    4855
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r1498 r1525  
    101101MEvtLoop::MEvtLoop() : fParList(NULL), fProgress(NULL)
    102102{
     103    fName = "Evtloop";
    103104}
    104105
     
    300301//  eventloop setup as a macro. The default name is "evtloop.C". The default
    301302//  extension is .C If the extension is not given, .C is added.
     303//  I the last character in the argument is a '+' the file is not closed.
     304//  This is usefull if you have an eventloop which runs three times and
     305//  you want to write one macro. If the first character is a '+' no
     306//  opening is written, eg:
     307//
     308//     MEvtLoop evtloop;
     309//     // some setup
     310//     evtloop.MakeMacro("mymacro+");
     311//     // replace the tasklist the first time
     312//     evtloop.MakeMacro("+mymacro+");
     313//     // replace the tasklist the second time
     314//     evtloop.MakeMacro("+mymacro");
    302315//
    303316void MEvtLoop::MakeMacro(const char *filename)
    304317{
    305318    TString name(filename);
     319
     320    name = name.Strip(TString::kBoth);
     321
     322    Bool_t open  = kTRUE;
     323    Bool_t close = kTRUE;
     324    if (name[0]=='+')
     325    {
     326        open = kFALSE;
     327        name.Remove(0, 1);
     328        name = name.Strip(TString::kBoth);
     329    }
     330
     331    if (name[name.Length()-1]=='+')
     332    {
     333        close = kFALSE;
     334        name.Remove(name.Length()-1, 1);
     335        name = name.Strip(TString::kBoth);
     336    }
    306337
    307338    if (!name.EndsWith(".C"))
    308339        name += ".C";
    309340
    310     time_t t = time(NULL);
    311 
    312     ofstream fout(name);
    313     fout <<
    314         "/* ======================================================================== *\\" << endl <<
    315         "!" << endl <<
    316         "! *" << endl <<
    317         "! * This file is part of MARS, the MAGIC Analysis and Reconstruction" << endl <<
    318         "! * Software. It is distributed to you in the hope that it can be a useful" << endl <<
    319         "! * and timesaving tool in analysing Data of imaging Cerenkov telescopes." << endl <<
    320         "! * It is distributed WITHOUT ANY WARRANTY." << endl <<
    321         "! *" << endl <<
    322         "! * Permission to use, copy, modify and distribute this software and its" << endl <<
    323         "! * documentation for any purpose is hereby granted without fee," << endl <<
    324         "! * provided that the above copyright notice appear in all copies and" << endl <<
    325         "! * that both that copyright notice and this permission notice appear" << endl <<
    326         "! * in supporting documentation. It is provided \"as is\" without express" << endl <<
    327         "! * or implied warranty." << endl <<
    328         "! *" << endl <<
    329         "!" << endl <<
    330         "!" << endl <<
    331         "!   Author(s): Thomas Bretz et al. <mailto:tbretz@astro.uni-wuerzburg.de>" << endl <<
    332         "!" << endl <<
    333         "!   Copyright: MAGIC Software Development, 2000-2002" << endl <<
    334         "!" << endl <<
    335         "!" << endl <<
    336         "\\* ======================================================================== */" << endl << endl <<
    337         "// ------------------------------------------------------------------------" << endl <<
    338         "//" << endl <<
    339         "//     This macro was automatically created on" << endl<<
    340         "//             " << ctime(&t) <<
    341         "//        with the MEvtLoop::MakeMacro tool." << endl <<
    342         "//" << endl <<
    343         "// ------------------------------------------------------------------------" << endl << endl <<
    344         "void " << name(0, name.Length()-2) << "()" << endl <<
    345         "{" << endl;
    346 
    347     SavePrimitive(fout);
     341    ofstream fout;
     342
     343    if (!open)
     344    {
     345        fout.open(name, ios::app);
     346        fout << endl;
     347        fout << "   // ----------------------------------------------------------------------" << endl;
     348        fout << endl;
     349    }
     350    else
     351    {
     352        fout.open(name);
     353
     354        time_t t = time(NULL);
     355        fout <<
     356            "/* ======================================================================== *\\" << endl <<
     357            "!" << endl <<
     358            "! *" << endl <<
     359            "! * This file is part of MARS, the MAGIC Analysis and Reconstruction" << endl <<
     360            "! * Software. It is distributed to you in the hope that it can be a useful" << endl <<
     361            "! * and timesaving tool in analysing Data of imaging Cerenkov telescopes." << endl <<
     362            "! * It is distributed WITHOUT ANY WARRANTY." << endl <<
     363            "! *" << endl <<
     364            "! * Permission to use, copy, modify and distribute this software and its" << endl <<
     365            "! * documentation for any purpose is hereby granted without fee," << endl <<
     366            "! * provided that the above copyright notice appear in all copies and" << endl <<
     367            "! * that both that copyright notice and this permission notice appear" << endl <<
     368            "! * in supporting documentation. It is provided \"as is\" without express" << endl <<
     369            "! * or implied warranty." << endl <<
     370            "! *" << endl <<
     371            "!" << endl <<
     372            "!" << endl <<
     373            "!   Author(s): Thomas Bretz et al. <mailto:tbretz@astro.uni-wuerzburg.de>" << endl <<
     374            "!" << endl <<
     375            "!   Copyright: MAGIC Software Development, 2000-2002" << endl <<
     376            "!" << endl <<
     377            "!" << endl <<
     378            "\\* ======================================================================== */" << endl << endl <<
     379            "// ------------------------------------------------------------------------" << endl <<
     380            "//" << endl <<
     381            "//     This macro was automatically created on" << endl<<
     382            "//             " << ctime(&t) <<
     383            "//        with the MEvtLoop::MakeMacro tool." << endl <<
     384            "//" << endl <<
     385            "// ------------------------------------------------------------------------" << endl << endl <<
     386            "void " << name(0, name.Length()-2) << "()" << endl <<
     387            "{" << endl;
     388    }
     389
     390    SavePrimitive(fout, (TString)"" + (open?"open":"") + (close?"close":""));
     391
     392    if (!close)
     393        return;
    348394
    349395    fout << "}" << endl;
     
    358404// gui elements to a macro-file.
    359405//
    360 void MEvtLoop::SavePrimitive(ofstream &out, Option_t *)
    361 {
     406
     407void MEvtLoop::StreamPrimitive(ofstream &out) const
     408{
     409    out << "   MEvtLoop " << GetUniqueName() << ";" << endl;
     410}
     411
     412void MEvtLoop::SavePrimitive(ofstream &out, Option_t *opt)
     413{
     414    TString options = opt;
     415    options.ToLower();
     416
    362417    if (HasDuplicateNames("MEvtLoop::SavePrimitive"))
    363418    {
     
    370425    }
    371426
    372     gListOfPrimitives = new TList;
     427    if (!options.Contains("open"))
     428    {
     429        if (gListOfPrimitives)
     430        {
     431            *fLog << err << "MEvtLoop::SavePrimitive - Error: old file not closed." << endl;
     432            gListOfPrimitives->ForEach(TObject, ResetBit)(BIT(15));
     433            delete gListOfPrimitives;
     434        }
     435        gListOfPrimitives = new TList;
     436    }
    373437
    374438    if (fParList)
    375439        fParList->SavePrimitive(out);
    376440
    377     out << "   MEvtLoop evtloop;" << endl;
     441    MParContainer::SavePrimitive(out);
     442
    378443    if (fParList)
    379         out << "   evtloop.SetParList(&" << fParList->GetUniqueName() << ");" << endl;
     444        out << "   " << GetUniqueName() << ".SetParList(&" << fParList->GetUniqueName() << ");" << endl;
    380445    else
    381446        out << "   // fParList empty..." << endl;
    382     out << "   if (!evtloop.Eventloop())" << endl;
     447    out << "   if (!" << GetUniqueName() << ".Eventloop())" << endl;
    383448    out << "      return;" << endl;
     449
     450    if (!options.Contains("close"))
     451        return;
    384452
    385453    gListOfPrimitives->ForEach(TObject, ResetBit)(BIT(15));
    386454    delete gListOfPrimitives;
    387455    gListOfPrimitives = 0;
    388 
    389     // remove all objects with BIT(15) set from gObjectTable
    390456}
    391457
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r1483 r1525  
    3434    MLog   *fLog;         // The general log facility for this object, initialized with the global object
    3535
    36     virtual void StreamPrimitive(ofstream &out) const;
    37 
    3836private:
    39     Bool_t  fReadyToSave; // should be set to true if the contents of the container is changed somehow
    40 
    4137    enum {
    4238        kIsSavedAsPrimitive = BIT(15)
    4339    };
     40
     41    Bool_t  fReadyToSave; // should be set to true if the contents of the container is changed somehow
     42
     43    virtual void StreamPrimitive(ofstream &out) const;
    4444
    4545public:
Note: See TracChangeset for help on using the changeset viewer.