Ignore:
Timestamp:
04/12/01 12:39:01 (24 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MArray.cc

    r458 r749  
    1 /////////////////////////////////////////////////////////////////////////////
    2 //                                                                         //
    3 // MArray                                                                  //
    4 //                                                                         //
    5 // This is an abstract base class for TObject derived Arrays. In principal //
    6 // it is almost the same than TArray. The difference is that this array    //
    7 // base classed is derived from TObject which makes storage of variable    //
    8 // sized arrays possible with splitlevel=1.                                //
    9 //                                                                         //
    10 // This should not be needed anymore for root >3.00                        //
    11 //                                                                         //
    12 /////////////////////////////////////////////////////////////////////////////
     1/* ======================================================================== *\
     2!
     3! *
     4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
     5! * Software. It is distributed to you in the hope that it can be a useful
     6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
     7! * It is distributed WITHOUT ANY WARRANTY.
     8! *
     9! * Permission to use, copy, modify and distribute this software and its
     10! * documentation for any purpose is hereby granted without fee,
     11! * provided that the above copyright notice appear in all copies and
     12! * that both that copyright notice and this permission notice appear
     13! * in supporting documentation. It is provided "as is" without express
     14! * or implied warranty.
     15! *
     16!
     17!
     18!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!
     20!   Copyright: MAGIC Software Development, 2000-2001
     21!
     22!
     23\* ======================================================================== */
     24
     25
     26//////////////////////////////////////////////////////////////////////////////
     27//                                                                          //
     28// MArray                                                                   //
     29//                                                                          //
     30// This is an abstract base class for TObject derived Arrays. In principal  //
     31// it is almost the same than TArray. The difference is that this array     //
     32// base classed is derived from TObject which makes storage of variable     //
     33// sized arrays possible with splitlevel=1.                                 //
     34//                                                                          //
     35// This should not be needed anymore for root >3.00                         //
     36//                                                                          //
     37//////////////////////////////////////////////////////////////////////////////
    1338#include "MArray.h"
    1439
  • trunk/MagicSoft/Mars/mbase/MArrayB.cc

    r458 r749  
    1 /////////////////////////////////////////////////////////////////////////////
    2 //                                                                         //
    3 // MArrayB                                                                 //
    4 //                                                                         //
    5 // Array of Byte_t. It is almost the same than TArrayC, but it containes   //
    6 // Byte_t instead of Char_t and it can be stored with splitlevel=1 to a    //
    7 // a root-file because of it's derivement from MArray (TObject)            //                                                                       //
    8 //                                                                         //
    9 /////////////////////////////////////////////////////////////////////////////
     1/* ======================================================================== *\
     2!
     3!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     4!
     5!   Copyright: MAGIC Software Development, 2000-2001
     6!
     7\* ======================================================================== */
     8
     9
     10//////////////////////////////////////////////////////////////////////////////
     11//                                                                          //
     12// MArrayB                                                                  //
     13//                                                                          //
     14// Array of Byte_t. It is almost the same than TArrayC, but it containes    //
     15// Byte_t instead of Char_t and it can be stored with splitlevel=1 to a     //
     16// a root-file because of it's derivement from MArray (TObject)             //                                                                       //
     17//                                                                          //
     18//////////////////////////////////////////////////////////////////////////////
    1019#include "MArrayB.h"
    1120
  • trunk/MagicSoft/Mars/mbase/MArrayS.cc

    r458 r749  
    1 /////////////////////////////////////////////////////////////////////////////
    2 //                                                                         //
    3 // MArrayS                                                                 //
    4 //                                                                         //
    5 // Array of UShort_t. It is almost the same than TArrayS, but it containes //
    6 // UShort_t instead of Short_t and it can be stored with splitlevel=1 to a //
    7 // a root-file because of it's derivement from MArray (TObject)            //                                                                       //
    8 //                                                                         //
    9 /////////////////////////////////////////////////////////////////////////////
     1/* ======================================================================== *\
     2!
     3! *
     4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
     5! * Software. It is distributed to you in the hope that it can be a useful
     6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
     7! * It is distributed WITHOUT ANY WARRANTY.
     8! *
     9! * Permission to use, copy, modify and distribute this software and its
     10! * documentation for any purpose is hereby granted without fee,
     11! * provided that the above copyright notice appear in all copies and
     12! * that both that copyright notice and this permission notice appear
     13! * in supporting documentation. It is provided "as is" without express
     14! * or implied warranty.
     15! *
     16!
     17!
     18!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!
     20!   Copyright: MAGIC Software Development, 2000-2001
     21!
     22!
     23\* ======================================================================== */
     24
     25
     26//////////////////////////////////////////////////////////////////////////////
     27//                                                                          //
     28// MArrayS                                                                  //
     29//                                                                          //
     30// Array of UShort_t. It is almost the same than TArrayS, but it containes  //
     31// UShort_t instead of Short_t and it can be stored with splitlevel=1 to a  //
     32// a root-file because of it's derivement from MArray (TObject)             //                                                                       //
     33//                                                                          //
     34//////////////////////////////////////////////////////////////////////////////
    1035#include "MArrayS.h"
    1136
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r606 r749  
    1 /////////////////////////////////////////////////////////////////////////////
    2 //                                                                         //
    3 // MEvtLoop                                                                //
    4 //                                                                         //
    5 // This class is the core of each event processing.                        //
    6 // First you must set the parameter list to use. The parameter list        //
    7 // must contain the task list (MTaskList) to use. The name of the task     //
    8 // list can be specified if you call Eventloop. The standard name is       //
    9 // "MTaskList". The name you specify must match the name of the MTaskList  //
    10 // object.                                                                 //
    11 //                                                                         //
    12 // If you call Eventloop first all PreProcess functions - with the         //
    13 // parameter list as an argument - of the tasks in the task list are       //
    14 // executed. If one of them returns kFALSE then the execution is stopped.  //
    15 // If the preprocessing was ok. The Process funtion of the tasks are       //
    16 // as long as one function returns kSTOP. Only the tasks which are marked  //
    17 // marked as "All" or with a string which matches the MInputStreamID of    //
    18 // MTaskList are executed. If one tasks returns kCONTINUE the pending      //
    19 // tasks in the list are skipped and the execution in continued with       //
    20 // the first one in the list.                                              //
    21 // Afterwards the PostProcess functions are executed.                      //
    22 //                                                                         //
    23 /////////////////////////////////////////////////////////////////////////////
     1/* ======================================================================== *\
     2!
     3! *
     4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
     5! * Software. It is distributed to you in the hope that it can be a useful
     6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
     7! * It is distributed WITHOUT ANY WARRANTY.
     8! *
     9! * Permission to use, copy, modify and distribute this software and its
     10! * documentation for any purpose is hereby granted without fee,
     11! * provided that the above copyright notice appear in all copies and
     12! * that both that copyright notice and this permission notice appear
     13! * in supporting documentation. It is provided "as is" without express
     14! * or implied warranty.
     15! *
     16!
     17!
     18!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!
     20!   Copyright: MAGIC Software Development, 2000-2001
     21!
     22!
     23\* ======================================================================== */
     24
     25
     26//////////////////////////////////////////////////////////////////////////////
     27//                                                                          //
     28// MEvtLoop                                                                 //
     29//                                                                          //
     30// This class is the core of each event processing.                         //
     31// First you must set the parameter list to use. The parameter list         //
     32// must contain the task list (MTaskList) to use. The name of the task      //
     33// list can be specified if you call Eventloop. The standard name is        //
     34// "MTaskList". The name you specify must match the name of the MTaskList   //
     35// object.                                                                  //
     36//                                                                          //
     37// If you call Eventloop first all PreProcess functions - with the          //
     38// parameter list as an argument - of the tasks in the task list are        //
     39// executed. If one of them returns kFALSE then the execution is stopped.   //
     40// If the preprocessing was ok. The Process funtion of the tasks are        //
     41// as long as one function returns kSTOP. Only the tasks which are marked   //
     42// marked as "All" or with a string which matches the MInputStreamID of     //
     43// MTaskList are executed. If one tasks returns kCONTINUE the pending       //
     44// tasks in the list are skipped and the execution in continued with        //
     45// the first one in the list.                                               //
     46// Afterwards the PostProcess functions are executed.                       //
     47//                                                                          //
     48//////////////////////////////////////////////////////////////////////////////
    2449#include "MEvtLoop.h"
    2550
     
    149174{
    150175    //
    151     // The postprocessing part of the eventloop. Be careful, this is
    152     // for developers use only!
     176    //  The postprocessing part of the eventloop. Be careful, this is
     177    //  for developers use only!
    153178    //
    154179
     
    161186void MEvtLoop::Eventloop(Int_t maxcnt, const char *tlist)
    162187{
     188    //
    163189    // See class description above.
    164 
     190    //
    165191    if (!PreProcess(tlist))
    166192        return;
  • trunk/MagicSoft/Mars/mbase/MInputStreamID.cc

    r458 r749  
    1 ///////////////////////////////////////////////////////////////////////
    2 //                                                                   //
    3 // MInpuStreamID                                                     //
    4 //                                                                   //
    5 // This is a ID which is assigned to tasks and to a task list.       //
    6 // It depends on this ID whether a task is executed by the           //
    7 // MTaskList::Process member funtion or not.                         //
    8 //                                                                   //
    9 ///////////////////////////////////////////////////////////////////////
     1/* ======================================================================== *\
     2!
     3! *
     4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
     5! * Software. It is distributed to you in the hope that it can be a useful
     6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
     7! * It is distributed WITHOUT ANY WARRANTY.
     8! *
     9! * Permission to use, copy, modify and distribute this software and its
     10! * documentation for any purpose is hereby granted without fee,
     11! * provided that the above copyright notice appear in all copies and
     12! * that both that copyright notice and this permission notice appear
     13! * in supporting documentation. It is provided "as is" without express
     14! * or implied warranty.
     15! *
     16!
     17!
     18!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!
     20!   Copyright: MAGIC Software Development, 2000-2001
     21!
     22!
     23\* ======================================================================== */
     24
     25
     26//////////////////////////////////////////////////////////////////////////////
     27//                                                                          //
     28// MInpuStreamID                                                            //
     29//                                                                          //
     30// This is a ID which is assigned to tasks and to a task list.              //
     31// It depends on this ID whether a task is executed by the                  //
     32// MTaskList::Process member funtion or not.                                //
     33//                                                                          //
     34//////////////////////////////////////////////////////////////////////////////
    1035
    1136#include "MInputStreamID.h"
    1237
    1338ClassImp(MInputStreamID);
    14 
    15 // ---------------------------------------------------------------------
    1639
    1740MInputStreamID::MInputStreamID(const char *name, const char *title)
  • trunk/MagicSoft/Mars/mbase/MLog.cc

    r609 r749  
     1/* ======================================================================== *\
     2!
     3! *
     4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
     5! * Software. It is distributed to you in the hope that it can be a useful
     6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
     7! * It is distributed WITHOUT ANY WARRANTY.
     8! *
     9! * Permission to use, copy, modify and distribute this software and its
     10! * documentation for any purpose is hereby granted without fee,
     11! * provided that the above copyright notice appear in all copies and
     12! * that both that copyright notice and this permission notice appear
     13! * in supporting documentation. It is provided "as is" without express
     14! * or implied warranty.
     15! *
     16!
     17!
     18!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!
     20!   Copyright: MAGIC Software Development, 2000-2001
     21!
     22!
     23\* ======================================================================== */
     24
     25
     26//////////////////////////////////////////////////////////////////////////////
     27//                                                                          //
     28// MLog                                                                     //
     29//                                                                          //
     30// This is what we call the logging-system.                                 //
     31//                                                                          //
     32// It is derived from the C++ streaming classes and can handle our          //
     33// logging. The log output can be redirected to stdout, stderr, any other   //
     34// stream or a root window.                                                 //
     35//                                                                          //
     36// There is a global log-instance which you can use like cout, id is gLog.  //
     37// A log-instance of your choice (gLog by default) is destributed to all    //
     38// Task which are used in an eventloop, so that you can redirect the output //
     39// of one eventloop to where you want..                                     //
     40//                                                                          //
     41//////////////////////////////////////////////////////////////////////////////
     42
    143#include "MLog.h"
    244
     
    75117int MLog::sync()
    76118{
    77 //    cout << "*sync*";
    78119    WriteBuffer();
    79120
  • trunk/MagicSoft/Mars/mbase/MLogManip.cc

    r604 r749  
     1/* ======================================================================== *\
     2!
     3! *
     4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
     5! * Software. It is distributed to you in the hope that it can be a useful
     6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
     7! * It is distributed WITHOUT ANY WARRANTY.
     8! *
     9! * Permission to use, copy, modify and distribute this software and its
     10! * documentation for any purpose is hereby granted without fee,
     11! * provided that the above copyright notice appear in all copies and
     12! * that both that copyright notice and this permission notice appear
     13! * in supporting documentation. It is provided "as is" without express
     14! * or implied warranty.
     15! *
     16!
     17!
     18!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!
     20!   Copyright: MAGIC Software Development, 2000-2001
     21!
     22!
     23\* ======================================================================== */
     24
    125#include "MLog.h"
    226#include "MLogManip.h"
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r609 r749  
    1 ///////////////////////////////////////////////////////////////////////////
    2 //                                                                       //
    3 // MParContainer                                                         //
    4 //                                                                       //
    5 // The MParContainer class is the base class for all MARS parameter      //
    6 // containers. At the moment it is almost the same than ROOT's TNamed.   //
    7 // A TNamed contains the essential elements (name, title)                //
    8 // to identify a derived object in lists like our MParList or MTaskList. //
    9 // The main difference is that the name and title isn't stored and read  //
    10 // to and from root files ("\\!")                                        //
    11 //                                                                      //
    12 //////////////////////////////////////////////////////////////////////////
     1/* ======================================================================== *\
     2!
     3! *
     4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
     5! * Software. It is distributed to you in the hope that it can be a useful
     6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
     7! * It is distributed WITHOUT ANY WARRANTY.
     8! *
     9! * Permission to use, copy, modify and distribute this software and its
     10! * documentation for any purpose is hereby granted without fee,
     11! * provided that the above copyright notice appear in all copies and
     12! * that both that copyright notice and this permission notice appear
     13! * in supporting documentation. It is provided "as is" without express
     14! * or implied warranty.
     15! *
     16!
     17!
     18!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!
     20!   Copyright: MAGIC Software Development, 2000-2001
     21!
     22!
     23\* ======================================================================== */
     24
     25//////////////////////////////////////////////////////////////////////////////
     26//                                                                          //
     27// MParContainer                                                            //
     28//                                                                          //
     29// The MParContainer class is the base class for all MARS parameter         //
     30// containers. At the moment it is almost the same than ROOT's TNamed.      //
     31// A TNamed contains the essential elements (name, title)                   //
     32// to identify a derived object in lists like our MParList or MTaskList.    //
     33// The main difference is that the name and title isn't stored and read     //
     34// to and from root files ("//!")                                           //
     35//                                                                          //
     36//////////////////////////////////////////////////////////////////////////////
    1337#include "MParContainer.h"
    1438
     
    1943#include "MLog.h"
    2044
    21 ClassImp(MParContainer)
     45ClassImp(MParContainer);
    2246
    23 //______________________________________________________________________________
    2447MParContainer::MParContainer(const MParContainer &named)
    2548{
    26    // MParContainer copy ctor.
    27 
    28    *fName = *(named.fName);
    29    *fTitle = *(named.fTitle);
     49    //
     50    //  MParContainer copy ctor.
     51    //
     52    *fName = *(named.fName);
     53    *fTitle = *(named.fTitle);
    3054}
    3155
    32 //______________________________________________________________________________
    3356MParContainer& MParContainer::operator=(const MParContainer& rhs)
    3457{
    35    // MParContainer assignment operator.
    36 
    37    if (this != &rhs) {
    38       TObject::operator=(rhs);
    39       *fName  = *(rhs.fName);
    40       *fTitle = *(rhs.fTitle);
    41    }
    42    return *this;
     58    //
     59    //  MParContainer assignment operator.
     60    //
     61    if (this != &rhs) {
     62        TObject::operator=(rhs);
     63        *fName  = *(rhs.fName);
     64        *fTitle = *(rhs.fTitle);
     65    }
     66    return *this;
    4367}
    4468
    45 //______________________________________________________________________________
    4669Int_t MParContainer::Compare(TObject *obj)
    4770{
    48    // Compare two MParContainer objects. Returns 0 when equal, -1 when this is
    49    // smaller and +1 when bigger (like strcmp).
    50 
    51    if (this == obj) return 0;
    52    return fName->CompareTo(obj->GetName());
     71    //
     72    //  Compare two MParContainer objects. Returns 0 when equal, -1 when this is
     73    //  smaller and +1 when bigger (like strcmp).
     74    //
     75    if (this == obj) return 0;
     76    return fName->CompareTo(obj->GetName());
    5377}
    5478
    55 //______________________________________________________________________________
    5679void MParContainer::Copy(TObject &obj)
    5780{
    58    // Copy this to obj.
    59 
    60    TObject::Copy(obj);
    61    *(((MParContainer&)obj).fName)  = *fName;
    62    *(((MParContainer&)obj).fTitle) = *fTitle;
     81    //
     82    //  Copy this to obj.
     83    //
     84    TObject::Copy(obj);
     85    *(((MParContainer&)obj).fName)  = *fName;
     86    *(((MParContainer&)obj).fTitle) = *fTitle;
    6387}
    6488
    65 //______________________________________________________________________________
    6689void MParContainer::FillBuffer(char *&buffer)
    6790{
    68    // Encode MParContainer into output buffer.
    69 
    70    fName->FillBuffer(buffer);
    71    fTitle->FillBuffer(buffer);
     91    //
     92    //  Encode MParContainer into output buffer.
     93    //
     94    fName->FillBuffer(buffer);
     95    fTitle->FillBuffer(buffer);
    7296}
    7397
    74 //______________________________________________________________________________
    7598void MParContainer::ls(Option_t *)
    7699{
    77    // List MParContainer name and title.
    78 
    79    TROOT::IndentLevel();
    80    *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
     100    //
     101    //  List MParContainer name and title.
     102    //
     103    TROOT::IndentLevel();
     104    *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
    81105        << Int_t(TestBit(kCanDelete)) << endl;
    82106}
    83107
    84 //______________________________________________________________________________
    85108void MParContainer::Print(Option_t *)
    86109{
    87    // Print MParContainer name and title.
    88 
    89    *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl;
     110    //
     111    //  Print MParContainer name and title.
     112    //
     113    *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl;
    90114}
    91115
    92 //______________________________________________________________________________
    93116void MParContainer::SetName(const char *name)
    94117{
    95    // Change (i.e. set) the name of the MParContainer.
    96    // WARNING !!
    97    // If the object is a member of a THashTable, THashList container
    98    // The HashTable must be Rehashed after SetName
    99    // For example the list of objects in the current directory is a THashList
    100 
    101    *fName = name;
    102    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
     118    //
     119    //  Change (i.e. set) the name of the MParContainer.
     120    //  WARNING !!
     121    //  If the object is a member of a THashTable, THashList container
     122    //  The HashTable must be Rehashed after SetName
     123    //  For example the list of objects in the current directory is a THashList
     124    //
     125    *fName = name;
     126    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
    103127}
    104128
    105 //______________________________________________________________________________
    106129void MParContainer::SetObject(const char *name, const char *title)
    107130{
    108    // Change (i.e. set) all the MParContainer parameters (name and title).
    109    // See also WARNING in SetName
    110 
    111    *fName  = name;
    112    *fTitle = title;
    113    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
     131    //
     132    //  Change (i.e. set) all the MParContainer parameters (name and title).
     133    //  See also WARNING in SetName
     134    //
     135    *fName  = name;
     136    *fTitle = title;
     137    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
    114138}
    115139
    116 //______________________________________________________________________________
    117140void MParContainer::SetTitle(const char *title)
    118141{
    119    // Change (i.e. set) the title of the MParContainer.
    120 
    121    *fTitle = title;
    122    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
     142    //
     143    //  Change (i.e. set) the title of the MParContainer.
     144    //
     145    *fTitle = title;
     146    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
    123147}
    124148
    125 //______________________________________________________________________________
    126149Int_t MParContainer::Sizeof() const
    127150{
    128    // Return size of the MParContainer part of the TObject.
    129 
    130    Int_t nbytes = fName->Sizeof() + fTitle->Sizeof();
    131    return nbytes;
     151    //
     152    //  Return size of the MParContainer part of the TObject.
     153    //
     154    Int_t nbytes = fName->Sizeof() + fTitle->Sizeof();
     155    return nbytes;
    132156}
    133 
    134 
    135 
    136 
    137 
    138 
    139 
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r705 r749  
     1/* ======================================================================== *\
     2!
     3! *
     4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
     5! * Software. It is distributed to you in the hope that it can be a useful
     6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
     7! * It is distributed WITHOUT ANY WARRANTY.
     8! *
     9! * Permission to use, copy, modify and distribute this software and its
     10! * documentation for any purpose is hereby granted without fee,
     11! * provided that the above copyright notice appear in all copies and
     12! * that both that copyright notice and this permission notice appear
     13! * in supporting documentation. It is provided "as is" without express
     14! * or implied warranty.
     15! *
     16!
     17!
     18!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!
     20!   Copyright: MAGIC Software Development, 2000-2001
     21!
     22!
     23\* ======================================================================== */
     24
    125/////////////////////////////////////////////////////////////////////////////
    226//                                                                         //
     
    124148}
    125149
    126 MParContainer *MParList::FindCreateObj(const char *name)
     150MParContainer *MParList::FindCreateObj(const char *classname, const char *objname)
    127151{
    128152    //
     
    132156    //  dictionary. If this isn't possible NULL is returned
    133157    //
    134     MParContainer *pcont = (MParContainer*)FindObject(name);
     158
     159    //
     160    // If now object name (name of the object to identify it in the
     161    // List) is given use it's classname as the objectname
     162    //
     163    if (!objname)
     164        objname = classname;
     165
     166    //
     167    // Try to find a object with this object name which is already
     168    // in the List. If we can find one we are done.
     169    //
     170    MParContainer *pcont = (MParContainer*)FindObject(objname);
    135171
    136172    if (pcont)
     
    140176    // if object is not existing in the list try to create one
    141177    //
    142     *fLog << dbginf << "'" << name << "' not found... creating." << endl;
     178    *fLog << dbginf << "'" << classname << "' not found... creating." << endl;
    143179
    144180    //
    145181    // try to get class from root environment
    146182    //
    147     TClass *cls = gROOT->GetClass(name);
     183    TClass *cls = gROOT->GetClass(classname);
    148184
    149185    if (!cls)
     
    152188        // if class is not existing in the root environment
    153189        //
    154         *fLog << dbginf << "Class '" << name << "' not existing in dictionary." << endl;
     190        *fLog << dbginf << "Class '" << classname << "' not existing in dictionary." << endl;
    155191        return NULL;
    156192    }
    157193
    158194    //
    159     // create the container and add it to the list
     195    // create the parameter container of the the given class type
    160196    //
    161197    pcont = (MParContainer*)cls->New();
     198
     199    //
     200    // If a name different to the classname was given,
     201    // set the new object name of the object
     202    //
     203    pcont->SetName(objname);
     204
     205    //
     206    // Now add the object to the parameter list
     207    //
    162208    AddToList(pcont);
    163209
     210    //
     211    // The object was automatically created. This makes sure, that such an
     212    // object is deleted together with the list
     213    //
    164214    fAutodelete.Add(pcont);
    165215
  • trunk/MagicSoft/Mars/mbase/MParList.h

    r698 r749  
    4242
    4343    TObject       *FindObject(const char *name) const;
    44     MParContainer *FindCreateObj(const char *name);
     44    MParContainer *FindCreateObj(const char *classname, const char *objname=NULL);
    4545
    4646    void Print(Option_t *t = NULL);
  • trunk/MagicSoft/Mars/mbase/MReadTree.cc

    r706 r749  
     1/* ======================================================================== *\
     2!
     3! *
     4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
     5! * Software. It is distributed to you in the hope that it can be a useful
     6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
     7! * It is distributed WITHOUT ANY WARRANTY.
     8! *
     9! * Permission to use, copy, modify and distribute this software and its
     10! * documentation for any purpose is hereby granted without fee,
     11! * provided that the above copyright notice appear in all copies and
     12! * that both that copyright notice and this permission notice appear
     13! * in supporting documentation. It is provided "as is" without express
     14! * or implied warranty.
     15! *
     16!
     17!
     18!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!
     20!   Copyright: MAGIC Software Development, 2000-2001
     21!
     22!
     23\* ======================================================================== */
     24
    125/////////////////////////////////////////////////////////////////////////////
    226//                                                                         //
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r609 r749  
     1/* ======================================================================== *\
     2!
     3! *
     4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
     5! * Software. It is distributed to you in the hope that it can be a useful
     6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
     7! * It is distributed WITHOUT ANY WARRANTY.
     8! *
     9! * Permission to use, copy, modify and distribute this software and its
     10! * documentation for any purpose is hereby granted without fee,
     11! * provided that the above copyright notice appear in all copies and
     12! * that both that copyright notice and this permission notice appear
     13! * in supporting documentation. It is provided "as is" without express
     14! * or implied warranty.
     15! *
     16!
     17!
     18!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!
     20!   Copyright: MAGIC Software Development, 2000-2001
     21!
     22!
     23\* ======================================================================== */
     24
    125/////////////////////////////////////////////////////////////////////////////
    226//                                                                         //
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r609 r749  
     1/* ======================================================================== *\
     2!
     3! *
     4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
     5! * Software. It is distributed to you in the hope that it can be a useful
     6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
     7! * It is distributed WITHOUT ANY WARRANTY.
     8! *
     9! * Permission to use, copy, modify and distribute this software and its
     10! * documentation for any purpose is hereby granted without fee,
     11! * provided that the above copyright notice appear in all copies and
     12! * that both that copyright notice and this permission notice appear
     13! * in supporting documentation. It is provided "as is" without express
     14! * or implied warranty.
     15! *
     16!
     17!
     18!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!
     20!   Copyright: MAGIC Software Development, 2000-2001
     21!
     22!
     23\* ======================================================================== */
     24
    125///////////////////////////////////////////////////////////////////////
    226//                                                                   //
  • trunk/MagicSoft/Mars/mbase/MTime.cc

    r609 r749  
     1/* ======================================================================== *\
     2!
     3! *
     4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
     5! * Software. It is distributed to you in the hope that it can be a useful
     6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
     7! * It is distributed WITHOUT ANY WARRANTY.
     8! *
     9! * Permission to use, copy, modify and distribute this software and its
     10! * documentation for any purpose is hereby granted without fee,
     11! * provided that the above copyright notice appear in all copies and
     12! * that both that copyright notice and this permission notice appear
     13! * in supporting documentation. It is provided "as is" without express
     14! * or implied warranty.
     15! *
     16!
     17!
     18!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!
     20!   Copyright: MAGIC Software Development, 2000-2001
     21!
     22!
     23\* ======================================================================== */
     24
    125/////////////////////////////////////////////////////////////////////////////
    226//                                                                         //
Note: See TracChangeset for help on using the changeset viewer.