Changeset 7169 for trunk/MagicSoft
- Timestamp:
- 06/17/05 13:33:56 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7168 r7169 21 21 22 22 -*-*- END OF LINE -*-*- 23 24 2005/06/17 Thomas Bretz 25 26 * mbase/MArgs.[h,cc]: 27 - handle possible char \015 in arguments 28 29 * mdata/MDataArray.h: 30 - added Print function to //*MENU* 31 32 * mhflux/MAlphaFitter.[h,cc]: 33 - added new Option for Scale: Fixed 34 - fixed typo in IsEnvDefined for Signalfunction 35 36 * mhist/MHCamera.cc: 37 - plot profile in deg instead of mm 38 39 * mjobs/MDataSet.[h,cc] 40 - changed error handling when reading source catalog 41 42 * mjobs/MJCut.cc: 43 - added MImagePar to output 44 - take new error handling into account when reading source catalog 45 46 * mjobs/MJSpectrum.cc: 47 - print energy estimator 48 - removed the double minus displaying the fitted spectrum 49 50 * mjoptim/MJOptimizeDisp.cc, mjoptim/MJOptimizeEnergy.cc: 51 - print rule when optimization has finished 52 53 * mmain/MBrowser.cc: 54 - replaced old path with new path to datacenter 55 56 * mranforest/MRFEnergyEst.[h,cc]: 57 - store binning in new data member fBinning to avoid many calles 58 to atof 59 60 61 23 62 2005/06/15 Daniela Dorner 24 63 -
trunk/MagicSoft/Mars/NEWS
r7148 r7169 8 8 - general: Added a class to correct for the missfocussing in 9 9 April (MSrcPosCorrect) 10 11 - general: Random Forest energy estimator should now work properly 12 13 - general: MHCamera now displays the profiles in deg instead of mm 10 14 11 15 - ganymed: the Conc1 plot was incorrectly scaled in MHVsSize -
trunk/MagicSoft/Mars/mbase/MArgs.cc
r4766 r7169 72 72 { 73 73 MArgsEntry &o = *new MArgsEntry(argv[i]); 74 dynamic_cast<TString&>(o) = o.Strip(TString::kBoth);75 74 fArgv->Add(&o); 76 75 } -
trunk/MagicSoft/Mars/mbase/MArgs.h
r4766 r7169 13 13 { 14 14 public: 15 MArgsEntry(const char *c) : TString(c), TObject() {} 15 MArgsEntry(const char *c) : TString(c), TObject() 16 { 17 ReplaceAll("\015", ""); 18 dynamic_cast<TString&>(*this) = Strip(TString::kBoth); 19 } 16 20 17 21 void Print(const Option_t *o) const; -
trunk/MagicSoft/Mars/mdata/MDataArray.h
r7130 r7169 51 51 TString GetDataMember() const; 52 52 53 void Print(Option_t *opt = "") const; 53 void Print(Option_t *opt = "") const; //*MENU* 54 54 Bool_t AsciiWrite(ostream &out) const; 55 55 -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
r7152 r7169 624 624 rc = kTRUE; 625 625 } 626 626 if (IsEnvDefined(env, prefix, "Scale", print)) 627 { 628 fScaleUser = GetEnvValue(env, prefix, "Scale", fScaleUser); 629 rc = kTRUE; 630 } 627 631 if (IsEnvDefined(env, prefix, "ScaleMode", print)) 628 632 { … … 644 648 if (txt==(TString)"userscale") 645 649 fScaleMode = kUserScale; 646 rc = kTRUE; 647 } 648 if (IsEnvDefined(env, prefix, "Signalfunction", print)) 650 if (txt==(TString)"fixed") 651 { 652 fScaleMode = kUserScale; 653 fScaleUser = fScaleFactor; 654 cout << "---------> " << fScaleFactor << " <----------" << endl; 655 } 656 rc = kTRUE; 657 } 658 if (IsEnvDefined(env, prefix, "SignalFunction", print)) 649 659 { 650 660 TString txt = GetEnvValue(env, prefix, "SignalFunction", ""); … … 657 667 rc = kTRUE; 658 668 } 659 if (IsEnvDefined(env, prefix, "Scale", print)) 660 { 661 fScaleUser = GetEnvValue(env, prefix, "Scale", fScaleUser); 662 rc = kTRUE; 663 } 664 665 return rc; 666 } 669 670 return rc; 671 } -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h
r7151 r7169 51 51 Int_t fPolynomOrder; // order of polyom to be fitted to the background 52 52 Bool_t fFitBackground; // Backround fit: yes/no 53 SignalFunc_t fSignalFunc; // Type of signal function53 SignalFunc_t fSignalFunc; // Type of signal function 54 54 // Result 55 55 Double_t fSignificance; // significance of signal … … 61 61 Double_t fChiSqBg; // Reduced (chi^2/NDF) chisq of bg fit 62 62 Double_t fIntegralMax; // Calculated bin border to which it was integrated 63 Double_t fScaleFactor; // Scale factor for off-data63 Double_t fScaleFactor; // Scale factor determined for off-data 64 64 65 65 TArrayD fCoefficients; // Fit result -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r7001 r7169 717 717 } 718 718 719 const Double_t m2d = fGeomCam->GetConvMm2Deg(); 720 719 721 Double_t min = 0.; 720 Double_t max = fGeomCam->GetMaxRadius() ;722 Double_t max = fGeomCam->GetMaxRadius()*m2d; 721 723 722 724 Int_t newbins=0; … … 730 732 for (Int_t idx=0; idx<fNcells-2; idx++) 731 733 if (IsUsed(idx) && MatchSector(idx, sector, aidx)) 732 h1->Fill(TMath::Hypot((*fGeomCam)[idx].GetX(),(*fGeomCam)[idx].GetY()) ,734 h1->Fill(TMath::Hypot((*fGeomCam)[idx].GetX(),(*fGeomCam)[idx].GetY())*m2d, 733 735 GetBinContent(idx+1)); 734 736 return h1; … … 910 912 911 913 Float_t x = pix.GetX()*conv/(fAbberation+1); 914 912 915 Float_t y = pix.GetY()*conv/(fAbberation+1); 913 916 Float_t d = pix.GetD()*conv; -
trunk/MagicSoft/Mars/mjobs/MJCut.cc
r7142 r7169 331 331 write->AddContainer("MPointingPos", "Events"); 332 332 write->AddContainer("MHillasSrcAnti", "Events", kFALSE); 333 write->AddContainer("MImagePar", "Events", kFALSE); 333 334 write->AddContainer("MNewImagePar", "Events", kFALSE); 334 335 write->AddContainer("MNewImagePar2", "Events", kFALSE); … … 338 339 write->AddContainer("MMcEvt", "Events", kFALSE); 339 340 write->AddContainer("DataType", "Events"); 340 341 // Should not be the default: Either as option, or as342 // setup from resource file343 // write.AddContainer("MHillasExt", "Events");344 // write.AddContainer("MImagePar", "Events");345 // write.AddContainer("MNewImagePar", "Events");346 341 } 347 342 … … 439 434 // Possible source position (eg. Wobble Mode) 440 435 MPointingPos source("MSourcePos"); 441 if (set.GetSourcePos(source)) 442 { 436 if (set.HasSource()) 437 { 438 if (!set.GetSourcePos(source)) 439 return kFALSE; 443 440 plist.AddToList(&source); 444 441 *fLog << inf << "Using Source Position: " << source.GetTitle() << endl; -
trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
r7148 r7169 637 637 TString str; 638 638 str += Form("(%.2f#pm%.2f)10^{%d}", p1/exp, e1/exp, np); 639 str += Form("(\\frac{E}{TeV})^{ -%.2f#pm%.2f}", p0, e0);639 str += Form("(\\frac{E}{TeV})^{%.2f#pm%.2f}", p0, e0); 640 640 str += "\\frac{ph}{TeVm^{2}s}"; 641 641 … … 814 814 TLatex tex; 815 815 tex.SetBit(TLatex::kTextNDC); 816 tex.DrawLatex(0.7 , 0.93, Form("P(\\chi^{2})=%.0f", p*100));816 tex.DrawLatex(0.75, 0.93, Form("P(\\chi^{2})=%.0f%%", p*100)); 817 817 } 818 818 } … … 1063 1063 } 1064 1064 1065 gLog.Separator("Energy Estimator"); 1066 if (plist.FindObject("EstimateEnergy")) 1067 plist.FindObject("EstimateEnergy")->Print(); 1068 1069 gLog.Separator("Spectrum"); 1070 1065 1071 // -------------------------- Spectrum ---------------------------- 1066 1072 -
trunk/MagicSoft/Mars/mjoptim/MJOptimizeDisp.cc
r7163 r7169 184 184 185 185 // Print the result 186 *fLog << inf << "Rule: " << rule << endl; 186 187 hist.GetAlphaFitter().Print("result"); 187 188 -
trunk/MagicSoft/Mars/mjoptim/MJOptimizeEnergy.cc
r7152 r7169 143 143 144 144 // Print the result 145 *fLog << inf << "Rule: " << rule << endl; 145 146 hist.Print(); 146 147 -
trunk/MagicSoft/Mars/mmain/MBrowser.cc
r4513 r7169 141 141 dir->GetListBox()->Resize(100, 150); 142 142 TGTreeLBEntry *entry = new TGTreeLBEntry(dir->GetListBox()->GetContainer(), 143 new TGString("/ data/MAGIC"), pic0, 6000,144 new TGString("/ data/MAGIC"));143 new TGString("/magic/data"), pic0, 6000, 144 new TGString("/magic/data")); 145 145 TGLayoutHints *laylb = new TGLayoutHints(kLHintsLeft|kLHintsTop, 14, 0, 0, 0); 146 146 dir->AddEntry(entry, laylb); -
trunk/MagicSoft/Mars/mranforest/MRFEnergyEst.cc
r7142 r7169 70 70 MRFEnergyEst::MRFEnergyEst(const char *name, const char *title) 71 71 : fNumTrees(-1), fNumTry(-1), fNdSize(-1), fDebug(kFALSE), 72 fData(0), fEnergyEst(0), fTestMatrix(0) 72 fData(0), fEnergyEst(0), fTestMatrix(0), fEstimationMode(kMean) 73 73 { 74 74 fName = name ? name : gsDefName.Data(); … … 91 91 } 92 92 93 const TMatrix &m = matrixtrain.GetM(); 94 95 const Int_t ncols = m.GetNcols(); 96 const Int_t nrows = m.GetNrows(); 93 const Int_t ncols = matrixtrain.GetM().GetNcols(); 94 const Int_t nrows = matrixtrain.GetM().GetNrows(); 97 95 if (ncols<=0 || nrows <=0) 98 96 { … … 132 130 Int_t irow0=0; 133 131 132 const TMatrix &m = matrixtrain.GetM(); 134 133 for (Int_t j=0; j<nrows; j++) 135 134 { … … 165 164 MHMatrix matrix0(mat0, "MatrixGammas"); 166 165 167 matrix1.AddColumns(&usedrules);168 matrix0.AddColumns(&usedrules);166 //matrix1.AddColumns(&usedrules); 167 //matrix0.AddColumns(&usedrules); 169 168 170 169 // training of RF … … 186 185 evtloop.SetParList(&plist); 187 186 187 if (!evtloop.Eventloop()) 188 return kFALSE; 189 188 190 if (fDebug) 189 191 gLog.SetNullOutput(kFALSE); 190 191 if (!evtloop.Eventloop())192 return kFALSE;193 192 194 193 const Double_t E = (log10(grid[ie])+log10(grid[ie+1]))/2; … … 220 219 fEForests.Delete(); 221 220 221 Int_t i=0; 222 222 223 TIter Next(fileRF.GetListOfKeys()); 223 224 TObject *o=0; … … 231 232 forest->SetTitle(o->GetTitle()); 232 233 forest->SetBit(kCanDelete); 234 235 fBinning.Set(i+1); 236 fBinning[i++] = atof(o->GetTitle()); 233 237 234 238 fEForests.Add(forest); … … 289 293 Double_t eest = 0; 290 294 Double_t hsum = 0; 295 Double_t maxh = 0; 296 Double_t maxe = 0; 297 298 Int_t i=0; 291 299 292 300 TIter Next(&fEForests); … … 295 303 { 296 304 const Double_t h = rf->CalcHadroness(event); 297 const Double_t e = atof(rf->GetTitle());305 const Double_t e = fBinning[i++]; 298 306 299 307 hsum += h; 300 308 eest += e*h; 301 } 302 303 fEnergyEst->SetVal(pow(10, eest/hsum)); 309 if (h>maxh) 310 { 311 maxh = h; 312 maxe = e; 313 } 314 } 315 316 switch (fEstimationMode) 317 { 318 case kMean: 319 fEnergyEst->SetVal(pow(10, eest/hsum)); 320 break; 321 case kMaximum: 322 fEnergyEst->SetVal(pow(10, maxe)); 323 break; 324 } 304 325 fEnergyEst->SetReadyToSave(); 305 326 … … 323 344 SetDebug(GetEnvValue(env, prefix, "Debug", fDebug)); 324 345 } 346 if (IsEnvDefined(env, prefix, "EstimationMode", print)) 347 { 348 TString txt = GetEnvValue(env, prefix, "EstimationMode", ""); 349 txt = txt.Strip(TString::kBoth); 350 txt.ToLower(); 351 if (txt==(TString)"mean") 352 fEstimationMode = kMean; 353 if (txt==(TString)"maximum") 354 fEstimationMode = kMaximum; 355 rc = kTRUE; 356 } 325 357 return rc; 326 358 } -
trunk/MagicSoft/Mars/mranforest/MRFEnergyEst.h
r7142 r7169 9 9 #include <TObjArray.h> 10 10 #endif 11 12 class TArrayD; 11 #ifndef ROOT_TArrayD 12 #include <TArrayD.h> 13 #endif 13 14 14 15 class MHMatrix; … … 18 19 class MRFEnergyEst : public MTask 19 20 { 21 public: 22 enum EstimationMode_t 23 { 24 kMean, 25 kMaximum 26 }; 20 27 private: 21 28 Int_t fNumTrees; // Training parameters … … 32 39 33 40 MHMatrix *fTestMatrix; 41 42 TArrayD fBinning; 43 44 EstimationMode_t fEstimationMode; 34 45 35 46 Int_t PreProcess(MParList *plist); … … 52 63 void InitMapping(MHMatrix *m=0) { fTestMatrix=m; } 53 64 54 void SetDebug(Bool_t b=kTRUE) { fDebug = b; } 65 void SetDebug(Bool_t b=kTRUE) { fDebug = b; } 66 67 void SetEstimationMode(EstimationMode_t op) { fEstimationMode = op; } 55 68 56 69 Int_t Train(const MHMatrix &n, const TArrayD &grid);
Note:
See TracChangeset
for help on using the changeset viewer.