Changeset 1203 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 01/21/02 20:52:12 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/HistLinkDef.h
r1015 r1203 11 11 #pragma link C++ class MHFadcPix+; 12 12 #pragma link C++ class MHHillas+; 13 #pragma link C++ class MHHillasSrc+; 13 14 #pragma link C++ class MHStarMap+; 14 15 #pragma link C++ class MHMcEnergy+; -
trunk/MagicSoft/Mars/mhist/MHHillas.cc
r1082 r1203 45 45 // -------------------------------------------------------------------------- 46 46 // 47 // Setup four histograms for Alpha, Width, Length and Dist47 // Setup four histograms for Width, Length 48 48 // 49 49 MHHillas::MHHillas (const char *name, const char *title) … … 60 60 // connect all the histogram with the container fHist 61 61 // 62 fAlpha = new TH1F("Alpha [deg]", "Alpha of Hillas", 90, 0, 90);63 62 fWidth = new TH1F("Width [mm]", "Width of Hillas", 100, 0, 300); 64 63 fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300); 65 fDist = new TH1F("Dist [mm]", "Dist of Hillas", 100, 0, 300);66 64 67 fAlpha->SetDirectory(NULL);68 65 fLength->SetDirectory(NULL); 69 fDist->SetDirectory(NULL);70 66 fWidth->SetDirectory(NULL); 71 67 72 fAlpha->GetXaxis()->SetTitle("\\alpha [\\circ]");73 68 fLength->GetXaxis()->SetTitle("Length [mm]"); 74 fDist->GetXaxis()->SetTitle("Dist [mm]");75 69 fWidth->GetXaxis()->SetTitle("Width [mm]"); 76 70 77 fAlpha->GetYaxis()->SetTitle("Counts");78 71 fLength->GetYaxis()->SetTitle("Counts"); 79 fDist->GetYaxis()->SetTitle("Counts");80 72 fWidth->GetYaxis()->SetTitle("Counts"); 81 73 } … … 87 79 MHHillas::~MHHillas() 88 80 { 89 delete fAlpha;90 81 delete fWidth; 91 82 delete fLength; 92 delete fDist;93 83 } 94 84 … … 102 92 const MHillas &h = *(MHillas*)par; 103 93 104 fAlpha ->Fill(fabs(h.GetAlpha()));105 94 fWidth ->Fill(h.GetWidth()); 106 95 fLength->Fill(h.GetLength()); 107 fDist ->Fill(h.GetDist());108 96 } 109 97 … … 118 106 TObject *MHHillas::DrawClone(Option_t *opt) const 119 107 { 120 TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters"); 121 c->Divide(2, 2); 108 TCanvas *c = MakeDefCanvas("Hillas", "Histograms of Hillas Parameters", 109 350, 500); 110 c->Divide(1, 2); 122 111 123 112 gROOT->SetSelectedPad(NULL); … … 127 116 // 128 117 c->cd(1); 129 f Alpha->DrawCopy();118 fLength->DrawCopy(); 130 119 131 120 c->cd(2); 132 fLength->DrawCopy();133 134 c->cd(3);135 fDist->DrawCopy();136 137 c->cd(4);138 121 fWidth->DrawCopy(); 139 122 … … 153 136 { 154 137 if (!gPad) 155 MakeDefCanvas("Hillas", "Histograms of Hillas Parameters" );138 MakeDefCanvas("Hillas", "Histograms of Hillas Parameters", 350, 500); 156 139 157 gPad->Divide( 2,2);140 gPad->Divide(1, 2); 158 141 159 142 gPad->cd(1); 160 f Alpha->Draw();143 fLength->Draw(); 161 144 162 145 gPad->cd(2); 163 fLength->Draw();164 165 gPad->cd(3);166 fDist->Draw();167 168 gPad->cd(4);169 146 fWidth->Draw(); 170 147 -
trunk/MagicSoft/Mars/mhist/MHHillas.h
r1015 r1203 12 12 { 13 13 private: 14 TH1F *fAlpha;15 14 TH1F *fWidth; 16 15 TH1F *fLength; 17 TH1F *fDist;18 16 19 17 public: 20 18 MHHillas(const char *name=NULL, const char *title=NULL); 21 19 ~MHHillas(); 22 20 23 21 void Fill(const MParContainer *par); 24 22 25 TH1F *GetHistAlpha() { return fAlpha; }26 23 TH1F *GetHistWidth() { return fWidth; } 27 24 TH1F *GetHistLength() { return fLength; } 28 TH1F *GetHistDist() { return fDist; }29 25 30 26 void Draw(Option_t *opt=NULL); … … 35 31 36 32 #endif 37 -
trunk/MagicSoft/Mars/mhist/MHStarMap.cc
r1082 r1203 47 47 // Create the star map histogram 48 48 // 49 MHStarMap::MHStarMap 49 MHStarMap::MHStarMap(const char *name, const char *title) 50 50 { 51 51 // … … 72 72 fStarMap->SetDirectory(NULL); 73 73 74 fStarMap->SetXTitle("x /mm");75 fStarMap->SetYTitle("y /mm");74 fStarMap->SetXTitle("x [mm]"); 75 fStarMap->SetYTitle("y [mm]"); 76 76 fStarMap->SetZTitle("Counts"); 77 77 } … … 95 95 const MHillas &h = *(MHillas*)par; 96 96 97 const float dist = h.GetDist(); 98 const float theta = h.GetTheta(); 99 const float alpha = h.GetAlpha()/kRad2Deg; 100 101 const float m = tan(theta+alpha-kPI); 102 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(); 103 101 104 102 if (m>-1 && m<1) … … 211 209 gPad->Update(); 212 210 } 213 -
trunk/MagicSoft/Mars/mhist/MHStarMap.h
r1015 r1203 20 20 21 21 public: 22 22 MHStarMap(const char *name=NULL, const char *title=NULL); 23 23 ~MHStarMap(); 24 24 … … 34 34 35 35 #endif 36 -
trunk/MagicSoft/Mars/mhist/Makefile
r1052 r1203 30 30 SRCFILES = MFillH.cc \ 31 31 MH.cc \ 32 32 MHFadcPix.cc \ 33 33 MHFadcCam.cc \ 34 34 MHHillas.cc \ 35 MHHillasSrc.cc \ 35 36 MHStarMap.cc \ 36 37 MHMcCollectionArea.cc \ … … 53 54 54 55 # @endcode 55
Note:
See TracChangeset
for help on using the changeset viewer.