Changeset 717


Ignore:
Timestamp:
04/03/01 13:28:36 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r716 r717  
    11                                                                  -*-*- END -*-*-
     2
     3 2000/04/03: Thomas Bretz
     4
     5 * manalysis/MCT1ReadAscii.cc:
     6   - the pedestal values read from the file are now stored in MeanRms
     7     instead of Sigma
     8   
     9 * manalysis/MCerPhotCalc.cc:
     10   - The pedestal mean Rms is used as the pixel error
     11   
     12 * MImgCleanStd.cc:
     13   - CleanStep1: the '<' was replaced by a '<=' to clean also pixels
     14     with value=noise=0
     15     
     16 * MMcPedestalCopy.cc:
     17   - All the pedestal values are now filled in (are they calculated correctly?)
     18   
     19 * mgui/MGeomCamMagic.cc:
     20   - Forgot to initialize the Nextneighbors of the Magic Camera
     21     (thanks to Oscar)
     22     
     23 * mhist/MHStarMap.cc:
     24   - I changed the model of the display (colors and bin width) to
     25     get a 'better' result
     26
    227
    328 2000/04/02: Thomas Bretz
  • trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc

    r716 r717  
    156156
    157157        if (val > 0.0)
    158             (*fPedest)[i].SetSigma(val);
     158            (*fPedest)[i].SetMeanRms(val);
    159159    }
    160160}
     
    188188
    189189        if (nphot > 0.0)
    190             fNphot->AddPixel(i, nphot, (*fPedest)[i].GetSigma());
     190            fNphot->AddPixel(i, nphot, (*fPedest)[i].GetMeanRms());
    191191    }
    192192
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc

    r698 r717  
    6565
    6666        const Float_t nphot = (Float_t)pixel.GetSumHiGainFadcSamples() - ped.GetMean();
    67         fCerPhotEvt->AddPixel(pixid, nphot, 0);
     67
     68        fCerPhotEvt->AddPixel(pixid, nphot, ped.GetMeanRms());
    6869
    6970        // FIXME! Handling of Lo Gains is missing!
  • trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc

    r716 r717  
    1818    //   the default constructor
    1919    //
    20  
    2120    *fName  = name  ? name  : "MImgCleanStd";
    2221    *fTitle = title ? title : "Task which does a standard image cleaning";
     22
     23    *fLog << "Cleaning initialized. Using noise level " << lvl1 << " and " << lvl2 << endl;
    2324}
    2425
     
    4445        const Float_t noise = pix.GetErrorPhot();
    4546
    46         if (entry < fCleanLvl1 * noise )
     47        // COBB: '<=' to skip entry=noise=0
     48        if (entry <= fCleanLvl1 * noise )
    4749            pix.SetPixelUnused();
    4850    }
     
    113115            pix.SetCorePixel();
    114116    }
    115 
    116117}
    117118
     
    124125    //
    125126    const Int_t entries = fEvt->GetNumPixels();
    126 
    127127    for (Int_t i=0; i<entries; i++)
    128128    {
     
    174174        }
    175175    }
     176
    176177}
    177178
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc

    r698 r717  
    4141Bool_t MMcPedestalCopy::Process()
    4242{
    43     fPedestals->InitSize(fMcPedestals->GetNumPixel());
     43    const int num = fMcPedestals->GetNumPixel();
    4444
    45     for (int i=0; i<MFADC_CHANNELS; i++)
     45    fPedestals->InitSize(num);
     46
     47    for (int i=0; i<num; i++)
    4648    {
    4749        MPedestalPix &pix = (*fPedestals)[i];
    4850
    49         pix.SetPedestal(fMcPedestals->GetPedestal(i), 0);
    50         pix.SetPedestalRms(fMcPedestals->GetPedestalRms(i), 0);
     51        const Float_t pedest = fMcPedestals->GetPedestal(i);
     52        const Float_t pedrms = fMcPedestals->GetPedestalRms(i);
     53
     54        const Float_t sigma  = pedest*sqrt(num);
     55        const Float_t sigrms = sigma/sqrt(2*num);
     56
     57        pix.SetPedestal(pedest, sigma);
     58        pix.SetPedestalRms(pedrms, sigrms);
     59
     60        *fLog << pedest << " " << sigma << " " << pedrms << " " << sigrms << endl;
    5161    }
    5262
  • trunk/MagicSoft/Mars/mgui/MGeomCamMagic.cc

    r715 r717  
    1010{
    1111    CreateCam();
     12    CreateNN();
    1213}
    1314
     
    263264
    264265    for (UInt_t i=0; i<GetNumPixels(); i++)
    265     {
    266266        (*this)[i].Set(xtemp[i], ytemp[i], rtemp[i]) ;
    267         //fPixels->Add( new MGeomPix() ;
    268     }
    269267}
    270268
  • trunk/MagicSoft/Mars/mhist/MHStarMap.cc

    r712 r717  
    1111#include "MHStarMap.h"
    1212
    13 #include <TH2.h>
    14 #include <TStyle.h>
    15 #include <TCanvas.h>
     13#include <TH2.h>      // TH2F
     14#include <TStyle.h>   // gStyle
     15#include <TColor.h>   // SetRGB
     16#include <TCanvas.h>  // TCanvas
    1617
    1718#include "MHillas.h"
     
    3940    //
    4041    fStarMap = new TH2F("Star Map", "Counts",
    41                         50, -300, 300,
    42                         50, -300, 300);
     42                        150, -300, 300,
     43                        150, -300, 300);
    4344}
    4445
     
    5051void MHStarMap::Draw(Option_t *)
    5152{
     53    //
     54    // Creates a new canvas, creates a useful palette and
     55    // draws the histogram in the new created canvas
     56    //
     57
    5258    TCanvas *c = new TCanvas("Star Map", "Star Map created from Hillas Parameters", 500, 500);
    5359
    54     gStyle->SetPalette(1, 0);
     60    //
     61    // Set the palette you wanna use:
     62    //  - you could set the root "Pretty Palette Violet->Red" by
     63    //    gStyle->SetPalette(1, 0), but in some cases this may look
     64    //    confusing
     65    //  - The maximum colors root allowes us to set by ourself
     66    //    is 50 (idx: 51-100). This colors are set to a grayscaled
     67    //    palette
     68    //  - the number of contours must be two less than the number
     69    //    of palette entries
     70    //
     71
     72    const Int_t numg = 32; // number of gray scaled colors
     73    const Int_t numw = 32; // number of white
     74
     75    Int_t palette[numg+numw];
     76
     77    //
     78    // The first half of the colors are white.
     79    // This is some kind of optical background supression
     80    //
     81    gROOT->GetColor(51)->SetRGB(1, 1, 1);
     82
     83    Int_t i;
     84    for (i=0; i<numw; i++)
     85        palette[i] = 51;
     86
     87    //
     88    // now the (gray) scaled part is coming
     89    //
     90    for (;i<numw+numg; i++)
     91    {
     92        const Float_t gray = 1.0-(float)(i-numw)/(numg-1.0);
     93
     94        gROOT->GetColor(52+i)->SetRGB(gray, gray, gray);
     95        palette[i] = 52+i;
     96    }
     97
     98    //
     99    // Set the palette and the number of contour levels
     100    //
     101    gStyle->SetPalette(numg+numw, palette);
     102    fStarMap->SetContour(numg+numw-2);
     103
     104    // gStyle->SetPalette(1, 0);
    55105    fStarMap->Draw("colz");
    56106
     
    68118    const float t = dist*(sin(theta)-cos(theta)*m);
    69119
    70     float y0 = -m*300+t;
    71     for (int i=-297; i<300; i+=3)
    72     {
    73         const float y1 = m*i+t;
     120    if (m>-1 && m<1)
     121        for (int x=-298; x<298; x+=4)
     122        {
     123            const float y = m*x+t;
    74124
    75 //        if (y1<=y0-3 || y1>=y0+3)
    76 //            continue;
     125            fStarMap->Fill(x, y);
     126        }
     127    else
     128        for (int y=-298; y<298; y+=4)
     129        {
     130            const float x = (y-t)/m;
    77131
    78         fStarMap->Fill(i, y1);
    79         y0 = y1;
    80     }
     132            fStarMap->Fill(x, y);
     133        }
    81134}
    82135
Note: See TracChangeset for help on using the changeset viewer.