Changeset 891


Ignore:
Timestamp:
07/20/01 16:44:11 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r889 r891  
    77   * mhist/MFillH.cc:
    88     - added comments
     9
     10   * mbase/MParList.[h,cc]:
     11     - Added AddToList from a TObjArray
     12     - Added GetClassName
     13     - Added GetObjName
     14     - Added FindObjectList
     15     - Added FindCreateObjList
     16     - Added CreateObjList
    917
    1018
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r890 r891  
    6969// --------------------------------------------------------------------------
    7070//
    71 // copy constructor
     71//  Copy constructor. It copies all entries of the parameter list, but it
     72//  takes care of, that the automatically created entries are only deleted
     73//  once. (doesn't copy the list which holds the automatically created
     74//  entries)
    7275//
    7376MParList::MParList(MParList &ts)
     
    7881// --------------------------------------------------------------------------
    7982//
    80 //  create the Iterator over the tasklist
     83//  Set the logging streamer of the parameter list and all contained
     84//  parameter containers
    8185//
    8286void MParList::SetLogStream(MLog *log)
  • trunk/MagicSoft/Mars/mbase/MParList.h

    r858 r891  
    2929    TOrdCollection fAutodelete; // All what this list contains is deleted in the destructor
    3030
     31    static TString GetClassName(const char *classname);
     32    static TString GetObjectName(const char *classname, const char *objname);
     33
    3134public:
    3235    MParList(const char *name=NULL, const char *title=NULL);
     
    3841
    3942    Bool_t AddToList(MParContainer *obj, MParContainer *where = NULL);
     43    void   AddToList(TObjArray *list);
    4044
    4145    void SetLogStream(MLog *log);
     
    4448    TObject       *FindObject(TObject *obj) const;
    4549    MParContainer *FindCreateObj(const char *classname, const char *objname=NULL);
     50
     51    TObjArray FindObjectList(const char *name, const UInt_t from, const UInt_t to=0) const;
     52    TObjArray FindCreateObjList(const char *cname, const UInt_t from, const UInt_t to=0, const char *oname=NULL);
     53
     54    static TObjArray CreateObjList(const char *cname, const UInt_t from, const UInt_t to=0, const char *oname=NULL);
    4655
    4756    void Reset();
  • trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc

    r867 r891  
    3333#include "MHMcEnergy.h"
    3434
     35#include <stdlib.h>
    3536#include <iostream.h>
    3637
     
    4647//  Default Constructor.
    4748//
    48 MHMcEnergy::MHMcEnergy(const UInt_t idx, const char *name, const char *title)
     49MHMcEnergy::MHMcEnergy(const char *name, const char *title)
    4950{
    50     char aux[15]="MHMcEnergy";
    51 
    52     if (idx>0)
    53         sprintf(aux+strlen(aux), ";%i", idx);
    54 
    55     *fName  = name  ? name  : aux;
    56     *fTitle = title ? title : "Container for an energy distribution histogram" ;
     51    *fTitle = title ? title : "Container for an energy distribution histogram";
    5752
    5853    //  - we initialize the histogram
     
    6055    //    root don't allow us to have diferent histograms with the same name
    6156
     57    fHist = new TH1F("", "", 40, 0.5, 4.5);
     58    fHist->SetXTitle("log(E/GeV)");
     59    fHist->SetYTitle("dN/dE");
     60
     61    SetName(name ? name : "MHMcEnergy");
     62}
     63
     64// -------------------------------------------------------------------------
     65//
     66//  This doesn't only set the name. It tries to get the number from the
     67//  name and creates also name and title of the histogram.
     68//
     69//  This is necessary for example if a list of such MHMcEnergy histograms
     70//  is created (s. MParList::CreateObjList)
     71//
     72void MHMcEnergy::SetName(const char *name)
     73{
     74    TString cname(name);
     75    const char *semicolon = strrchr(cname, ';');
     76
     77    UInt_t idx = semicolon ? atoi(semicolon+1) : 0;
     78
     79    *fName = cname;
     80
    6281    char text[256];
    63     sprintf(text, "Energy Distribution for trigger condition #%i", idx);
    64 
     82    if (idx>0)
     83        sprintf(text, "Energy Distribution for trigger condition #%i", idx);
     84    else
     85        sprintf(text, "Energy Distribution");
     86
     87    char aux[256];
    6588    strcpy(aux, "log(E)");
     89
    6690    if (idx>0)
    6791        sprintf(aux+strlen(aux), " #%i", idx);
    68     fHist = new TH1F(aux, text, 40, 0.5, 4.5);
    69     fHist->SetXTitle("log(E/GeV)");
    70     fHist->SetYTitle("dN/dE");
     92
     93    fHist->SetName(aux);
     94    fHist->SetTitle(text);
    7195}
    7296
  • trunk/MagicSoft/Mars/mhist/MHMcEnergy.h

    r867 r891  
    3131public:
    3232
    33     MHMcEnergy(const UInt_t idx=0, const char *name=NULL, const char *title=NULL);
     33    MHMcEnergy(const char *name=NULL, const char *title=NULL);
    3434    ~MHMcEnergy();
     35
     36    void SetName(const char *name);
    3537
    3638    Float_t GetThreshold() const { return fThreshold; }
Note: See TracChangeset for help on using the changeset viewer.