Changeset 9303 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 02/07/09 20:48:57 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mhflux
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MHAlpha.cc
r9281 r9303 46 46 #include "MHAlpha.h" 47 47 48 #include <TF1.h>49 #include <TGraph.h>50 48 #include <TStyle.h> 51 49 #include <TLatex.h> 52 50 #include <TCanvas.h> 53 51 #include <TPaveStats.h> 54 #include <TStopwatch.h>55 52 56 53 #include "MSrcPosCam.h" … … 82 79 MHAlpha::MHAlpha(const char *name, const char *title) 83 80 : fNameParameter("MHillasSrc"), fParameter(0), 84 fOffData(0), fResult(0), f Energy(0), fBin(0),81 fOffData(0), fResult(0), fSigma(0), fEnergy(0), fBin(0), 85 82 fPointPos(0), fTimeEffOn(0), fTime(0), fNumTimeBins(10), 86 83 fHillas(0), fMatrix(0), fSkipHistTime(kFALSE), fSkipHistTheta(kFALSE), … … 100 97 fHist.SetDirectory(NULL); 101 98 fHist.UseCurrentStyle(); 99 fHist.Sumw2(); 102 100 103 101 // Main histogram … … 107 105 fHistTime.UseCurrentStyle(); 108 106 fHistTime.SetDirectory(NULL); 109 107 fHistTime.Sumw2(); 110 108 111 109 fHEnergy.SetName("Excess"); … … 115 113 fHEnergy.SetDirectory(NULL); 116 114 fHEnergy.UseCurrentStyle(); 115 fHEnergy.Sumw2(); 117 116 118 117 fHTheta.SetName("ExcessTheta"); … … 123 122 fHTheta.UseCurrentStyle(); 124 123 fHTheta.SetMinimum(0); 124 fHTheta.Sumw2(); 125 125 126 126 // effective on time versus time … … 1024 1024 pave->SetLabel(title); 1025 1025 1026 char txt[1000]; 1027 TText *ptxt; 1028 sprintf(txt, " "); 1029 ptxt = pave->AddText(txt); 1026 TText *ptxt = pave->AddText(" "); 1030 1027 ptxt->SetTextAlign(23); 1031 1028 1032 //sprintf(txt, "Significance %.1f\\sigma, off-scale %.2f (\\omega=%.2f\\circ)", 1033 // fFit.GetSignificance(), fFit.GetScaleFactor(), fFit.GetGausSigma()); 1034 sprintf(txt, "Significance %.1f\\sigma, off-scale %.2f", 1035 fit.GetSignificance(), fit.GetScaleFactor()); 1036 ptxt = pave->AddText(txt); 1029 ptxt = pave->AddText(MString::Format("Significance %.1f\\sigma, off-scale %.2f", 1030 fit.GetSignificance(), fit.GetScaleFactor())); 1037 1031 ptxt->SetTextAlign(23); 1038 1032 1039 sprintf(txt, "%.1f excess events, %.1f background events", 1040 fit.GetEventsExcess(), fit.GetEventsBackground()); 1041 ptxt = pave->AddText(txt); 1033 ptxt = pave->AddText(MString::Format("%.1f excess events, %.1f background events", 1034 fit.GetEventsExcess(), fit.GetEventsBackground())); 1042 1035 ptxt->SetTextAlign(23); 1043 1036 pave->SetBit(kCanDelete); … … 1062 1055 if (!fSkipHistEnergy) 1063 1056 { 1064 *fLog << inf << "Processing energy bins..." << endl;1057 *fLog << inf3 << "Processing energy bins..." << endl; 1065 1058 FitEnergyBins(); 1066 1059 } 1067 1060 if (!fSkipHistTheta) 1068 1061 { 1069 *fLog << inf << "Processing theta bins..." << endl;1062 *fLog << inf3 << "Processing theta bins..." << endl; 1070 1063 FitThetaBins(); 1071 1064 } 1072 1065 if (!fSkipHistTime) 1073 1066 { 1074 *fLog << inf << "Processing time bins..." << endl;1067 *fLog << inf3 << "Processing time bins..." << endl; 1075 1068 UpdateAlphaTime(kTRUE); 1076 1069 MH::RemoveFirstBin(fHTime); … … 1164 1157 return gPad->GetPad(1)->DistancetoPrimitive(px,py)==0 ? 0 : 9999; 1165 1158 } 1159 1160 void MHAlpha::RecursiveRemove(TObject *obj) 1161 { 1162 if (obj==fOffData) 1163 fOffData = 0; 1164 } -
trunk/MagicSoft/Mars/mhflux/MHAlpha.h
r9153 r9303 152 152 void Paint(Option_t *opt=""); 153 153 void Draw(Option_t *option=""); 154 void RecursiveRemove(TObject *obj); 154 155 155 156 // MParContainer -
trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc
r9292 r9303 280 280 281 281 #include "MTime.h" 282 #include "MString.h" 282 283 #include "MParameters.h" 283 284 #include "MPointingPos.h" … … 609 610 610 611 // Use a random name to make sure the object is unique 611 const TString name = Form("CalcTheta%d", (UInt_t)gRandom->Uniform(999999999));612 const TString name = MString::Format("CalcTheta%d", (UInt_t)gRandom->Uniform(999999999)); 612 613 613 614 // nbins = number of Theta bins … … 795 796 text.SetTextSize(0.04); 796 797 797 TString txt = Form("T_{eff} = %.1fs \\pm %.1fs", val, error);798 TString txt = MString::Format("T_{eff} = %.1fs \\pm %.1fs", val, error); 798 799 if (range>0) 799 txt += Form(" T_{axe} = %.1fs", range);800 txt += MString::Format(" T_{axe} = %.1fs", range); 800 801 if (fTotalTime>0) 801 txt += Form(" T_{max} = %.1fs", fTotalTime);802 txt += MString::Format(" T_{max} = %.1fs", fTotalTime); 802 803 803 804 text.SetText(0.35, 0.94, txt); … … 807 808 void MHEffectiveOnTime::PaintText(Double_t *res) const 808 809 { 809 TLatex text(0.27, 0.94, Form("T_{eff}=%.1fs\\pm%.1fs \\lambda=%.1f\\pm%.1fHz p=%.1f%% \\chi^{2}/%d=%.1f",810 res[0], res[1], res[3], res[4], res[2], (int)res[5], res[6]/res[5]));810 TLatex text(0.27, 0.94, MString::Format("T_{eff}=%.1fs\\pm%.1fs \\lambda=%.1f\\pm%.1fHz p=%.1f%% \\chi^{2}/%d=%.1f", 811 res[0], res[1], res[3], res[4], res[2], (int)res[5], res[6]/res[5])); 811 812 text.SetBit(TLatex::kTextNDC); 812 813 text.SetTextSize(0.04); … … 828 829 return; 829 830 830 TLatex text(0.47, 0.94, Form("\\bar{p} = %.1f%%", sum/n));831 TLatex text(0.47, 0.94, MString::Format("\\bar{p} = %.1f%%", sum/n)); 831 832 text.SetBit(TLatex::kTextNDC); 832 833 text.SetTextSize(0.04); -
trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc
r9301 r9303 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHFalseSource.cc,v 1.2 4 2009-02-07 16:11:57tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHFalseSource.cc,v 1.25 2009-02-07 20:47:33 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 243 243 fMm2Deg = geom->GetConvMm2Deg(); 244 244 245 const TString off( Form("%sOff", fName.Data()));245 const TString off(MString::Format("%sOff", fName.Data())); 246 246 if (fName!=off && fHistOff==NULL) 247 247 { 248 const TString desc( Form("%s [%s] found... using ", off.Data(), ClassName()));248 const TString desc(MString::Format("%s [%s] found... using ", off.Data(), ClassName())); 249 249 MHFalseSource *hoff = (MHFalseSource*)plist->FindObject(off, ClassName()); 250 250 if (!hoff) … … 1143 1143 if (maxx>0 && maxy>0) 1144 1144 { 1145 const char *title = MString::Format(" \\alpha for x=%.2f y=%.2f (S_{max}=%.1f\\sigma) ",1146 hist->GetXaxis()->GetBinCenter(maxx),1147 hist->GetYaxis()->GetBinCenter(maxy), maxs);1145 const TString title = MString::Format(" \\alpha for x=%.2f y=%.2f (S_{max}=%.1f\\sigma) ", 1146 hist->GetXaxis()->GetBinCenter(maxx), 1147 hist->GetYaxis()->GetBinCenter(maxy), maxs); 1148 1148 1149 1149 h = fHist.ProjectionZ("AlphaFit", maxx, maxx, maxy, maxy);
Note:
See TracChangeset
for help on using the changeset viewer.