Changeset 2147 for trunk/MagicSoft


Ignore:
Timestamp:
06/02/03 09:51:18 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2145 r2147  
    11                                                 -*-*- END OF LINE -*-*-
     2 2003/06/02: Thomas Bretz
     3
     4   * manalysis/AnalysisLinkDef.h, manalysis/Makefile:
     5     - added MCurrents
     6     
     7   * manalysis/MCerPhotEvt.[h,cc]:
     8     - added MGeomCam argument to GetRatioMin/Max
     9     
     10   * mfileio/FileIOLinkDef.h, mfileio/Makefile:
     11     - added MReadCurrents
     12
     13   * mfileio/MReadCurrents.[h,cc]:
     14     - added
     15     
     16   * manalysis/MCurrents.[h,cc]:
     17     - added
     18     
     19   * mgui/MCamDisplay.[h,cc]:
     20     - added current support
     21
     22
     23
    224 2003/05/30: Wolfgang Wittek
    325
  • trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h

    r2124 r2147  
    1212#pragma link C++ class MBlindPixels+;
    1313#pragma link C++ class MBlindPixelCalc+;
     14
     15#pragma link C++ class MCurrents+;
    1416
    1517#pragma link C++ class MPedestalPix+;
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc

    r2139 r2147  
    236236// get the minimum ratio of photons/error
    237237//
    238 Float_t MCerPhotEvt::GetRatioMin() const
     238Float_t MCerPhotEvt::GetRatioMin(const MGeomCam *geom) const
    239239{
    240240    if (fNumPixels <= 0)
     
    250250
    251251        Float_t testval = pix.GetNumPhotons()/pix.GetErrorPhot();
     252        if (geom)
     253            testval *= TMath::Sqrt(geom->GetPixRatio(pix.GetPixId()));
     254
    252255        if (testval < minval)
    253256            minval = testval;
     
    261264// get the maximum ratio of photons/error
    262265//
    263 Float_t MCerPhotEvt::GetRatioMax() const
     266Float_t MCerPhotEvt::GetRatioMax(const MGeomCam *geom) const
    264267{
    265268    if (fNumPixels <= 0)
     
    275278
    276279        Float_t testval = pix.GetNumPhotons()/pix.GetErrorPhot();
     280        if (geom)
     281            testval *= TMath::Sqrt(geom->GetPixRatio(pix.GetPixId()));
     282
    277283        if (testval > maxval)
    278284            maxval = testval;
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h

    r2135 r2147  
    4141    Float_t GetNumPhotonsMax(const MGeomCam *geom=NULL) const;
    4242
    43     Float_t GetRatioMin() const;
    44     Float_t GetRatioMax() const;
     43    Float_t GetRatioMin(const MGeomCam *geom=NULL) const;
     44    Float_t GetRatioMax(const MGeomCam *geom=NULL) const;
    4545
    4646    Float_t GetErrorPhotMin(const MGeomCam *geom=NULL) const;
  • trunk/MagicSoft/Mars/manalysis/Makefile

    r2124 r2147  
    3333           MMcPedestalCopy.cc \
    3434           MMcPedestalNSBAdd.cc \
     35           MCurrents.cc \
    3536           MEnergyEst.cc \
    3637           MEnergyEstimate.cc \
  • trunk/MagicSoft/Mars/mfileio/FileIOLinkDef.h

    r2134 r2147  
    99#pragma link C++ class MReadTree+;
    1010#pragma link C++ class MReadMarsFile+;
     11#pragma link C++ class MReadCurrents+;
    1112#pragma link C++ class MReadRflFile+;
    1213
  • trunk/MagicSoft/Mars/mfileio/Makefile

    r2134 r2147  
    3535           MChain.cc \
    3636           MReadTree.cc \
     37           MReadCurrents.cc \
    3738           MReadMarsFile.cc \
    3839           MReadRflFile.cc \
  • trunk/MagicSoft/Mars/mgui/MCamDisplay.cc

    r2135 r2147  
    5959#include "MPedestalCam.h"
    6060
     61#include "MCurrents.h"
     62
    6163#include "MImgCleanStd.h"
    6264
     
    249251    // Fixme: Use absolute value per mm^2. Needs another scaling algorithm.
    250252    //
    251     const Float_t pnum  = pix.GetNumPhotons()/pix.GetErrorPhot();
    252     (*this)[pix.GetPixId()].SetFillColor(GetColor(pnum, min, max));
     253    // *OLD* const Float_t r = pix.GetNumPhotons()/pix.GetErrorPhot();
     254    //    if (entry * ratio <= fCleanLvl1 * noise)
     255
     256    const Float_t  entry = pix.GetNumPhotons();
     257    const Float_t  noise = pix.GetErrorPhot();
     258    const Double_t ratio = TMath::Sqrt(fGeomCam->GetPixRatio(pix.GetPixId()));
     259
     260    const Float_t r = entry*ratio/noise;
     261    //const Float_t pnum  = pix.GetNumPhotons()/pix.GetErrorPhot();
     262
     263    (*this)[pix.GetPixId()].SetFillColor(GetColor(r, min, max));
    253264}
    254265
     
    259270    MHexagon &hex = (*this)[pix.GetPixId()];
    260271
    261     const Float_t r = pix.GetNumPhotons()/pix.GetErrorPhot();
     272    // *OLD* const Float_t r = pix.GetNumPhotons()/pix.GetErrorPhot();
     273    //    if (entry * ratio <= fCleanLvl1 * noise)
     274
     275    const Float_t  entry = pix.GetNumPhotons();
     276    const Float_t  noise = pix.GetErrorPhot();
     277    const Double_t ratio = TMath::Sqrt(fGeomCam->GetPixRatio(pix.GetPixId()));
     278
     279    const Float_t r = entry*ratio/noise;
    262280
    263281    if (r>lvl1)
     
    618636    if (fAutoScale)
    619637    {
    620         min = event.GetRatioMin();
    621         max = event.GetRatioMax();
     638        min = event.GetRatioMin(fGeomCam);
     639        max = event.GetRatioMax(fGeomCam);
    622640
    623641        UpdateLegend(min, max);
     
    637655
    638656        SetPixColorRatio(pix, min, max);
     657    }
     658}
     659
     660// ------------------------------------------------------------------------
     661//
     662// Call this function to fill the currents
     663//
     664void MCamDisplay::FillCurrents(const MCurrents &event)
     665{
     666    //
     667    // Reset pixel colors to default value
     668    //
     669    Reset();
     670
     671    //
     672    //  if the autoscale is true, set the values for the range for
     673    //  each event
     674    //
     675    Float_t min = 0;
     676    Float_t max = 20;
     677    if (fAutoScale)
     678    {
     679        min = event.GetMin();
     680        max = event.GetMax();
     681
     682        UpdateLegend(min, max);
     683    }
     684
     685    //
     686    //   update the colors in the picture
     687    //
     688    // FIXME: Security check missing!
     689    for (UInt_t i=0; i<fNumPixels; i++)
     690    {
     691        //const Float_t pnum  = pix.GetNumPhotons()/pix.GetErrorPhot();
     692        (*this)[i].SetFillColor(GetColor(event[i], min, max));
    639693    }
    640694}
  • trunk/MagicSoft/Mars/mgui/MCamDisplay.h

    r2135 r2147  
    1919class MHexagon;
    2020class MRflEvtData;
     21class MCurrents;
    2122class MCerPhotEvt;
    2223class MCerPhotPix;
     
    8081    void FillPedestals(const MPedestalCam &event);
    8182    void FillRflEvent(const MRflEvtData &event);
     83    void FillCurrents(const MCurrents &event);
    8284    void ShowRflEvent(const MRflEvtData *event=NULL, EMarkerStyle m=kFullDotMedium);
    8385
Note: See TracChangeset for help on using the changeset viewer.