Ignore:
Timestamp:
08/05/02 16:12:14 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MBinning.cc

    r1477 r1483  
    3636ClassImp(MBinning);
    3737
     38static const TString gsDefName  = "MBinning";
     39static const TString gsDefTitle = "Container describing the binning of an axis";
     40
    3841// --------------------------------------------------------------------------
    3942//
     
    4649    //   set the name and title of this object
    4750    //
    48     fName  = name  ? name  : "MBinning";
    49     fTitle = title ? title : "Container describing the binning of an axis";
     51    fName  = name  ? name  : gsDefName.Data();
     52    fTitle = title ? title : gsDefTitle.Data();
    5053
    5154    SetEdges(10, 0, 1);
     
    105108void MBinning::StreamPrimitive(ofstream &out) const
    106109{
    107     out << "   MBinning " << ToLower(fName) << "(\"";
    108     out << fName << "\", \"" << fTitle << "\");" << endl;
     110    out << "   MBinning " << GetUniqueName();
     111    if (fName!=gsDefName)
     112    {
     113        out << "(\"" << fName << "\"";
     114        if (fTitle!=gsDefTitle)
     115            out << ", \"" << fTitle << "\"";
     116        out <<")";
     117    }
     118    out << ";" << endl;
    109119
    110120    if (IsDefault())
     
    113123    if (IsLinear() || IsLogarithmic())
    114124    {
    115         out << "   " << ToLower(fName) << ".SetEdges";
     125        out << "   " << GetUniqueName() << ".SetEdges";
    116126        if (IsLogarithmic())
    117127            out << "Log";
     
    124134    for (int i=0; i<GetNumEdges(); i++)
    125135        out << "      dummy[" << i << "]=" << GetEdges()[i] << ";" << endl;
    126     out << "      " << ToLower(fName) << ".SetEdges(dummy);" << endl;
     136    out << "      " << GetUniqueName() << ".SetEdges(dummy);" << endl;
    127137    out << "   }" << endl;
    128138}
  • trunk/MagicSoft/Mars/mhist/MFillH.cc

    r1481 r1483  
    358358        fParContainer->SavePrimitive(out);
    359359
    360     out << "   MFillH " << ToLower(fName) << "(";
     360    out << "   MFillH " << GetUniqueName() << "(";
    361361
    362362    if (fH)
    363         out << "&" << ToLower(fH->GetName());
     363        out << "&" << fH->GetUniqueName();
    364364    else
    365365        out << "\"" << fHName << "\"";
    366366
    367367    if (fParContainer)
    368         out << ", &" << ToLower(fParContainer->GetName());
     368        out << ", &" << fParContainer->GetUniqueName();
    369369    else
    370370        if (!fParContainerName.IsNull())
  • trunk/MagicSoft/Mars/mhist/MH3.cc

    r1481 r1483  
    7878ClassImp(MH3);
    7979
     80static const TString gsDefName  = "MH3";
     81static const TString gsDefTitle = "Container for a %dD Mars Histogram";
     82
    8083MH3::MH3() : fDimension(0), fHist(NULL)
    8184{
    82     fName  = "MH3";
    83     fTitle = "Container for a 1D Mars Histogram";
     85    fName  = gsDefName;
     86    fTitle = Form(gsDefTitle.Data(), 0);
    8487
    8588    fData[0]  = fData[1]  = fData[2]  = NULL;
     
    101104    fData[2] = NULL;
    102105
    103     fName  = "MH3";
    104     fTitle = "Container for a 1D Mars Histogram";
     106    fName  = gsDefName;
     107    fTitle = Form(gsDefTitle.Data(), 1);
    105108
    106109    fHist->SetDirectory(NULL);
     
    127130    fData[2] = NULL;
    128131
    129     fName  = "MH3";
    130     fTitle = "Container for a 2D Mars Histogram";
     132    fName  = gsDefName;
     133    fTitle = Form(gsDefTitle.Data(), 2);
    131134
    132135    fHist->SetDirectory(NULL);
     
    153156    fData[2] = new MDataChain(memberz);
    154157
    155     fName  = "MH3";
    156     fTitle = "Container for a 3D Mars Histogram";
     158    fName  = gsDefName;
     159    fTitle = Form(gsDefTitle.Data(), 3);
    157160
    158161    fHist->SetDirectory(NULL);
     
    386389void MH3::StreamPrimitive(ofstream &out) const
    387390{
    388     TString name = ToLower(fName);
     391    TString name = GetUniqueName();
    389392
    390393    out << "   MH3 " << name << "(\"";
     
    397400    out << ");" << endl;
    398401
    399     out << "   " << name << ".SetName(\"" << fName << "\");" << endl;
    400     out << "   " << name << ".SetTitle(\"" << fTitle << "\");" << endl;
     402    if (fName!=gsDefName)
     403        out << "   " << name << ".SetName(\"" << fName << "\");" << endl;
     404
     405    if (fTitle!=Form(gsDefTitle.Data(), fDimension))
     406        out << "   " << name << ".SetTitle(\"" << fTitle << "\");" << endl;
    401407
    402408    switch (fDimension)
Note: See TracChangeset for help on using the changeset viewer.