Changeset 6489
- Timestamp:
- 02/15/05 16:18:28 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r6480 r6489 31 31 - replaced mutal exclusive options (Integral, Amplitude) by 32 32 a one-line resource "ExtractionType" (old code still works) 33 34 * manalysis/MCerPhotEvt.[h,cc]: 35 - added new variables to store information about islands 36 and removed pixels - PRELIMINARY 37 - increased class version number 38 39 * mfilter/MFSoftwareTrigger.cc: 40 - optimized output in PostProcess 41 42 * mimage/MHImagePar.[h,cc]: 43 - added new histograms for new variables in MCerPhotEvt 44 45 * mimage/MImagePar.[h,cc]: 46 - added new data members for the new image parameters 47 - increased class version 48 49 * mimage/MImgCleanStd.[h,cc]: 50 - adapted image cleaning to calculate the new image 51 parameters 52 - added a flag to keep single core pixels 53 33 54 34 55 -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
r4702 r6489 31 31 // risk! 32 32 // 33 // Class Version 4: 34 // ---------------- 35 // - added Short_t fNumSinglePixels; 36 // - added Float_t fSizeSinglePixels; 37 // - added Float_t fSizeSubIslands; 38 // - added Float_t fSizeMainIsland; 39 // 33 40 // Class Version 3: 34 41 // ---------------- … … 102 109 void MCerPhotEvt::Reset() 103 110 { 104 fNumPixels = 0; 105 fMaxIndex = -1; 106 fNumIslands = -1; 111 fNumPixels = 0; 112 fNumSinglePixels = 0; 113 fSizeSinglePixels = 0; 114 fSizeSubIslands = 0; 115 fSizeMainIsland = 0; 116 fMaxIndex = -1; 117 fNumIslands = -1; 107 118 fLut.Set(0); 108 119 // fPixels->Delete(); … … 516 527 517 528 // Create a list to hold the sizes of the islands (The maximum 518 // number of islands possible is roug ly fNumPixels/4)529 // number of islands possible is roughly fNumPixels/4) 519 530 TArrayD size(fNumPixels/3); 520 531 521 532 // Calculate Islands 522 Int_t n=0; 533 Int_t n=0; 534 Float_t totsize = 0; 523 535 524 536 // We could loop over all indices which looks more straight … … 535 547 if (pix->GetIdxIsland()<0) 536 548 { 537 Double_t sz = CalcIsland(geom, pix->GetPixId(), n); 549 // Don't put this in one line! n is used twice... 550 const Double_t sz = CalcIsland(geom, pix->GetPixId(), n); 538 551 size[n++] = sz; 552 totsize += sz; 539 553 } 540 554 } … … 563 577 564 578 // Now assign number of islands found 565 fNumIslands = n; 579 fNumIslands = n; 580 fSizeSubIslands = n>0 ? totsize-size[idx[0]] : 0; 581 fSizeMainIsland = n>0 ? size[idx[0]] : 0; 566 582 567 583 // return number of island -
trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
r4732 r6489 25 25 UInt_t fNumPixels; 26 26 Short_t fNumIslands; 27 Short_t fNumSinglePixels; 28 Float_t fSizeSinglePixels; 29 Float_t fSizeSubIslands; 30 Float_t fSizeMainIsland; 27 31 Int_t fMaxIndex; 28 32 TArrayI fLut; // Lookup tabel to lookup pixel by index … … 58 62 UInt_t GetNumPixels() const { return fNumPixels; } 59 63 Short_t GetNumIslands() const { return fNumIslands; }; 64 Short_t GetNumSinglePixels() const { return fNumSinglePixels; } 65 Float_t GetSizeSinglePixels() const { return fSizeSinglePixels; } 66 Float_t GetSizeSubIslands() const { return fSizeSubIslands; } 67 Float_t GetSizeMainIsland() const { return fSizeMainIsland; } 68 69 // Setter functions for use in image cleaning classes only 70 void SetSinglePixels(Short_t num, Float_t size) { fNumSinglePixels=num; fSizeSinglePixels=size; } 60 71 61 72 Bool_t IsPixelExisting(Int_t id) const; … … 103 114 operator TIterator*() const; 104 115 105 ClassDef(MCerPhotEvt, 3) // class for an event containing cerenkov photons116 ClassDef(MCerPhotEvt, 4) // class for an event containing cerenkov photons 106 117 }; 107 118 -
trunk/MagicSoft/Mars/mfilter/MFSoftwareTrigger.cc
r6460 r6489 435 435 *fLog << inf << endl; 436 436 *fLog << GetDescriptor() << " execution statistics:" << endl; 437 *fLog << " Threshold=" << fThreshold << ", Number=" << (int)fNumNeighbors; 438 if (fTimeWindow>0) 439 *fLog << ", Time Window=" << fTimeWindow; 440 *fLog << endl; 437 441 *fLog << dec << setfill(' '); 438 442 439 443 *fLog << " " << setw(7) << fCut[0] << " (" << setw(3) ; 440 444 *fLog << (int)(fCut[0]*100/GetNumExecutions()); 441 *fLog << "%) Evts fullfilled" << type; 442 *fLog << " (Thresh>=" << fThreshold << ", Num>=" << (int)fNumNeighbors; 443 if (fTimeWindow>0) 444 *fLog << ", Win=" << fTimeWindow; 445 *fLog << ")" << endl; 445 *fLog << "%) Evts fullfilled" << type << endl; 446 446 *fLog << " " << setw(7) << fCut[1] << " (" << setw(3) ; 447 447 *fLog << (int)(fCut[1]*100/GetNumExecutions()); -
trunk/MagicSoft/Mars/mimage/MHImagePar.cc
r5994 r6489 66 66 fHistSatHi.SetDirectory(NULL); 67 67 fHistSatHi.UseCurrentStyle(); 68 fHistSatHi.SetLineColor(kBlue); 68 69 fHistSatHi.SetFillStyle(4000); 69 70 … … 72 73 fHistSatLo.SetXTitle("Pixels"); 73 74 fHistSatLo.SetYTitle("Counts"); 74 fHistSatLo.SetLineColor(kBlue);75 75 fHistSatLo.SetDirectory(NULL); 76 76 fHistSatLo.UseCurrentStyle(); … … 83 83 fHistIslands.SetDirectory(NULL); 84 84 fHistIslands.UseCurrentStyle(); 85 fHistIslands.SetLineColor(kBlue);85 //fHistIslands.SetLineColor(kBlue); 86 86 fHistIslands.SetFillStyle(4000); 87 87 88 fHistSizeSubIslands.SetName("SizeSub"); 89 fHistSizeSubIslands.SetTitle("Size of Sub Islands"); 90 fHistSizeSubIslands.SetXTitle("S [phe]"); 91 fHistSizeSubIslands.SetYTitle("Counts"); 92 fHistSizeSubIslands.SetDirectory(NULL); 93 fHistSizeSubIslands.UseCurrentStyle(); 94 fHistSizeSubIslands.SetLineColor(kBlue); 95 fHistSizeSubIslands.SetFillStyle(4000); 96 97 fHistSizeMainIsland.SetName("SizeMain"); 98 fHistSizeMainIsland.SetTitle("Size of Main Island"); 99 fHistSizeMainIsland.SetXTitle("S [phe]"); 100 fHistSizeMainIsland.SetYTitle("Counts"); 101 fHistSizeMainIsland.SetDirectory(NULL); 102 fHistSizeMainIsland.UseCurrentStyle(); 103 fHistSizeMainIsland.SetFillStyle(4000); 104 105 fHistNumSP.SetName("NumSP"); 106 fHistNumSP.SetTitle("Number of single core pixels"); 107 fHistNumSP.SetXTitle("N"); 108 fHistNumSP.SetYTitle("Counts"); 109 fHistNumSP.SetDirectory(NULL); 110 fHistNumSP.UseCurrentStyle(); 111 //fHistNumSP.SetLineColor(kBlue); 112 fHistNumSP.SetFillStyle(4000); 113 114 fHistSizeSP.SetName("SizeSP"); 115 fHistSizeSP.SetTitle("Size of single core pixels"); 116 fHistSizeSP.SetXTitle("S [phe]"); 117 fHistSizeSP.SetYTitle("Counts"); 118 fHistSizeSP.SetDirectory(NULL); 119 fHistSizeSP.UseCurrentStyle(); 120 //fHistSizeSP.SetLineColor(kBlue); 121 fHistSizeSP.SetFillStyle(4000); 122 123 88 124 MBinning bins; 89 125 90 126 bins.SetEdges(60, -0.5, 59.5); 127 bins.Apply(fHistSatLo); 91 128 bins.Apply(fHistSatHi); 92 bins.Apply(fHistSatHi); 129 bins.Apply(fHistNumSP); 130 131 bins.SetEdgesLog(50, 1, 1e7); 132 bins.Apply(fHistSizeSubIslands); 133 bins.Apply(fHistSizeMainIsland); 134 bins.Apply(fHistSizeSP); 93 135 94 136 bins.SetEdges(15, 0.5, 15.5); … … 103 145 Bool_t MHImagePar::SetupFill(const MParList *plist) 104 146 { 147 ApplyBinning(*plist, "Pixels", &fHistSatLo); 105 148 ApplyBinning(*plist, "Pixels", &fHistSatHi); 106 ApplyBinning(*plist, "Pixels", &fHist SatHi);149 ApplyBinning(*plist, "Pixels", &fHistNumSP); 107 150 108 151 ApplyBinning(*plist, "Islands", &fHistIslands); 152 153 ApplyBinning(*plist, "Size", &fHistSizeSubIslands); 154 ApplyBinning(*plist, "Size", &fHistSizeMainIsland); 155 ApplyBinning(*plist, "Size", &fHistSizeSP); 109 156 110 157 return kTRUE; … … 126 173 const MImagePar &h = *(MImagePar*)par; 127 174 128 fHistSatHi.Fill(h.GetNumSatPixelsHG(), w); 129 fHistSatLo.Fill(h.GetNumSatPixelsLG(), w); 130 131 fHistIslands.Fill(h.GetNumIslands(), w); 175 fHistSatHi.Fill(h.GetNumSatPixelsHG(), w); 176 fHistSatLo.Fill(h.GetNumSatPixelsLG(), w); 177 fHistNumSP.Fill(h.GetNumSinglePixels(), w); 178 fHistSizeSP.Fill(h.GetSizeSinglePixels(), w); 179 fHistSizeSubIslands.Fill(h.GetSizeSubIslands(), w); 180 fHistSizeMainIsland.Fill(h.GetSizeMainIsland(), w); 181 fHistIslands.Fill(h.GetNumIslands(), w); 132 182 133 183 return kTRUE; … … 136 186 void MHImagePar::Paint(Option_t *o) 137 187 { 138 /*139 if (TString(o)==(TString)"log1" && fHistSatHi.GetMaximum()>0)140 gPad->SetLogy();141 if (TString(o)==(TString)"log2" && fHistIslands.GetMaximum()>0)142 gPad->SetLogy();143 */144 188 if (fHistSatHi.GetMaximum()>0 && gPad->GetPad(1)) 145 189 gPad->GetPad(1)->SetLogy(); 146 if (fHistIslands.GetMaximum()>0 && gPad->GetPad(2)) 147 gPad->GetPad(2)->SetLogy(); 190 if (fHistIslands.GetMaximum()>0 && gPad->GetPad(3)) 191 gPad->GetPad(3)->SetLogy(); 192 193 TVirtualPad *pad = gPad->GetPad(2); 194 if (pad) 195 { 196 if (fHistNumSP.GetMaximum()>0 && pad->GetPad(1)) 197 pad->GetPad(1)->SetLogy(); 198 if (fHistSizeSP.GetMaximum()>0 && pad->GetPad(2)) 199 { 200 pad->GetPad(2)->SetLogx(); 201 pad->GetPad(2)->SetLogy(); 202 } 203 } 204 if (fHistSizeMainIsland.GetMaximum()>0 && gPad->GetPad(4)) 205 { 206 gPad->GetPad(4)->SetLogx(); 207 gPad->GetPad(4)->SetLogy(); 208 } 148 209 } 149 210 … … 168 229 169 230 if (!same) 170 pad->Divide( 1,2);231 pad->Divide(2,2); 171 232 else 172 233 fHistIslands.SetLineColor(kGreen); … … 177 238 gPad->SetBorderMode(0); 178 239 MH::DrawSame(fHistSatHi, fHistSatLo, "Saturating Pixels"); 179 fHistSatHi.SetMinimum(); // switch off to allow log-scale 180 fHistSatLo.SetMinimum(); // switch off to allow log-scale 181 fHistSatLo.SetMaximum(0.1); // dummy value to allow log-scale 182 //AppendPad("log1"); 240 fHistSatHi.SetMinimum(); // switch off to allow log-scale 241 fHistSatLo.SetMinimum(); // switch off to allow log-scale 242 fHistSatLo.SetMaximum(0.1); // dummy value to allow log-scale 243 244 pad->cd(4); 245 gPad->SetBorderMode(0); 246 MH::DrawSame(fHistSizeMainIsland, fHistSizeSubIslands, "Sizes..."); 247 fHistSizeMainIsland.SetMinimum(); // switch off to allow log-scale 248 fHistSizeSubIslands.SetMinimum(); // switch off to allow log-scale 249 fHistSizeSubIslands.SetMaximum(0.1); // dummy value to allow log-scale 183 250 } 184 251 185 252 pad->cd(2); 186 253 gPad->SetBorderMode(0); 254 pad->GetPad(2)->Divide(1,2,0,0); 255 pad->GetPad(2)->cd(1); 256 gPad->SetBorderMode(0); 257 fHistNumSP.Draw(same?"same":""); 258 pad->GetPad(2)->cd(2); 259 gPad->SetBorderMode(0); 260 fHistSizeSP.Draw(same?"same":""); 261 262 pad->cd(3); 263 gPad->SetBorderMode(0); 187 264 fHistIslands.Draw(same?"same":""); 188 //AppendPad("log2");189 265 } 190 266 -
trunk/MagicSoft/Mars/mimage/MHImagePar.h
r4834 r6489 14 14 { 15 15 private: 16 TH1F fHistSatHi; // Number of pixels with sat hi-gain17 TH1F fHistSatLo; // Number of pixels with sat lo-gain16 TH1F fHistSatHi; // Number of pixels with sat hi-gain 17 TH1F fHistSatLo; // Number of pixels with sat lo-gain 18 18 19 TH1F fHistIslands; // Number of islands per event 19 TH1F fHistIslands; // Number of islands per event 20 TH1F fHistSizeSubIslands; // Size of sub islands 21 TH1F fHistSizeMainIsland; // Size of main island 22 23 TH1F fHistNumSP; // Number of single core pixels 24 TH1F fHistSizeSP; // size of single core pixels 25 26 Short_t fNumSatPixelsHG; // number of pixels with saturating hi-gains 27 Short_t fNumSatPixelsLG; // number of pixels with saturating lo-gains 20 28 21 29 public: … … 39 47 40 48 #endif 41 42 -
trunk/MagicSoft/Mars/mimage/MImagePar.cc
r4826 r6489 29 29 // Storage Container for new image parameters 30 30 // 31 // Class Version 2: 32 // ---------------- 33 // - added Short_t fNumSinglePixels; 34 // - added Float_t fSizeSinglePixels; 35 // - added Float_t fSizeSubIslands; 36 // 37 // Class Version 1: 38 // ---------------- 31 39 // Short_t fNumIslands; // number of islands found 32 40 // … … 63 71 void MImagePar::Reset() 64 72 { 65 fNumIslands = -1; 73 fNumIslands = -1; 74 fNumSinglePixels = -1; 66 75 67 fNumSatPixelsHG = -1; 68 fNumSatPixelsLG = -1; 76 fNumSatPixelsHG = -1; 77 fNumSatPixelsLG = -1; 78 79 fSizeSinglePixels = -1; 80 fSizeSubIslands = -1; 81 fSizeMainIsland = -1; 69 82 } 70 83 … … 91 104 92 105 // Get number of islands 93 fNumIslands = evt.GetNumIslands(); 106 fNumIslands = evt.GetNumIslands(); 107 fNumSinglePixels = evt.GetNumSinglePixels(); 108 fSizeSinglePixels = evt.GetSizeSinglePixels(); 109 fSizeSubIslands = evt.GetSizeSubIslands(); 110 fSizeMainIsland = evt.GetSizeMainIsland(); 94 111 95 112 SetReadyToSave(); … … 102 119 *fLog << all; 103 120 *fLog << "Image Parameters (" << GetName() << ")" << endl; 104 *fLog << " - Num Islands [#] = " << fNumIslands << " Islands" << endl; 105 *fLog << " - Sat.Pixels/HG [#] = " << fNumSatPixelsHG << " Pixels" << endl; 106 *fLog << " - Sat.Pixels/LG [#] = " << fNumSatPixelsLG << " Pixels" << endl; 121 *fLog << " - Num Islands [#] = " << fNumIslands << " Islands" << endl; 122 *fLog << " - Sat.Pixels (HG) [#] = " << fNumSatPixelsHG << " Pixels" << endl; 123 *fLog << " - Sat.Pixels (LG) [#] = " << fNumSatPixelsLG << " Pixels" << endl; 124 *fLog << " - Num rmvd CorePix [#] = " << fNumSinglePixels << " Pixels" << endl; 125 *fLog << " - Sz rmvd CorePix [#] = " << fSizeSinglePixels << " CerPhot" << endl; 126 *fLog << " - Size Sub Islands [#] = " << fSizeSubIslands << " CerPhot" << endl; 127 *fLog << " - Size Main Island [#] = " << fSizeMainIsland << " CerPhot" << endl; 107 128 } -
trunk/MagicSoft/Mars/mimage/MImagePar.h
r4710 r6489 14 14 private: 15 15 Short_t fNumIslands; // Number of islands found 16 Short_t fNumSinglePixels; 17 18 Float_t fSizeSinglePixels; 19 Float_t fSizeSubIslands; 20 Float_t fSizeMainIsland; 16 21 17 22 Short_t fNumSatPixelsHG; // number of pixels with saturating hi-gains … … 27 32 Short_t GetNumSatPixelsHG() const { return fNumSatPixelsHG; } 28 33 Short_t GetNumSatPixelsLG() const { return fNumSatPixelsLG; } 34 Short_t GetNumSinglePixels() const { return fNumSinglePixels; } 35 Float_t GetSizeSinglePixels() const { return fSizeSinglePixels; } 36 Float_t GetSizeSubIslands() const { return fSizeSubIslands; } 37 Float_t GetSizeMainIsland() const { return fSizeMainIsland; } 29 38 30 39 void Print(Option_t *opt=NULL) const; … … 32 41 void Calc(const MCerPhotEvt &evt); 33 42 34 ClassDef(MImagePar, 1) // Container to hold (geometry and island independant) image parameters43 ClassDef(MImagePar, 2) // Container to hold (geometry and island independant) image parameters 35 44 }; 36 45 -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
r5690 r6489 339 339 const char *name, const char *title) 340 340 : fCleaningMethod(kStandard), fCleanLvl1(lvl1), 341 fCleanLvl2(lvl2), fCleanRings(1), f NamePedPhotCam(gsNamePedPhotCam),342 fName GeomCam(gsNameGeomCam), fNameCerPhotEvt(gsNameCerPhotEvt)343 341 fCleanLvl2(lvl2), fCleanRings(1), fKeepSinglePixels(kFALSE), 342 fNamePedPhotCam(gsNamePedPhotCam), fNameGeomCam(gsNameGeomCam), 343 fNameCerPhotEvt(gsNameCerPhotEvt) 344 344 { 345 345 fName = name ? name : gsDefName.Data(); … … 386 386 // 387 387 // Check if the survived pixel have a neighbor, that also 388 // survived, otherwise set pixel to unused (removes pixels without 389 // neighbors). 390 // 391 void MImgCleanStd::CleanStep2() 392 { 388 // survived. Set all single pixels Unused if !fKeepSinglePixels. Now we 389 // declare all pixels that survived previous CleanSteps as CorePixels. 390 // Return number of single pixels, and there cumulative size in size. 391 // 392 Short_t MImgCleanStd::CleanStep2(Float_t &size) 393 { 394 Short_t n=0; 395 size = 0; 396 393 397 MCerPhotPix *pix; 394 398 … … 420 424 } 421 425 422 if (hasNeighbor == kFALSE) 423 pix->SetPixelUnused(); 424 } 425 426 // 427 // now we declare all pixels that survive as CorePixels 428 // 426 if (hasNeighbor == kFALSE) 427 { 428 if (!fKeepSinglePixels) 429 pix->SetPixelUnused(); 430 size += pix->GetNumPhotons(); 431 n++; 432 } 433 } 429 434 430 435 Next.Reset(); … … 434 439 pix->SetPixelCore(); 435 440 } 441 442 return n; 436 443 } 437 444 … … 613 620 *fLog << all << "CleanStep 2" << endl; 614 621 #endif 615 CleanStep2(); 622 Float_t size; 623 const Short_t n = CleanStep2(size); 624 fEvt->SetSinglePixels(n, size); 616 625 617 626 // For speed reasons skip the rest of the cleaning if no … … 812 821 if (gsNameCerPhotEvt!=fNameCerPhotEvt) 813 822 out << " " << GetUniqueName() << ".SetNameCerPhotEvt(\"" << fNameCerPhotEvt << "\");" << endl; 823 if (fKeepSinglePixels) 824 out << " " << GetUniqueName() << ".SetKeepSinglePixels();" << endl; 825 814 826 } 815 827 … … 821 833 // MImgCleanStd.CleanMethod: Standard, Scaled, Democratic, Probability, Absolute 822 834 // MImgCleanStd.CleanRings: 1 835 // MImgCleanStd.KeepSinglePixels: yes, no 823 836 // 824 837 Int_t MImgCleanStd::ReadEnv(const TEnv &env, TString prefix, Bool_t print) … … 839 852 rc = kTRUE; 840 853 fCleanLvl2 = GetEnvValue(env, prefix, "CleanLevel2", fCleanLvl2); 854 } 855 if (IsEnvDefined(env, prefix, "KeepSinglePixels", print)) 856 { 857 rc = kTRUE; 858 fKeepSinglePixels = GetEnvValue(env, prefix, "KeepSinglePixels", fKeepSinglePixels); 841 859 } 842 860 -
trunk/MagicSoft/Mars/mimage/MImgCleanStd.h
r5690 r6489 44 44 45 45 UShort_t fCleanRings; 46 Bool_t fKeepSinglePixels; 46 47 47 48 TString fNamePedPhotCam; // name of the 'MPedPhotCam' container … … 49 50 TString fNameCerPhotEvt; // name of the 'MCerPhotEvt' container 50 51 52 // MImgCleanStd 53 void CleanStep1(); 54 Short_t CleanStep2(Float_t &size); 55 void CleanStep3(); 56 void CleanStep3b(MCerPhotPix &pix); 57 void CleanStep4(UShort_t r, MCerPhotPix &pix); 51 58 52 void CreateGuiElements(MGGroupFrame *f); 53 void StreamPrimitive(ofstream &out) const; 54 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 55 56 void CleanStep3b(MCerPhotPix &pix); 57 void CleanStep4(UShort_t r, MCerPhotPix &pix); 58 59 void CleanStep1(); 60 void CleanStep2(); 61 void CleanStep3(); 59 // MGTask, MTask, MParContainer 60 void CreateGuiElements(MGGroupFrame *f); 61 void StreamPrimitive(ofstream &out) const; 62 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 62 63 63 64 Int_t PreProcess(MParList *pList); … … 75 76 void SetCleanRings(UShort_t r) { if(r==0) r=1; fCleanRings=r; } 76 77 void SetMethod(CleaningMethod_t m) { fCleaningMethod = m; } 78 void SetKeepSinglePixels(Bool_t b=kTRUE) { fKeepSinglePixels=b; } 77 79 78 80 Bool_t ProcessMessage(Int_t msg, Int_t submsg, Long_t param1, Long_t param2);
Note:
See TracChangeset
for help on using the changeset viewer.