Changeset 9341 for trunk/MagicSoft/Mars/mimage
- Timestamp:
- 02/15/09 15:44:45 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mimage
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mimage/MHNewImagePar2.h
r9340 r9341 20 20 TH1F fHistBorder2; // 21 21 22 Float_t fMm2Deg;23 Bool_t fUseMmScale;24 25 22 public: 26 23 MHNewImagePar2(const char *name=NULL, const char *title=NULL); -
trunk/MagicSoft/Mars/mimage/MHVsSize.cc
r9153 r9341 59 59 // 60 60 MHVsSize::MHVsSize(const char *name, const char *title) 61 : f Hillas(NULL), fHillasExt(NULL), fNewImagePar(NULL), fMm2Deg(1), fUseMmScale(kTRUE)61 : fGeom(0), fHillas(0), fHillasExt(0), fNewImagePar(0) 62 62 { 63 63 // … … 88 88 fM3Long.SetXTitle("Size [phe]"); 89 89 90 fLength.SetYTitle("Length [ mm]");91 fWidth.SetYTitle("Width [ mm]");92 fDist.SetYTitle("Distance [ mm]");90 fLength.SetYTitle("Length [\\circ]"); 91 fWidth.SetYTitle("Width [\\circ]"); 92 fDist.SetYTitle("Distance [\\circ]"); 93 93 fConc1.SetYTitle("Conc1 [ratio]"); 94 fArea.SetYTitle(" Conc1 [mm^{2}]");95 fM3Long.SetYTitle("M3Long [ mm]");94 fArea.SetYTitle("Area [\\circ^{2}]"); 95 fM3Long.SetYTitle("M3Long [\\circ]"); 96 96 97 97 MBinning binse, binsl, binsd, binsc, binsa, binsm; 98 98 binse.SetEdgesLog( 50, 10, 1e5); 99 binsl.SetEdges( 100, 0, 296.7/2);100 binsd.SetEdges( 100, 0, 600);99 binsl.SetEdges( 100, 0, 0.5); 100 binsd.SetEdges( 100, 0, 2.0); 101 101 binsc.SetEdgesLog(100, 3e-3, 1); 102 binsa.SetEdges( 100, 0, 445*45);103 binsm.SetEdges( 100, - 445, 445);102 binsa.SetEdges( 100, 0, 0.25); 103 binsm.SetEdges( 100, -1.5, 1.5); 104 104 105 105 MH::SetBinning(&fLength, &binse, &binsl); … … 130 130 Bool_t MHVsSize::SetupFill(const MParList *plist) 131 131 { 132 MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); 133 if (!geom) 134 *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl; 135 else 136 { 137 fMm2Deg = geom->GetConvMm2Deg(); 138 SetMmScale(kFALSE); 132 fGeom = (MGeomCam*)plist->FindObject("MGeomCam"); 133 if (!fGeom) 134 { 135 *fLog << err << "MGeomCam not found... abort." << endl; 136 return kFALSE; 139 137 } 140 138 … … 173 171 // -------------------------------------------------------------------------- 174 172 // 175 // Use this function to setup your own conversion factor between degrees176 // and millimeters. The conversion factor should be the one calculated in177 // MGeomCam. Use this function with Caution: You could create wrong values178 // by setting up your own scale factor.179 //180 void MHVsSize::SetMm2Deg(Float_t mmdeg)181 {182 if (mmdeg<0)183 {184 *fLog << warn << dbginf << "Warning - Conversion factor < 0 - nonsense. Ignored." << endl;185 return;186 }187 188 if (fMm2Deg>=0)189 *fLog << warn << dbginf << "Warning - Conversion factor already set. Overwriting" << endl;190 191 fMm2Deg = mmdeg;192 }193 194 // --------------------------------------------------------------------------195 //196 // With this function you can convert the histogram ('on the fly') between197 // degrees and millimeters.198 //199 void MHVsSize::SetMmScale(Bool_t mmscale)200 {201 if (fUseMmScale == mmscale)202 return;203 204 if (fMm2Deg<0)205 {206 *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl;207 return;208 }209 210 const Double_t scale = mmscale ? 1./fMm2Deg : fMm2Deg;211 MH::ScaleAxis(&fLength, 1, scale);212 MH::ScaleAxis(&fWidth, 1, scale);213 MH::ScaleAxis(&fDist, 1, scale);214 MH::ScaleAxis(&fM3Long, 1, scale);215 MH::ScaleAxis(&fArea, 1, scale*scale);216 217 if (mmscale)218 {219 fLength.SetYTitle("Length [mm]");220 fWidth.SetYTitle("Width [mm]");221 fDist.SetYTitle("Distance [mm]");222 fArea.SetYTitle("Area [mm^{2}]");223 fM3Long.SetYTitle("M3Long [mm]");224 }225 else226 {227 fLength.SetYTitle("Length [\\circ]");228 fWidth.SetYTitle("Width [\\circ]");229 fDist.SetYTitle("Distance [\\circ]");230 fArea.SetYTitle("Area [\\circ^{2}]");231 fM3Long.SetYTitle("M3Long [\\circ]");232 }233 234 fUseMmScale = mmscale;235 }236 237 // --------------------------------------------------------------------------238 //239 173 // Fill the histograms with data from a MHillas-Container. 240 174 // Be careful: Only call this with an object of type MHillas … … 249 183 } 250 184 251 const Double_t scale = f UseMmScale ? 1 : fMm2Deg;185 const Double_t scale = fGeom->GetConvMm2Deg(); 252 186 253 187 fLength.Fill(fHillas->GetSize(), scale*fHillas->GetLength(), w); -
trunk/MagicSoft/Mars/mimage/MHVsSize.h
r9153 r9341 10 10 #endif 11 11 12 class MGeomCam; 12 13 class MHillas; 13 14 class MHillasExt; … … 17 18 { 18 19 private: 20 MGeomCam *fGeom; //! Conversion from mm to deg 19 21 MHillas *fHillas; //! 20 22 MHillasExt *fHillasExt; //! … … 30 32 TH2F fArea; // 31 33 32 Float_t fMm2Deg;33 Bool_t fUseMmScale;34 35 34 public: 36 35 MHVsSize(const char *name=NULL, const char *title=NULL); 37 38 void SetMmScale(Bool_t mmscale=kTRUE);39 virtual void SetMm2Deg(Float_t mmdeg);40 36 41 37 Bool_t SetupFill(const MParList *pList);
Note:
See TracChangeset
for help on using the changeset viewer.