Changeset 1216 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 02/13/02 16:40:37 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHHillas.cc
r1210 r1216 39 39 #include <TCanvas.h> 40 40 41 #include "MLog.h" 42 #include "MLogManip.h" 43 44 #include "MGeomCam.h" 41 45 #include "MHillas.h" 42 46 #include "MParList.h" … … 49 53 // 50 54 MHHillas::MHHillas(const char *name, const char *title) 55 : fMm2Deg(1), fUseMmScale(kFALSE) 51 56 { 52 57 // … … 61 66 // connect all the histogram with the container fHist 62 67 // 63 fWidth = new TH1F("Width [mm]", "Width of Hillas", 100, 0, 300);64 fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);68 fWidth = new TH1F("Width", "Width of Ellipse", 100, 0, 300); 69 fLength = new TH1F("Length", "Length of Ellipse", 100, 0, 300); 65 70 66 71 fLength->SetDirectory(NULL); … … 89 94 // instances of MBinning (with the names 'BinningWidth' and 'BinningLength') 90 95 // are found in the parameter list 96 // Use this function if you want to set the conversion factor which 97 // is used to convert the mm-scale in the camera plain into the deg-scale 98 // used for histogram presentations. The conversion factor is part of 99 // the camera geometry. Please create a corresponding MGeomCam container. 91 100 // 92 101 Bool_t MHHillas::SetupFill(const MParList *plist) … … 94 103 const MBinning* binsw = (MBinning*)plist->FindObject("BinningWidth"); 95 104 const MBinning* binsl = (MBinning*)plist->FindObject("BinningLength"); 96 97 if (binsw) 98 SetBinning(fWidth, binsw); 99 100 if (binsl) 101 SetBinning(fLength, binsl); 105 if (!binsw || !binsl) 106 { 107 *fLog << err << dbginf << "At least one MBinning not found... aborting." << endl; 108 return kFALSE; 109 } 110 111 SetBinning(fWidth, binsw); 112 SetBinning(fLength, binsl); 113 114 const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); 115 if (!geom) 116 { 117 *fLog << warn << dbginf << "No Camera Geometry available. Using mm-scale for histograms." << endl; 118 return kTRUE; 119 } 120 121 fLength->GetXaxis()->SetTitle("Length [\\circ]"); 122 fWidth->GetXaxis()->SetTitle("Width [\\circ]"); 123 124 fMm2Deg = geom->GetConvMm2Deg(); 102 125 103 126 return kTRUE; … … 113 136 const MHillas &h = *(MHillas*)par; 114 137 115 fWidth ->Fill(h.GetWidth()); 116 fLength->Fill(h.GetLength()); 138 if (fUseMmScale) 139 { 140 fWidth ->Fill(h.GetWidth()); 141 fLength->Fill(h.GetLength()); 142 } 143 else 144 { 145 fWidth ->Fill(fMm2Deg*h.GetWidth()); 146 fLength->Fill(fMm2Deg*h.GetLength()); 147 } 117 148 118 149 return kTRUE; -
trunk/MagicSoft/Mars/mhist/MHHillas.h
r1210 r1216 15 15 TH1F *fLength; 16 16 17 Float_t fMm2Deg; 18 19 Bool_t fUseMmScale; 20 17 21 public: 18 22 MHHillas(const char *name=NULL, const char *title=NULL); 19 23 ~MHHillas(); 24 25 void SetMmScale(Bool_t mmscale=kTRUE) { fUseMmScale = mmscale; } 20 26 21 27 Bool_t SetupFill(const MParList *pList); -
trunk/MagicSoft/Mars/mhist/MHHillasSrc.cc
r1210 r1216 38 38 #include <TCanvas.h> 39 39 40 #include "MLog.h" 41 #include "MLogManip.h" 42 43 #include "MGeomCam.h" 44 40 45 #include "MParList.h" 41 46 … … 62 67 // connect all the histogram with the container fHist 63 68 // 64 fAlpha = new TH1F("Alpha [deg]", "Alpha of Hillas", 90, 0, 90);65 fDist = new TH1F("Dist [mm]", "Dist of Hillas", 100, 0, 600);69 fAlpha = new TH1F("Alpha", "Alpha of Ellipse", 90, 0, 90); 70 fDist = new TH1F("Dist", "Dist of Ellipse", 100, 0, 600); 66 71 67 72 fAlpha->SetDirectory(NULL); … … 90 95 // instances of MBinning (with the names 'BinningAlpha' and 'BinningDist') 91 96 // are found in the parameter list 97 // Use this function if you want to set the conversion factor which 98 // is used to convert the mm-scale in the camera plain into the deg-scale 99 // used for histogram presentations. The conversion factor is part of 100 // the camera geometry. Please create a corresponding MGeomCam container. 92 101 // 93 102 Bool_t MHHillasSrc::SetupFill(const MParList *plist) … … 95 104 const MBinning* binsa = (MBinning*)plist->FindObject("BinningAlpha"); 96 105 const MBinning* binsd = (MBinning*)plist->FindObject("BinningDist"); 97 98 if (binsa) 99 SetBinning(fAlpha, binsa); 100 101 if (binsd) 102 SetBinning(fDist, binsd); 106 if (!binsa || !binsd) 107 { 108 *fLog << err << dbginf << "At least one MBinning not found... aborting." << endl; 109 return kFALSE; 110 } 111 112 SetBinning(fAlpha, binsa); 113 SetBinning(fDist, binsd); 114 115 const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); 116 if (!geom) 117 { 118 *fLog << warn << dbginf << "No Camera Geometry available. Using mm-scale for histograms." << endl; 119 return kTRUE; 120 } 121 122 fDist->GetXaxis()->SetTitle("Dist [\\circ]"); 123 124 fMm2Deg = geom->GetConvMm2Deg(); 103 125 104 126 return kTRUE; … … 115 137 116 138 fAlpha->Fill(fabs(h.GetAlpha())); 117 fDist ->Fill( h.GetDist());139 fDist ->Fill(fUseMmScale ? h.GetDist() : fMm2Deg*h.GetDist()); 118 140 119 141 return kTRUE; -
trunk/MagicSoft/Mars/mhist/MHHillasSrc.h
r1210 r1216 15 15 TH1F *fDist; 16 16 17 Float_t fMm2Deg; 18 Bool_t fUseMmScale; 19 17 20 public: 18 21 MHHillasSrc(const char *name=NULL, const char *title=NULL); 19 22 ~MHHillasSrc(); 23 24 void SetUseMmScale(Bool_t mmscale=kTRUE) { fUseMmScale = mmscale; } 20 25 21 26 Bool_t SetupFill(const MParList *pList); -
trunk/MagicSoft/Mars/mhist/Makefile
r1211 r1216 22 22 # connect the include files defined in the config.mk file 23 23 # 24 INCLUDES = -I. -I../mbase -I../mraw -I../manalysis -I../mmc 24 INCLUDES = -I. -I../mbase -I../mraw -I../manalysis -I../mmc -I../mgui 25 25 26 26 #------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.