Changeset 8073


Ignore:
Timestamp:
10/16/06 19:43:37 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.cc

    r7149 r8073  
    3434//             "(4.4*MHillas.fSize*MHillas.fLength) + (5.5*MHillasSrc.fDist*MHillas.fLength)");
    3535//
    36 // For description of rules, see MDataChain.
     36// For description of rules, see MDataPhrase.
    3737//
    3838// The default rule is "MMcEvt.fEnergy"
  • trunk/MagicSoft/Mars/manalysis/MParameterCalc.cc

    r7150 r8073  
    3333//             "(4.4*MHillas.fSize*MHillas.fLength) + (5.5*MHillasSrc.fDist*MHillas.fLength)");
    3434//
    35 // For description of rules, see MDataChain.
     35// For description of rules, see MDataPhrase.
    3636//
    3737// Output:
     
    4343#include "MParList.h"
    4444
    45 #include "MDataChain.h"
     45#include "MDataPhrase.h"
    4646#include "MParameters.h"
    4747
     
    6363    fTitle = title ? title : "Task to calculate a MParameterD";
    6464
    65     fData = new MDataChain(def);
     65    fData = new MDataPhrase(def);
    6666}
    6767
     
    7777// --------------------------------------------------------------------------
    7878//
    79 // Delete fData. Initialize a new MDataChain with rule.
     79// Delete fData. Initialize a new MDataPhrase with rule.
    8080// Returns if fData->IsValid()
    8181//
     
    8383{
    8484    delete fData;
    85     fData = new MDataChain(rule);
     85    fData = new MDataPhrase(rule);
    8686
    8787    return fData->IsValid();
     
    183183//     MyEstimator.1: 5.5
    184184//
    185 // For more details see MDataChain::ReadEnv
     185// For more details see MDataPhrase::ReadEnv
    186186//
    187187Int_t MParameterCalc::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
    188188{
    189     MDataChain *f = new MDataChain;
     189    MDataPhrase *f = new MDataPhrase;
    190190    f->SetName(fName);
    191191
  • trunk/MagicSoft/Mars/manalysis/MParameterCalc.h

    r7150 r8073  
    1212{
    1313private:
    14     MData       *fData;          //-> Input MDataChain with rule
     14    MData       *fData;          //-> Input MDataPhrase with rule
    1515    MParameterD *fParameter;     //!  Output parameter
    1616
  • trunk/MagicSoft/Mars/mbase/MMath.cc

    r8029 r8073  
    554554// An exact solution of the cubic polynomial equation:
    555555//
    556 // x^3 + a*x^2 + b*x + c = 0
     556//   x^3 + a*x^2 + b*x + c = 0
    557557//
    558558// was first published by Gerolamo Cardano (1501-1576) in his treatise,
     
    563563// discovered. Zeno source code
    564564//
     565// http://home.att.net/~srschmitt/cubizen.html
     566//
    565567// % compute real or complex roots of cubic polynomial
    566568// function cubic( var z1, z2, z3 : real, a, b, c : real ) : real
     
    598600// end function
    599601//
     602// see also http://en.wikipedia.org/wiki/Cubic_equation
     603//
    600604Int_t MMath::SolvePol3(Double_t a, Double_t b, Double_t c,
    601605                       Double_t &x1, Double_t &x2, Double_t &x3)
    602606{
     607    //    Double_t coeff[4] = { 1, a, b, c };
     608    //    return TMath::RootsCubic(coeff, x1, x2, x3) ? 1 : 3;
     609
    603610    const Double_t Q = (a*a - 3*b)/9;
    604611    const Double_t R = (9*b*a - 27*c - 2*a*a*a)/54;
     
    607614    // ----- The single-real / duplicate-roots solution -----
    608615
     616    // D<0:  three real roots
     617    // D>0:  one real root
     618    // D==0: maximum two real roots (two identical roots)
     619
     620    // R==0: only one unique root
     621    // R!=0: two roots
     622
    609623    if (D==0)
    610624    {
    611625        const Double_t r = MMath::Sqrt3(R);
    612626
    613         x1 = 2*r - a/3.;               // real root
    614         x2 =   r - a/3.;               // real root
    615 
     627        x1 = r - a/3.;               // real root
     628        if (R==0)
     629            return 1;
     630
     631        x2 = 2*r - a/3.;               // real root
    616632        return 2;
    617633    }
  • trunk/MagicSoft/Mars/mdata/DataLinkDef.h

    r3666 r8073  
    1414#pragma link C++ class MDataFormula+;
    1515
     16#pragma link C++ class MDataPhrase+;
     17
    1618#endif
  • trunk/MagicSoft/Mars/mdata/MDataList.cc

    r7804 r8073  
    310310//
    311311// Builds a rule from all the list members. This is a rule which could
    312 // be used to rebuild the list using the constructor of a MDataChain
     312// be used to rebuild the list using the constructor of a MDataPhrase
    313313//
    314314TString MDataList::GetRule() const
  • trunk/MagicSoft/Mars/mdata/MDataMember.cc

    r3572 r8073  
    187187// --------------------------------------------------------------------------
    188188//
    189 // Builds a rule which cn be used in a MDataChain to describe this object
     189// Builds a rule which can be used in a MDataPhrase to describe this object
    190190//
    191191TString MDataMember::GetRule() const
  • trunk/MagicSoft/Mars/mdata/Makefile

    r3927 r8073  
    1616
    1717SRCFILES = MData.cc \
     18           MDataPhrase.cc \
    1819           MDataArray.cc \
    1920           MDataElement.cc \
  • trunk/MagicSoft/Mars/mhbase/MH.cc

    r8047 r8073  
    13221322//
    13231323// see http://root.cern.ch/phpBB2/viewtopic.php?p=14818
     1324// see http://savannah.cern.ch/bugs/?20722
    13241325//
    13251326void MH::SetBinomialErrors(TH1 &hres, const TH1 &h1, const TH1 &h2, Double_t c1, Double_t c2)
     
    13291330        const Double_t b1 = h1.GetBinContent(binx);
    13301331        const Double_t b2 = h2.GetBinContent(binx);
    1331         const Double_t w  = c2*b2 ? (c1*b1)/(c2*b2) : 0;
    13321332        const Double_t e1 = h2.GetBinError(binx);
    13331333        const Double_t e2 = h1.GetBinError(binx);
    13341334
    1335         const Double_t rc = ((1-2*w)*e1*e1+w*w*e2*e2)/(b2*b2);
     1335        //const Double_t w  = c2*b2 ? (c1*b1)/(c2*b2) : 0;
     1336        //const Double_t rc = ((1-2*w)*e1*e1+w*w*e2*e2)/(b2*b2);
     1337
     1338        const Double_t c = c2==0 ? 1 : c1/c2;
     1339        const Double_t u = b2==0 ? 0 : b1/b2;
     1340
     1341        const Double_t rc = c*((1-2*u)*e1*e1+u*u*e2*e2)/(b2*b2);
    13361342
    13371343        hres.SetBinError(binx, TMath::Sqrt(TMath::Abs(rc)));
Note: See TracChangeset for help on using the changeset viewer.