Changeset 4702
- Timestamp:
- 08/23/04 11:41:30 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4700 r4702 34 34 * mimage/MHHillas.[h,cc]: 35 35 - added display of camera on top of MeanXY-plot 36 37 * mraw/MRawSocketRead.h: 38 - added GetFileName() 39 40 * manalysis/MCerPhotEvt.[h,cc]: 41 - added new data member fNumIslands 42 - added new functions (CalcIsland/CalcIslands to calculate islands) 43 - added new member function to sort pixels by index 44 - added island index in GetPixelContent 45 - increased version number 46 47 * manalysis/MCerPhotPix.[h,cc]: 48 - added fIdxIsland data member 49 - overloaded Compare function to be able to sort by pixel index 50 - increased version number 51 52 * mhist/MHEvent.[h,cc]: 53 - added new option for island index 54 55 * mimage/MImgCleanStd.[h,cc]: 56 - added island calculation after image cleaning 57 - fixed some output to be consistent 58 - added ReadEnv 59 - updated StreamPrimitive 60 61 * mimage/Makefile: 62 - added mhist 63 64 * mmain/MEventDisplay.cc: 65 - added display of island index 36 66 37 67 -
trunk/MagicSoft/Mars/NEWS
r4694 r4702 16 16 17 17 - Implemented automatic file splitting in MWriteRootFile 18 19 - After image cleaning an island index is assigned to all used pixels. 20 The index corresponds to the order of the islands in size. 18 21 19 22 -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
r3734 r4702 31 31 // risk! 32 32 // 33 // Class Version 3: 34 // ---------------- 35 // - added fNumIslands 36 // 33 37 // Class Version 2: 34 38 // ---------------- … … 46 50 #include <fstream> 47 51 52 #include <TArrayD.h> 48 53 #include <TCanvas.h> 49 54 … … 52 57 53 58 #include "MGeomCam.h" 59 #include "MGeomPix.h" 54 60 55 61 ClassImp(MCerPhotEvt); … … 96 102 void MCerPhotEvt::Reset() 97 103 { 98 fNumPixels = 0; 99 fMaxIndex = -1; 104 fNumPixels = 0; 105 fMaxIndex = -1; 106 fNumIslands = -1; 100 107 fLut.Set(0); 101 108 // fPixels->Delete(); … … 346 353 void MCerPhotEvt::RemoveUnusedPixels() 347 354 { 355 // Create iterator 348 356 TIter Next(fPixels); 349 357 MCerPhotPix *pix = NULL; 350 358 359 fMaxIndex = -1; 360 361 // Remove all unused pixels from list, calculate new fMaxIndex 351 362 while ((pix=(MCerPhotPix*)Next())) 363 { 352 364 if (!pix->IsPixelUsed()) 353 365 fPixels->Remove(pix); 354 366 else 367 fMaxIndex = TMath::Max(fMaxIndex, pix->GetPixId()); 368 } 369 370 // Crompress array 355 371 fPixels->Compress(); 372 373 // Get new number of entries in array 356 374 fNumPixels=fPixels->GetEntriesFast(); 375 376 // Rebuild lookup table 377 RebuildLut(); 357 378 } 358 379 … … 409 430 // -------------------------------------------------------------------------- 410 431 // 432 // This function recursively finds all pixels of one island and assigns 433 // the number num as island number to the pixel. 434 // 435 // 1) Check whether a pixel with the index idx exists, is unused 436 // and has not yet a island number assigned. 437 // 2) Assign the island number num to the pixel 438 // 3) Loop over all its neighbors taken from the geometry geom. For all 439 // neighbors recursively call this function (CalcIsland) 440 // 4) Sum the size of the pixel and all neighbors newly assigned 441 // (by CalcIsland) to this island 442 // 443 // Returns the sum of the pixel size. 444 // 445 Double_t MCerPhotEvt::CalcIsland(const MGeomCam &geom, Int_t idx, Int_t num) 446 { 447 // Try to get the pixel information of a pixel with this index 448 MCerPhotPix *pix = GetPixById(idx); 449 450 // If a pixel with this index is not existing... do nothing. 451 if (!pix) 452 return 0; 453 454 // If an island number was already assigned to this pixel... do nothing. 455 if (pix->GetIdxIsland()>=0) 456 return 0; 457 458 // If the pixel is an unused pixel... do nothing. 459 if (!pix->IsPixelUsed()) 460 return 0; 461 462 // Assign the new island number num to this used pixel 463 pix->SetIdxIsland(num); 464 465 // Get the geometry information (neighbors) of this pixel 466 const MGeomPix &gpix = geom[idx]; 467 468 // Get the size of this pixel 469 Double_t size = pix->GetNumPhotons(); 470 471 // Now do the same with all its neighbors and sum the 472 // sizes which they correspond to 473 const Int_t n = gpix.GetNumNeighbors(); 474 for (int i=0; i<n; i++) 475 size += CalcIsland(geom, gpix.GetNeighbor(i), num); 476 477 // return size of this (sub)cluster 478 return size; 479 } 480 481 // -------------------------------------------------------------------------- 482 // 483 // Each pixel which is maked as used is assigned an island number 484 // (starting from 0). A pixel without an island number assigned 485 // has island number -1. 486 // 487 // The index 0 corresponds to the island with the highest size (sum 488 // of GetNumPhotons() in island). The size is decreasing with 489 // increasing indices. 490 // 491 // The information about pixel neighbory is taken from the geometry 492 // MGeomCam geom; 493 // 494 // You can access this island number of a pixel with a call to 495 // MCerPhotPix->GetIdxIsland. The total number of islands available 496 // can be accessed with MCerPhotEvt->GetNumIslands. 497 // 498 // CalcIslands returns the number of islands found. If an error occurs, 499 // eg the geometry has less pixels than the highest index stored, -1 is 500 // returned. 501 // 502 Int_t MCerPhotEvt::CalcIslands(const MGeomCam &geom) 503 { 504 if (fMaxIndex<0 || fNumPixels<=0) 505 { 506 *fLog << err << "ERROR - MCerPhotEvt doesn't contain pixels!" << endl; 507 fNumIslands = 0; 508 return -1; 509 } 510 511 if ((UInt_t)fMaxIndex>=geom.GetNumPixels()) 512 { 513 *fLog << err << "ERROR - MCerPhotEvt::CalcIslands: Size mismatch - geometry too small!" << endl; 514 return -1; 515 } 516 517 // Create a list to hold the sizes of the islands (The maximum 518 // number of islands possible is rougly fNumPixels/4) 519 TArrayD size(fNumPixels/3); 520 521 // Calculate Islands 522 Int_t n=0; 523 524 // We could loop over all indices which looks more straight 525 // forward but should be a lot slower (assuming zero supression) 526 MCerPhotPix *pix=0; 527 528 TIter Next(*this); 529 while ((pix=static_cast<MCerPhotPix*>(Next()))) 530 { 531 // This 'if' is necessary (although it is done in GetIsland, too) 532 // because otherwise the counter (n) would be wrong. 533 // So only 'start' a new island for used pixels (selected by 534 // using the Iterator) which do not yet belong to another island. 535 if (pix->GetIdxIsland()<0) 536 { 537 Double_t sz = CalcIsland(geom, pix->GetPixId(), n); 538 size[n++] = sz; 539 } 540 } 541 542 // Create an array holding the indices 543 TArrayI idx(n); 544 545 // Sort the sizes descending 546 TMath::Sort(n, size.GetArray(), idx.GetArray(), kTRUE); 547 548 // Replace island numbers by size indices -- After this 549 // islands indices are sorted by the island size 550 Next.Reset(); 551 while ((pix=static_cast<MCerPhotPix*>(Next()))) 552 { 553 const Short_t i = pix->GetIdxIsland(); 554 555 // Find new index 556 Short_t j; 557 for (j=0; j<n; j++) 558 if (idx[j]==i) 559 break; 560 561 pix->SetIdxIsland(j==n ? -1 : j); 562 } 563 564 // Now assign number of islands found 565 fNumIslands = n; 566 567 // return number of island 568 return fNumIslands; 569 } 570 571 // -------------------------------------------------------------------------- 572 // 411 573 // Returns, depending on the type flag: 412 574 // … … 416 578 // 3: Number of Photons 417 579 // 4: Error 580 // 5: Island index 418 581 // 419 582 Bool_t MCerPhotEvt::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const … … 442 605 val = pix->GetErrorPhot(); 443 606 break; 607 case 5: 608 val = pix->GetIdxIsland(); 609 break; 444 610 default: 445 611 val = pix->GetNumPhotons()*ratio; -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
r3734 r4702 24 24 private: 25 25 UInt_t fNumPixels; 26 Short_t fNumIslands; 26 27 Int_t fMaxIndex; 27 28 TArrayI fLut; // Lookup tabel to lookup pixel by index 28 29 TClonesArray *fPixels; //-> FIXME: Change TClonesArray away from a pointer? 30 31 void RebuildLut() 32 { 33 // Resize Lut 34 fLut.Set(fMaxIndex+1); 35 36 // Reset Lut 37 fLut.Reset(-1); 38 39 // Rebuild Lut 40 for (UInt_t i=0; i<GetNumPixels(); i++) 41 { 42 const MCerPhotPix &pix = (*this)[i]; 43 fLut[pix.GetPixId()] = i; 44 } 45 } 46 47 Double_t CalcIsland(const MGeomCam &geom, Int_t idx, Int_t num); 29 48 30 49 public: … … 32 51 ~MCerPhotEvt() { delete fPixels; } 33 52 34 UInt_t GetNumPixels() const { return fNumPixels; } 35 //void InitSize(UInt_t num) { fPixels->Expand(num); } 53 // Setter function to fill pixels 54 MCerPhotPix *AddPixel(Int_t idx, Float_t nph=0, Float_t er=0); 55 void FixSize(); 36 56 37 MCerPhotPix *AddPixel(Int_t idx, Float_t nph=0, Float_t er=0);38 39 void FixSize();57 // Getter functions 58 UInt_t GetNumPixels() const { return fNumPixels; } 59 Short_t GetNumIslands() const { return fNumIslands; }; 40 60 41 61 Bool_t IsPixelExisting(Int_t id) const; … … 52 72 Float_t GetErrorPhotMax(const MGeomCam *geom=NULL) const; 53 73 74 // Getter functions to access single pixels 54 75 MCerPhotPix &operator[](int i) { return *(MCerPhotPix*)(fPixels->UncheckedAt(i)); } 55 76 MCerPhotPix &operator[](int i) const { return *(MCerPhotPix*)(fPixels->UncheckedAt(i)); } 56 77 78 MCerPhotPix *GetPixById(Int_t idx) const; 79 80 // Functions to change the contained data 57 81 void Scale(Double_t f) { fPixels->ForEach(MCerPhotPix, Scale)(f); } 58 82 void RemoveUnusedPixels(); 83 Int_t CalcIslands(const MGeomCam &geom); 84 void Sort(Int_t upto = kMaxInt) 85 { 86 // Sort pixels by index 87 fPixels->Sort(upto); 88 RebuildLut(); 89 } // For convinience: Sort pixels by index 59 90 60 MCerPhotPix *GetPixById(Int_t idx) const; 61 91 // class MParContainer 62 92 void Reset(); 63 93 94 // class TObject 64 95 void Print(Option_t *opt=NULL) const; 65 96 void Clear(Option_t *opt=NULL) { Reset(); } … … 69 100 void DrawPixelContent(Int_t num) const; 70 101 102 // To build an iterator for this class 71 103 operator TIterator*() const; 72 104 -
trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc
r3751 r4702 45 45 // - added fIsHGSaturated 46 46 // 47 // Version 5: 48 // ---------- 49 // - added fIdxIsland 50 // 47 51 //////////////////////////////////////////////////////////////////////////// 48 52 #include "MCerPhotPix.h" … … 60 64 // 61 65 MCerPhotPix::MCerPhotPix(Int_t pix, Float_t phot, Float_t errphot) : 62 fPixId(pix), fRing(1), fIsCore(kFALSE), fPhot(phot), fErrPhot(errphot), 66 fPixId(pix), fIsCore(kFALSE), fRing(1), fIdxIsland(-1), 67 fPhot(phot), fErrPhot(errphot), 63 68 fIsSaturated(kFALSE), fIsHGSaturated(kFALSE) 64 69 { 65 70 } 71 72 // -------------------------------------------------------------------------- 73 // 74 // From TObject: 75 // Compare abstract method. Must be overridden if a class wants to be able 76 // to compare itself with other objects. Must return -1 if this is smaller 77 // than obj, 0 if objects are equal and 1 if this is larger than obj. 78 // 79 // Here: 80 // Index numbers are compared 81 // 82 Int_t MCerPhotPix::Compare(const TObject *o) const 83 { 84 const Int_t diff = fPixId - static_cast<const MCerPhotPix*>(o)->fPixId; 85 return diff==0 ? 0 : TMath::Sign(1, diff); 86 } 66 87 67 88 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/manalysis/MCerPhotPix.h
r3751 r4702 12 12 Int_t fPixId; // the pixel Id 13 13 14 Short_t fRing; // NT: number of analyzed rings around the core pixels, fRing>0 means: used, fRing= 0 means: unused, fRing= -1 means: unmapped (no possible to use in the calculation of the image parameters) 15 Bool_t fIsCore; // the pixel is a Core pixel -> kTRUE 14 Bool_t fIsCore; // the pixel is a Core pixel -> kTRUE 15 Short_t fRing; // NT: number of analyzed rings around the core pixels, fRing>0 means: used, fRing= 0 means: unused, fRing= -1 means: unmapped (no possible to use in the calculation of the image parameters) 16 Short_t fIdxIsland; // the pixel is a Core pixel -> kTRUE 16 17 17 18 Float_t fPhot; // The number of Cerenkov photons … … 26 27 MCerPhotPix(Int_t pix=-1, Float_t phot=0, Float_t errphot=0); 27 28 28 Int_t 29 Float_t 30 Float_t 29 Int_t GetPixId() const { return fPixId; } 30 Float_t GetNumPhotons() const { return fPhot; } 31 Float_t GetErrorPhot() const { return fErrPhot; } 31 32 32 Bool_t IsPixelUsed() const { return fRing>0; } 33 Bool_t IsPixelUnmapped() const { return fRing==-1; } 34 void SetPixelUnused() { fRing=0; } 35 void SetPixelUsed() { fRing=1; } 36 void SetPixelUnmapped() { fRing=-1;} 33 Bool_t IsPixelUsed() const { return fRing>0; } 34 Bool_t IsPixelUnmapped() const { return fRing==-1; } 35 void SetPixelUnused() { fRing=0; } 36 void SetPixelUsed() { fRing=1; } 37 void SetPixelUnmapped() { fRing=-1;} 38 void SetIdxIsland(Short_t num) { fIdxIsland=num; } 39 Short_t GetIdxIsland() const { return fIdxIsland; } 37 40 38 void 39 Short_t 41 void SetRing(UShort_t r) { fRing = r; } 42 Short_t GetRing() const { return fRing;} 40 43 41 void 42 Bool_t 44 void SetPixelCore() { fIsCore = kTRUE; } 45 Bool_t IsPixelCore() const { return fIsCore; } 43 46 44 void 45 void 46 void 47 void SetNumPhotons(Float_t f) { fPhot = f; } 48 void SetErrorPhot(Float_t f) { fErrPhot = f; } 49 void Set(Float_t np, Float_t ep) { fPhot = np; fErrPhot = ep; } 47 50 48 void 49 Bool_t 51 void SetPixelSaturated() { fIsSaturated = kTRUE; } 52 Bool_t IsPixelSaturated() const { return fIsSaturated; } 50 53 51 void SetPixelHGSaturated(){ fIsHGSaturated = kTRUE; }52 Bool_t IsPixelHGSaturated() const{ return fIsHGSaturated; }54 void SetPixelHGSaturated() { fIsHGSaturated = kTRUE; } 55 Bool_t IsPixelHGSaturated() const { return fIsHGSaturated; } 53 56 54 void 57 void AddNumPhotons(Float_t f) { fPhot += f; } 55 58 56 void 59 void Scale(Float_t f) { fPhot/=f; } 57 60 58 void Print(Option_t *opt = NULL) const; 61 void Print(Option_t *opt = NULL) const; 62 Int_t Compare(const TObject *obj) const; 63 Bool_t IsSortable() const { return kTRUE; } 59 64 60 ClassDef(MCerPhotPix, 4) // class containing information about the Cerenkov Photons in a pixel65 ClassDef(MCerPhotPix, 5) // class containing information about the Cerenkov Photons in a pixel 61 66 }; 62 67 -
trunk/MagicSoft/Mars/mhist/MHEvent.cc
r3795 r4702 96 96 fMcEvt = (MMcEvt*)plist->FindObject("MMcEvt"); 97 97 98 99 98 fRawEvtData = (MRawEvtData*)plist->FindObject("MRawEvtData"); 99 if (!fRawEvtData) 100 100 *fLog << warn << "MRawEvtData not found..." << endl; 101 101 … … 165 165 fHist->SetName("Triggered pix"); 166 166 fHist->SetYTitle("ON/OFF"); 167 fHist->SetPrettyPalette(); 168 break; 169 case kEvtIslandIndex: 170 fHist->SetName("Island Index"); 171 fHist->SetYTitle("Index"); 167 172 fHist->SetPrettyPalette(); 168 173 break; … … 224 229 case kEvtTrigPix: 225 230 fHist->SetCamContent(*event, 0); 231 break; 232 case kEvtIslandIndex: 233 fHist->SetCamContent(*event, 5); 226 234 break; 227 235 } -
trunk/MagicSoft/Mars/mhist/MHEvent.h
r4524 r4702 22 22 kEvtSignalRaw, kEvtSignalDensity, kEvtPedestal, 23 23 kEvtPedestalRMS, kEvtRelativeSignal, kEvtCleaningLevels, 24 kEvtIdxMax, kEvtArrTime, kEvtTrigPix 24 kEvtIdxMax, kEvtArrTime, kEvtTrigPix, kEvtIslandIndex 25 25 }; 26 26 -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r4608 r4702 250 250 #include <fstream> // ofstream, SavePrimitive 251 251 252 #include <TEnv.h> 253 252 254 #include <TGFrame.h> // TGFrame 253 255 #include <TGLabel.h> // TGLabel … … 279 281 static const TString gsDefName = "MImgCleanStd"; 280 282 static const TString gsDefTitle = "Task to perform image cleaning"; 283 284 const TString MImgCleanStd::gsNamePedPhotCam="MPedPhotCam"; // default name of the 'MPedPhotCam' container 281 285 282 286 // -------------------------------------------------------------------------- … … 291 295 const char *name, const char *title) 292 296 : fCleaningMethod(kStandard), fCleanLvl1(lvl1), 293 fCleanLvl2(lvl2), fCleanRings(1), fNamePedPhotC ontainer("MPedPhotCam")297 fCleanLvl2(lvl2), fCleanRings(1), fNamePedPhotCam(gsNamePedPhotCam) 294 298 295 299 { … … 499 503 if (!fCam) 500 504 { 501 *fLog << dbginf<< "MGeomCam not found (no geometry information available)... aborting." << endl;505 *fLog << err << "MGeomCam not found (no geometry information available)... aborting." << endl; 502 506 return kFALSE; 503 507 } … … 506 510 if (!fEvt) 507 511 { 508 *fLog << dbginf<< "MCerPhotEvt not found... aborting." << endl;512 *fLog << err << "MCerPhotEvt not found... aborting." << endl; 509 513 return kFALSE; 510 514 } 511 515 512 fPed = (MPedPhotCam*)pList->FindObject(AddSerialNumber(fNamePedPhotC ontainer), "MPedPhotCam");516 fPed = (MPedPhotCam*)pList->FindObject(AddSerialNumber(fNamePedPhotCam), "MPedPhotCam"); 513 517 if (!fPed) 514 518 { 515 *fLog << dbginf<< "MPedPhotCam not found... aborting." << endl;519 *fLog << err << "MPedPhotCam not found... aborting." << endl; 516 520 return kFALSE; 517 521 } 522 523 fTime = (MArrivalTime*)pList->FindObject(AddSerialNumber("MArrivalTime")); 524 if (!fTime && fCleaningMethod==kProbability) 525 *fLog << warn << "MArrivalTime not found... probability cleaning done with signal only!" << endl; 518 526 519 527 fData = (MCameraData*)pList->FindCreateObj(AddSerialNumber("MCameraData")); … … 541 549 fData->CalcCleaningLevelDemocratic(*fEvt, *fPed, *fCam); 542 550 break; 551 /* 552 case kProbability: 553 fData->CalcCleaningProbability(*fEvt, *fPed, *fCam, fTime); 554 break;*/ 555 default: 556 break; 543 557 } 544 558 … … 556 570 // For speed reasons skip the rest of the cleaning if no 557 571 // action will be taken! 558 if (fCleanLvl1<=fCleanLvl2) 559 return kTRUE; 560 572 if (fCleanLvl1>fCleanLvl2) 573 { 561 574 #ifdef DEBUG 562 *fLog << all << "CleanStep 3" << endl;575 *fLog << all << "CleanStep 3" << endl; 563 576 #endif 564 CleanStep3(); 577 CleanStep3(); 578 } 579 580 #ifdef DEBUG 581 *fLog << all << "Calc Islands" << endl; 582 #endif 583 // Takes roughly 10% of the time 584 fEvt->CalcIslands(*fCam); 585 565 586 #ifdef DEBUG 566 587 *fLog << all << "Done." << endl; … … 587 608 case kScaled: 588 609 *fLog << "scaled"; 610 break; 611 case kProbability: 612 *fLog << "probability"; 589 613 break; 590 614 } … … 711 735 out << ");" << endl; 712 736 713 if (fCleaningMethod!=kDemocratic) 714 return; 715 716 out << " " << GetUniqueName() << ".SetMethod(MImgCleanStd::kDemocratic);" << endl; 717 718 if (fCleanRings==1) 719 return; 720 721 out << " " << GetUniqueName() << ".SetCleanRings(" << fCleanRings << ");" << endl; 722 } 737 if (fCleaningMethod!=kStandard) 738 { 739 out << " " << GetUniqueName() << ".SetMethod(MImgCleanStd::k"; 740 switch (fCleaningMethod) 741 { 742 case kScaled: out << "Scaled"; break; 743 case kDemocratic: out << "Democratic"; break; 744 case kProbability: out << "Probability"; break; 745 default: 746 break; 747 } 748 out << ");" << endl; 749 } 750 if (fCleanRings!=1) 751 out << " " << GetUniqueName() << ".SetCleanRings(" << fCleanRings << ");" << endl; 752 753 if (gsNamePedPhotCam!=fNamePedPhotCam) 754 out << " " << GetUniqueName() << ".SetNamePedPhotCam(\"" << fNamePedPhotCam << "\");" << endl; 755 } 756 757 // -------------------------------------------------------------------------- 758 // 759 // Read the setup from a TEnv, eg: 760 // MImgCleanStd.CleanLevel1: 3.0 761 // MImgCleanStd.CleanLevel2: 2.5 762 // MImgCleanStd.CleanMethod: Standard, Scaled, Democratic, Probability 763 // MImgCleanStd.CleanRings: 1 764 // 765 Int_t MImgCleanStd::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 766 { 767 Bool_t rc = kFALSE; 768 if (IsEnvDefined(env, prefix, "CleanRings", print)) 769 { 770 rc = kTRUE; 771 SetCleanRings(GetEnvValue(env, prefix, "CleanRings", fCleanRings)); 772 } 773 if (IsEnvDefined(env, prefix, "CleanLevel1", print)) 774 { 775 rc = kTRUE; 776 fCleanLvl1 = GetEnvValue(env, prefix, "CleanLevel1", fCleanLvl1); 777 } 778 if (IsEnvDefined(env, prefix, "CleanLevel2", print)) 779 { 780 rc = kTRUE; 781 fCleanLvl2 = GetEnvValue(env, prefix, "CleanLevel2", fCleanLvl2); 782 } 783 784 if (IsEnvDefined(env, prefix, "CleanMethod", print)) 785 { 786 rc = kTRUE; 787 TString s = GetEnvValue(env, prefix, "CleanMethod", ""); 788 s.ToLower(); 789 if (s.BeginsWith("standard")) 790 SetMethod(kStandard); 791 if (s.BeginsWith("scaled")) 792 SetMethod(kScaled); 793 if (s.BeginsWith("democratic")) 794 SetMethod(kDemocratic); 795 if (s.BeginsWith("probability")) 796 SetMethod(kProbability); 797 } 798 799 return rc; 800 } -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.h
r4586 r4702 11 11 class MCerPhotEvt; 12 12 class MPedPhotCam; 13 class MArrivalTime; 13 14 class MCameraData; 14 15 … … 21 22 kStandard, 22 23 kScaled, 23 kDemocratic 24 kDemocratic, 25 kProbability 24 26 } CleaningMethod_t; 25 27 26 28 private: 27 const MGeomCam *fCam; //! 28 MCerPhotEvt *fEvt; //! 29 MPedPhotCam *fPed; //! 30 MCameraData *fData; //! 29 static const TString gsNamePedPhotCam; // default name of the 'MPedPhotCam' container 30 31 const MGeomCam *fCam; //! 32 MCerPhotEvt *fEvt; //! 33 MPedPhotCam *fPed; //! 34 MArrivalTime *fTime; //! 35 MCameraData *fData; //! 31 36 32 37 CleaningMethod_t fCleaningMethod; 33 38 34 Float_t fCleanLvl1;35 Float_t fCleanLvl2;39 Float_t fCleanLvl1; 40 Float_t fCleanLvl2; 36 41 37 42 UShort_t fCleanRings; 38 43 39 Float_t fInnerNoise; //! 40 TString fNamePedPhotContainer; // name of the 'MPedPhotCam' container 44 TString fNamePedPhotCam; // name of the 'MPedPhotCam' container 41 45 42 46 43 void CreateGuiElements(MGGroupFrame *f); 44 void StreamPrimitive(ofstream &out) const; 47 void CreateGuiElements(MGGroupFrame *f); 48 void StreamPrimitive(ofstream &out) const; 49 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 45 50 46 void 47 void 51 void CleanStep3b(MCerPhotPix &pix); 52 void CleanStep4(UShort_t r, MCerPhotPix &pix); 48 53 49 54 void CleanStep1(); … … 56 61 public: 57 62 MImgCleanStd(const Float_t lvl1=3.0, const Float_t lvl2=2.5, 58 const char *name=NULL, const char *title=NULL);63 const char *name=NULL, const char *title=NULL); 59 64 void Print(Option_t *o="") const; 60 65 … … 67 72 68 73 Bool_t ProcessMessage(Int_t msg, Int_t submsg, Long_t param1, Long_t param2); 69 void SetNamePedPhotC ontainer(const char *name) { fNamePedPhotContainer= name; }74 void SetNamePedPhotCam(const char *name) { fNamePedPhotCam = name; } 70 75 71 76 ClassDef(MImgCleanStd, 2) // task doing the image cleaning -
trunk/MagicSoft/Mars/mimage/Makefile
r3927 r4702 20 20 # 21 21 INCLUDES = -I. -I../mbase -I../mhbase -I../mgeom -I../manalysis \ 22 -I../mgui -I../mmc -I../mpointing -I../mpedestal 22 -I../mgui -I../mmc -I../mpointing -I../mpedestal \ 23 -I../mhist 24 25 # mhist: MHHillas (MHCamera) 26 23 27 24 28 SRCFILES = MImgCleanStd.cc \ -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r4452 r4702 215 215 fEvtLoop->SetParList(plist); 216 216 217 MHEvent *evt1 = new MHEvent(MHEvent::kEvtSignalRaw); 218 MHEvent *evt2 = new MHEvent(MHEvent::kEvtSignalRaw); 219 MHEvent *evt3 = new MHEvent(MHEvent::kEvtPedestal); 220 MHEvent *evt4 = new MHEvent(MHEvent::kEvtPedestalRMS); 221 MHEvent *evt5 = new MHEvent(MHEvent::kEvtRelativeSignal); 222 MHEvent *evt6 = new MHEvent(MHEvent::kEvtCleaningLevels); 223 MHEvent *evt7 = new MHEvent(MHEvent::kEvtIdxMax); 224 MHEvent *evt8 = new MHEvent(MHEvent::kEvtArrTime); 225 MHEvent *evt9 = new MHEvent(MHEvent::kEvtTrigPix); 226 227 evt1->SetName("Signal"); 228 evt2->SetName("Cleaned"); 229 evt3->SetName("Pedestal"); 230 evt4->SetName("PedRMS"); 231 evt5->SetName("Signal/PedRMS"); 232 evt6->SetName("CleanLevels"); 233 evt7->SetName("Max Slice Idx"); 234 evt8->SetName("Arrival Time"); 235 evt9->SetName("Trigger"); 217 MHEvent *evt01 = new MHEvent(MHEvent::kEvtSignalRaw); 218 MHEvent *evt02 = new MHEvent(MHEvent::kEvtSignalRaw); 219 MHEvent *evt03 = new MHEvent(MHEvent::kEvtPedestal); 220 MHEvent *evt04 = new MHEvent(MHEvent::kEvtPedestalRMS); 221 MHEvent *evt05 = new MHEvent(MHEvent::kEvtRelativeSignal); 222 MHEvent *evt06 = new MHEvent(MHEvent::kEvtCleaningLevels); 223 MHEvent *evt07 = new MHEvent(MHEvent::kEvtIdxMax); 224 MHEvent *evt08 = new MHEvent(MHEvent::kEvtArrTime); 225 MHEvent *evt09 = new MHEvent(MHEvent::kEvtTrigPix); 226 MHEvent *evt10 = new MHEvent(MHEvent::kEvtIslandIndex); 227 228 evt01->SetName("Signal"); 229 evt02->SetName("Cleaned"); 230 evt03->SetName("Pedestal"); 231 evt04->SetName("PedRMS"); 232 evt05->SetName("Signal/PedRMS"); 233 evt06->SetName("CleanLevels"); 234 evt07->SetName("Max Slice Idx"); 235 evt08->SetName("Arrival Time"); 236 evt09->SetName("Trigger"); 237 evt10->SetName("Islands"); 236 238 237 239 // This makes sure, that the containers are deleted... 238 plist->AddToList(evt1); 239 plist->AddToList(evt2); 240 plist->AddToList(evt3); 241 plist->AddToList(evt4); 242 plist->AddToList(evt5); 243 plist->AddToList(evt6); 244 plist->AddToList(evt7); 245 plist->AddToList(evt8); 246 plist->AddToList(evt9); 247 248 MCerPhotAnal2 *nanal = new MCerPhotAnal2; 249 MFillH *fill1 = new MFillH(evt1, "MCerPhotEvt", "MFillH1"); 250 MImgCleanStd *clean = new MImgCleanStd; 251 MFillH *fill2 = new MFillH(evt2, "MCerPhotEvt", "MFillH2"); 252 MFillH *fill3 = new MFillH(evt3, "MPedPhotCam", "MFillH3"); 253 MFillH *fill4 = new MFillH(evt4, "MPedPhotCam", "MFillH4"); 254 MFillH *fill5 = new MFillH(evt5, "MCameraData", "MFillH5"); 255 MFillH *fill6 = new MFillH(evt6, "MCameraData", "MFillH6"); 240 plist->AddToList(evt01); 241 plist->AddToList(evt02); 242 plist->AddToList(evt03); 243 plist->AddToList(evt04); 244 plist->AddToList(evt05); 245 plist->AddToList(evt06); 246 plist->AddToList(evt07); 247 plist->AddToList(evt08); 248 plist->AddToList(evt09); 249 plist->AddToList(evt10); 250 251 MCerPhotAnal2 *nanal = new MCerPhotAnal2; 252 MFillH *fill01 = new MFillH(evt01, "MCerPhotEvt", "MFillH01"); 253 MImgCleanStd *clean = new MImgCleanStd; 254 MFillH *fill02 = new MFillH(evt02, "MCerPhotEvt", "MFillH02"); 255 MFillH *fill03 = new MFillH(evt03, "MPedPhotCam", "MFillH03"); 256 MFillH *fill04 = new MFillH(evt04, "MPedPhotCam", "MFillH04"); 257 MFillH *fill05 = new MFillH(evt05, "MCameraData", "MFillH05"); 258 MFillH *fill06 = new MFillH(evt06, "MCameraData", "MFillH06"); 256 259 // MBlindPixelCalc *blind = new MBlindPixelCalc; 257 MHillasCalc *hcalc = new MHillasCalc; 258 MHillasSrcCalc *scalc = new MHillasSrcCalc; 259 MMcTriggerLvl2Calc *trcal = new MMcTriggerLvl2Calc; 260 MFillH *fill9 = new MFillH(evt9, "MMcTriggerLvl2", "MFillH9"); 260 MHillasCalc *hcalc = new MHillasCalc; 261 MHillasSrcCalc *scalc = new MHillasSrcCalc; 262 MMcTriggerLvl2Calc *trcal = new MMcTriggerLvl2Calc; 263 MFillH *fill09 = new MFillH(evt09, "MMcTriggerLvl2", "MFillH09"); 264 MFillH *fill10 = new MFillH(evt10, "MCerPhotEvt", "MFillH10"); 261 265 262 266 // If no pedestal or no calibration file is availble … … 285 289 mcupd->SetFilter(f1); 286 290 mccal->SetFilter(f1); 287 trcal->SetFilter(f1); 291 trcal->SetFilter(f1); 292 //fill09->SetFilter(f1); 288 293 289 294 // Data … … 309 314 } 310 315 311 tlist->AddToList(fill 1);316 tlist->AddToList(fill01); 312 317 tlist->AddToList(clean); 313 tlist->AddToList(fill 2);314 tlist->AddToList(fill 3);315 tlist->AddToList(fill 4);316 tlist->AddToList(fill 5);317 tlist->AddToList(fill 6);318 tlist->AddToList(fill02); 319 tlist->AddToList(fill03); 320 tlist->AddToList(fill04); 321 tlist->AddToList(fill05); 322 tlist->AddToList(fill06); 318 323 // tlist->AddToList(blind); 319 324 tlist->AddToList(hcalc); 320 325 tlist->AddToList(scalc); 326 tlist->AddToList(fill10); 321 327 322 328 if (!pcam || !ccam) 323 329 { 324 330 MArrivalTimeCalc *tcalc = new MArrivalTimeCalc; 325 MFillH *fill 7 = new MFillH(evt7, "MRawEvtData", "MFillH7");326 MFillH *fill 8 = new MFillH(evt8, "MArrivalTimeCam", "MFillH8");331 MFillH *fill07 = new MFillH(evt07, "MRawEvtData", "MFillH7"); 332 MFillH *fill08 = new MFillH(evt08, "MArrivalTimeCam", "MFillH8"); 327 333 tlist->AddToList(tcalc); 328 tlist->AddToList(fill 7);329 tlist->AddToList(fill 8);334 tlist->AddToList(fill07); 335 tlist->AddToList(fill08); 330 336 331 337 tlist->AddToList(trcal); 332 tlist->AddToList(fill 9);338 tlist->AddToList(fill09); 333 339 } 334 340
Note:
See TracChangeset
for help on using the changeset viewer.