Changeset 2229
- Timestamp:
- 06/24/03 15:01:48 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2227 r2229 19 19 * mevtdisp/MGCamDisplay.cc: 20 20 - display ellipse in all canvas' 21 22 * macros/readrfl.C: 23 - adapted 24 25 * manalysis/MMcTriggerLvl2.cc, meventdisp/MGEvtDisplay.cc, 26 mraw/MRawEvtPixelIter.cc: 27 - adapted 28 29 * mgui/MCamEvent.[h,cc], mhist/MHCamEvent.[h,cc]: 30 - more comments 31 32 * mgui/MHexagon.[h,cc]: 33 - removed obsolete destructor 34 35 * mhist/MHCamera.[h,cc]: 36 - removed fPhotons 37 - removed ShowRflEvent 38 - added comments 39 40 * mhist/MHTriggerLvl0.cc: 41 - fixed comments 42 43 * mraw/MRawEvtData.cc: 44 - some small changes 45 46 * mreflector/MRflEvtData.[h,cc]: 47 - implemented Paint function 21 48 22 49 … … 155 182 156 183 * manalysis/MCerPhotEvt.h: 157 - added -> to fPixels184 - added //-> to fPixels 158 185 159 186 * meventdisp/Makefile: -
trunk/MagicSoft/Mars/macros/readrfl.C
r2223 r2229 80 80 MHCamera display(geomcam); 81 81 display.Draw(); 82 event.Draw(); 82 83 83 84 cout << "Runno: " << runno << " Eventno: " << evtno << endl; … … 91 92 92 93 display.SetCamContent(event); 93 display.ShowRflEvent(&event);94 94 gPad->Modified(); 95 95 gPad->Update(); -
trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.cc
r2210 r2229 293 293 fCam = new MHCamera(*fGeomCam); 294 294 fCam->Draw(); 295 fCam->DrawPixel Numbers();295 fCam->DrawPixelIndices(); 296 296 } 297 297 … … 337 337 fCam = new MHCamera(*fGeomCam); 338 338 fCam->Draw(); 339 fCam->DrawPixel Numbers();339 fCam->DrawPixelIndices(); 340 340 } 341 341 -
trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc
r2210 r2229 281 281 MHCamera *display = new MHCamera(geom); 282 282 display->Draw(); 283 display->DrawPixel Numbers();283 display->DrawPixelIndices(); 284 284 fList->Add(display); 285 285 -
trunk/MagicSoft/Mars/mgui/MCamEvent.cc
r2206 r2229 24 24 25 25 ////////////////////////////////////////////////////////////////////////////// 26 // // 27 // MCamEvent // 28 // // 26 // 27 // MCamEvent 28 // 29 // A base class describing an event in the camera. 30 // 29 31 ////////////////////////////////////////////////////////////////////////////// 30 32 #include "MCamEvent.h" -
trunk/MagicSoft/Mars/mgui/MCamEvent.h
r2206 r2229 2 2 #define MARS_MCamEvent 3 3 4 //////////////////////////////////////////////////////////////5 //6 // MCamEvent7 //8 // A Hexagon for the MAGIC event display9 //10 //////////////////////////////////////////////////////////////11 4 #ifndef MARS_MParContainer 12 5 #include "MParContainer.h" -
trunk/MagicSoft/Mars/mgui/MHexagon.cc
r2173 r2229 83 83 // ------------------------------------------------------------------------ 84 84 // 85 // default destructor for MHexagon86 //87 MHexagon::~MHexagon()88 {89 }90 91 // ------------------------------------------------------------------------92 //93 85 // copy this hexagon to hexagon 94 86 // -
trunk/MagicSoft/Mars/mgui/MHexagon.h
r2189 r2229 42 42 MHexagon(MGeomPix &pix); 43 43 MHexagon(const MHexagon &hexagon); 44 virtual ~MHexagon();45 44 46 45 virtual void Copy(TObject &hexagon) -
trunk/MagicSoft/Mars/mhist/MHCamEvent.cc
r2221 r2229 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 18 ! Author(s): Thomas Bretz, 12/2002 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 20 ! Copyright: MAGIC Software Development, 2000-2003 … … 26 26 // 27 27 // MHCamEvent 28 // 29 // A histogram to store the sum of camera events. This can be photons, 30 // currents or enything else derived from MCamEvent 28 31 // 29 32 ///////////////////////////////////////////////////////////////////////////// … … 131 134 } 132 135 136 // -------------------------------------------------------------------------- 137 // 138 // Return fSum. 139 // 133 140 TH1 *MHCamEvent::GetHistByName(const TString name) 134 141 { -
trunk/MagicSoft/Mars/mhist/MHCamEvent.h
r2209 r2229 12 12 { 13 13 private: 14 MHCamera *fSum;// storing the sum15 MCamEvent *fEvt;//! the current event14 MHCamera *fSum; // storing the sum 15 MCamEvent *fEvt; //! the current event 16 16 17 17 TString fNameEvt; -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r2222 r2229 28 28 // MHCamera 29 29 // 30 // Camera Display. The Pixels are displayed in 31 // contents/area [somthing/mm^2] 32 // 33 // To change the scale to a logarithmic scale SetLogz() of the Pad. 34 // 30 // Camera Display, based on a TH1D. Pleas be carefull using the 31 // underlaying TH1D. 32 // 33 // To change the scale to a logarithmic scale SetLogy() of the Pad. 35 34 // 36 35 //////////////////////////////////////////////////////////////////////////// … … 44 43 #include <TLatex.h> 45 44 #include <TStyle.h> 46 #include <TMarker.h>47 45 #include <TCanvas.h> 48 46 #include <TArrayF.h> … … 57 55 #include "MGeomCam.h" 58 56 59 #include "MRflEvtData.h"60 #include "MRflSinglePhoton.h"61 62 57 #include "MCerPhotPix.h" 63 58 #include "MCerPhotEvt.h" … … 85 80 SetDirectory(NULL); 86 81 87 fPhotons = NULL;88 82 fNotify = NULL; 89 83 … … 97 91 // ------------------------------------------------------------------------ 98 92 // 99 // Constructor. Makes a clone of MGeomCam. 93 // Constructor. Makes a clone of MGeomCam. Removed the TH1D from the 94 // current directory. Calls Sumw2(). Set the histogram line color 95 // (for error bars) to Green and the marker style to kFullDotMedium. 100 96 // 101 97 MHCamera::MHCamera(const MGeomCam &geom, const char *name, const char *title) … … 121 117 // register BIT(8) as kNoContextMenu. If an object has this bit set it will 122 118 // not get an automatic context menu when clicked with the right mouse button. 123 124 fPhotons = new TClonesArray("TMarker", 0);125 119 126 120 // … … 139 133 // ------------------------------------------------------------------------ 140 134 // 141 // Destructor. Deletes TClonesArrays for hexagons and legend elements.135 // Destructor. Deletes the cloned fGeomCam and the notification list. 142 136 // 143 137 MHCamera::~MHCamera() 144 138 { 145 if (fPhotons)146 {147 fPhotons->Delete();148 delete fPhotons;149 }150 139 if (fGeomCam) 151 140 delete fGeomCam; … … 154 143 } 155 144 156 Int_t MHCamera::Fill(Axis_t x) 157 { 145 // ------------------------------------------------------------------------ 146 // 147 // Taken from TH1D::Fill(). Uses the argument directly as bin index. 148 // Doesn't increment the number of entries. 149 // 158 150 // -*-*-*-*-*-*-*-*Increment bin with abscissa X by 1*-*-*-*-*-*-*-*-*-*-* 159 151 // ================================== … … 167 159 // 168 160 // -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 161 Int_t MHCamera::Fill(Axis_t x) 162 { 169 163 170 164 #if ROOT_VERSION_CODE > ROOT_VERSION(3,05,00) … … 186 180 } 187 181 188 //______________________________________________________________________________ 189 Int_t MHCamera::Fill(Axis_t x, Stat_t w) 190 { 182 // ------------------------------------------------------------------------ 183 // 184 // Taken from TH1D::Fill(). Uses the argument directly as bin index. 185 // Doesn't increment the number of entries. 186 // 191 187 // -*-*-*-*-*-*Increment bin with abscissa X with a weight w*-*-*-*-*-*-*-* 192 188 // ============================================= … … 200 196 // 201 197 // -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 202 198 Int_t MHCamera::Fill(Axis_t x, Stat_t w) 199 { 203 200 #if ROOT_VERSION_CODE > ROOT_VERSION(3,05,00) 204 201 if (fBuffer) return BufferFill(x,w); … … 310 307 } 311 308 312 309 // ------------------------------------------------------------------------ 310 // 311 // Resizes the current pad so that the camera is displayed in its 312 // correct aspect ratio 313 // 313 314 void MHCamera::SetRange() 314 315 { … … 349 350 } 350 351 352 // ------------------------------------------------------------------------ 353 // 354 // Updates the pixel colors and paints the pixels 355 // 351 356 void MHCamera::Update(Bool_t islog, Bool_t isbox, Bool_t iscol) 352 357 { … … 383 388 } 384 389 390 // ------------------------------------------------------------------------ 391 // 392 // Print minimum and maximum 393 // 385 394 void MHCamera::Print(Option_t *) const 386 395 { … … 395 404 } 396 405 406 // ------------------------------------------------------------------------ 407 // 408 // Paint the y-axis title 409 // 397 410 void MHCamera::PaintAxisTitle() 398 411 { … … 412 425 } 413 426 427 // ------------------------------------------------------------------------ 428 // 429 // Paint the histogram title 430 // 414 431 void MHCamera::PaintTitle() 415 432 { … … 485 502 // ------------------------------------------------------------------------ 486 503 // 487 // This is called at any time the canvas should get repainted. 488 // Here we maintain an aspect ratio of 1.15. This makes sure, 489 // that the camera image doesn't get distorted by resizing the canvas. 504 // Paints the camera. 490 505 // 491 506 void MHCamera::Paint(Option_t *o) … … 517 532 518 533 // Paint primitives (pixels, color legend, photons, ...) 519 { fPhotons->ForEach(TObject, Paint)(); }520 521 534 PaintTitle(); 522 535 PaintAxisTitle(); … … 525 538 // ------------------------------------------------------------------------ 526 539 // 527 // 540 // With this function you can change the color palette. For more 528 541 // information see TStyle::SetPalette. Only palettes with 50 colors 529 542 // are allowed. … … 580 593 } 581 594 582 void MHCamera::DrawPixel Numbers()595 void MHCamera::DrawPixelIndices() 583 596 { 584 597 for (int i=0; i<kItemsLegend; i++) … … 605 618 // ------------------------------------------------------------------------ 606 619 // 607 // Call this function to fill the currents 620 // Call this function to add a MCamEvent on top of the present contents. 621 // Only 'used' pixels are added. 608 622 // 609 623 void MHCamera::AddCamContent(const MCamEvent &event, Int_t type) … … 617 631 618 632 Fill(idx, val); // FIXME: Slow! 619 //fArray[idx+1]+=val;620 633 } 621 634 fEntries++; … … 624 637 // ------------------------------------------------------------------------ 625 638 // 626 // Call this function to fill the currents 639 // Call this function to add a MHCamera on top of the present contents. 640 // Only 'used' pixels are added. 641 // Type: 642 // 0) bin content 643 // 1) errors 644 // 2) rel. errors 627 645 // 628 646 void MHCamera::AddCamContent(const MHCamera &d, Int_t type) … … 657 675 // ------------------------------------------------------------------------ 658 676 // 659 // Call this function to fill the currents 677 // Call this function to add a TArrayD on top of the present contents. 678 // Only 'used' pixels are added. 660 679 // 661 680 void MHCamera::AddCamContent(const TArrayD &event, Bool_t ispos) 662 681 { 682 if (event.GetSize()!=fNcells-2) 683 return; 684 663 685 for (Int_t idx=0; idx<fNcells-2; idx++) 664 686 { 665 687 Fill(idx, const_cast<TArrayD&>(event)[idx]); // FIXME: Slow! 666 //fArray[idx+1]+=val;667 688 668 689 if (!ispos || fArray[idx+1]>0) … … 674 695 // ------------------------------------------------------------------------ 675 696 // 676 // Call this function to fill the currents 697 // Call this function to add a MCamEvent on top of the present contents. 698 // 1 is added to each pixel if the contents of MCamEvent>threshold 677 699 // 678 700 void MHCamera::CntCamContent(const MCamEvent &event, Double_t threshold, Int_t type) … … 693 715 // ------------------------------------------------------------------------ 694 716 // 695 // Call this function to fill the currents 717 // Call this function to add a TArrayD on top of the present contents. 718 // 1 is added to each pixel if the contents of MCamEvent>threshold 696 719 // 697 720 void MHCamera::CntCamContent(const TArrayD &event, Double_t threshold, Bool_t ispos) 698 721 { 722 if (event.GetSize()!=fNcells-2) 723 return; 724 699 725 for (Int_t idx=0; idx<fNcells-2; idx++) 700 726 { … … 708 734 } 709 735 736 // ------------------------------------------------------------------------ 737 // 738 // Fill the pixels with random contents. 739 // 710 740 void MHCamera::FillRandom() 711 741 { … … 752 782 { 753 783 FillLevels(event, clean.GetCleanLvl1(), clean.GetCleanLvl2()); 754 }755 756 // ------------------------------------------------------------------------757 //758 // Show a reflector event. EMarkerStyle is defined in root/include/Gtypes.h759 // To remove the photons from the display call FillRflEvent(NULL)760 //761 void MHCamera::ShowRflEvent(const MRflEvtData *event, EMarkerStyle ms)762 {763 const Int_t num = event ? event->GetNumPhotons() : 0;764 765 fPhotons->ExpandCreate(num);766 if (num < 1)767 return;768 769 Int_t i=num-1;770 do771 {772 const MRflSinglePhoton &ph = event->GetPhoton(i);773 TMarker &m = *static_cast<TMarker*>(fPhotons->UncheckedAt(i));774 m.SetX(ph.GetX());775 m.SetY(ph.GetY());776 m.SetMarkerStyle(ms);777 } while (i--);778 784 } 779 785 … … 917 923 // with the graphical primitive with the mouse!!! 918 924 // 919 // All calcutations are runningin pixel coordinates925 // All calcutations are done in pixel coordinates 920 926 // 921 927 Int_t MHCamera::DistancetoPrimitive(Int_t px, Int_t py) … … 939 945 // ------------------------------------------------------------------------ 940 946 // 941 // Execute a mouse event on the camera942 //943 /*944 void MHCamera::ExecuteEvent(Int_t event, Int_t px, Int_t py)945 {946 cout << "Execute Event Camera " << event << " @ " << px << " " << py << endl;947 }948 */949 950 951 // ------------------------------------------------------------------------952 //953 947 // Function introduced (31-01-03) WILL BE REMOVED IN THE FUTURE! DON'T 954 948 // USE IT! … … 960 954 } 961 955 956 // ------------------------------------------------------------------------ 957 // 958 // Function introduced (31-01-03) WILL BE REMOVED IN THE FUTURE! DON'T 959 // USE IT! 960 // 962 961 Int_t MHCamera::GetPixelIndex(Int_t px, Int_t py) const 963 962 { … … 1019 1018 cout << "Contents: " << fArray[idx+1] << " <"; 1020 1019 cout << (IsUsed(idx)?"on":"off"); 1021 cout << ">" << endl << endl;1020 cout << ">" << endl; 1022 1021 1023 1022 if (fNotify && fNotify->GetSize()>0) -
trunk/MagicSoft/Mars/mhist/MHCamera.h
r2216 r2229 5 5 #include "MAGIC.h" 6 6 #endif 7 #ifndef ROOT_Gtypes8 #include <Gtypes.h>9 #endif10 7 #ifndef ROOT_TArrayC 11 8 #include <TArrayC.h> … … 21 18 #endif 22 19 23 #include "MGeomCam.h"24 #include "MGeomPix.h"25 class TBox;26 class TText;27 class TArrow;28 class TGStatusBar;29 30 20 class MGeomCam; 31 class MHexagon;32 class MCurrents;33 21 class MCamEvent; 34 22 class MRflEvtData; 35 23 class MCerPhotEvt; 36 class MCerPhotPix;37 24 class MImgCleanStd; 38 class MPedestalPix;39 class MPedestalCam;40 25 41 26 class MHCamera : public TH1D 42 27 { 43 28 private: 44 MGeomCam *fGeomCam; // pointer to camera geometry 45 46 TArrayC fUsed; 47 48 TClonesArray *fPhotons; // array of reflector photons 29 MGeomCam *fGeomCam; // pointer to camera geometry (y-axis) 30 TArrayC fUsed; // array containing flags 49 31 50 32 TArrayI fColors; //! Color conversion table … … 121 103 Double_t GetMaximum() const { return GetMaximum(0/*kTRUE*/); } 122 104 123 void ShowRflEvent(const MRflEvtData *event=NULL, EMarkerStyle m=kFullDotMedium);124 105 void FillLevels(const MCerPhotEvt &event, Float_t lvl1, Float_t lvl2); 125 106 void FillLevels(const MCerPhotEvt &event, const MImgCleanStd &clean); … … 129 110 void FillRandom(); 130 111 131 void DrawPixel Numbers();112 void DrawPixelIndices(); 132 113 133 114 void PrintInfo() const { Print(""); } // *MENU* -
trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.cc
r2221 r2229 28 28 // MHTriggerLvl0 29 29 // 30 // This is intended to be a sort of "level 0 trigger display". What it really 31 // does is to store the number of events of a data file in which each pixel 32 // has gone above a given threshold (fPixelThreshold) which is chosen when 33 // calling the constructor. Displaying a camera view with these values can 34 // help identify noisy pixels. See the macro pixfixrate.C to see an example 35 // of its use. Many things are to be fixed. Only inner pixels are shown now 36 // (which are anyhow those involved in the trigger), and the camera geometry 37 // (number of pixels, and how many inner ones) is not yet read from the input 38 // file. 39 // The "pedestal" we are using is just the signal in the first ADC slice 40 // (seems reasonable from the inspection of the available test data files). 41 // 30 // This is intended to be a sort of "level 0 trigger display". What it 31 // really does is to store the number of events of a data file in which 32 // each pixel has gone above a given threshold (fPixelThreshold) which 33 // is chosen when calling the constructor. Displaying a camera view with 34 // these values can help identify noisy pixels. See the macro pixfixrate.C 35 // to see an example of its use. 42 36 // 43 37 ///////////////////////////////////////////////////////////////////////////// … … 118 112 // -------------------------------------------------------------------------- 119 113 // 120 // Fill the histograms with data from a MC erPhotEvt-Container.114 // Fill the histograms with data from a MCamEvent-Container. 121 115 // 122 116 Bool_t MHTriggerLvl0::Fill(const MParContainer *par, const Stat_t w) … … 136 130 // -------------------------------------------------------------------------- 137 131 // 138 // S et to Unused outer pixels.132 // Scale by the number of events 139 133 // 140 134 Bool_t MHTriggerLvl0::Finalize() -
trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.h
r2209 r2229 12 12 { 13 13 private: 14 MHCamera *fSum;// storing the sum15 MCamEvent *fEvt;//! the current event14 MHCamera *fSum; // storing the sum 15 MCamEvent *fEvt; //! the current event 16 16 17 17 TString fNameEvt; … … 36 36 void Draw(Option_t * =""); 37 37 38 ClassDef(MHTriggerLvl0, 1) // Histogram to sum level 0 triggers in all pixels38 ClassDef(MHTriggerLvl0, 1) // Histogram to count how often a pixel is above threshold 39 39 }; 40 40 -
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r2207 r2229 213 213 // "GRAPH" A graph is drawn 214 214 // "HIST" A histogram is drawn 215 // number The pixel with the given numberis drawn215 // <index> The pixel with the given index is drawn 216 216 // 217 217 void MRawEvtData::Draw(Option_t *opt) … … 279 279 { 280 280 // FIXME: Add Legend 281 *fLog << "Drawing Histogram of Pixel with Idx " << pix.GetPixelId() << endl;282 283 TH1F *histh = new TH1F(name, "FADC Samples", 281 *fLog << "Drawing Histogram of Pixel with Idx #" << pix.GetPixelId() << endl; 282 283 TH1F *histh = new TH1F(name, "FADC Samples", nh, -0.5, nh-.5); 284 284 histh->SetXTitle("Time [FADC Slices]"); 285 285 histh->SetYTitle("Signal [FADC Units]"); -
trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
r2207 r2229 187 187 } 188 188 189 // -------------------------------------------------------------------------- 190 // 191 // Returns the variance (sigma^2) of the HiGainSamples 192 // 189 193 Float_t MRawEvtPixelIter::GetVarHiGainSamples() const 190 194 { … … 203 207 } 204 208 209 // -------------------------------------------------------------------------- 210 // 211 // Returns the index of the FADC slice the maximum signal in 212 // 205 213 Byte_t MRawEvtPixelIter::GetNumMaxHiGainSample() const 206 214 { -
trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc
r2224 r2229 38 38 ///////////////////////////////////////////////////////////////////////////// 39 39 #include "MRflEvtData.h" 40 41 #include <TMarker.h> 40 42 41 43 #include "MLog.h" … … 98 100 return; 99 101 100 fList.ExpandCreate Fast(fPos);102 fList.ExpandCreate(fPos); 101 103 } 102 104 … … 119 121 // sum the photons content in each pixel 120 122 // 121 const Int_t entries = GetNumPhotons();122 123 123 val = 0; 124 124 125 125 MHexagon hex(cam[idx]); 126 for (Int_t i=0; i<entries; i++)127 {128 const MRflSinglePhoton &ph = GetPhoton(i);129 126 130 if (hex.DistanceToPrimitive(ph.GetX(), ph.GetY())<=0) 127 MRflSinglePhoton *ph=NULL; 128 129 TIter Next(&fList); 130 while ((ph=(MRflSinglePhoton*)Next())) 131 if (hex.DistanceToPrimitive(ph->GetX(), ph->GetY())<=0) 131 132 val += cam.GetPixRatio(idx); 132 }133 133 134 134 return val>0; 135 135 } 136 137 // ------------------------------------------------------------------------ 138 // 139 // You can call Draw() to add the photons to the current pad. 140 // The photons are painted each tim ethe pad is updated. 141 // Make sure that you use the right (world) coordinate system, 142 // like created, eg. by the MHCamera histogram. 143 // 144 void MRflEvtData::Paint(Option_t *) 145 { 146 MRflSinglePhoton *ph=NULL; 147 148 TMarker m; 149 m.SetMarkerStyle(kFullDotMedium); // Gtypes.h 150 151 TIter Next(&fList); 152 while ((ph=(MRflSinglePhoton*)Next())) 153 { 154 m.SetX(ph->GetX()); 155 m.SetY(ph->GetY()); 156 m.Paint(); 157 } 158 } 159 -
trunk/MagicSoft/Mars/mreflector/MRflEvtData.h
r2208 r2229 30 30 31 31 void Print(Option_t *o="") const; 32 void Paint(Option_t *o=""); 32 33 33 34 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
Note:
See TracChangeset
for help on using the changeset viewer.