Changeset 6869 for trunk/MagicSoft/Mars/mimage
- Timestamp:
- 03/21/05 10:39:58 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mimage
- Files:
-
- 4 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mimage/ImageLinkDef.h
r6855 r6869 15 15 #pragma link C++ class MImagePar+; 16 16 #pragma link C++ class MNewImagePar+; 17 #pragma link C++ class MNewImagePar2+; 17 18 #pragma link C++ class MConcentration+; 18 19 … … 22 23 #pragma link C++ class MHImagePar+; 23 24 #pragma link C++ class MHNewImagePar+; 25 #pragma link C++ class MHNewImagePar2+; 24 26 #pragma link C++ class MStereoPar+; 25 27 #pragma link C++ class MStereoCalc+; -
trunk/MagicSoft/Mars/mimage/MHImagePar.cc
r6489 r6869 252 252 pad->cd(2); 253 253 gPad->SetBorderMode(0); 254 pad->GetPad(2)->Divide(1,2, 0,0);254 pad->GetPad(2)->Divide(1,2,1e-10,1e-10); 255 255 pad->GetPad(2)->cd(1); 256 256 gPad->SetBorderMode(0); -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc
r5142 r6869 56 56 // 57 57 MHNewImagePar::MHNewImagePar(const char *name, const char *title) 58 : fMm2Deg(1), fUseMmScale(kTRUE) 58 59 { 59 60 fName = name ? name : "MHNewImagePar"; … … 142 143 bins.Apply(fHistCorePix); 143 144 144 bins.SetEdges(75, 0, 0.249);145 bins.Apply(fHistUsedArea);146 bins.Apply(fHistCoreArea);145 //bins.SetEdges(75, 0, 0.249); 146 //bins.Apply(fHistUsedArea); 147 //bins.Apply(fHistCoreArea); 147 148 } 148 149 … … 154 155 Bool_t MHNewImagePar::SetupFill(const MParList *plist) 155 156 { 157 MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam"); 158 if (!geom) 159 *fLog << warn << GetDescriptor() << ": No Camera Geometry available. Using mm-scale for histograms." << endl; 160 else 161 { 162 fMm2Deg = geom->GetConvMm2Deg(); 163 SetMmScale(kFALSE); 164 } 165 166 const MBinning *bins = (MBinning*)plist->FindObject("BinningArea"); 167 if (!bins) 168 { 169 float r = geom ? 1.5 : 0.133; 170 171 MBinning b; 172 b.SetEdges(50, 0, r); 173 b.Apply(fHistUsedArea); 174 b.Apply(fHistCoreArea); 175 } 176 else 177 { 178 bins->Apply(fHistUsedArea); 179 bins->Apply(fHistCoreArea); 180 } 181 156 182 ApplyBinning(*plist, "Leakage", &fHistLeakage1); 157 183 ApplyBinning(*plist, "Leakage", &fHistLeakage2); … … 160 186 ApplyBinning(*plist, "Pixels", &fHistCorePix); 161 187 162 ApplyBinning(*plist, "Area", &fHistUsedArea);163 ApplyBinning(*plist, "Area", &fHistCoreArea);188 //ApplyBinning(*plist, "Area", &fHistUsedArea); 189 //ApplyBinning(*plist, "Area", &fHistCoreArea); 164 190 165 191 ApplyBinning(*plist, "Conc", &fHistConc); … … 182 208 } 183 209 210 const Double_t scale = fUseMmScale ? 1e-6 : fMm2Deg*fMm2Deg; 211 184 212 const MNewImagePar &h = *(MNewImagePar*)par; 185 213 … … 190 218 fHistCorePix.Fill(h.GetNumCorePixels(), w); 191 219 192 fHistUsedArea.Fill(h.GetUsedArea() /1000000, w);193 fHistCoreArea.Fill(h.GetCoreArea() /1000000, w);220 fHistUsedArea.Fill(h.GetUsedArea()*scale, w); 221 fHistCoreArea.Fill(h.GetCoreArea()*scale, w); 194 222 195 223 fHistConc.Fill(h.GetConc(), w); … … 197 225 198 226 return kTRUE; 227 } 228 229 // -------------------------------------------------------------------------- 230 // 231 // With this function you can convert the histogram ('on the fly') between 232 // degrees and millimeters. 233 // 234 void MHNewImagePar::SetMmScale(Bool_t mmscale) 235 { 236 if (fUseMmScale == mmscale) 237 return; 238 239 if (fMm2Deg<0) 240 { 241 *fLog << warn << dbginf << "Warning - Sorry, no conversion factor for conversion available." << endl; 242 return; 243 } 244 245 const Double_t scale = mmscale ? 1./(fMm2Deg*fMm2Deg) : (fMm2Deg*fMm2Deg); 246 MH::ScaleAxis(&fHistUsedArea, scale); 247 MH::ScaleAxis(&fHistCoreArea, scale); 248 249 if (mmscale) 250 { 251 fHistUsedArea.SetXTitle("A [m^{2}]"); 252 fHistCoreArea.SetXTitle("A [m^{2}]"); 253 } 254 else 255 { 256 fHistUsedArea.SetXTitle("A [deg^{2}]"); 257 fHistCoreArea.SetXTitle("A [deg^{2}]"); 258 } 259 260 fUseMmScale = mmscale; 261 } 262 263 // -------------------------------------------------------------------------- 264 // 265 // Use this function to setup your own conversion factor between degrees 266 // and millimeters. The conversion factor should be the one calculated in 267 // MGeomCam. Use this function with Caution: You could create wrong values 268 // by setting up your own scale factor. 269 // 270 void MHNewImagePar::SetMm2Deg(Float_t mmdeg) 271 { 272 if (mmdeg<0) 273 { 274 *fLog << warn << dbginf << "Warning - Conversion factor < 0 - nonsense. Ignored." << endl; 275 return; 276 } 277 278 if (fMm2Deg>=0) 279 *fLog << warn << dbginf << "Warning - Conversion factor already set. Overwriting" << endl; 280 281 fMm2Deg = mmdeg; 199 282 } 200 283 -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.h
r4833 r6869 26 26 TH1F fHistConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize 27 27 28 Float_t fMm2Deg; 29 Bool_t fUseMmScale; 30 28 31 public: 29 32 MHNewImagePar(const char *name=NULL, const char *title=NULL); … … 46 49 TH1F &GetHistConc1() { return fHistConc1; } 47 50 51 void SetMmScale(Bool_t mmscale=kTRUE); 52 virtual void SetMm2Deg(Float_t mmdeg); 53 48 54 void Draw(Option_t *opt=""); 49 55 void Paint(Option_t *opt=""); -
trunk/MagicSoft/Mars/mimage/MHillas.cc
r6855 r6869 128 128 129 129 *fLog << all; 130 *fLog << "Basic Image Parameters (" << GetName() << ")"<< endl;130 *fLog << GetDescriptor() << endl; 131 131 *fLog << " - Length [mm] = " << fLength << endl; 132 132 *fLog << " - Width [mm] = " << fWidth << endl; … … 151 151 152 152 *fLog << all; 153 *fLog << "Basic Image Parameters (" << GetName() << ")"<< endl;153 *fLog << GetDescriptor() << endl; 154 154 *fLog << " - Length [deg] = " << fLength*geom.GetConvMm2Deg() << endl; 155 155 *fLog << " - Width [deg] = " << fWidth *geom.GetConvMm2Deg() << endl; … … 240 240 { 241 241 MSignalPix &pix = evt[i]; 242 if (!pix.IsPixelUsed())243 continue;242 //if (!pix.IsPixelUsed()) 243 // continue; 244 244 245 245 if (island>=0 && pix.GetIdxIsland()!=island) … … 290 290 for (UInt_t i=0; i<numpix; i++) 291 291 { 292 MSignalPix &pix = evt[i];292 const MSignalPix &pix = evt[i]; 293 293 if (!pix.IsPixelUsed()) 294 294 continue; -
trunk/MagicSoft/Mars/mimage/MHillasCalc.cc
r6855 r6869 42 42 // - Disable(MHillasCalc::kCalcNewImagePar) 43 43 // - Disable(MHillasCalc::kCalcImagePar) 44 // - Disable(MHillasCalc::kCalcImagePar2) 44 45 // - Disable(MHillasCalc::kCalcSrcPosCam) 45 46 // - Disable(MHillasCalc::kCalcConc) … … 61 62 // - SetNameNewImgPar("NewName") 62 63 // - SetNameImagePar("NewName") 64 // - SetNameImagePar2("NewName") 63 65 // - SetNameSrcPosCam("NewName") 64 66 // - SetNameConc("NewName") … … 77 79 // - kCalcHillasExt 78 80 // - kCalcNewImgPar 81 // - kCalcNewImgPar2 79 82 // 80 83 // … … 117 120 // 118 121 // 1) MGeomCam 5) MHillas 8) MImagePar 119 // 2) MSignalCam 6) MHillasSrc 9) MNewImagePar120 // 3) MSrcPosCam 7) MHillasExt 10) M Concentration121 // 4) fIdxIslands 122 // 2) MSignalCam 6) MHillasSrc 9) MNewImagePar 123 // 3) MSrcPosCam 7) MHillasExt 10) MNewImagePar2 124 // 4) fIdxIslands 11) MConcentration 122 125 // 123 126 // Flag | Input Container | Output … … 128 131 // kCalcImagePar | 2 | 8 129 132 // kCalcNewImgPar | 1 2 4 5 | 9 130 // kCalcConc | 1 2 5 | 10 133 // kCalcNewImgPar2 | 1 2 4 | 10 134 // kCalcConc | 1 2 5 | 11 131 135 // -----------------+-----------------+-------- 132 136 // … … 145 149 #include "MImagePar.h" 146 150 #include "MNewImagePar.h" 151 #include "MNewImagePar2.h" 147 152 #include "MConcentration.h" 148 153 … … 160 165 const TString MHillasCalc::gsNameHillasExt = "MHillasExt"; // default name of the 'MHillasExt' container 161 166 const TString MHillasCalc::gsNameNewImagePar = "MNewImagePar"; // default name of the 'MNewImagePar' container 167 const TString MHillasCalc::gsNameNewImagePar2= "MNewImagePar2"; // default name of the 'MNewImagePar2' container 162 168 const TString MHillasCalc::gsNameConc = "MConcentration"; // default name of the 'MConcentration' container 163 169 const TString MHillasCalc::gsNameImagePar = "MImagePar"; // default name of the 'MImagePar' container … … 174 180 fNameConc(gsNameConc), fNameImagePar(gsNameImagePar), 175 181 fNameNewImagePar(gsNameNewImagePar), 182 fNameNewImagePar2(gsNameNewImagePar2), 176 183 fErrors(7), fFlags(0xff), fIdxIsland(-1) 177 184 { … … 197 204 } 198 205 199 if (TestFlags(kCalcHillas|kCalcHillasExt|kCalcNewImagePar|kCalc Conc))206 if (TestFlags(kCalcHillas|kCalcHillasExt|kCalcNewImagePar|kCalcNewImagePar2|kCalcConc)) 200 207 { 201 208 fGeomCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam")); … … 261 268 262 269 // if enabled 270 if (TestFlag(kCalcNewImagePar2)) 271 { 272 fNewImgPar2 = (MNewImagePar2*)pList->FindCreateObj("MNewImagePar2", AddSerialNumber(fNameNewImagePar2)); 273 if (!fNewImgPar2) 274 return kFALSE; 275 } 276 277 // if enabled 263 278 if (TestFlag(kCalcImagePar)) 264 279 { … … 331 346 if (TestFlag(kCalcNewImagePar)) 332 347 fNewImgPar->Calc(*fGeomCam, *fCerPhotEvt, *fHillas, fIdxIsland); 348 349 if (TestFlag(kCalcNewImagePar2)) 350 fNewImgPar2->Calc(*fGeomCam, *fCerPhotEvt, fIdxIsland); 333 351 334 352 if (TestFlag(kCalcConc)) … … 388 406 if (TestFlag(kCalcNewImagePar)) 389 407 *fLog << " - " << fNameNewImagePar << " from MGeomCam, MSignalCam, " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl; 408 if (TestFlag(kCalcNewImagePar2)) 409 *fLog << " - " << fNameNewImagePar2 << " from MGeomCam, MSignalCam, " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl; 390 410 if (TestFlag(kCalcConc)) 391 411 *fLog << " - " << fNameConc << " from MGeomCam, MSignalCam and " << fNameHillas << endl; … … 427 447 if (TestFlag(kCalcNewImagePar) && fNameNewImagePar!=gsNameNewImagePar) 428 448 out << " " << GetUniqueName() << ".SetNameNewImagePar(\"" << fNameNewImagePar << "\");" << endl; 449 if (TestFlag(kCalcNewImagePar2) && fNameNewImagePar2!=gsNameNewImagePar2) 450 out << " " << GetUniqueName() << ".SetNameNewImagePar2(\"" << fNameNewImagePar2 << "\");" << endl; 429 451 430 452 if (!TestFlag(kCalcHillas)) … … 436 458 if (!TestFlag(kCalcNewImagePar)) 437 459 out << " " << GetUniqueName() << ".Disable(MHilllasCalc::kCalcNewImagePar);" << endl; 460 if (!TestFlag(kCalcNewImagePar2)) 461 out << " " << GetUniqueName() << ".Disable(MHilllasCalc::kCalcNewImagePar2);" << endl; 438 462 if (!TestFlag(kCalcConc)) 439 463 out << " " << GetUniqueName() << ".Disable(MHilllasCalc::kCalcConc);" << endl; -
trunk/MagicSoft/Mars/mimage/MHillasCalc.h
r6855 r6869 24 24 class MImagePar; 25 25 class MNewImagePar; 26 class MNewImagePar2; 26 27 class MConcentration; 27 28 class MSrcPosCam; … … 35 36 static const TString gsNameHillasExt; // default name of the 'MHillasExt' container 36 37 static const TString gsNameNewImagePar; // default name of the 'MNewImagePar' container 38 static const TString gsNameNewImagePar2; // default name of the 'MNewImagePar' container 37 39 static const TString gsNameConc; // default name of the 'MConcentration' container 38 40 static const TString gsNameImagePar; // default name of the 'MImagePar' container … … 48 50 MImagePar *fImagePar; //! output container to store result 49 51 MNewImagePar *fNewImgPar; //! output container to store result 52 MNewImagePar2 *fNewImgPar2; //! output container to store result 50 53 MConcentration *fConc; //! output container to store result 51 54 … … 57 60 TString fNameImagePar; // name of the 'MImagePar' container 58 61 TString fNameNewImagePar; // name of the 'MNewImagePar' container 62 TString fNameNewImagePar2; // name of the 'MNewImagePar' container 59 63 60 64 TArrayL fErrors; //! Error counter. Do we have to change to Double? … … 77 81 // Flags 78 82 enum CalcCont_t { 79 kCalcHillas = BIT(0), 80 kCalcHillasExt = BIT(1), 81 kCalcHillasSrc = BIT(2), 82 kCalcNewImagePar = BIT(3), 83 kCalcConc = BIT(4), 84 kCalcImagePar = BIT(5) 83 kCalcHillas = BIT(0), 84 kCalcHillasExt = BIT(1), 85 kCalcHillasSrc = BIT(2), 86 kCalcNewImagePar = BIT(3), 87 kCalcNewImagePar2 = BIT(4), 88 kCalcConc = BIT(5), 89 kCalcImagePar = BIT(6) 85 90 }; 86 91 … … 98 103 void SetNameHillasSrc(const char *name) { fNameHillasSrc = name; } 99 104 void SetNameNewImagePar(const char *name) { fNameNewImagePar = name; } 105 void SetNameNewImagePar2(const char *name){ fNameNewImagePar2 = name; } 100 106 void SetNameConc(const char *name) { fNameConc = name; } 101 107 void SetNameImagePar(const char *name) { fNameImagePar = name; } -
trunk/MagicSoft/Mars/mimage/MHillasExt.cc
r6855 r6869 105 105 // ------------------------------------------------------------------------- 106 106 // 107 // Print contents of MHillasExt to *fLog.108 //109 void MHillasExt::Print(Option_t *) const110 {111 *fLog << all;112 *fLog << "Extended Image Parameters (" << GetName() << ")" << endl;113 *fLog << " - Asymmetry = " << fAsym << endl;114 *fLog << " - 3.Moment Long [mm] = " << fM3Long << endl;115 *fLog << " - 3.Moment Trans [mm] = " << fM3Trans << endl;116 *fLog << " - Max.Dist [mm] = " << fMaxDist << endl;117 }118 119 // -------------------------------------------------------------------------120 //121 // Print contents of MHillasExt to *fLog, depending on the geometry in122 // units of deg.123 //124 void MHillasExt::Print(const MGeomCam &geom) const125 {126 *fLog << all;127 *fLog << "Extended Image Parameters (" << GetName() << ")" << endl;128 *fLog << " - Asymmetry = " << fAsym *geom.GetConvMm2Deg() << endl;129 *fLog << " - 3.Moment Long [deg] = " << fM3Long *geom.GetConvMm2Deg() << endl;130 *fLog << " - 3.Moment Trans [deg] = " << fM3Trans*geom.GetConvMm2Deg() << endl;131 *fLog << " - Max.Dist [deg] = " << fMaxDist*geom.GetConvMm2Deg() << endl;132 }133 134 // -------------------------------------------------------------------------135 //136 107 // calculation of additional parameters based on the camera geometry 137 108 // and the cerenkov photon event … … 238 209 fMaxDist = arr.At(3); 239 210 } 211 212 // ------------------------------------------------------------------------- 213 // 214 // Print contents of MHillasExt to *fLog. 215 // 216 void MHillasExt::Print(Option_t *) const 217 { 218 *fLog << all; 219 *fLog << GetDescriptor() << endl; 220 *fLog << " - Asymmetry = " << fAsym << endl; 221 *fLog << " - 3.Moment Long [mm] = " << fM3Long << endl; 222 *fLog << " - 3.Moment Trans [mm] = " << fM3Trans << endl; 223 *fLog << " - Max.Dist [mm] = " << fMaxDist << endl; 224 } 225 226 // ------------------------------------------------------------------------- 227 // 228 // Print contents of MHillasExt to *fLog, depending on the geometry in 229 // units of deg. 230 // 231 void MHillasExt::Print(const MGeomCam &geom) const 232 { 233 *fLog << all; 234 *fLog << GetDescriptor() << endl; 235 *fLog << " - Asymmetry = " << fAsym *geom.GetConvMm2Deg() << endl; 236 *fLog << " - 3.Moment Long [deg] = " << fM3Long *geom.GetConvMm2Deg() << endl; 237 *fLog << " - 3.Moment Trans [deg] = " << fM3Trans*geom.GetConvMm2Deg() << endl; 238 *fLog << " - Max.Dist [deg] = " << fMaxDist*geom.GetConvMm2Deg() << endl; 239 } -
trunk/MagicSoft/Mars/mimage/MHillasSrc.cc
r5080 r6869 217 217 { 218 218 *fLog << all; 219 *fLog << "Source dependant Image Parameters (" << GetName() << ")"<< endl;219 *fLog << GetDescriptor() << endl; 220 220 *fLog << " - Dist [mm] = " << fDist << endl; 221 221 *fLog << " - Alpha [deg] = " << fAlpha << endl; … … 233 233 { 234 234 *fLog << all; 235 *fLog << "Source dependant Image Parameters (" << GetName() << ")"<< endl;235 *fLog << GetDescriptor() << endl; 236 236 *fLog << " - Dist [deg] = " << fDist*geom.GetConvMm2Deg() << endl; 237 237 *fLog << " - Alpha [deg] = " << fAlpha << endl; -
trunk/MagicSoft/Mars/mimage/MImagePar.cc
r6855 r6869 106 106 { 107 107 *fLog << all; 108 *fLog << "Image Parameters (" << GetName() << ")"<< endl;108 *fLog << GetDescriptor() << endl; 109 109 *fLog << " - Num Islands [#] = " << fNumIslands << " Islands" << endl; 110 110 *fLog << " - Sat.Pixels (HG) [#] = " << fNumSatPixelsHG << " Pixels" << endl; -
trunk/MagicSoft/Mars/mimage/MNewImagePar.cc
r6855 r6869 227 227 { 228 228 *fLog << all; 229 *fLog << "New Image Parameters (" << GetName() << ")"<< endl;229 *fLog << GetDescriptor() << endl; 230 230 *fLog << " - Leakage1 [1] = " << fLeakage1 << endl; 231 231 *fLog << " - Leakage2 [1] = " << fLeakage2 << endl; … … 249 249 { 250 250 *fLog << all; 251 *fLog << "New Image Parameters (" << GetName() << ")"<< endl;251 *fLog << GetDescriptor() << endl; 252 252 *fLog << " - Leakage1 [1] = " << fLeakage1 << endl; 253 253 *fLog << " - Leakage2 [1] = " << fLeakage2 << endl; -
trunk/MagicSoft/Mars/mimage/Makefile
r6855 r6869 34 34 MImagePar.cc \ 35 35 MNewImagePar.cc \ 36 MNewImagePar2.cc \ 36 37 MConcentration.cc \ 37 38 MHHillas.cc \ … … 40 41 MHImagePar.cc \ 41 42 MHNewImagePar.cc \ 43 MHNewImagePar2.cc \ 42 44 MStereoPar.cc \ 43 45 MStereoCalc.cc
Note:
See TracChangeset
for help on using the changeset viewer.