Changeset 2488
- Timestamp:
- 11/07/03 19:03:41 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2487 r2488 47 47 * mraw/MRawEvtPixelIter.[h,cc]: 48 48 - added a fixes for the case that fData->fLoGainPixId->GetArray()=NULL 49 50 * manalysis/Makefile, manalysis/AnalysisLinkDef.h: 51 - added MCameraData 52 53 * manalysis/MCameraData.[h,cc]: 54 - added 55 56 * mhist/MHEvent.[h,cc]: 57 - fixed display of levels 58 - fixed unallowed characters 59 60 * mimage/MImgCleanStd.[h,cc]: 61 - moved the calculation for signal/noise to MCameraData 62 63 * mmain/MEventDisplay.cc: 64 - added display for cleaning data and levels 49 65 50 66 -
trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
r2440 r2488 11 11 #pragma link C++ class MCerPhotCalc+; 12 12 13 //#pragma link C++ class MRelSignal+;13 #pragma link C++ class MCameraData+; 14 14 15 15 #pragma link C++ class MBlindPixels+; -
trunk/MagicSoft/Mars/manalysis/Makefile
r2440 r2488 37 37 MGeomApply.cc \ 38 38 MCurrents.cc \ 39 MCameraData.cc \ 39 40 MEnergyEst.cc \ 40 41 MEnergyEstimate.cc \ … … 69 70 MCT1PadONOFF.cc 70 71 71 # MRelSignal.cc \72 72 73 73 SRCS = $(SRCFILES) -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r2484 r2488 1144 1144 TIter Next(gPad->GetListOfPrimitives()); 1145 1145 TObject *o; 1146 while (o=Next()) cout << o ->GetName() << " " << o->IsA()->GetName() << endl;1146 while (o=Next()) cout << o << ": " << o->GetName() << " " << o->IsA()->GetName() << endl; 1147 1147 */ 1148 1148 -
trunk/MagicSoft/Mars/mhist/MHEvent.cc
r2482 r2488 64 64 #include "MRawRunHeader.h" 65 65 #include "MRawEvtData.h" 66 #include "MImgCleanStd.h" 66 67 67 68 ClassImp(MHEvent); … … 140 141 break; 141 142 case kEvtCleaningLevels: 143 if (!fImgCleanStd) 144 { 145 *fLog << err << "MImgCleanStd not found... aborting." << endl; 146 return kFALSE; 147 } 142 148 fHist->SetName("CleanLevels"); 143 149 fHist->SetYTitle("L"); 144 if (!fImgCleanStd)145 return kFALSE;146 150 break; 147 151 } … … 171 175 break; 172 176 case kEvtRelativeSignal: 177 fHist->SetCamContent(*(MCamEvent*)par, 0); 178 break; 173 179 case kEvtCleaningLevels: 174 fHist->SetCamContent(*(MCamEvent*)par, 0); 180 { 181 TArrayF lvl(2); 182 lvl[0] = fImgCleanStd->GetCleanLvl2(); 183 lvl[1] = fImgCleanStd->GetCleanLvl1(); 184 fHist->SetCamContent(*(MCamEvent*)par, 0); 185 fHist->SetLevels(lvl); 186 } 175 187 break; 176 188 } … … 193 205 if (fMcEvt) 194 206 { 195 TString txt ;// = "#splitline{";207 TString txt("#splitline{"); 196 208 197 209 switch (fMcEvt->GetPartId()) … … 214 226 s.Insert(0, txt); 215 227 216 //s += "}{";228 s += "}{"; 217 229 s += " E="; 218 230 if (fMcEvt->GetEnergy()>1000) … … 224 236 s += "m ZA="; 225 237 s += (int)(fMcEvt->GetTheta()*180/TMath::Pi()+.5); 226 s += " °";238 s += "\xb0 "; 227 239 s += fMcEvt->GetPhotElfromShower(); 228 240 s += "PhEl"; 229 //s += "}";241 s += "}"; 230 242 } 231 243 -
trunk/MagicSoft/Mars/mhist/MHEvent.h
r2482 r2488 15 15 class MPedestalCam; 16 16 class MImgCleanStd; 17 class M RelSignal;17 class MCameraSignal; 18 18 19 19 class MHEvent : public MH … … 34 34 MPedestalCam *fPedestalCam; //! 35 35 MImgCleanStd *fImgCleanStd; //! 36 MCameraSignal *fCamSignal; //! 36 37 37 38 MRawEvtData *fClone; //-> -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r2470 r2488 266 266 #include "MParList.h" 267 267 #include "MSigmabar.h" 268 #include "MCameraData.h" 268 269 269 270 #include "MGeomPix.h" … … 312 313 // -------------------------------------------------------------------------- 313 314 // 314 // NT 28/04/2003: now the option to use the standard method or the 315 // The first step of cleaning defines the CORE pixels. All the other pixels 316 // are set as UNUSED and belong to RING 0. 317 // After this point, only the CORE pixels are set as USED, with RING 318 // number 1. 319 // 320 // NT 28/04/2003: now the option to use the standard method or the 315 321 // democratic method is implemented: 316 322 // 317 // KStandard: This method looks for all pixels with an entry (photons) 318 // that is three times bigger than the noise of the pixel 319 // (default: 3 sigma, clean level 1) 320 // 321 // -------------------------------------------------------------------------- 322 // 323 // Returns the maximum Pixel Id (used for ispixused in CleanStep2) 324 // 325 void MImgCleanStd::CleanStep1Std() 323 // kStandard: This method looks for all pixels with an entry (photons) 324 // that is three times bigger than the noise of the pixel 325 // (default: 3 sigma, clean level 1) 326 // 327 // kDemocratic: this method looks for all pixels with an entry (photons) 328 // that is n times bigger than the noise of the mean of the 329 // inner pixels (default: 3 sigmabar, clean level 1) 330 // 331 // 332 void MImgCleanStd::CleanStep1() 326 333 { 327 334 const Int_t entries = fEvt->GetNumPixels(); 328 329 // 330 // check the number of all pixels against the noise level and 331 // set them to 'unused' state if necessary 332 // 333 334 for (Int_t i=0; i<entries; i++ ) 335 { 336 MCerPhotPix &pix = (*fEvt)[i]; 337 338 const Int_t idx = pix.GetPixId(); 339 340 const Float_t entry = pix.GetNumPhotons(); 341 const Float_t noise = (*fPed)[idx].GetPedestalRms(); 342 343 // 344 // We calculate a correction factor which accounts for the 345 // fact that pixels have different size (see TDAS 02-14). 346 // 347 const Double_t factor = fCam->GetPixRatioSqrt(idx); 348 349 // COBB: '<=' to skip entry=noise=0 350 if (entry * factor <= fCleanLvl1 * noise) 351 pix.SetPixelUnused(); 352 } 353 } 354 355 // -------------------------------------------------------------------------- 356 // 357 // NT 28/04/2003: now the option to use the standard method or the 358 // democratic method is implemented: 359 // 360 // "KDemocratic": this method looks for all pixels with an entry (photons) 361 // that is n times bigger than the noise of the mean of the 362 // inner pixels (default: 3 sigmabar, clean level 1) 363 // 364 // Returns the maximum Pixel Id (used for ispixused in CleanStep2) 365 // 366 void MImgCleanStd::CleanStep1Dem() 367 { 368 const Int_t entries = fEvt->GetNumPixels(); 335 const TArrayD &data = fData->GetData(); 369 336 370 337 // … … 376 343 MCerPhotPix &pix = (*fEvt)[i]; 377 344 378 const Int_t idx = pix.GetPixId(); 379 380 const Float_t entry = pix.GetNumPhotons(); 381 const Double_t ratio = fCam->GetPixRatio(idx); 382 383 // COBB: '<=' to skip entry=noise=0 384 if (entry * ratio <= fCleanLvl1 * fInnerNoise) 345 if (data[pix.GetPixId()] <= fCleanLvl1) 385 346 pix.SetPixelUnused(); 386 }387 }388 389 // --------------------------------------------------------------------------390 // The first step of cleaning defines the CORE pixels. All the other pixels391 // are set as UNUSED and belong to RING 0.392 // After this point, only the CORE pixels are set as USED, with RING393 // number 1.394 // Returns the maximum Pixel Id (used for ispixused in CleanStep2)395 //396 void MImgCleanStd::CleanStep1()397 {398 switch (fCleaningMethod)399 {400 case kStandard:401 CleanStep1Std();402 return;403 case kDemocratic:404 CleanStep1Dem();405 return;406 347 } 407 348 } … … 487 428 } 488 429 489 490 // --------------------------------------------------------------------------491 //492 // Look for the boundary pixels around the core pixels493 // if a pixel has more than 2.5 (clean level 2.5) sigma, and494 // a core neigbor it is declared as used.495 //496 Bool_t MImgCleanStd::CleanStep3Std(const MCerPhotPix &pix)497 {498 //499 // get pixel id of this entry500 //501 const Int_t idx = pix.GetPixId();502 503 //504 // check the num of photons against the noise level505 //506 const Float_t entry = pix.GetNumPhotons();507 const Float_t noise = (*fPed)[idx].GetPedestalRms();508 509 //510 // We calculate a correction factor which accounts for the511 // fact that pixels have different size (see TDAS 02-14).512 //513 const Double_t factor = fCam->GetPixRatioSqrt(idx);514 515 return (entry * factor <= fCleanLvl2 * noise);516 }517 518 // --------------------------------------------------------------------------519 //520 // Look for the boundary pixels around the core pixels521 // if a pixel has more than 2.5 (clean level 2.5) sigmabar and522 // a core neighbor, it is declared as used.523 //524 Bool_t MImgCleanStd::CleanStep3Dem(const MCerPhotPix &pix)525 {526 //527 // get pixel id of this entry528 //529 const Int_t idx = pix.GetPixId();530 531 //532 // check the num of photons against the noise level533 //534 const Float_t entry = pix.GetNumPhotons();535 const Double_t ratio = fCam->GetPixRatio(idx);536 537 return (entry * ratio <= fCleanLvl2 * fInnerNoise);538 }539 540 430 void MImgCleanStd::CleanStep3b(MCerPhotPix &pix) 541 431 { … … 598 488 // -------------------------------------------------------------------------- 599 489 // 600 // 601 // 602 // 490 // Look for the boundary pixels around the core pixels 491 // if a pixel has more than 2.5 (clean level 2.5) sigma, and 492 // a core neigbor, it is declared as used. 603 493 // 604 494 void MImgCleanStd::CleanStep3() 605 495 { 606 496 const Int_t entries = fEvt->GetNumPixels(); 497 const TArrayD &data = fData->GetData(); 607 498 608 499 for (UShort_t r=1; r<fCleanRings+1; r++) … … 621 512 continue; 622 513 623 switch (fCleaningMethod) 624 { 625 case kStandard: 626 if (CleanStep3Std(pix)) 627 continue; 628 break; 629 case kDemocratic: 630 if (CleanStep3Dem(pix)) 631 continue; 632 break; 633 } 514 if (data[pix.GetPixId()] <= fCleanLvl2) 515 continue; 634 516 635 517 if (r==1) … … 681 563 } 682 564 565 fData = (MCameraData*)pList->FindCreateObj(AddSerialNumber("MCameraData")); 566 if (!fData) 567 return kFALSE; 568 683 569 return kTRUE; 684 570 } … … 691 577 { 692 578 if (fSgb) 693 fInnerNoise = fSgb->GetSigmabarInner(); 579 fData->Calc(*fEvt, *fSgb, *fCam); 580 else 581 fData->Calc(*fEvt, *fPed, *fCam); 582 694 583 #ifdef DEBUG 695 584 *fLog << all << "CleanStep 1" << endl; -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.h
r2237 r2488 11 11 class MCerPhotEvt; 12 12 class MPedestalCam; 13 class MCameraData; 13 14 14 15 class MGGroupFrame; … … 27 28 MSigmabar *fSgb; //! 28 29 MPedestalCam *fPed; //! 30 MCameraData *fData; //! 29 31 30 32 CleaningMethod_t fCleaningMethod; … … 40 42 void StreamPrimitive(ofstream &out) const; 41 43 42 void CleanStep1Dem();43 void CleanStep1Std();44 Bool_t CleanStep3Dem(const MCerPhotPix &pix);45 Bool_t CleanStep3Std(const MCerPhotPix &pix);46 44 void CleanStep3b(MCerPhotPix &pix); 47 45 void CleanStep4(UShort_t r, MCerPhotPix &pix); -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r2484 r2488 187 187 MFillH *fill3 = new MFillH(evt3, "MPedestalCam", "MFillH3"); 188 188 MFillH *fill4 = new MFillH(evt4, "MPedestalCam", "MFillH4"); 189 MFillH *fill5 = new MFillH(evt5, "M RelSignal","MFillH5");190 MFillH *fill6 = new MFillH(evt6, "M RelSignal","MFillH6");189 MFillH *fill5 = new MFillH(evt5, "MCameraData", "MFillH5"); 190 MFillH *fill6 = new MFillH(evt6, "MCameraData", "MFillH6"); 191 191 MBlindPixelCalc *blind = new MBlindPixelCalc; 192 192 MHillasCalc *hcalc = new MHillasCalc; … … 201 201 tlist->AddToList(fill3); 202 202 tlist->AddToList(fill4); 203 //tlist->AddToList(fill5);204 //tlist->AddToList(fill6);203 tlist->AddToList(fill5); 204 tlist->AddToList(fill6); 205 205 tlist->AddToList(blind); 206 206 tlist->AddToList(hcalc); … … 469 469 // 470 470 TObject *hillas = plist->FindObject("MHillas"); 471 for (int i=1; i< 5;i++)471 for (int i=1; i<7;i++) 472 472 { 473 473 TCanvas *c = GetCanvas(i);
Note:
See TracChangeset
for help on using the changeset viewer.