Changeset 8657 for trunk/MagicSoft
- Timestamp:
- 08/06/07 15:44:16 (17 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8655 r8657 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2007/08/06 Thomas Bretz 22 23 * mcalib/CalibLinkDef.h, mcalib/Makefile: 24 - removed obsolete MMcCalibrationCalc 25 26 * mhbase/MH.[h,cc]: 27 - adde ApplyBinning member functions for two- and three-dim hists 28 29 * mimage/MHHillasExt.[h,cc]: 30 - removed plot for max dist 31 - added plot for SlopeL 32 - increased class version number 33 34 * mjobs/MJCut.cc: 35 - added BinningSlope to list of binnings 36 - added BinningM3Trans to list of binnings 37 - added BinningM3Asym to list of binnings 38 - removed BinningMaxDist from list of binnings 39 40 * mjtrain/MJTrainDisp.cc: 41 - renamed TrainDist to Train 42 43 * mpointing/MHSrcPosCam.cc: 44 - changed default palette from glow1 to pretty 45 46 * mpointing/MSrcPosCam.h: 47 - added a function to return the distance to the camera center 48 49 20 50 21 51 2007/08/02 Thomas Bretz -
trunk/MagicSoft/Mars/mcalib/CalibLinkDef.h
r8504 r8657 39 39 #pragma link C++ class MCalibrationChargePINDiode+; 40 40 41 #pragma link C++ class MMcCalibrationCalc+;42 43 41 #endif -
trunk/MagicSoft/Mars/mcalib/Makefile
r8504 r8657 59 59 MCalibrationBlindCamTwoNewStyle.cc \ 60 60 MCalibrationBlindCamThreeNewStyle.cc \ 61 MCalibrationChargePINDiode.cc \ 62 MMcCalibrationCalc.cc 61 MCalibrationChargePINDiode.cc 63 62 64 63 ############################################################ -
trunk/MagicSoft/Mars/mhbase/MH.cc
r8238 r8657 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.3 2 2007-01-10 12:58:25tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.33 2007-08-06 14:44:13 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 619 619 } 620 620 621 Bool_t MH::ApplyBinning(const MParList &plist, TString x, TString y, TH2 *h) 622 { 623 const MBinning *binsx = (MBinning*)plist.FindObject("Binning"+x); 624 if (!binsx) 625 { 626 gLog << inf << "Object 'Binning" << x << "' [MBinning] not found... no binning applied." << endl; 627 return kFALSE; 628 } 629 const MBinning *binsy = (MBinning*)plist.FindObject("Binning"+y); 630 if (!binsy) 631 { 632 gLog << inf << "Object 'Binning" << y << "' [MBinning] not found... no binning applied." << endl; 633 return kFALSE; 634 } 635 636 if (binsx->IsDefault() && binsy->IsDefault()) 637 return kTRUE; 638 639 // ------------------------- 640 /* 641 MBinning binsx, binsy, binsz; 642 binsx.SetEdges(fHist, 'x'); 643 binsy.SetEdges(fHist, 'y'); 644 binsz.SetEdges(fHist, 'z'); 645 */ 646 // ------------------------- 647 648 SetBinning(h, binsx, binsy); 649 650 return kTRUE; 651 } 652 653 Bool_t MH::ApplyBinning(const MParList &plist, TString x, TString y, TString z, TH3 *h) 654 { 655 const MBinning *binsx = (MBinning*)plist.FindObject("Binning"+x); 656 if (!binsx) 657 { 658 gLog << inf << "Object 'Binning" << x << "' [MBinning] not found... no binning applied." << endl; 659 return kFALSE; 660 } 661 const MBinning *binsy = (MBinning*)plist.FindObject("Binning"+y); 662 if (!binsy) 663 { 664 gLog << inf << "Object 'Binning" << y << "' [MBinning] not found... no binning applied." << endl; 665 return kFALSE; 666 } 667 const MBinning *binsz = (MBinning*)plist.FindObject("Binning"+z); 668 if (!binsz) 669 { 670 gLog << inf << "Object 'Binning" << z << "' [MBinning] not found... no binning applied." << endl; 671 return kFALSE; 672 } 673 674 if (binsx->IsDefault() && binsy->IsDefault() && binsz->IsDefault()) 675 return kTRUE; 676 677 SetBinning(h, binsx, binsy, binsz); 678 return kTRUE; 679 } 680 621 681 void MH::FindGoodLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger) 622 682 { -
trunk/MagicSoft/Mars/mhbase/MH.h
r8047 r8657 80 80 static void RemoveFirstBin(TH1 &h); 81 81 82 static Bool_t ApplyBinning(const MParList &plist, TString name, TH1 *h); 82 static Bool_t ApplyBinning(const MParList &plist, TString x, TH1 *h); 83 static Bool_t ApplyBinning(const MParList &plist, TString x, TString y, TH2 *h); 84 static Bool_t ApplyBinning(const MParList &plist, TString x, TString y, TString z, TH3 *h); 83 85 84 86 static void ScaleArray(TArrayD &bins, Double_t f); -
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 -
trunk/MagicSoft/Mars/mjobs/MJCut.cc
r8646 r8657 618 618 MBinning bins6("BinningLength"); 619 619 MBinning bins7("BinningDist"); 620 MBinning bins8("Binning MaxDist");620 MBinning bins8("BinningSlope"); 621 621 MBinning bins9("BinningM3Long"); 622 MBinning bins0("BinningConc1"); 622 MBinning bins0("BinningM3Trans"); 623 MBinning binsa("BinningAsym"); 624 MBinning binsb("BinningConc1"); 623 625 plist.AddToList(&bins1); 624 626 plist.AddToList(&bins2); … … 631 633 plist.AddToList(&bins9); 632 634 plist.AddToList(&bins0); 635 plist.AddToList(&binsa); 636 plist.AddToList(&binsb); 633 637 //plist.AddToList(&binsT); 634 638 -
trunk/MagicSoft/Mars/mjtrain/MJTrainDisp.cc
r8656 r8657 189 189 // Run Disp optimization 190 190 // 191 Bool_t MJTrainDisp::Train Disp(const char *out, const MDataSet &set, Int_t num)191 Bool_t MJTrainDisp::Train(const char *out, const MDataSet &set, Int_t num) 192 192 { 193 193 SetTitle(Form("TrainDisp: %s", out)); -
trunk/MagicSoft/Mars/mpointing/MHSrcPosCam.cc
r8383 r8657 167 167 void MHSrcPosCam::Paint(Option_t *) 168 168 { 169 MH::SetPalette(" glow1", 99);169 MH::SetPalette("pretty", 99); 170 170 } 171 171 -
trunk/MagicSoft/Mars/mpointing/MSrcPosCam.h
r7804 r8657 27 27 void Add(const TVector2 &v); 28 28 29 Float_t GetDist() const { return TMath::Hypot(fX, fY); } 30 29 31 Float_t GetX() const { return fX; } 30 32 Float_t GetY() const { return fY; }
Note:
See TracChangeset
for help on using the changeset viewer.