Changeset 9341 for trunk/MagicSoft
- Timestamp:
- 02/15/09 15:44:45 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9336 r9341 19 19 -*-*- END OF LINE -*-*- 20 20 2009/02/15 Thomas Bretz 21 22 * mpointing/MHSrcPosCam.[h,cc], mpointing/MSrcPosRndm.[h,cc], 23 mfilter/MFMagicCuts.[h,cc], mmuon/MHMuonPar.[h,cc], 24 mhflux/MHThetaSqN.[h,cc]: 25 - support changing geometries (conversion factors) reading 26 a new geometry from a run header 27 28 * mimage/MHVsSize.[h,cc], mimage/MHNewImagePar.[h,cc], 29 mimage/MHHillasSrc.[h,cc], mimage/MHHillasExt.[h,cc], 30 mimage/MHHillas.[h,cc], mimage/MNewImagePar2.[h,cc]: 31 - removed option to set conversion factor manually 32 - support changing geometries (conversion factors) reading 33 a new geometry from a run header 34 35 * mhflux/MMcSpectrumWeight.cc: 36 - replaced Form by MString::Format 37 - made sure that nobody is mixing different energy-range monte 38 carlos and normalizes by integral (to be implemented) 39 40 * manalysis/MMcCalibrationUpdate.cc: 41 - switched off file Ceres files (this might only be temporary 42 but it makes the display work quite well even without 43 calibrated units. 21 44 22 45 * mjobs/MJCalibrateSignal.cc: -
trunk/MagicSoft/Mars/mhflux/MHThetaSqN.cc
r9153 r9341 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHThetaSqN.cc,v 1.1 0 2008-11-11 11:42:14tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHThetaSqN.cc,v 1.11 2009-02-15 15:43:30 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 167 167 } 168 168 169 MGeomCam *geom = (MGeomCam*)pl->FindObject("MGeomCam");170 if (! geom)169 fGeom = (MGeomCam*)pl->FindObject("MGeomCam"); 170 if (!fGeom) 171 171 { 172 172 *fLog << err << "MGeomCam not found... abort." << endl; 173 173 return kFALSE; 174 174 } 175 fMm2Deg = geom->GetConvMm2Deg();176 175 177 176 if (fFit.GetScaleMode()==MAlphaFitter::kNone) … … 217 216 Int_t MHThetaSqN::Fill(const MParContainer *par, const Stat_t weight) 218 217 { 218 const Double_t fMm2Deg = fGeom->GetConvMm2Deg(); 219 219 220 const TVector2 norm(GetVec(fHillas->GetNormAxis(), 6)); 220 221 const TVector2 mean(GetVec(fHillas->GetMean(), 8)); -
trunk/MagicSoft/Mars/mhflux/MHThetaSqN.h
r9153 r9341 8 8 class TVector2; 9 9 10 class MGeomCam; 10 11 class MTaskList; 11 12 class MSrcPosCam; … … 14 15 { 15 16 private: 17 MGeomCam *fGeom; //! conversion mm to deg 16 18 MParameterD *fDisp; //! 17 19 MSrcPosCam *fSrcPosCam; //! 18 20 19 Double_t fMm2Deg; //!20 21 Double_t fThetaSqCut; //! 21 22 Double_t fSignificanceCutLevel; -
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.