Changeset 2296 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 07/29/03 13:18:57 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MH.cc
r2209 r2296 796 796 // Otherwise the present gPad is returned. 797 797 // 798 TVirtualPad *MH::GetNewPad( Option_t *opt)799 { 800 TString str(opt);801 802 if (! str.Contains("nonew", TString::kIgnoreCase))798 TVirtualPad *MH::GetNewPad(TString &opt) 799 { 800 opt.ToLower(); 801 802 if (!opt.Contains("nonew")) 803 803 return NULL; 804 805 opt.ReplaceAll("nonew", ""); 804 806 805 807 return gPad; … … 813 815 TObject *MH::Clone(const char *name) const 814 816 { 815 Bool_t store = TH1::AddDirectoryStatus(); 817 const Bool_t store = TH1::AddDirectoryStatus(); 818 816 819 TH1::AddDirectory(kFALSE); 817 818 820 TObject *o = MParContainer::Clone(name); 819 820 821 TH1::AddDirectory(store); 821 822 … … 831 832 TObject *MH::DrawClone(Option_t *opt, Int_t w, Int_t h) const 832 833 { 833 TVirtualPad *p = GetNewPad(opt); 834 TString option(opt); 835 836 TVirtualPad *p = GetNewPad(option); 834 837 if (!p) 835 838 p = MakeDefCanvas(this, w, h); … … 839 842 gROOT->SetSelectedPad(NULL); 840 843 841 TObject *o = MParContainer::DrawClone(opt );844 TObject *o = MParContainer::DrawClone(option); 842 845 o->SetBit(kCanDelete); 843 846 return o; -
trunk/MagicSoft/Mars/mhist/MH.h
r2150 r2296 75 75 } 76 76 77 static TVirtualPad *GetNewPad( Option_t *opt);77 static TVirtualPad *GetNewPad(TString &opt); 78 78 79 79 static void FindGoodLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger); -
trunk/MagicSoft/Mars/mhist/MHHadronness.cc
r2225 r2296 430 430 // -------------------------------------------------------------------------- 431 431 // 432 // Search the hadronness corresponding to a given hadron acceptance. 433 // 434 Double_t MHHadronness::GetHadronness(Double_t acchad) const 435 { 436 for (int i=1; i<fIntPhness->GetNbinsX()+1; i++) 437 if (fIntPhness->GetBinContent(i)>acchad) 438 return fIntPhness->GetBinLowEdge(i); 439 440 return -1; 441 } 442 443 // -------------------------------------------------------------------------- 444 // 432 445 // Print the corresponding Gammas Acceptance for a hadron acceptance of 433 446 // 10%, 20%, 30%, 40% and 50%. Also the minimum distance to the optimum … … 448 461 449 462 *fLog << "Used " << fGhness->GetEntries() << " Gammas and " << fPhness->GetEntries() << " Hadrons." << endl; 450 *fLog << "acc(hadron) acc(gamma) acc(g)/acc(h)" << endl <<endl;451 452 *fLog << " 0.005 " << Form("%6.3f", GetGammaAcceptance(0.005)) << " " << Form("%6.3f", GetGammaAcceptance(0.005)/0.005) << endl;453 *fLog << " 0.02 " << Form("%6.3f", GetGammaAcceptance(0.02)) << " " << Form("%6.3f", GetGammaAcceptance(0.02)/0.02) << endl;454 *fLog << " 0.05 " << Form("%6.3f", GetGammaAcceptance(0.05)) << " " << Form("%6.3f", GetGammaAcceptance(0.05)/0.05) << endl;455 *fLog << " 0.1 " << Form("%6.3f", GetGammaAcceptance(0.1 )) << " " << Form("%6.3f", GetGammaAcceptance(0.1)/0.1) << endl;456 *fLog << " 0.2 " << Form("%6.3f", GetGammaAcceptance(0.2 )) << " " << Form("%6.3f", GetGammaAcceptance(0.2)/0.2) << endl;457 *fLog << " 0.3 " << Form("%6.3f", GetGammaAcceptance(0.3 )) << " " << Form("%6.3f", GetGammaAcceptance(0.3)/0.3) << endl;463 *fLog << "acc(hadron) acc(gamma) acc(g)/acc(h) h" << endl <<endl; 464 465 *fLog << " 0.005 " << Form("%6.3f", GetGammaAcceptance(0.005)) << " " << Form("%6.3f", GetGammaAcceptance(0.005)/0.005) << " " << GetHadronness(0.005) << endl; 466 *fLog << " 0.02 " << Form("%6.3f", GetGammaAcceptance(0.02)) << " " << Form("%6.3f", GetGammaAcceptance(0.02)/0.02) << " " << GetHadronness(0.02) << endl; 467 *fLog << " 0.05 " << Form("%6.3f", GetGammaAcceptance(0.05)) << " " << Form("%6.3f", GetGammaAcceptance(0.05)/0.05) << " " << GetHadronness(0.05) << endl; 468 *fLog << " 0.1 " << Form("%6.3f", GetGammaAcceptance(0.1 )) << " " << Form("%6.3f", GetGammaAcceptance(0.1)/0.1) << " " << GetHadronness(0.1) << endl; 469 *fLog << " 0.2 " << Form("%6.3f", GetGammaAcceptance(0.2 )) << " " << Form("%6.3f", GetGammaAcceptance(0.2)/0.2) << " " << GetHadronness(0.2) << endl; 470 *fLog << " 0.3 " << Form("%6.3f", GetGammaAcceptance(0.3 )) << " " << Form("%6.3f", GetGammaAcceptance(0.3)/0.3) << " " << GetHadronness(0.3) << endl; 458 471 *fLog << Form("%6.3f", GetHadronAcceptance(0.1)) << " 0.1 " << endl; 459 472 *fLog << Form("%6.3f", GetHadronAcceptance(0.2)) << " 0.2 " << endl; -
trunk/MagicSoft/Mars/mhist/MHHadronness.h
r2225 r2296 38 38 Double_t GetGammaAcceptance(Double_t acchad) const; 39 39 Double_t GetHadronAcceptance(Double_t accgam) const; 40 Double_t GetHadronness(Double_t acchad) const; 40 41 41 42 TH1D *Getghness() const { return fGhness; } -
trunk/MagicSoft/Mars/mhist/MHMatrix.cc
r2282 r2296 260 260 return kTRUE; 261 261 } 262 262 263 /* 263 264 // -------------------------------------------------------------------------- … … 503 504 if (!fM2.IsValid()) 504 505 { 506 if (!fM.IsValid()) 507 { 508 *fLog << err << "MHMatrix::CalcDist - ERROR: fM not valid." << endl; 509 return -1; 510 } 511 505 512 const TMatrix *m = InvertPosDef(); 506 513 if (!m) … … 625 632 tlist.AddToList(&fillh); 626 633 627 MProgressBar bar;634 //MProgressBar bar; 628 635 MEvtLoop evtloop; 629 636 evtloop.SetParList(plist); 630 evtloop.SetProgressBar(&bar);637 //evtloop.SetProgressBar(&bar); 631 638 632 639 if (!evtloop.Eventloop()) 633 640 return kFALSE; 634 641 635 tlist.PrintStatistics( 0, kTRUE);642 tlist.PrintStatistics(); 636 643 637 644 plist->Remove(&tlist); … … 1097 1104 void MHMatrix::ShuffleRows(UInt_t seed) 1098 1105 { 1099 TRandom rnd(seed); 1100 1101 for (Int_t irow = 0; irow < fNumRow; irow++) 1102 { 1103 Int_t jrow = rnd.Integer(fNumRow); 1104 1105 for (Int_t icol = 0; icol < fM.GetNcols(); icol++) 1106 { 1107 Real_t tmp = fM(irow,icol); 1108 fM(irow,icol) = fM(jrow,icol); 1109 fM(jrow,icol) = tmp; 1110 } 1111 } 1112 1113 *fLog << warn << this->GetName() << " : Attention! Matrix rows have been shuffled." << endl; 1114 1115 } 1106 TRandom rnd(seed); 1107 1108 TVector v(fM.GetNcols()); 1109 TVector tmp(fM.GetNcols()); 1110 for (Int_t irow = 0; irow<fNumRow; irow++) 1111 { 1112 const Int_t jrow = rnd.Integer(fNumRow); 1113 1114 v = TMatrixRow(fM, irow); 1115 TMatrixRow(fM, irow) = tmp = TMatrixRow(fM, jrow); 1116 TMatrixRow(fM, jrow) = v; 1117 } 1118 1119 *fLog << warn << GetDescriptor() << ": Attention! Matrix rows have been shuffled." << endl; 1120 } 1121 1122 void MHMatrix::ReduceRows(UInt_t num) 1123 { 1124 if ((Int_t)num>=fM.GetNrows()) 1125 { 1126 *fLog << warn << GetDescriptor() << ": Warning - " << num << " >= rows=" << fM.GetNrows() << endl; 1127 return; 1128 } 1129 1130 const TMatrix m(fM); 1131 fM.ResizeTo(num, fM.GetNcols()); 1132 1133 TVector tmp(fM.GetNcols()); 1134 for (UInt_t irow=0; irow<num; irow++) 1135 TMatrixRow(fM, irow) = tmp = TMatrixRow(m, irow); 1136 } -
trunk/MagicSoft/Mars/mhist/MHMatrix.h
r2133 r2296 113 113 114 114 void ShuffleRows(UInt_t seed); 115 void ReduceRows(UInt_t num); 115 116 116 117 ClassDef(MHMatrix, 1) // Multidimensional Matrix to store events
Note:
See TracChangeset
for help on using the changeset viewer.