Changeset 7538 for trunk/MagicSoft
- Timestamp:
- 02/27/06 13:04:28 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7537 r7538 49 49 - increased class version of MNewImagePar 50 50 51 * mimage/MHillasExt.cc: 52 - added some comments 53 - removed an obsolete TMath::Abs around "dist" 54 51 55 * mranforest/MRanForest.[h,cc]: 52 56 - the initialization of fTreeHad was done at the wrong moment -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.cc
r6977 r7538 19 19 ! Author(s): Thomas Bretz, 04/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 421 ! Copyright: MAGIC Software Development, 2000-2006 22 22 ! 23 23 ! … … 27 27 // 28 28 // MHNewImagePar 29 // 30 // 31 // Version 2: 32 // ---------- 33 // + TH1F fHistConcCOG; // [ratio] concentration around the center of gravity (all pixels) 34 // + TH1F fHistConcCore; // [ratio] concentration of signals inside ellipse (used pixels) 29 35 // 30 36 //////////////////////////////////////////////////////////////////////////// … … 116 122 fHistConc.SetDirectory(NULL); 117 123 fHistConc1.SetDirectory(NULL); 124 fHistConcCOG.SetDirectory(NULL); 125 fHistConcCore.SetDirectory(NULL); 118 126 fHistConc.SetName("Conc2"); 119 127 fHistConc1.SetName("Conc1"); 128 fHistConcCOG.SetName("ConcCOG"); 129 fHistConcCore.SetName("ConcCore"); 120 130 fHistConc.SetTitle("Ratio: Conc"); 121 131 fHistConc1.SetTitle("Ratio: Conc1"); 132 fHistConcCOG.SetTitle("Ratio: ConcCOG"); 133 fHistConcCore.SetTitle("Ratio: ConcCore"); 122 134 fHistConc.SetXTitle("Ratio"); 123 135 fHistConc1.SetXTitle("Ratio"); 136 fHistConcCOG.SetXTitle("Ratio"); 137 fHistConcCore.SetXTitle("Ratio"); 124 138 fHistConc.SetYTitle("Counts"); 125 139 fHistConc1.SetYTitle("Counts"); 140 fHistConcCOG.SetYTitle("Counts"); 141 fHistConcCore.SetYTitle("Counts"); 142 fHistConc.UseCurrentStyle(); 126 143 fHistConc1.UseCurrentStyle(); 127 fHistConc.UseCurrentStyle(); 144 fHistConcCOG.UseCurrentStyle(); 145 fHistConcCore.UseCurrentStyle(); 128 146 fHistConc.SetFillStyle(4000); 129 147 fHistConc1.SetFillStyle(4000); 148 fHistConcCOG.SetFillStyle(4000); 149 fHistConcCore.SetFillStyle(4000); 130 150 fHistConc1.SetLineColor(kBlue); 131 151 fHistConcCOG.SetLineColor(kBlue); 132 152 133 153 MBinning bins; … … 138 158 bins.Apply(fHistConc); 139 159 bins.Apply(fHistConc1); 160 bins.Apply(fHistConcCOG); 161 bins.Apply(fHistConcCore); 140 162 141 163 bins.SetEdges(75, 0.5, 150.5); … … 189 211 //ApplyBinning(*plist, "Area", &fHistCoreArea); 190 212 191 ApplyBinning(*plist, "Conc", &fHistConc); 192 ApplyBinning(*plist, "Conc1", &fHistConc1); 213 ApplyBinning(*plist, "Conc", &fHistConc); 214 ApplyBinning(*plist, "Conc1", &fHistConc1); 215 ApplyBinning(*plist, "ConcCOG", &fHistConcCOG); 216 ApplyBinning(*plist, "ConcCore", &fHistConcCore); 193 217 194 218 return kTRUE; … … 223 247 fHistConc.Fill(h.GetConc(), w); 224 248 fHistConc1.Fill(h.GetConc1(), w); 249 fHistConcCOG.Fill(h.GetConcCOG(), w); 250 fHistConcCore.Fill(h.GetConcCore(), w); 225 251 226 252 return kTRUE; … … 284 310 void MHNewImagePar::Paint(Option_t *o) 285 311 { 286 if (fHistLeakage1.GetMaximum()>0 && gPad->GetPad(1) )287 gPad->GetPad(1)-> SetLogy();312 if (fHistLeakage1.GetMaximum()>0 && gPad->GetPad(1) && gPad->GetPad(1)->GetPad(1)) 313 gPad->GetPad(1)->GetPad(1)->SetLogy(); 288 314 } 289 315 … … 306 332 307 333 if (!same) 308 pad->Divide(2, 2);334 pad->Divide(2, 1); 309 335 else 310 336 { … … 315 341 fHistUsedArea.SetName("UsedAreaSame"); 316 342 fHistCoreArea.SetName("CoreAreaSame"); 343 fHistConcCOG.SetName("ConcCOGSame"); 344 fHistConcCore.SetName("ConcCoreSame"); 317 345 fHistConc1.SetName("Conc1Same"); 318 346 fHistConc.SetName("Conc2Same"); … … 324 352 fHistUsedArea.SetDirectory(0); 325 353 fHistCoreArea.SetDirectory(0); 354 fHistConcCOG.SetDirectory(0); 355 fHistConcCore.SetDirectory(0); 326 356 fHistConc1.SetDirectory(0); 327 357 fHistConc.SetDirectory(0); … … 332 362 fHistUsedPix.SetLineColor(kCyan); 333 363 fHistConc1.SetLineColor(kMagenta); 364 fHistConcCOG.SetLineColor(kCyan); 365 fHistConcCore.SetLineColor(kCyan); 334 366 fHistConc.SetLineColor(kCyan); 335 367 fHistCoreArea.SetLineColor(kMagenta); … … 338 370 339 371 pad->cd(1); 372 TVirtualPad *pad1=gPad; 373 pad1->SetBorderMode(0); 374 pad1->Divide(1,3, 0.001, 0.001); 375 376 pad1->cd(1); 340 377 gPad->SetBorderMode(0); 378 gPad->SetGridx(); 341 379 TAxis &x = *fHistLeakage1.GetXaxis(); 342 380 x.SetRangeUser(0.0, x.GetXmax()); … … 348 386 fHistLeakage2.SetMaximum(0.1); // dummy value to allow log-scale 349 387 350 pad ->cd(2);388 pad1->cd(2); 351 389 gPad->SetBorderMode(0); 390 gPad->SetGridx(); 352 391 RemoveFromPad("UsedPixSame"); 353 392 RemoveFromPad("CorePixSame"); 354 393 MH::DrawSame(fHistCorePix, fHistUsedPix, "Number of core/used Pixels", same); 355 394 356 pad ->cd(3);395 pad1->cd(3); 357 396 gPad->SetBorderMode(0); 397 gPad->SetGridx(); 398 RemoveFromPad("CoreAreaSame"); 399 RemoveFromPad("UsedAreaSame"); 400 MH::DrawSame(fHistCoreArea, fHistUsedArea, "Area of core/used Pixels", same); 401 402 pad->cd(2); 403 TVirtualPad *pad2=gPad; 404 pad2->SetBorderMode(0); 405 pad2->Divide(1, 2, 0.001, 0.001); 406 407 pad2->cd(1); 408 gPad->SetBorderMode(0); 409 gPad->SetGridx(); 358 410 RemoveFromPad("Conc1Same"); 359 411 RemoveFromPad("Conc2Same"); 360 412 MH::DrawSame(fHistConc1, fHistConc, "Concentrations", same); 361 413 362 pad ->cd(4);414 pad2->cd(2); 363 415 gPad->SetBorderMode(0); 364 RemoveFromPad("CoreAreaSame"); 365 RemoveFromPad("UsedAreaSame"); 366 MH::DrawSame(fHistCoreArea, fHistUsedArea, "Area of core/used Pixels", same); 416 gPad->SetGridx(); 417 RemoveFromPad("ConcCOGSame"); 418 RemoveFromPad("ConcCoreSame"); 419 MH::DrawSame(fHistConcCore, fHistConcCOG, "Concentrations", same); 367 420 } 368 421 … … 373 426 if (name.Contains("Leakage2", TString::kIgnoreCase)) 374 427 return const_cast<TH1F*>(&fHistLeakage2); 428 if (name.Contains("ConcCOG", TString::kIgnoreCase)) 429 return const_cast<TH1F*>(&fHistConcCOG); 430 if (name.Contains("ConcCore", TString::kIgnoreCase)) 431 return const_cast<TH1F*>(&fHistConcCore); 375 432 if (name.Contains("Conc1", TString::kIgnoreCase)) // must be first! 376 433 return const_cast<TH1F*>(&fHistConc1); -
trunk/MagicSoft/Mars/mimage/MHNewImagePar.h
r6977 r7538 25 25 TH1F fHistConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize 26 26 TH1F fHistConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize 27 TH1F fHistConcCOG; // [ratio] concentration of the three pixels next to COG 28 TH1F fHistConcCore; // [ratio] concentration of signals inside or touching the ellipse 27 29 28 30 Float_t fMm2Deg; … … 53 55 TH1F &GetHistConc() { return fHistConc; } 54 56 TH1F &GetHistConc1() { return fHistConc1; } 57 TH1F &GetHistConcCOG() { return fHistConcCOG; } 58 TH1F &GetHistConcCore() { return fHistConcCore; } 55 59 56 60 void SetMmScale(Bool_t mmscale=kTRUE); … … 60 64 void Paint(Option_t *opt=""); 61 65 62 ClassDef(MHNewImagePar, 1) // Histograms of new image parameters66 ClassDef(MHNewImagePar, 2) // Histograms of new image parameters 63 67 }; 64 68 -
trunk/MagicSoft/Mars/mimage/MHillasExt.cc
r7181 r7538 161 161 162 162 const Double_t dist = dx*dx+dy*dy; 163 if ( TMath::Abs(dist)>TMath::Abs(maxdist))163 if (dist>TMath::Abs(maxdist)) 164 164 maxdist = dzx<0 ? -dist : dist; // [mm^2] 165 165 … … 177 177 maxpix = nphot; // [1] 178 178 maxpixid = i;//pixid; 179 continue; // [1]180 179 } 181 180 } … … 183 182 const MGeomPix &maxp = geom[maxpixid]; 184 183 184 // 185 // Asymmetry 186 // 185 187 fAsym = (hil.GetMeanX()-maxp.GetX())*hil.GetCosDelta() + 186 188 (hil.GetMeanY()-maxp.GetY())*hil.GetSinDelta(); // [mm] … … 195 197 fM3Trans = m3y<0 ? -pow(-m3y, 1./3) : pow(m3y, 1./3); // [mm] 196 198 199 // 200 // Distance between max signal and COG 201 // 197 202 const Double_t md = TMath::Sqrt(TMath::Abs(maxdist)); 198 203 fMaxDist = maxdist<0 ? -md : md; // [mm] -
trunk/MagicSoft/Mars/mimage/MNewImagePar.cc
r7188 r7538 38 38 // Float_t fConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize 39 39 // Float_t fConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize 40 // Float_t fConcCOG; // [ratio] concentration of the three pixels next to COG 41 // Float_t fConcCore; // [ratio] concentration of signals inside or touching the ellipse 40 42 // 41 43 // Float_t fUsedArea; // Area of pixels which survived the image cleaning … … 65 67 // + removed fNumSaturatedPixels 66 68 // 69 // Version 5: 70 // ---------- 71 // - added fConcCOG 72 // - added fConcCore 73 // 67 74 // 68 75 ///////////////////////////////////////////////////////////////////////////// … … 105 112 fInnerLeakage1 = -1; 106 113 fInnerLeakage2 = -1; 107 fInnerSize = -1; 108 109 fConc = -1; 110 fConc1 = -1; 114 fInnerSize = -1; 115 116 fConc = -1; 117 fConc1 = -1; 118 fConcCOG = -1; 119 fConcCore = -1; 111 120 112 121 fNumUsedPixels = -1; … … 131 140 132 141 fInnerSize = 0; 142 fConcCore = 0; 133 143 134 144 Double_t edgepix1 = 0; … … 140 150 Float_t maxpix1 = 0; // [#phot] 141 151 Float_t maxpix2 = 0; // [#phot] 152 153 const Double_t d = geom.GetMaxRadius()*geom.GetMaxRadius(); 154 Double_t dist[3] = { d, d, d }; 155 Int_t idx[3] = { -1, -1, -1}; 156 157 const Double_t rl = 1./(hillas.GetLength()*hillas.GetLength()); 158 const Double_t rw = 1./(hillas.GetWidth() *hillas.GetWidth()); 142 159 143 160 const Bool_t ismagiclike = … … 149 166 for (UInt_t i=0; i<npix; i++) 150 167 { 168 // Get geometry of pixel 169 const MGeomPix &gpix = geom[i]; 170 171 // Find the three pixels which are next to the COG 172 const Double_t dx = gpix.GetX() - hillas.GetMeanX(); // [mm] 173 const Double_t dy = gpix.GetY() - hillas.GetMeanY(); // [mm] 174 175 const Double_t dist0 = dx*dx+dy*dy; 176 177 if (dist0<dist[0]) 178 { 179 dist[2] = dist[1]; 180 dist[1] = dist[0]; 181 dist[0] = dist0; 182 183 idx[2] = idx[1]; 184 idx[1] = idx[0]; 185 idx[0] = i; 186 } 187 else 188 if (dist0<dist[1]) 189 { 190 dist[2] = dist[1]; 191 dist[1] = dist0; 192 193 idx[2] = idx[1]; 194 idx[1] = i; 195 } 196 else 197 if (dist0<dist[2]) 198 { 199 dist[2] = dist0; 200 idx[2] = i; 201 } 202 151 203 const MSignalPix &pix = evt[i]; 152 204 if (!pix.IsPixelUsed()) … … 156 208 if (island>=0 && pix.GetIdxIsland()!=island) 157 209 continue; 158 159 // Get geometry of pixel160 //const Int_t pixid = pix->GetPixId();161 const MGeomPix &gpix = geom[i/*pixid*/];162 210 163 211 // count used and core pixels … … 172 220 fUsedArea += gpix.GetA(); 173 221 222 // signal in pixel 174 223 Double_t nphot = pix.GetNumPhotons(); 224 225 // 226 // Calculate signal contained inside ellipse 227 // 228 const Double_t dzx = hillas.GetCosDelta()*dx + hillas.GetSinDelta()*dy; // [mm] 229 const Double_t dzy = -hillas.GetSinDelta()*dx + hillas.GetCosDelta()*dy; // [mm] 230 const Double_t dz = gpix.GetD()*gpix.GetD()/4; 231 const Double_t tana = dzy*dzy/(dzx*dzx); 232 const Double_t distr = (1+tana)/(rl + tana*rw); 233 if (distr>dist0-dz || dzx==0) 234 fConcCore += nphot; 175 235 176 236 // … … 213 273 maxpix2 = maxpix1; 214 274 maxpix1 = nphot; // [1] 215 continue; // [1]216 275 } 217 218 if (nphot>maxpix2)219 maxpix2 = nphot;// [1]276 else 277 if (nphot>maxpix2) 278 maxpix2 = nphot; // [1] 220 279 } 221 280 222 281 fInnerLeakage1 = edgepixin1 / fInnerSize; 223 282 fInnerLeakage2 = edgepixin2 / fInnerSize; … … 226 285 fLeakage2 = edgepix2 / hillas.GetSize(); 227 286 228 // FIXME?: in case the pixel with highest signal density is an outer pixel,229 // the value of fConc (ratio of signal in two highest pixels to SIZE) should230 // rather be 2*fConc1, under the simplest assumption that the light density231 // inside the outer (large) pixel is uniform.287 // FIXME?: in case the pixel with highest signal density is an outer 288 // pixel, the value of fConc (ratio of signal in two highest pixels 289 // to SIZE) should rather be 2*fConc1, under the simplest assumption 290 // that the light density inside the outer (large) pixel is uniform. 232 291 fConc = (maxpix1+maxpix2)/hillas.GetSize(); // [ratio] 233 292 fConc1 = maxpix1/hillas.GetSize(); // [ratio] 234 293 294 // 295 // Concentration around COG (it is calculated here, because the 296 // distance of the pixel to COG is calculated anyhow) 297 // 298 fConcCOG = 0; 299 for (UInt_t i=0; i<TMath::Min(3U, npix); i++) 300 fConcCOG += idx[i]<0 ? 0 : evt[idx[i]].GetNumPhotons()*geom.GetPixRatio(idx[i]); 301 fConcCOG /= hillas.GetSize(); // [ratio] 302 303 // Concentration of signal contained in ellipse 304 fConcCore /= hillas.GetSize(); 305 306 // if (fConcCore==0) 307 // fConcCore = fConcCOG/3; 308 235 309 SetReadyToSave(); 236 } 310 } 237 311 238 312 // -------------------------------------------------------------------------- … … 249 323 *fLog << " - Conc [1] = " << fConc << endl; 250 324 *fLog << " - Conc1 [1] = " << fConc1 << endl; 325 *fLog << " - ConcCOG [1] = " << fConcCOG << endl; 326 *fLog << " - ConcCore [1] = " << fConcCore << endl; 251 327 *fLog << " - Num Used Pixels [#] = " << fNumUsedPixels << endl; 252 328 *fLog << " - Num Core Pixels [#] = " << fNumCorePixels << endl; … … 271 347 *fLog << " - Conc [1] = " << fConc << endl; 272 348 *fLog << " - Conc1 [1] = " << fConc1 << endl; 349 *fLog << " - ConcCOG [1] = " << fConcCOG << endl; 350 *fLog << " - ConcCore [1] = " << fConcCore << endl; 273 351 *fLog << " - Num Used Pixels [#] = " << fNumUsedPixels << endl; 274 352 *fLog << " - Num Core Pixels [#] = " << fNumCorePixels << endl; -
trunk/MagicSoft/Mars/mimage/MNewImagePar.h
r6855 r7538 23 23 Float_t fConc; // [ratio] concentration ratio: sum of the two highest pixels / fSize 24 24 Float_t fConc1; // [ratio] concentration ratio: sum of the highest pixel / fSize 25 Float_t fConcCOG; // [ratio] concentration of the three pixels next to COG 26 Float_t fConcCore; // [ratio] concentration of signals inside or touching the ellipse 25 27 26 28 Float_t fUsedArea; // Area of pixels which survived the image cleaning … … 41 43 Float_t GetInnerSize() const { return fInnerSize; } 42 44 43 Float_t GetConc() const { return fConc; } 44 Float_t GetConc1() const { return fConc1; } 45 Float_t GetConc() const { return fConc; } 46 Float_t GetConc1() const { return fConc1; } 47 Float_t GetConcCOG() const { return fConcCOG; } 48 Float_t GetConcCore() const { return fConcCore; } 45 49 46 50 Short_t GetNumUsedPixels() const { return fNumUsedPixels; } … … 56 60 const MHillas &hillas, Int_t island=-1); 57 61 58 ClassDef(MNewImagePar, 4) // Container to hold new image parameters62 ClassDef(MNewImagePar, 5) // Container to hold new image parameters 59 63 }; 60 64
Note:
See TracChangeset
for help on using the changeset viewer.