Changeset 1910 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 04/07/03 15:34:51 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.cc
r1809 r1910 61 61 62 62 static const TString gsDefName = "MMultiDimDistCalc"; 63 static const TString gsDefTitle = "Composite Probabilities Loop 1/2"; 63 static const TString gsDefTitle = "Calculate Hadronness with Nearest Neighbor/Kernel Method"; 64 64 65 // -------------------------------------------------------------------------- 65 66 // … … 68 69 // 69 70 MMultiDimDistCalc::MMultiDimDistCalc(const char *name, const char *title) 70 : fNum(0), fUseKernel(kTRUE), f Data(NULL)71 : fNum(0), fUseKernel(kTRUE), fHadronnessName("MHadronness"), fData(NULL) 71 72 { 72 73 // … … 151 152 } 152 153 153 fHadronness = (MHadronness*)plist->FindCreateObj( "MHadronness");154 fHadronness = (MHadronness*)plist->FindCreateObj(fHadronnessName, "MHadronness"); 154 155 if (!fHadronness) 155 156 return kFALSE; … … 208 209 } 209 210 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)); 224 212 225 213 return kTRUE; … … 238 226 out << ";" << endl; 239 227 228 if (fHadronnessName!="MHadronness") 229 out << " " << GetUniqueName() << ".SetHadronnessName(\"" << fHadronnessName << "\");" << endl; 240 230 if (fNum!=0) 241 231 out << " " << GetUniqueName() << ".SetUseNumRows(" << fNum << ");" << endl; -
trunk/MagicSoft/Mars/manalysis/MMultiDimDistCalc.h
r1557 r1910 17 17 Bool_t fUseKernel; // Flag whether kernel method should be used 18 18 19 TString fHadronnessName; // Name of container storing hadronness 20 19 21 MHMatrix *fMGammas; //! Gammas describing matrix 20 22 MHMatrix *fMHadrons; //! Hadrons (non gammas) describing matrix … … 30 32 ~MMultiDimDistCalc(); 31 33 34 void SetHadronnessName(const TString name) { fHadronnessName = name; } 35 TString GetHadronnessName() const { return fHadronnessName; } 36 32 37 void SetUseNumRows(UShort_t n=0) { fNum = n; } 33 38 void SetUseKernelMethod(Bool_t k=kTRUE) { fUseKernel = k; } … … 36 41 Bool_t Process(); 37 42 38 ClassDef(MMultiDimDistCalc, 0) // Task to calculate multidimensional distances43 ClassDef(MMultiDimDistCalc, 0) // Task to calculate nearest neighbor-/kernel-hadronness 39 44 }; 40 45 -
trunk/MagicSoft/Mars/manalysis/MRanForestCalc.cc
r1870 r1910 60 60 // 61 61 MRanForestCalc::MRanForestCalc(const char *name, const char *title) 62 : fNum(100), f Data(NULL)62 : fNum(100), fHadronnessName("MHadronness"), fData(NULL) 63 63 { 64 64 // … … 125 125 } 126 126 127 fHadroness = (MHadronness*)plist->FindCreateObj( "MHadronness");127 fHadroness = (MHadronness*)plist->FindCreateObj(fHadronnessName, "MHadronness"); 128 128 if (!fHadroness) 129 129 return kFALSE; -
trunk/MagicSoft/Mars/manalysis/MRanForestCalc.h
r1864 r1910 15 15 { 16 16 private: 17 Int_t fNum; // number of trees used to compute hadronness17 Int_t fNum; // number of trees used to compute hadronness 18 18 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; 23 25 24 26 public: 25 27 MRanForestCalc(const char *name=NULL, const char *title=NULL); 26 28 ~MRanForestCalc(); 29 30 void SetHadronnessName(const TString name) { fHadronnessName = name; } 31 TString GetHadronnessName() const { return fHadronnessName; } 27 32 28 33 void SetUseNumTrees(UShort_t n=100) { fNum = n; }
Note:
See TracChangeset
for help on using the changeset viewer.