- Timestamp:
- 02/15/09 15:41:15 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mimage
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mimage/MHHillas.cc
r9271 r9340 61 61 // 62 62 MHHillas::MHHillas(const char *name, const char *title) 63 : fGeomCam(0) , fMm2Deg(1), fUseMmScale(kTRUE)63 : fGeomCam(0) 64 64 { 65 65 // … … 81 81 fDelta->SetDirectory(NULL); 82 82 83 fLength->SetXTitle("Length [ mm]");84 fWidth->SetXTitle("Width [ mm]");85 fDistC->SetXTitle("Distance [ mm]");83 fLength->SetXTitle("Length [\\circ]"); 84 fWidth->SetXTitle("Width [\\circ]"); 85 fDistC->SetXTitle("Distance [\\circ]"); 86 86 fDelta->SetXTitle("Delta [\\circ]"); 87 87 … … 146 146 fGeomCam = (MGeomCam*)plist->FindObject("MGeomCam"); 147 147 if (!fGeomCam) 148 *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl; 149 else 150 { 151 fMm2Deg = fGeomCam->GetConvMm2Deg(); 152 SetMmScale(kFALSE); 153 } 148 { 149 *fLog << err << "MGeomCam not found... abort." << endl; 150 return kFALSE; 151 } 152 154 153 155 154 ApplyBinning(*plist, "Width", fWidth); … … 162 161 if (!bins) 163 162 { 164 float r = fGeomCam ? fGeomCam->GetMaxRadius() : 600; 165 if (!fUseMmScale) 166 r *= fMm2Deg; 163 const Float_t r = fGeomCam->GetMaxRadius()*fGeomCam->GetConvMm2Deg(); 167 164 168 165 MBinning b; … … 179 176 // -------------------------------------------------------------------------- 180 177 // 181 // Use this function to setup your own conversion factor between degrees182 // and millimeters. The conversion factor should be the one calculated in183 // MGeomCam. Use this function with Caution: You could create wrong values184 // by setting up your own scale factor.185 //186 void MHHillas::SetMm2Deg(Float_t mmdeg)187 {188 if (mmdeg<0)189 {190 *fLog << warn << dbginf << "Warning - Conversion factor < 0 - nonsense. Ignored." << endl;191 return;192 }193 194 if (fMm2Deg>=0)195 *fLog << warn << dbginf << "Warning - Conversion factor already set. Overwriting" << endl;196 197 fMm2Deg = mmdeg;198 }199 200 // --------------------------------------------------------------------------201 //202 // With this function you can convert the histogram ('on the fly') between203 // degrees and millimeters.204 //205 void MHHillas::SetMmScale(Bool_t mmscale)206 {207 if (fUseMmScale == mmscale)208 return;209 210 if (fMm2Deg<0)211 {212 *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl;213 return;214 }215 216 const Double_t scale = mmscale ? 1./fMm2Deg : fMm2Deg;217 MH::ScaleAxis(fLength, scale);218 MH::ScaleAxis(fWidth, scale);219 MH::ScaleAxis(fDistC, scale);220 MH::ScaleAxis(fCenter, scale, scale);221 222 if (mmscale)223 {224 fLength->SetXTitle("Length [mm]");225 fWidth->SetXTitle("Width [mm]");226 fDistC->SetXTitle("Distance [mm]");227 fCenter->SetXTitle("x [mm]");228 fCenter->SetYTitle("y [mm]");229 }230 else231 {232 fLength->SetXTitle("Length [\\circ]");233 fWidth->SetXTitle("Width [\\circ]");234 fDistC->SetXTitle("Distance [\\circ]");235 fCenter->SetXTitle("x [\\circ]");236 fCenter->SetYTitle("y [\\circ]");237 }238 239 fUseMmScale = mmscale;240 }241 242 // --------------------------------------------------------------------------243 //244 178 // Fill the histograms with data from a MHillas-Container. 245 179 // Be careful: Only call this with an object of type MHillas … … 255 189 const MHillas &h = *(MHillas*)par; 256 190 257 const Double_t d = sqrt(h.GetMeanX()*h.GetMeanX() + h.GetMeanY()*h.GetMeanY()); 258 const Double_t scale = fUseMmScale ? 1 : fMm2Deg; 191 const Double_t scale = fGeomCam->GetConvMm2Deg(); 259 192 260 193 fLength->Fill(scale*h.GetLength(), w); 261 194 fWidth ->Fill(scale*h.GetWidth(), w); 262 fDistC ->Fill(scale* d, w);195 fDistC ->Fill(scale*h.GetDist0(), w); 263 196 fCenter->Fill(scale*h.GetMeanX(), scale*h.GetMeanY(), w); 264 197 fDelta ->Fill(kRad2Deg*h.GetDelta(), w); -
trunk/MagicSoft/Mars/mimage/MHHillas.h
r9153 r9340 14 14 { 15 15 private: 16 MGeomCam *fGeomCam; //! Camera geometry for plots (for the moment this is a feature for a loop only!) 16 17 17 18 TH1F *fLength; //-> Length … … 24 25 TH2F *fCenter; //-> Center 25 26 26 MGeomCam *fGeomCam; //! Camera geometry for plots (for the moment this is a feature for a loop only!)27 28 Float_t fMm2Deg;29 Bool_t fUseMmScale;30 31 27 void Paint(Option_t *opt=""); 32 28 … … 34 30 MHHillas(const char *name=NULL, const char *title=NULL); 35 31 ~MHHillas(); 36 37 void SetMmScale(Bool_t mmscale=kTRUE);38 virtual void SetMm2Deg(Float_t mmdeg);39 32 40 33 Bool_t SetupFill(const MParList *pList); -
trunk/MagicSoft/Mars/mimage/MHHillasExt.cc
r9153 r9340 65 65 // 66 66 MHHillasExt::MHHillasExt(const char *name, const char *title) 67 : fHillas(0), fHillasExt(0), fMm2Deg(1), 68 fUseMmScale(kTRUE), fHilName("MHillasExt") 67 : fGeom(0), fHillas(0), fHillasExt(0), fHilName("MHillasExt") 69 68 { 70 69 // … … 94 93 fHSlopeL.SetTitle("Longitudinal time-slope vs. Dist"); 95 94 96 fHAsym.SetXTitle("Asym [ mm]");97 fHM3Long.SetXTitle("3^{rd} M_{l} [ mm]");98 fHM3Trans.SetXTitle("3^{rd} M_{t} [ mm]");99 fHSlopeL.SetXTitle("D [ mm]");95 fHAsym.SetXTitle("Asym [\\circ]"); 96 fHM3Long.SetXTitle("3^{rd} M_{l} [\\circ]"); 97 fHM3Trans.SetXTitle("3^{rd} M_{t} [\\circ]"); 98 fHSlopeL.SetXTitle("D [\\circ]"); 100 99 101 100 fHAsym.SetYTitle("Counts"); 102 101 fHM3Long.SetYTitle("Counts"); 103 102 fHM3Trans.SetYTitle("Counts"); 104 fHSlopeL.SetYTitle("S_{l} [ns/ mm]");103 fHSlopeL.SetYTitle("S_{l} [ns/\\circ]"); 105 104 106 105 fHAsym.SetFillStyle(4000); … … 156 155 } 157 156 158 const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); 159 if (!geom) 160 *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl; 161 else 162 { 163 fMm2Deg = geom->GetConvMm2Deg(); 164 SetMmScale(kFALSE); 157 fGeom = (MGeomCam*)plist->FindObject("MGeomCam"); 158 if (!fGeom) 159 { 160 *fLog << err << "MGeomCam not found... abort." << endl; 161 return kFALSE; 165 162 } 166 163 … … 182 179 const MHillasSrc *src = (MHillasSrc*)par; 183 180 184 const Double_t scale = TMath::Sign(f UseMmScale?1:fMm2Deg, (src ? src->GetCosDeltaAlpha() : 1));181 const Double_t scale = TMath::Sign(fGeom->GetConvMm2Deg(), (src ? src->GetCosDeltaAlpha() : 1)); 185 182 const Double_t dist = src ? src->GetDist() : fHillas->GetDist0(); 186 183 … … 191 188 192 189 return kTRUE; 193 }194 195 // --------------------------------------------------------------------------196 //197 // With this function you can convert the histogram ('on the fly') between198 // degrees and millimeters.199 //200 void MHHillasExt::SetMmScale(Bool_t mmscale)201 {202 if (fUseMmScale == mmscale)203 return;204 205 if (fMm2Deg<0)206 {207 *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl;208 return;209 }210 211 const Double_t scale = mmscale ? 1./fMm2Deg : fMm2Deg;212 MH::ScaleAxis(&fHAsym, scale);213 MH::ScaleAxis(&fHM3Long, scale);214 MH::ScaleAxis(&fHM3Trans, scale);215 MH::ScaleAxis(&fHSlopeL, scale, 1./scale);216 217 if (mmscale)218 {219 fHAsym.SetXTitle("Asym [mm]");220 fHM3Long.SetXTitle("3^{rd} M_{l} [mm]");221 fHM3Trans.SetXTitle("3^{rd} M_{t} [mm]");222 fHSlopeL.SetXTitle("D [mm]");223 fHSlopeL.SetYTitle("S_{l} [ns/mm]");224 }225 else226 {227 fHAsym.SetXTitle("Asym [\\circ]");228 fHM3Long.SetXTitle("3^{rd} M_{l} [\\circ]");229 fHM3Trans.SetXTitle("3^{rd} M_{t} [\\circ]");230 fHSlopeL.SetXTitle("D [\\circ]");231 fHSlopeL.SetYTitle("S_{l} [ns/\\circ]");232 }233 234 fUseMmScale = mmscale;235 }236 237 // --------------------------------------------------------------------------238 //239 // Use this function to setup your own conversion factor between degrees240 // and millimeters. The conversion factor should be the one calculated in241 // MGeomCam. Use this function with Caution: You could create wrong values242 // by setting up your own scale factor.243 //244 void MHHillasExt::SetMm2Deg(Float_t mmdeg)245 {246 if (mmdeg<0)247 {248 *fLog << warn << dbginf << "Warning - Conversion factor < 0 - nonsense. Ignored." << endl;249 return;250 }251 252 if (fMm2Deg>=0)253 *fLog << warn << dbginf << "Warning - Conversion factor already set. Overwriting" << endl;254 255 fMm2Deg = mmdeg;256 190 } 257 191 -
trunk/MagicSoft/Mars/mimage/MHHillasExt.h
r9153 r9340 9 9 #endif 10 10 11 class MGeomCam; 11 12 class MHillas; 12 13 class MHillasExt; … … 15 16 { 16 17 private: 18 MGeomCam *fGeom; //! conversion mm to deg 17 19 MHillas *fHillas; //! Pointer to the MHillas container 18 20 MHillasExt *fHillasExt; //! Pointer to the MHillasExt container … … 23 25 TH2F fHSlopeL; // 24 26 25 Float_t fMm2Deg;26 Bool_t fUseMmScale;27 28 27 TString fHilName; 29 28 … … 32 31 33 32 void SetHillasName(const char *name) { fHilName = name; } 34 35 void SetMmScale(Bool_t mmscale=kTRUE);36 virtual void SetMm2Deg(Float_t mmdeg);37 33 38 34 Bool_t SetupFill(const MParList *pList); -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc
r9153 r9340 56 56 // 57 57 MHHillasSrc::MHHillasSrc(const char *name, const char *title) 58 : f UseMmScale(kTRUE)58 : fGeom(0) 59 59 { 60 60 // … … 82 82 83 83 fAlpha->SetXTitle("\\alpha [\\circ]"); 84 fDist->SetXTitle("Dist [ mm]");84 fDist->SetXTitle("Dist [\\circ]"); 85 85 fCosDA->SetXTitle("cos(\\delta,\\alpha)"); 86 86 fDCA->SetXTitle("DCA [\\circ]"); … … 123 123 Bool_t MHHillasSrc::SetupFill(const MParList *plist) 124 124 { 125 const MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); 126 if (!geom) 127 *fLog << warn << dbginf << "No Camera Geometry available. Using mm-scale for histograms." << endl; 128 else 125 fGeom = (MGeomCam*)plist->FindObject("MGeomCam"); 126 if (!fGeom) 129 127 { 130 fMm2Deg = geom->GetConvMm2Deg();131 SetMmScale(kFALSE);128 *fLog << err << "MGeomCam not found... abort." << endl; 129 return kFALSE; 132 130 } 133 131 … … 155 153 const MHillasSrc &h = *(MHillasSrc*)par; 156 154 155 const Double_t scale = fGeom->GetConvMm2Deg(); 156 157 157 fAlpha->Fill(h.GetAlpha(), w); 158 fDist ->Fill( fUseMmScale ? h.GetDist() : fMm2Deg*h.GetDist(), w);158 fDist ->Fill(h.GetDist()*scale, w); 159 159 fCosDA->Fill(h.GetCosDeltaAlpha(), w); 160 fDCA ->Fill( fUseMmScale ? h.GetDCA() : fMm2Deg*h.GetDCA(), w);160 fDCA ->Fill(h.GetDCA()*scale, w); 161 161 fDCADelta->Fill(h.GetDCADelta(), w); 162 162 163 163 return kTRUE; 164 }165 166 // --------------------------------------------------------------------------167 //168 // Use this function to setup your own conversion factor between degrees169 // and millimeters. The conversion factor should be the one calculated in170 // MGeomCam. Use this function with Caution: You could create wrong values171 // by setting up your own scale factor.172 //173 void MHHillasSrc::SetMm2Deg(Float_t mmdeg)174 {175 if (mmdeg<=0)176 {177 *fLog << warn << dbginf << "Warning - Conversion factor <= 0 - nonsense. Ignored." << endl;178 return;179 }180 181 if (fMm2Deg>0)182 *fLog << warn << dbginf << "Warning - Conversion factor already set. Overwriting" << endl;183 184 fMm2Deg = mmdeg;185 }186 187 // --------------------------------------------------------------------------188 //189 // With this function you can convert the histogram ('on the fly') between190 // degrees and millimeters.191 //192 void MHHillasSrc::SetMmScale(Bool_t mmscale)193 {194 if (fUseMmScale == mmscale)195 return;196 197 if (fMm2Deg<0)198 {199 *fLog << warn << GetDescriptor() << ": Warning - Sorry, no conversion factor for conversion available." << endl;200 return;201 }202 203 const Double_t scale = mmscale ? 1./fMm2Deg : fMm2Deg;204 MH::ScaleAxis(fDist, scale);205 MH::ScaleAxis(fDCA, scale);206 207 fDist->SetXTitle(mmscale ? "Dist [mm]" : "Dist [\\circ]");208 fDCA ->SetXTitle(mmscale ? "DCA [mm]" : "DCA [\\circ]");209 210 fUseMmScale = mmscale;211 164 } 212 165 -
trunk/MagicSoft/Mars/mimage/MHHillasSrc.h
r9153 r9340 7 7 8 8 class TH1F; 9 class MGeomCam; 9 10 class MHillas; 10 11 … … 12 13 { 13 14 private: 15 MGeomCam *fGeom; //! conversion mm to deg 16 14 17 TH1F *fAlpha; //-> 15 18 TH1F *fDist; //-> … … 19 22 TH1F *fDCADelta; //-> 20 23 21 Float_t fMm2Deg;22 Bool_t fUseMmScale;23 24 24 public: 25 25 MHHillasSrc(const char *name=NULL, const char *title=NULL); 26 26 ~MHHillasSrc(); 27 28 void SetMmScale(Bool_t mmscale=kTRUE);29 void SetMm2Deg(Float_t mmdeg);30 27 31 28 Bool_t SetupFill(const MParList *pList); -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc
r9153 r9340 62 62 // 63 63 MHNewImagePar::MHNewImagePar(const char *name, const char *title) 64 : f Mm2Deg(1), fUseMmScale(kTRUE)64 : fGeom(0) 65 65 { 66 66 fName = name ? name : "MHNewImagePar"; … … 104 104 fHistUsedArea.SetName("UsedArea"); 105 105 fHistUsedArea.SetTitle("Area of used pixels"); 106 fHistUsedArea.SetXTitle("Area [ m^2]");106 fHistUsedArea.SetXTitle("Area [\\circ^{2}]"); 107 107 fHistUsedArea.SetYTitle("Counts"); 108 108 fHistUsedArea.SetDirectory(NULL); … … 113 113 fHistCoreArea.SetName("CoreArea"); 114 114 fHistCoreArea.SetTitle("Area of core pixels"); 115 fHistCoreArea.SetXTitle("Area [ m^2]");115 fHistCoreArea.SetXTitle("Area [\\circ^{2}]"); 116 116 fHistCoreArea.SetYTitle("Counts"); 117 117 fHistCoreArea.SetDirectory(NULL); … … 165 165 bins.Apply(fHistCorePix); 166 166 167 //bins.SetEdges(75, 0, 0.249); 168 //bins.Apply(fHistUsedArea); 169 //bins.Apply(fHistCoreArea); 167 MBinning b; 168 b.SetEdges(50, 0, 1.5); 169 b.Apply(fHistUsedArea); 170 b.Apply(fHistCoreArea); 170 171 } 171 172 … … 177 178 Bool_t MHNewImagePar::SetupFill(const MParList *plist) 178 179 { 179 MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); 180 if (!geom) 181 *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl; 182 else 180 fGeom = (MGeomCam*)plist->FindObject("MGeomCam"); 181 if (!fGeom) 183 182 { 184 fMm2Deg = geom->GetConvMm2Deg();185 SetMmScale(kFALSE);183 *fLog << err << "MGeomCam not found... abort." << endl; 184 return kFALSE; 186 185 } 187 186 188 187 const MBinning *bins = (MBinning*)plist->FindObject("BinningArea"); 189 if (!bins) 190 { 191 float r = geom ? 1.5 : 0.133; 192 193 MBinning b; 194 b.SetEdges(50, 0, r); 195 b.Apply(fHistUsedArea); 196 b.Apply(fHistCoreArea); 197 } 198 else 188 if (bins) 199 189 { 200 190 bins->Apply(fHistUsedArea); … … 232 222 } 233 223 234 const Double_t scale = f UseMmScale ? 1e-6 : fMm2Deg*fMm2Deg;224 const Double_t scale = fGeom->GetConvMm2Deg()*fGeom->GetConvMm2Deg(); 235 225 236 226 const MNewImagePar &h = *(MNewImagePar*)par; … … 251 241 252 242 return kTRUE; 253 }254 255 // --------------------------------------------------------------------------256 //257 // With this function you can convert the histogram ('on the fly') between258 // degrees and millimeters.259 //260 void MHNewImagePar::SetMmScale(Bool_t mmscale)261 {262 if (fUseMmScale == mmscale)263 return;264 265 if (fMm2Deg<0)266 {267 *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl;268 return;269 }270 271 const Double_t scale = mmscale ? 1./(fMm2Deg*fMm2Deg) : (fMm2Deg*fMm2Deg);272 MH::ScaleAxis(&fHistUsedArea, scale);273 MH::ScaleAxis(&fHistCoreArea, scale);274 275 if (mmscale)276 {277 fHistUsedArea.SetXTitle("A [m^{2}]");278 fHistCoreArea.SetXTitle("A [m^{2}]");279 }280 else281 {282 fHistUsedArea.SetXTitle("A [deg^{2}]");283 fHistCoreArea.SetXTitle("A [deg^{2}]");284 }285 286 fUseMmScale = mmscale;287 }288 289 // --------------------------------------------------------------------------290 //291 // Use this function to setup your own conversion factor between degrees292 // and millimeters. The conversion factor should be the one calculated in293 // MGeomCam. Use this function with Caution: You could create wrong values294 // by setting up your own scale factor.295 //296 void MHNewImagePar::SetMm2Deg(Float_t mmdeg)297 {298 if (mmdeg<0)299 {300 *fLog << warn << dbginf << "Warning - Conversion factor < 0 - nonsense. Ignored." << endl;301 return;302 }303 304 if (fMm2Deg>=0)305 *fLog << warn << dbginf << "Warning - Conversion factor already set. Overwriting" << endl;306 307 fMm2Deg = mmdeg;308 243 } 309 244 -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.h
r9153 r9340 9 9 #endif 10 10 11 class MGeomCam; 11 12 class MHillas; 12 13 … … 14 15 { 15 16 private: 17 MGeomCam *fGeom; //! Conversion from mm to deg 18 16 19 TH1F fHistLeakage1; // 17 20 TH1F fHistLeakage2; // … … 27 30 TH1F fHistConcCOG; // [ratio] concentration of the three pixels next to COG 28 31 TH1F fHistConcCore; // [ratio] concentration of signals inside or touching the ellipse 29 30 Float_t fMm2Deg;31 Bool_t fUseMmScale;32 32 33 33 public: … … 58 58 TH1F &GetHistConcCore() { return fHistConcCore; } 59 59 60 void SetMmScale(Bool_t mmscale=kTRUE);61 virtual void SetMm2Deg(Float_t mmdeg);62 63 60 void Draw(Option_t *opt=""); 64 61 void Paint(Option_t *opt=""); -
trunk/MagicSoft/Mars/mimage/MHNewImagePar2.cc
r9153 r9340 55 55 // 56 56 MHNewImagePar2::MHNewImagePar2(const char *name, const char *title) 57 : f Mm2Deg(1), fUseMmScale(kTRUE)57 : fGeom(0) 58 58 { 59 59 fName = name ? name : "MHNewImagePar2"; … … 62 62 fHistBorder1.SetName("Border1"); 63 63 fHistBorder1.SetTitle("Border Line of border pixels (pixel border)"); 64 fHistBorder1.SetXTitle("Border ");64 fHistBorder1.SetXTitle("Border [\\circ]]"); 65 65 fHistBorder1.SetYTitle("Counts"); 66 66 fHistBorder1.SetDirectory(NULL); … … 70 70 fHistBorder2.SetName("Border2"); 71 71 fHistBorder2.SetTitle("Border Line of border pixels (pixel center)"); 72 fHistBorder2.SetXTitle("Border ");72 fHistBorder2.SetXTitle("Border [\\circ]]"); 73 73 fHistBorder2.SetYTitle("Counts"); 74 74 fHistBorder2.SetDirectory(NULL); … … 85 85 Bool_t MHNewImagePar2::SetupFill(const MParList *plist) 86 86 { 87 MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); 88 if (!geom) 89 *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl; 90 else 87 fGeom = (MGeomCam*)plist->FindObject("MGeomCam"); 88 if (!fGeom) 91 89 { 92 fMm2Deg = geom->GetConvMm2Deg();93 SetMmScale(kFALSE);90 *fLog << err << "MGeomCam not found... abort." << endl; 91 return kFALSE; 94 92 } 95 93 … … 97 95 if (!bins) 98 96 { 99 const float r = geom ? 10 : 2967;100 101 97 MBinning b; 102 b.SetEdges(87, 0, r);98 b.SetEdges(87, 0, 10); 103 99 b.Apply(fHistBorder1); 104 100 b.Apply(fHistBorder2); … … 127 123 } 128 124 129 const Double_t scale = f UseMmScale ? 1 : fMm2Deg;125 const Double_t scale = fGeom->GetConvMm2Deg(); 130 126 131 127 fHistBorder1.Fill(h->GetBorderLinePixel() *scale, w); … … 133 129 134 130 return kTRUE; 135 }136 137 // --------------------------------------------------------------------------138 //139 // With this function you can convert the histogram ('on the fly') between140 // degrees and millimeters.141 //142 void MHNewImagePar2::SetMmScale(Bool_t mmscale)143 {144 if (fUseMmScale == mmscale)145 return;146 147 if (fMm2Deg<0)148 {149 *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl;150 return;151 }152 153 const Double_t scale = mmscale ? 1./fMm2Deg : fMm2Deg;154 MH::ScaleAxis(&fHistBorder1, scale);155 MH::ScaleAxis(&fHistBorder2, scale);156 157 if (mmscale)158 {159 fHistBorder1.SetXTitle("L [mm]");160 fHistBorder2.SetXTitle("L [mm]");161 }162 else163 {164 fHistBorder1.SetXTitle("L [\\circ]");165 fHistBorder2.SetXTitle("L [\\circ]");166 }167 168 fUseMmScale = mmscale;169 }170 171 // --------------------------------------------------------------------------172 //173 // Use this function to setup your own conversion factor between degrees174 // and millimeters. The conversion factor should be the one calculated in175 // MGeomCam. Use this function with Caution: You could create wrong values176 // by setting up your own scale factor.177 //178 void MHNewImagePar2::SetMm2Deg(Float_t mmdeg)179 {180 if (mmdeg<0)181 {182 *fLog << warn << dbginf << "Warning - Conversion factor < 0 - nonsense. Ignored." << endl;183 return;184 }185 186 if (fMm2Deg>=0)187 *fLog << warn << dbginf << "Warning - Conversion factor already set. Overwriting" << endl;188 189 fMm2Deg = mmdeg;190 131 } 191 132 -
trunk/MagicSoft/Mars/mimage/MHNewImagePar2.h
r9153 r9340 9 9 #endif 10 10 11 class MGeomCam; 11 12 class MHillas; 12 13 … … 14 15 { 15 16 private: 17 MGeomCam *fGeom; //! conversion mm to deg 18 16 19 TH1F fHistBorder1; // 17 20 TH1F fHistBorder2; // … … 26 29 Int_t Fill(const MParContainer *par, const Stat_t w=1); 27 30 28 void SetMmScale(Bool_t mmscale=kTRUE);29 virtual void SetMm2Deg(Float_t mmdeg);30 31 31 void Draw(Option_t *opt=""); 32 32
Note:
See TracChangeset
for help on using the changeset viewer.