Changeset 8657 for trunk/MagicSoft/Mars/mimage
- Timestamp:
- 08/06/07 15:44:16 (17 years ago)
- Location:
- trunk/MagicSoft/Mars/mimage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mimage/MHHillasExt.cc
r8256 r8657 18 18 ! Author(s): Thomas Bretz, 2001 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 420 ! Copyright: MAGIC Software Development, 2000-2007 21 21 ! 22 22 ! … … 28 28 // 29 29 // This class contains histograms for every Hillas parameter 30 // 31 // Class Version 2: 32 // ---------------- 33 // - fHMaxDist 34 // + fHSlopeL 30 35 // 31 36 ///////////////////////////////////////////////////////////////////////////// … … 34 39 #include <math.h> 35 40 36 #include <TH1.h>37 41 #include <TPad.h> 38 42 #include <TLegend.h> … … 47 51 48 52 #include "MBinning.h" 53 54 #include "MHillas.h" 49 55 #include "MHillasExt.h" 50 56 #include "MHillasSrc.h" … … 59 65 // 60 66 MHHillasExt::MHHillasExt(const char *name, const char *title) 61 : fMm2Deg(1), fUseMmScale(kTRUE), fHilName("MHillasExt") 67 : fHillas(0), fHillasExt(0), fMm2Deg(1), 68 fUseMmScale(kTRUE), fHilName("MHillasExt") 62 69 { 63 70 // … … 75 82 fHM3Long.UseCurrentStyle(); 76 83 fHM3Trans.UseCurrentStyle(); 77 fH MaxDist.UseCurrentStyle();84 fHSlopeL.UseCurrentStyle(); 78 85 79 86 fHAsym.SetName("Asymmetry"); 80 87 fHM3Long.SetName("M3l"); 81 88 fHM3Trans.SetName("M3t"); 82 fH MaxDist.SetName("MaxDist");89 fHSlopeL.SetName("SlopeL"); 83 90 84 91 fHAsym.SetTitle("Asymmetry"); 85 92 fHM3Long.SetTitle("3^{rd} Moment Longitudinal"); 86 93 fHM3Trans.SetTitle("3^{rd} Moment Transverse"); 87 fH MaxDist.SetTitle("Distance of max distant pixel");94 fHSlopeL.SetTitle("Longitudinal time-slope vs. Dist"); 88 95 89 96 fHAsym.SetXTitle("Asym [mm]"); 90 97 fHM3Long.SetXTitle("3^{rd} M_{l} [mm]"); 91 98 fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]"); 92 fH MaxDist.SetXTitle("D_{max}[mm]");99 fHSlopeL.SetXTitle("D [mm]"); 93 100 94 101 fHAsym.SetYTitle("Counts"); 95 102 fHM3Long.SetYTitle("Counts"); 96 103 fHM3Trans.SetYTitle("Counts"); 97 fH MaxDist.SetYTitle("Counts");104 fHSlopeL.SetYTitle("S_{l} [ns/mm]"); 98 105 99 106 fHAsym.SetFillStyle(4000); 100 107 fHM3Long.SetFillStyle(4000); 101 108 fHM3Trans.SetFillStyle(4000); 102 fHMaxDist.SetFillStyle(4000);109 //fHSlopeL.SetFillStyle(4000); 103 110 104 111 fHAsym.SetDirectory(NULL); 105 112 fHM3Long.SetDirectory(NULL); 106 113 fHM3Trans.SetDirectory(NULL); 107 fH MaxDist.SetDirectory(NULL);114 fHSlopeL.SetDirectory(NULL); 108 115 109 116 fHM3Trans.SetLineColor(kBlue); 110 117 111 MBinning bins; 112 113 bins.SetEdges(51, -326, 326); 114 bins.Apply(fHM3Long); 115 bins.Apply(fHM3Trans); 116 117 bins.SetEdges(51, -593, 593); 118 bins.Apply(fHAsym); 119 120 bins.SetEdges(100, 0, 593); 121 bins.Apply(fHMaxDist); 118 MBinning binsx, binsy; 119 120 binsx.SetEdges(51, -326, 326); 121 binsx.Apply(fHM3Long); 122 binsx.Apply(fHM3Trans); 123 124 binsx.SetEdges(51, -593, 593); 125 binsx.Apply(fHAsym); 126 127 binsx.SetEdges(100, 0, 445); 128 binsy.SetEdges(100, -0.04, 0.04); 129 MH::SetBinning(&fHSlopeL, &binsx, &binsy); 122 130 } 123 131 … … 141 149 } 142 150 151 fHillas = (MHillas*)plist->FindObject("MHillas"); 152 if (!fHillas) 153 { 154 *fLog << err << "MHillas not found in parameter list... aborting." << endl; 155 return kFALSE; 156 } 157 143 158 const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); 144 159 if (!geom) … … 150 165 } 151 166 152 ApplyBinning(*plist, "Asym", 153 ApplyBinning(*plist, "M3Long", 167 ApplyBinning(*plist, "Asym", &fHAsym); 168 ApplyBinning(*plist, "M3Long", &fHM3Long); 154 169 ApplyBinning(*plist, "M3Trans", &fHM3Trans); 155 ApplyBinning(*plist, " MaxDist", &fHMaxDist);170 ApplyBinning(*plist, "Dist", "Slope", &fHSlopeL); 156 171 157 172 return kTRUE; … … 168 183 169 184 const Double_t scale = TMath::Sign(fUseMmScale?1:fMm2Deg, (src ? src->GetCosDeltaAlpha() : 1)); 185 const Double_t dist = src ? src->GetDist() : fHillas->GetDist0(); 170 186 171 187 fHAsym.Fill(scale*fHillasExt->GetAsym(), w); 172 188 fHM3Long.Fill(scale*fHillasExt->GetM3Long(), w); 173 189 fHM3Trans.Fill(scale*fHillasExt->GetM3Trans(), w); 174 fH MaxDist.Fill(TMath::Abs(scale*fHillasExt->GetMaxDist()), w);190 fHSlopeL.Fill(scale*dist, fHillasExt->GetSlopeLong()/scale, w); 175 191 176 192 return kTRUE; … … 197 213 MH::ScaleAxis(&fHM3Long, scale); 198 214 MH::ScaleAxis(&fHM3Trans, scale); 199 MH::ScaleAxis(&fH MaxDist,scale);215 MH::ScaleAxis(&fHSlopeL, scale, 1./scale); 200 216 201 217 if (mmscale) … … 204 220 fHM3Long.SetXTitle("3^{rd} M_{l} [mm]"); 205 221 fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]"); 206 fHMaxDist.SetXTitle("D_{max} [mm]"); 222 fHSlopeL.SetXTitle("D [mm]"); 223 fHSlopeL.SetYTitle("S_{l} [ns/mm]"); 207 224 } 208 225 else … … 211 228 fHM3Long.SetXTitle("3^{rd} M_{l} [\\circ]"); 212 229 fHM3Trans.SetXTitle("3^{rd} M_{t} [\\circ]"); 213 fHMaxDist.SetXTitle("D_{max} [\\circ]"); 230 fHSlopeL.SetXTitle("D [\\circ]"); 231 fHSlopeL.SetYTitle("S_{l} [ns/\\circ]"); 214 232 } 215 233 … … 262 280 fHM3Long.SetName("M3lSame"); 263 281 fHM3Trans.SetName("M3tSame"); 264 fH MaxDist.SetName("MaxDistSame");282 fHSlopeL.SetName("SlopeLSame"); 265 283 266 284 fHAsym.SetDirectory(0); 267 285 fHM3Long.SetDirectory(0); 268 286 fHM3Trans.SetDirectory(0); 269 fH MaxDist.SetDirectory(0);287 fHSlopeL.SetDirectory(0); 270 288 271 289 fHM3Long.SetLineColor(kMagenta); 272 290 fHM3Trans.SetLineColor(kCyan); 273 291 fHAsym.SetLineColor(kBlue); 274 fH MaxDist.SetLineColor(kBlue);292 fHSlopeL.SetMarkerColor(kBlue); 275 293 } 276 294 … … 288 306 pad->cd(2); 289 307 gPad->SetBorderMode(0); 290 RemoveFromPad("MaxDistSame"); 291 fHMaxDist.Draw(same?"same":""); 308 //RemoveFromPad("SlopeLSame"); 309 //fHSlopeL.Draw(same?"same":""); 310 if (same) 311 { 312 TH2 *h=dynamic_cast<TH2*>(gPad->FindObject("SlopeL")); 313 if (h) 314 { 315 // This causes crashes in THistPainter::PaintTable 316 // if the z-axis is not kept. No idea why... 317 h->SetDrawOption("z"); 318 h->SetMarkerColor(kBlack); 319 } 320 321 RemoveFromPad("SlopeLSame"); 322 fHSlopeL.SetMarkerColor(kGreen); 323 fHSlopeL.Draw("same"); 324 } 325 else 326 fHSlopeL.Draw("colz"); 292 327 293 328 delete pad->GetPad(4); … … 302 337 if (name.Contains("M3T", TString::kIgnoreCase)) 303 338 return const_cast<TH1F*>(&fHM3Trans); 304 if (name.Contains(" MaxDist", TString::kIgnoreCase))305 return const_cast<TH 1F*>(&fHMaxDist);339 if (name.Contains("SlopeL", TString::kIgnoreCase)) 340 return const_cast<TH2F*>(&fHSlopeL); 306 341 307 342 return NULL; -
trunk/MagicSoft/Mars/mimage/MHHillasExt.h
r6977 r8657 2 2 #define MARS_MHHillasExt 3 3 4 #ifndef ROOT_TH 15 #include <TH 1.h>4 #ifndef ROOT_TH2 5 #include <TH2.h> 6 6 #endif 7 7 #ifndef MARS_MH … … 9 9 #endif 10 10 11 class MHillas; 11 12 class MHillasExt; 12 13 … … 14 15 { 15 16 private: 17 MHillas *fHillas; //! Pointer to the MHillas container 16 18 MHillasExt *fHillasExt; //! Pointer to the MHillasExt container 17 19 … … 19 21 TH1F fHM3Long; // [mm] 3rd moment (e-weighted) along major axis 20 22 TH1F fHM3Trans; // [mm] 3rd moment (e-weighted) along minor axis 21 TH 1F fHMaxDist; // [mm] Distance between shower center maximum distant pixel23 TH2F fHSlopeL; // 22 24 23 25 Float_t fMm2Deg; … … 46 48 void Draw(Option_t *opt=NULL); 47 49 48 ClassDef(MHHillasExt, 1) // Container which holds histograms for the extended hillas parameters50 ClassDef(MHHillasExt, 2) // Container which holds histograms for the extended hillas parameters 49 51 }; 50 52
Note:
See TracChangeset
for help on using the changeset viewer.