- Timestamp:
- 08/04/04 11:19:34 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4450 r4452 46 46 - fixed some errors in the documentation 47 47 - changed ClassDef to 1 48 - changed the new algorithms such that any number of different pixel-49 sizes are supported48 - changed the new algorithms such that any number of different 49 pixel-sizes are supported 50 50 - small modifications to the sanity checks 51 51 -
trunk/MagicSoft/Mars/manalysis/MCameraData.h
r4444 r4452 45 45 const MGeomCam &geom); 46 46 47 /*48 void Calc(const MCerPhotEvt &evt, const MGeomCam &geom)49 {50 CalcCleaningLevel(evt, 1, geom);51 }52 */53 47 const TArrayD &GetData() const { return fData; } 54 48 const TArrayC &GetValidity() const { return fValidity; } … … 59 53 void DrawPixelContent(Int_t num) const; 60 54 61 ClassDef(MCameraData, 2) // class for an event containing cerenkov photons55 ClassDef(MCameraData, 1) // Generalized storage class for camera data 62 56 }; 63 57 -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsTreat.h
r3892 r4452 56 56 b ? SETBIT(fFlags, kProcessRMS) : CLRBIT(fFlags, kProcessRMS); 57 57 } 58 void SetNumMinNeighbors( UShort_t num) { fNumMinNeighbors=num; }58 void SetNumMinNeighbors(Byte_t num) { fNumMinNeighbors=num; } 59 59 60 60 -
trunk/MagicSoft/Mars/mbase/MArgs.cc
r2728 r4452 18 18 ! Author(s): Thomas Bretz, 7/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2003 20 ! Copyright: MAGIC Software Development, 2003-2004 21 21 ! 22 22 ! -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r4368 r4452 952 952 } 953 953 954 fLog->ReadEnv(env, prefix, print); 955 954 956 return kTRUE; 955 957 } … … 1003 1005 } 1004 1006 1007 fLog->WriteEnv(env, prefix, print); 1008 1005 1009 return kTRUE; 1006 1010 } -
trunk/MagicSoft/Mars/mbase/MLog.cc
r4253 r4452 108 108 109 109 #include "MLogPlugin.h" 110 #include "MParContainer.h" 111 #include "MArgs.h" 110 112 111 113 ClassImp(MLog); … … 509 511 // -------------------------------------------------------------------------- 510 512 // 513 // Setup MLog and global debug output from command line arguments. 514 // 515 // gLog << " -v# Verbosity level # [default=2]" << endl; 516 // gLog << " -a, --no-colors Do not use Ansii color codes" << endl; 517 // gLog << " --debug[=n] Enable root debugging (Default: gDebug=1)" << endl; 518 // 519 void MLog::Setup(MArgs &arg) 520 { 521 if (arg.HasOnlyAndRemove("--no-colors") || arg.HasOnlyAndRemove("-a")) 522 SetNoColors(); 523 524 SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2); 525 526 gDebug = arg.HasOption("--debug=") ? arg.GetIntAndRemove("--debug=") : 0; 527 if (gDebug==0 && arg.HasOnlyAndRemove("--debug")) 528 gDebug=1; 529 } 530 531 // -------------------------------------------------------------------------- 532 // 533 // Read the setup from a TEnv: 534 // MLog.VerbosityLevel: 0, 1, 2, 3, 4 535 // MLog.DebugLevel: 0, 1, 2, 3, 4 536 // MLog.NoColors 537 // 538 // Depending on your setup it might be correct to use something like: 539 // Job1.MLog.VerbosityLevel: 1 540 // Job1.DebugLevel: 2 541 // Job1.MLog.NoColors 542 // 543 void MLog::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 544 { 545 if (!prefix.IsNull()) 546 prefix += "."; 547 prefix += "MLog"; 548 549 MParContainer mlog("MLog"); 550 551 if (mlog.IsEnvDefined(env, prefix, "VerbosityLevel", print)) 552 SetDebugLevel(mlog.GetEnvValue(env, prefix, "VerbosityLevel", 2)); 553 554 if (mlog.IsEnvDefined(env, prefix, "DebugLevel", print)) 555 gDebug = mlog.GetEnvValue(env, prefix, "DebugLevel", 0); 556 557 if (mlog.IsEnvDefined(env, prefix, "NoColors", print)) 558 if (mlog.GetEnvValue(env, prefix, "NoColors", 1)>0) 559 SetNoColors(); 560 } 561 562 // -------------------------------------------------------------------------- 563 // 564 // Read the setup from a TEnv: 565 // MLog.VerbosityLevel: 0, 1, 2, 3, 4 566 // MLog.DebugLevel: 0, 1, 2, 3, 4 567 // MLog.NoColors 568 // 569 // Depending on your setup it might be correct to use something like: 570 // Job1.MLog.VerbosityLevel: 1 571 // Job1.DebugLevel: 2 572 // Job1.MLog.NoColors 573 // 574 void MLog::WriteEnv(TEnv &env, TString prefix, Bool_t print) const 575 { 576 if (!prefix.IsNull()) 577 prefix += "."; 578 prefix += "MLog"; 579 580 cout << "MLog::WriteEnv: not yet implemented!" << endl; 581 } 582 583 // -------------------------------------------------------------------------- 584 // 511 585 // Create a new instance of an file output stream 512 586 // an set the corresponding flag -
trunk/MagicSoft/Mars/mbase/MLog.h
r4253 r4452 13 13 #define bsz 160 // two standard lines 14 14 15 class MArgs; 16 17 class TEnv; 15 18 class TMutex; 16 19 class TGTextView; … … 181 184 void SetNoColors(Bool_t flag=kTRUE) { flag ? SetBit(eNoColors) : ResetBit(eNoColors); } 182 185 186 void Setup(MArgs &arg); 187 188 void ReadEnv(const TEnv &env, TString prefix="", Bool_t print=kFALSE); 189 void WriteEnv(TEnv &env, TString prefix="", Bool_t print=kFALSE) const; 190 183 191 void Separator(TString str="", int outlvl=0) 184 192 { -
trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc
r2206 r4452 34 34 // This is a simple way to develop new code in a macro without need 35 35 // to compile it. 36 // 37 // Example: 38 // Int_t Process() 39 // { 40 // gLog << "Processing..." << endl; 41 // return kTRUE; 42 // } 43 // 44 // void main() 45 // { 46 // MTaskInteractive task; 47 // task.SetProcess(Process); 48 // MTaskList list; 49 // list.AddToList(&task); 50 // } 51 // 36 52 // 37 53 // Input Containers: -
trunk/MagicSoft/Mars/mbase/MTaskInteractive.h
r2206 r4452 1 1 #ifndef MARS_MTaskInteractive 2 2 #define MARS_MTaskInteractive 3 4 /////////////////////////////////////////////////////////////////////////////5 // //6 // MTaskInteractive //7 // //8 // Does nothing than return kCONTINUE in the Process-fucntion //9 // (use with filters) //10 // //11 /////////////////////////////////////////////////////////////////////////////12 3 13 4 #ifndef MARS_MTask -
trunk/MagicSoft/Mars/mbase/MTime.cc
r4358 r4452 157 157 // strange offsets. You can get rid of this by calling: 158 158 // TAxis::SetTimeFormat("[your-format] %F1995-01-01 00:00:00"); 159 // 160 // Be carefull: It seems that root takes sommer and winter time into account! 161 // In some circumstances you may need 162 // TAxis::SetTimeFormat("[your-format] %F1995-01-00 23:00:00"); 159 163 // 160 164 Double_t MTime::GetAxisTime() const -
trunk/MagicSoft/Mars/merpp.cc
r3800 r4452 116 116 } 117 117 118 if (arg.HasOnlyAndRemove("--no-colors") || arg.HasOnlyAndRemove("-a")) 119 gLog.SetNoColors(); 118 gLog.Setup(arg); 120 119 121 120 const Int_t kComprlvl = arg.HasOption("-c") ? arg.GetIntAndRemove("-c") : 2; … … 124 123 const Bool_t kForce = arg.HasOnlyAndRemove("-f"); 125 124 const Bool_t kForceProc = arg.HasOnlyAndRemove("-ff"); 126 127 gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2);128 129 gDebug = arg.HasOption("--debug=") ? arg.GetIntAndRemove("--debug=") : 0;130 if (gDebug==0 && arg.HasOnlyAndRemove("--debug"))131 gDebug=1;132 125 133 126 MTime kTimeStart; … … 145 138 if (kTimeStop) 146 139 gLog << inf << "Stop Time: " << kTimeStop << endl; 140 141 if (arg.GetNumOptions()>0) 142 { 143 gLog << warn << "WARNING - Unknown commandline options..." << endl; 144 arg.Print("options"); 145 gLog << endl; 146 } 147 147 148 148 // -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r3415 r4452 128 128 // the terms commonly used in the class. 129 129 // 130 // 130 131 // STANDARD CLEANING: 131 132 // ================= … … 165 166 // // add the image cleaning to the main task list 166 167 // 168 // 167 169 // DEMOCRATIC CLEANING: 168 170 // =================== 169 171 // You use this cleaning method when you want to compare the number of 170 // photo-electons of each pixel with the average pedestal RMS 171 // (fInnerNoise = fSgb->GetSigmabarInner()) of the inner pixels (for the 172 // MAGIC camera they are the smaller ones): 172 // photo-electons of each pixel with the average pedestal RMS of the 173 // inner pixels (for the MAGIC camera they are the smaller ones): 173 174 //Begin_Html 174 175 // <img src="images/MImgCleanStd-f2.png"> … … 178 179 // have a different area) are compared to the same pedestal RMS, coming 179 180 // from the inner pixels. 180 // To calculate the average pedestal RMS of the inner pixels, you have to 181 // add to the main task list an object of type MSigmabarCalc before the 182 // MImgCleanStd object. To know how the calculation of fInnerNoise is done 183 // look at the MSigmabarCalc Class. 184 // 185 // Example: 186 // 187 // MSigmabarCalc sbcalc; 188 // //creates an object that calcutates the average pedestal RMS 189 // MImgCleanStd clean; 190 // ... 191 // tlist.AddToList(&sbcalc); 192 // tlist.AddToList(&clean); 181 // 182 // Make sure that you used a class calculating the MPedPhotCam which also 183 // updated the contents of the mean values (Recalc) correctly. 184 // 193 185 // 194 186 // Member Function: SetMethod() … … 206 198 // clean.SetMethod(MImgCleanStd::kDemocratic); 207 199 // //now the method of cleaning is changed to Democratic 200 // 208 201 // 209 202 // FIRST AND SECOND CLEANING LEVEL … … 245 238 // Input Containers: 246 239 // MGeomCam 240 // MPedPhotCam 247 241 // MCerPhotEvt 248 // [MSigmabar]249 242 // 250 243 // Output Containers: … … 265 258 266 259 #include "MParList.h" 267 #include "MSigmabar.h"268 260 #include "MCameraData.h" 269 261 … … 298 290 MImgCleanStd::MImgCleanStd(const Float_t lvl1, const Float_t lvl2, 299 291 const char *name, const char *title) 300 : f Sgb(NULL), fCleaningMethod(kStandard), fCleanLvl1(lvl1),292 : fCleaningMethod(kStandard), fCleanLvl1(lvl1), 301 293 fCleanLvl2(lvl2), fCleanRings(1) 302 294 … … 358 350 359 351 while ((pix=static_cast<MCerPhotPix*>(Next()))) 360 352 { 361 353 // get pixel id of this entry 362 354 const Int_t idx = pix->GetPixId(); … … 391 383 Next.Reset(); 392 384 while ((pix=static_cast<MCerPhotPix*>(Next()))) 393 { 394 if ( pix->IsPixelUsed()) 395 pix->SetPixelCore();} 385 { 386 if (pix->IsPixelUsed()) 387 pix->SetPixelCore(); 388 } 396 389 } 397 390 … … 434 427 // 435 428 if (pix.GetRing() != 0) 436 { 437 return; 438 } 429 return; 439 430 440 431 // … … 480 471 MCerPhotEvtIter NextAll(fEvt, kFALSE); 481 472 while ((pix=static_cast<MCerPhotPix*>(NextAll()))) 482 473 { 483 474 // 484 475 // if pixel is a core pixel or unmapped, go to the next pixel 485 476 // 486 if (pix->IsPixelCore()) 487 { 488 continue;} 489 if (pix->IsPixelUnmapped()) 490 { 491 continue;} 492 493 if (data[pix->GetPixId()] <= fCleanLvl2) 494 { 495 continue;} 496 497 if (r==1) 498 { 499 CleanStep3b(*pix);} 500 else 501 { 502 CleanStep4(r, *pix);} 503 477 if (pix->IsPixelCore() || pix->IsPixelUnmapped()) 478 continue; 479 480 if (data[pix->GetPixId()] <= fCleanLvl2) 481 continue; 482 483 if (r==1) 484 CleanStep3b(*pix); 485 else 486 CleanStep4(r, *pix); 504 487 } 505 488 } … … 527 510 } 528 511 529 if (fCleaningMethod == kDemocratic) 530 { 531 fSgb = (MSigmabar*)pList->FindObject(AddSerialNumber("MSigmabar")); 532 if (!fSgb) 533 { 534 *fLog << dbginf << "MSigmabar not found... aborting." << endl; 535 return kFALSE; 536 } 537 } 538 else 539 { 540 fPed = (MPedPhotCam*)pList->FindObject(AddSerialNumber("MPedPhotCam")); 541 if (!fPed) 542 { 543 *fLog << dbginf << "MPedPhotCam not found... aborting." << endl; 544 return kFALSE; 545 } 512 fPed = (MPedPhotCam*)pList->FindObject(AddSerialNumber("MPedPhotCam")); 513 if (!fPed) 514 { 515 *fLog << dbginf << "MPedPhotCam not found... aborting." << endl; 516 return kFALSE; 546 517 } 547 518 … … 559 530 Int_t MImgCleanStd::Process() 560 531 { 561 if (fSgb)562 fData->CalcCleaningLevel(*fEvt, *fSgb, *fCam);563 else532 switch (fCleaningMethod) 533 { 534 case kStandard: 564 535 fData->CalcCleaningLevel(*fEvt, *fPed, *fCam); 536 break; 537 case kScaled: 538 fData->CalcCleaningLevel2(*fEvt, *fPed, *fCam); 539 break; 540 case kDemocratic: 541 fData->CalcCleaningLevelDemocratic(*fEvt, *fPed, *fCam); 542 break; 543 } 565 544 566 545 #ifdef DEBUG … … 568 547 #endif 569 548 CleanStep1(); 549 550 // For speed reasons skip the rest of the cleaning if no 551 // action will be taken! 552 if (fCleanLvl1>=fCleanLvl2) 553 return kTRUE; 570 554 571 555 #ifdef DEBUG … … 599 583 *fLog << "standard"; 600 584 break; 585 case kScaled: 586 *fLog << "scaled"; 587 break; 601 588 } 602 589 *fLog << " cleaning initialized with noise level " << fCleanLvl1 << " and " << fCleanLvl2; … … 611 598 void MImgCleanStd::CreateGuiElements(MGGroupFrame *f) 612 599 { 613 // 614 // Create a frame for line 3 and 4 to be able 615 // to align entry field and label in one line 616 // 617 TGHorizontalFrame *f1 = new TGHorizontalFrame(f, 0, 0); 618 TGHorizontalFrame *f2 = new TGHorizontalFrame(f, 0, 0); 600 // 601 // Create a frame for line 3 and 4 to be able 602 // to align entry field and label in one line 603 // 604 TGHorizontalFrame *f1 = new TGHorizontalFrame(f, 0, 0); 605 TGHorizontalFrame *f2 = new TGHorizontalFrame(f, 0, 0); 606 607 /* 608 * --> use with root >=3.02 <-- 609 * 610 611 TGNumberEntry *fNumEntry1 = new TGNumberEntry(frame, 3.0, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative); 612 TGNumberEntry *fNumEntry2 = new TGNumberEntry(frame, 2.5, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative); 619 613 620 /* 621 * --> use with root >=3.02 <-- 622 * 623 624 TGNumberEntry *fNumEntry1 = new TGNumberEntry(frame, 3.0, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative); 625 TGNumberEntry *fNumEntry2 = new TGNumberEntry(frame, 2.5, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative); 626 627 */ 628 TGTextEntry *entry1 = new TGTextEntry(f1, "****", kImgCleanLvl1); 629 TGTextEntry *entry2 = new TGTextEntry(f2, "****", kImgCleanLvl2); 630 631 // --- doesn't work like expected (until root 3.02?) --- fNumEntry1->SetAlignment(kTextRight); 632 // --- doesn't work like expected (until root 3.02?) --- fNumEntry2->SetAlignment(kTextRight); 633 634 entry1->SetText("3.0"); 635 entry2->SetText("2.5"); 636 637 entry1->Associate(f); 638 entry2->Associate(f); 639 640 TGLabel *l1 = new TGLabel(f1, "Cleaning Level 1"); 641 TGLabel *l2 = new TGLabel(f2, "Cleaning Level 2"); 642 643 l1->SetTextJustify(kTextLeft); 644 l2->SetTextJustify(kTextLeft); 645 646 // 647 // Align the text of the label centered, left in the row 648 // with a left padding of 10 649 // 650 TGLayoutHints *laylabel = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 10); 651 TGLayoutHints *layframe = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 5, 0, 10); 652 653 // 654 // Add one entry field and the corresponding label to each line 655 // 656 f1->AddFrame(entry1); 657 f2->AddFrame(entry2); 658 659 f1->AddFrame(l1, laylabel); 660 f2->AddFrame(l2, laylabel); 661 662 f->AddFrame(f1, layframe); 663 f->AddFrame(f2, layframe); 664 665 f->AddToList(entry1); 666 f->AddToList(entry2); 667 f->AddToList(l1); 668 f->AddToList(l2); 669 f->AddToList(laylabel); 670 f->AddToList(layframe); 614 */ 615 TGTextEntry *entry1 = new TGTextEntry(f1, "****", kImgCleanLvl1); 616 TGTextEntry *entry2 = new TGTextEntry(f2, "****", kImgCleanLvl2); 617 618 // --- doesn't work like expected (until root 3.02?) --- fNumEntry1->SetAlignment(kTextRight); 619 // --- doesn't work like expected (until root 3.02?) --- fNumEntry2->SetAlignment(kTextRight); 620 621 entry1->SetText("3.0"); 622 entry2->SetText("2.5"); 623 624 entry1->Associate(f); 625 entry2->Associate(f); 626 627 TGLabel *l1 = new TGLabel(f1, "Cleaning Level 1"); 628 TGLabel *l2 = new TGLabel(f2, "Cleaning Level 2"); 629 630 l1->SetTextJustify(kTextLeft); 631 l2->SetTextJustify(kTextLeft); 632 633 // 634 // Align the text of the label centered, left in the row 635 // with a left padding of 10 636 // 637 TGLayoutHints *laylabel = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 10); 638 TGLayoutHints *layframe = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 5, 0, 10); 639 640 // 641 // Add one entry field and the corresponding label to each line 642 // 643 f1->AddFrame(entry1); 644 f2->AddFrame(entry2); 645 646 f1->AddFrame(l1, laylabel); 647 f2->AddFrame(l2, laylabel); 648 649 f->AddFrame(f1, layframe); 650 f->AddFrame(f2, layframe); 651 652 f->AddToList(entry1); 653 f->AddToList(entry2); 654 f->AddToList(l1); 655 f->AddToList(l2); 656 f->AddToList(laylabel); 657 f->AddToList(layframe); 671 658 } 672 659 -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.h
r2781 r4452 20 20 typedef enum { 21 21 kStandard, 22 kScaled, 22 23 kDemocratic 23 24 } CleaningMethod_t; … … 26 27 const MGeomCam *fCam; //! 27 28 MCerPhotEvt *fEvt; //! 28 MSigmabar *fSgb; //!29 29 MPedPhotCam *fPed; //! 30 30 MCameraData *fData; //! -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r3926 r4452 69 69 #include "MHillasCalc.h" // MHillasCalc 70 70 #include "MHillasSrcCalc.h" // MHillasSrcCalc 71 #include "MBlindPixelCalc.h" // MBlindPixelCalc71 //#include "MBlindPixelCalc.h" // MBlindPixelCalc 72 72 #include "MArrivalTimeCalc.h" // MArrivalTimeCalc 73 73 #include "MFillH.h" // MFillH … … 254 254 MFillH *fill5 = new MFillH(evt5, "MCameraData", "MFillH5"); 255 255 MFillH *fill6 = new MFillH(evt6, "MCameraData", "MFillH6"); 256 MBlindPixelCalc *blind = new MBlindPixelCalc;256 // MBlindPixelCalc *blind = new MBlindPixelCalc; 257 257 MHillasCalc *hcalc = new MHillasCalc; 258 258 MHillasSrcCalc *scalc = new MHillasSrcCalc; … … 316 316 tlist->AddToList(fill5); 317 317 tlist->AddToList(fill6); 318 tlist->AddToList(blind);318 // tlist->AddToList(blind); 319 319 tlist->AddToList(hcalc); 320 320 tlist->AddToList(scalc);
Note:
See TracChangeset
for help on using the changeset viewer.