Ignore:
Timestamp:
04/07/03 15:34:51 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
4 edited

Legend:

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

    r1809 r1910  
    6161
    6262static const TString gsDefName  = "MMultiDimDistCalc";
    63 static const TString gsDefTitle = "Composite Probabilities Loop 1/2";
     63static const TString gsDefTitle = "Calculate Hadronness with Nearest Neighbor/Kernel Method";
     64
    6465// --------------------------------------------------------------------------
    6566//
     
    6869//
    6970MMultiDimDistCalc::MMultiDimDistCalc(const char *name, const char *title)
    70     : fNum(0), fUseKernel(kTRUE), fData(NULL)
     71    : fNum(0), fUseKernel(kTRUE), fHadronnessName("MHadronness"), fData(NULL)
    7172{
    7273    //
     
    151152    }
    152153
    153     fHadronness = (MHadronness*)plist->FindCreateObj("MHadronness");
     154    fHadronness = (MHadronness*)plist->FindCreateObj(fHadronnessName, "MHadronness");
    154155    if (!fHadronness)
    155156        return kFALSE;
     
    208209    }
    209210
    210     Double_t arg;
    211 
    212     if (dg+dh != 0.0)
    213       arg = dg / (dg+dh);
    214     else
    215       arg = 1.e10;
    216     //fHadronness->SetHadronness(arg);
    217 
    218     if (dg != 0.0)
    219       arg = exp(-dh/dg);
    220     else
    221       arg = 0.0;
    222     fHadronness->SetHadronness(arg);
    223      
     211    fHadronness->SetHadronness(dg==0 ? 0 : exp(-dh/dg));
    224212
    225213    return kTRUE;
     
    238226    out << ";" << endl;
    239227
     228    if (fHadronnessName!="MHadronness")
     229        out << "   " << GetUniqueName() << ".SetHadronnessName(\"" << fHadronnessName << "\");" << endl;
    240230    if (fNum!=0)
    241231        out << "   " << GetUniqueName() << ".SetUseNumRows(" << fNum << ");" << endl;
  • trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.h

    r1557 r1910  
    1717    Bool_t fUseKernel;        // Flag whether kernel method should be used
    1818
     19    TString fHadronnessName;  // Name of container storing hadronness
     20
    1921    MHMatrix   *fMGammas;     //! Gammas describing matrix
    2022    MHMatrix   *fMHadrons;    //! Hadrons (non gammas) describing matrix
     
    3032    ~MMultiDimDistCalc();
    3133
     34    void SetHadronnessName(const TString name) { fHadronnessName = name; }
     35    TString GetHadronnessName() const { return fHadronnessName; }
     36
    3237    void SetUseNumRows(UShort_t n=0) { fNum = n; }
    3338    void SetUseKernelMethod(Bool_t k=kTRUE) { fUseKernel = k; }
     
    3641    Bool_t Process();
    3742
    38     ClassDef(MMultiDimDistCalc, 0) // Task to calculate multidimensional distances
     43    ClassDef(MMultiDimDistCalc, 0) // Task to calculate nearest neighbor-/kernel-hadronness
    3944};
    4045
  • trunk/MagicSoft/Mars/manalysis/MRanForestCalc.cc

    r1870 r1910  
    6060//
    6161MRanForestCalc::MRanForestCalc(const char *name, const char *title)
    62     : fNum(100), fData(NULL)
     62    : fNum(100), fHadronnessName("MHadronness"), fData(NULL)
    6363{
    6464    //
     
    125125    }
    126126
    127     fHadroness = (MHadronness*)plist->FindCreateObj("MHadronness");
     127    fHadroness = (MHadronness*)plist->FindCreateObj(fHadronnessName, "MHadronness");
    128128    if (!fHadroness)
    129129        return kFALSE;
  • trunk/MagicSoft/Mars/manalysis/MRanForestCalc.h

    r1864 r1910  
    1515{
    1616private:
    17     Int_t  fNum;             // number of trees used to compute hadronness
     17    Int_t  fNum;              // number of trees used to compute hadronness
    1818
    19     MHadronness *fHadroness; //! Output container for calculated hadroness
    20     MDataArray *fData;       //! Used to store the MDataChains to get the event values
    21     MRanForest *fRanForest;
    22     MRanTree   *fRanTree;
     19    TString fHadronnessName;  // Name of container storing hadronness
     20
     21    MHadronness *fHadroness;  //! Output container for calculated hadroness
     22    MDataArray  *fData;       //! Used to store the MDataChains to get the event values
     23    MRanForest  *fRanForest;
     24    MRanTree    *fRanTree;
    2325
    2426public:
    2527    MRanForestCalc(const char *name=NULL, const char *title=NULL);
    2628    ~MRanForestCalc();
     29
     30    void SetHadronnessName(const TString name) { fHadronnessName = name; }
     31    TString GetHadronnessName() const { return fHadronnessName; }
    2732
    2833    void SetUseNumTrees(UShort_t n=100) { fNum = n; }
Note: See TracChangeset for help on using the changeset viewer.