Changeset 1207 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 01/21/02 22:09:45 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MH.cc
r1205 r1207 222 222 } 223 223 224 void MH::SetBinning(TH1 *h, TH1 *x) 225 { 226 SetBinning(h, x->GetXaxis(), x->GetYaxis(), x->GetZaxis()); 227 } -
trunk/MagicSoft/Mars/mhist/MH.h
r1205 r1207 7 7 8 8 class TH1; 9 class TAxis; 10 class TArrayD; 11 class TCanvas; 12 9 13 class MBinning; 10 14 class MParList; 11 class TArrayD;12 class TAxis;13 14 class TCanvas;15 15 16 16 class MH : public MParContainer … … 39 39 static void SetBinning(TH1 *h, const TAxis *binsx, const TAxis *binsy, const TAxis *binsz); 40 40 41 static void SetBinning(TH1 *h, TH1 *x); 42 41 43 ClassDef(MH, 1) //A histogram base class for Mars histograms 42 44 }; -
trunk/MagicSoft/Mars/mhist/MHHillas.cc
r1205 r1207 1 <<<<<<< MHHillas.cc2 1 /* ======================================================================== *\ 3 2 ! … … 19 18 ! Author(s): Thomas Bretz 2001 <mailto:tbretz@uni-sw.gwdg.de> 20 19 ! 21 ! Copyright: MAGIC Software Development, 2000-200 120 ! Copyright: MAGIC Software Development, 2000-2002 22 21 ! 23 22 ! 24 23 \* ======================================================================== */ 25 24 26 /////////////////////////////////////////////////////////////////////// 25 ///////////////////////////////////////////////////////////////////////////// 27 26 // 28 27 // MHHillas … … 30 29 // This class contains histograms for every Hillas parameter 31 30 // 32 /////////////////////////////////////////////////////////////////////// 31 ///////////////////////////////////////////////////////////////////////////// 33 32 34 33 #include "MHHillas.h" … … 46 45 // -------------------------------------------------------------------------- 47 46 // 48 // Setup four histograms for Alpha, Width, Length and Dist47 // Setup four histograms for Width, Length 49 48 // 50 49 MHHillas::MHHillas (const char *name, const char *title) … … 61 60 // connect all the histogram with the container fHist 62 61 // 63 fAlpha = new TH1F("Alpha [deg]", "Alpha of Hillas", 90, 0, 90);64 62 fWidth = new TH1F("Width [mm]", "Width of Hillas", 100, 0, 300); 65 63 fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300); 66 fDist = new TH1F("Dist [mm]", "Dist of Hillas", 100, 0, 300);67 64 68 fAlpha->SetDirectory(NULL);69 65 fLength->SetDirectory(NULL); 70 fDist->SetDirectory(NULL);71 66 fWidth->SetDirectory(NULL); 72 67 73 fAlpha->GetXaxis()->SetTitle("\\alpha [\\circ]");74 68 fLength->GetXaxis()->SetTitle("Length [mm]"); 75 fDist->GetXaxis()->SetTitle("Dist [mm]");76 69 fWidth->GetXaxis()->SetTitle("Width [mm]"); 77 70 78 fAlpha->GetYaxis()->SetTitle("Counts");79 71 fLength->GetYaxis()->SetTitle("Counts"); 80 fDist->GetYaxis()->SetTitle("Counts");81 72 fWidth->GetYaxis()->SetTitle("Counts"); 82 73 } … … 88 79 MHHillas::~MHHillas() 89 80 { 90 delete fAlpha;91 81 delete fWidth; 92 82 delete fLength; 93 delete fDist;94 83 } 95 84 … … 103 92 const MHillas &h = *(MHillas*)par; 104 93 105 fAlpha ->Fill(fabs(h.GetAlpha()));106 94 fWidth ->Fill(h.GetWidth()); 107 95 fLength->Fill(h.GetLength()); 108 fDist ->Fill(h.GetDist());109 96 110 97 return kTRUE; … … 121 108 TObject *MHHillas::DrawClone(Option_t *opt) const 122 109 { 123 TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters"); 124 c->Divide(2, 2); 110 TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters", 111 350, 500); 112 c->Divide(1, 2); 125 113 126 114 gROOT->SetSelectedPad(NULL); … … 130 118 // 131 119 c->cd(1); 132 f Alpha->DrawCopy();120 fLength->DrawCopy(); 133 121 134 122 c->cd(2); 135 fLength->DrawCopy();136 137 c->cd(3);138 fDist->DrawCopy();139 140 c->cd(4);141 123 fWidth->DrawCopy(); 142 124 … … 156 138 { 157 139 if (!gPad) 158 MakeDefCanvas("Hillas", "Histograms of Hillas Parameters" );140 MakeDefCanvas("Hillas", "Histograms of Hillas Parameters", 350, 500); 159 141 160 gPad->Divide( 2,2);142 gPad->Divide(1, 2); 161 143 162 144 gPad->cd(1); 163 f Alpha->Draw();145 fLength->Draw(); 164 146 165 147 gPad->cd(2); 166 fLength->Draw();167 168 gPad->cd(3);169 fDist->Draw();170 171 gPad->cd(4);172 148 fWidth->Draw(); 173 149 -
trunk/MagicSoft/Mars/mhist/MHHillas.h
r1203 r1207 19 19 ~MHHillas(); 20 20 21 voidFill(const MParContainer *par);21 Bool_t Fill(const MParContainer *par); 22 22 23 23 TH1F *GetHistWidth() { return fWidth; } -
trunk/MagicSoft/Mars/mhist/MHStarMap.cc
r1205 r1207 1 <<<<<<< MHStarMap.cc2 1 /* ======================================================================== *\ 3 2 ! … … 48 47 // Create the star map histogram 49 48 // 50 MHStarMap::MHStarMap 49 MHStarMap::MHStarMap(const char *name, const char *title) 51 50 { 52 51 // … … 73 72 fStarMap->SetDirectory(NULL); 74 73 75 fStarMap->SetXTitle("x /mm");76 fStarMap->SetYTitle("y /mm");74 fStarMap->SetXTitle("x [mm]"); 75 fStarMap->SetYTitle("y [mm]"); 77 76 fStarMap->SetZTitle("Counts"); 78 77 } … … 96 95 const MHillas &h = *(MHillas*)par; 97 96 98 const float dist = h.GetDist(); 99 const float theta = h.GetTheta(); 100 const float alpha = h.GetAlpha()/kRad2Deg; 101 102 const float m = tan(theta+alpha-kPI); 103 const float t = dist*(sin(theta)-cos(theta)*m); 97 const float delta = h.GetDelta(); 98 99 const float m = tan(delta); 100 const float t = m*h.GetMeanX()-h.GetMeanY(); 104 101 105 102 if (m>-1 && m<1) … … 214 211 gPad->Update(); 215 212 } 216 -
trunk/MagicSoft/Mars/mhist/MHStarMap.h
r1203 r1207 23 23 ~MHStarMap(); 24 24 25 voidFill(const MParContainer *par);25 Bool_t Fill(const MParContainer *par); 26 26 27 27 TH2F *GetHist() { return fStarMap; }
Note:
See TracChangeset
for help on using the changeset viewer.