Changeset 7251 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 08/02/05 10:04:19 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/mhflux
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MHPhi.cc
r7250 r7251 30 30 // the source position. 31 31 // 32 // More detail can be found at: 33 // http://www.astro.uni-wuerzburg.de/results/ringmethod/ 34 // 32 35 //////////////////////////////////////////////////////////////////////////// 33 36 #include "MHPhi.h" … … 60 63 // 61 64 MHPhi::MHPhi(const char *name, const char *title) 62 : fHillas(0), fSrcPos(0), fDisp(0) 65 : fHillas(0), fSrcPos(0), fDisp(0)//, fOnOffMode(kTRUE), fIsOffLoop(kFALSE) 63 66 { 64 67 fName = name ? name : "MHPhi"; … … 66 69 67 70 // Init Graphs 68 fHPhi.SetNameTitle("Phi", " Distribution of \\Delta\\Phi");71 fHPhi.SetNameTitle("Phi", "\\Delta\\Phi-Distribution"); 69 72 70 73 fHPhi.SetXTitle("\\Delta\\Phi [\\circ]"); … … 78 81 79 82 fHPhi.GetYaxis()->SetTitleOffset(1.2); 80 } 83 84 /* 85 fNameParameter = "Disp"; 86 87 fHist.SetNameTitle("Phi", "\\Delta\\Phi-Distribution"); 88 fHist.SetZTitle("\\Delta\\Phi [\\circ]"); 89 fHist.SetDirectory(NULL); 90 91 // Main histogram 92 fHistTime.SetName("Phi"); 93 fHistTime.SetXTitle("\\Delta\\Phi [\\circ]"); 94 fHistTime.SetDirectory(NULL); 95 96 MBinning binsa, binse, binst; 97 //binsa.SetEdges(75, 0, 1.5); 98 //binsa.SetEdges(arr); 99 binse.SetEdgesLog(15, 10, 100000); 100 binst.SetEdgesASin(67, -0.005, 0.665); 101 //binsa.Apply(fHistTime); 102 103 MH::SetBinning(&fHist, &binst, &binse, &binsa); 104 */ 105 } 106 107 /* 108 Double_t MHPhi::GetVal() const 109 { 110 const Dopuble_t disp = static_cast<const MParameterD*>(fParameter)->GetVal(); 111 112 const TVector2 pos = fHillas->GetMean()*fConvMm2Deg + fHillas->GetNormAxis()*disp; 113 const TVector2 src = fSrcPos->GetXY()*fConvMm2Deg; 114 115 // Calculate radial distance. 116 const Double_t d = pos.Mod() - src.Mod(); 117 118 if (d<-fThetaCut*0.913 || d>fThetaCut) 119 return kTRUE; 120 121 const Double_t delta = src.DeltaPhi(pos)*TMath::RadToDeg(); 122 const Double_t absd = TMath::Abs(delta) 123 124 return fHistOff ? absd : 180-absd; 125 } 126 */ 81 127 82 128 // -------------------------------------------------------------------------- … … 118 164 fThetaCut = 0.21/1.2; 119 165 fDistSrc = 0.4; 166 //fIsOffLoop = !fIsOffLoop; 120 167 121 168 const Double_t w = TMath::ATan(fThetaCut/fDistSrc); … … 124 171 125 172 MBinning(n, 0, n*sz).Apply(fHPhi); 126 173 /* 174 175 // Get Histogram binnings 176 MBinning binst, binse; 177 binst.SetEdges(fHist, 'x'); 178 binse.SetEdges(fHist, 'y'); 179 180 MBinning binsa(n, 0, n*sz); 181 182 // Apply binning 183 binsa.Apply(fHistTime); 184 MH::SetBinning(&fHist, &binst, &binse, &binsa); 185 186 // Remark: Binnings might be overwritten in MHAlpha::SetupFill 187 return MHAlpha::SetupFill(pl); 188 */ 127 189 return kTRUE; 128 190 } … … 135 197 Bool_t MHPhi::Fill(const MParContainer *par, const Stat_t weight) 136 198 { 137 const TVector2 pos = fHillas->GetMean()*fConvMm2Deg -fHillas->GetNormAxis()*fDisp->GetVal();199 const TVector2 pos = fHillas->GetMean()*fConvMm2Deg + fHillas->GetNormAxis()*fDisp->GetVal(); 138 200 const TVector2 src = fSrcPos->GetXY()*fConvMm2Deg; 139 201 202 // Calculate radial distance. 140 203 const Double_t d = pos.Mod() - src.Mod(); 141 204 … … 146 209 147 210 fHPhi.Fill(TMath::Abs(delta), weight); 211 212 // const Double_t absd = TMath::Abs(delta) 213 // fHPhi.Fill(fHistOff ? absd : 180-absd, weight); 148 214 149 215 return kTRUE; … … 161 227 pad->SetBorderMode(0); 162 228 229 AppendPad("combine"); 230 163 231 fHPhi.Draw(); 164 232 165 AppendPad( );233 AppendPad(opt); 166 234 } 167 235 168 236 void MHPhi::Paint(Option_t *o) 169 237 { 170 const Double_t sig = fHPhi.Integral(1, fNumBinsSignal); 171 const Double_t bg = fHPhi.Integral(1+fNumBinsSignal, fHPhi.GetNbinsX()); 172 173 const Double_t cut = fHPhi.GetBinLowEdge(fNumBinsSignal+1); 174 175 const Double_t f = cut/(180-cut); 176 177 const Double_t S0 = MMath::SignificanceLiMaSigned(sig, bg*f); 178 const Double_t S = MMath::SignificanceLiMaSigned(sig, bg, f); 179 180 const TString fmt = Form("\\sigma_{L/M}=%.1f (\\sigma_{0}=%.1f) \\Delta\\Phi<%.1f\\circ E=%.0f B=%.0f f=%.2f", 181 S, S0, cut, sig-bg*f, bg*f, f); 238 //TString opt(o); 239 //opt.ToLower(); 240 241 // if (opt=="combine" && fHistOff) 242 // { 243 // fHPhi.Add(fHist, fHistOff); 244 // return; 245 // } 246 247 const Bool_t wobble = TString(o).Contains("anticut", TString::kIgnoreCase); 248 249 const Double_t cut = fHPhi.GetBinLowEdge(fNumBinsSignal+1); 250 251 const Int_t maxbin = wobble ? fHPhi.GetXaxis()->FindFixBin(180-cut)-1 : fHPhi.GetNbinsX(); 252 const Double_t cut2 = wobble ? fHPhi.GetBinLowEdge(maxbin+1) : 180; 253 254 const Double_t sig = fHPhi.Integral(1, fNumBinsSignal); 255 const Double_t bg = fHPhi.Integral(1+fNumBinsSignal, maxbin); 256 257 const Double_t f = cut/(cut2-cut); 258 259 const Double_t S0 = MMath::SignificanceLiMaSigned(sig, bg*f); 260 const Double_t S = MMath::SignificanceLiMaSigned(sig, bg, f); 261 262 const TString fmt = Form("\\sigma_{L/M}=%.1f (\\sigma_{0}=%.1f) \\Delta\\Phi_{on}<%.1f\\circ \\Delta\\Phi_{off}<%.1f\\circ E=%.0f B=%.0f f=%.2f", 263 S, S0, cut, cut2, sig-bg*f, bg*f, f); 182 264 183 265 const Double_t b = bg *f/fNumBinsSignal; 184 266 const Double_t e = TMath::Sqrt(bg)*f/fNumBinsSignal; 185 267 186 TLatex text(0. 33, 0.94, fmt);268 TLatex text(0.27, 0.94, fmt); 187 269 text.SetBit(TLatex::kTextNDC); 188 270 text.SetTextSize(0.035); … … 192 274 line.SetLineColor(14); 193 275 line.PaintLine(cut, gPad->GetUymin(), cut, gPad->GetUymax()); 276 if (maxbin<fHPhi.GetNbinsX()) 277 line.PaintLine(cut2, gPad->GetUymin(), cut2, gPad->GetUymax()); 194 278 line.SetLineColor(kBlue); 195 279 line.PaintLine(0, b, cut, b); … … 202 286 m.SetMarkerStyle(kFullDotMedium); 203 287 m.PaintMarker(cut/2, b); 204 205 } 288 } -
trunk/MagicSoft/Mars/mhflux/MHPhi.h
r7250 r7251 27 27 Float_t fThetaCut; 28 28 Float_t fDistSrc; 29 //Bool_t fOnOffMode; 30 31 //Bool_t fIsOffLoop; //! 29 32 30 33 public:
Note:
See TracChangeset
for help on using the changeset viewer.