Changeset 2190


Ignore:
Timestamp:
06/18/03 09:29:45 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2188 r2190  
    11                                                 -*-*- END OF LINE -*-*-
     2
     3 2003/06/18: Thomas Bretz
     4
     5   * macros/sumcurrents.C:
     6     - added MDirIter support
     7     - fixed the rel. error calculation
     8     - some small corrections to the layout
     9     
     10   * mhist/MHCurrents.cc:
     11     - changed histogram name
     12     - added axis titles
     13
     14
    215
    316 2003/06/17: Oscar Blanch
     
    720
    821  * mgeom/MGeomCamMagicHG.[h,cc]
    9     - New geomatry for a high granularity hipothetic Magic camera
     22    - New geometry for a high granularity hipothetic Magic camera
    1023
    1124  * mgeom/Makefile and mgeom/GeomLinkDef.h
    1225    - Introduction of MGeomMagicHG class.
    1326
     27
     28
    1429 2003/06/17: Thomas Bretz
    1530
     
    2237   * manalysis/MCurrents.h:
    2338     - fixed a bug in the const operator[]
     39
     40   * mgui/MCamDisplay.[h,cc]:
     41     - set ClassDef to 1 so that the camera display can be written into
     42       a root file
     43     - fixed destructor (didn't fit default constructor)
     44     - implemented FillRandom for test cases
     45
     46   * mgui/MHexagon.h
     47     - set ClassDef to 1 so that the camera display can be written into
     48       a root file
    2449
    2550
  • trunk/MagicSoft/Mars/macros/sumcurrents.C

    r2178 r2190  
    2323\* ======================================================================== */
    2424
    25 // -------------------------------------------------------------------------
    26 //
    27 //  plot.C
    28 //
    29 //  This macro shows how to fill and display a histogram using Mars
    30 //
    31 void sumcurrents(const char *fname="../currents/spica_center.txt")
     25void ProcessFile(TString fname)
    3226{
    3327    //
     
    5145    // (created with the star.C macro)
    5246    MReadCurrents read(fname);
    53     /*
    54      read.AddFile("../currents/dcs_arcturus2.dat");
    55      read.AddFile("../currents/dcs_arcturus3.dat");
    56      read.AddFile("../currents/dcs_arcturus4.dat");
    57      read.AddFile("../currents/dcs_arcturus5.dat");
    58      read.AddFile("../currents/dcs_arcturus6.dat");
    59      read.AddFile("../currents/dcs_arcturus7.dat");
    60      read.AddFile("../currents/dcs_arcturus8.dat");
    61      read.AddFile("../currents/dcs_arcturus9.dat");
    62      read.AddFile("../currents/dcs_arcturus10.dat");
    63      */
    6447    tlist.AddToList(&read);
    6548
     
    9780        TArrayF &r = h.GetRms();
    9881        TArrayF &v = h.GetSum();
    99         arr[i] = (r[i]==0 ? 0 : v[i]/r[i]);
     82        arr[i] = (r[i]==0 ? 0 : r[i]/v[i]);
    10083    }
    10184    disp3->Fill(arr);
     
    124107    c->cd(4);
    125108    gPad->SetBorderMode(0);
    126     h.GetHist().DrawClone();
     109    h.GetHist().SetStats(kFALSE);
     110    h.GetHist().DrawCopy();
    127111    c->cd(5);
    128112    gPad->SetBorderMode(0);
     113    gPad->SetLogy();
    129114    TH1F h1("currents;rms", "Currents Rms", 577, -0.5, 576.5);
     115    h1.SetXTitle("Pixel Index");
     116    h1.SetStats(kFALSE);
    130117    for (int i=1;i<=577; i++)
    131118        h1.SetBinContent(i, h.GetHist().GetBinError(i));
     
    133120    c->cd(6);
    134121    gPad->SetBorderMode(0);
     122    gPad->SetLogy();
    135123    TH1F h2("currents;relerr", "Currents rel. Error [%]", 577, -0.5, 576.5);
     124    h2.SetXTitle("Pixel Index");
     125    h2.SetStats(kFALSE);
    136126    for (int i=1;i<=577; i++)
    137     {
    138         Float_t val = h.GetHist().GetBinContent(i);
    139         Float_t rms = h.GetHist().GetBinError(i);
    140         h2.SetBinContent(i, rms==0?0:val/rms);
    141     }
     127        h2.SetBinContent(i, arr[i]*100);
    142128    h2.DrawCopy();
    143129
    144     c->SaveAs("spica_center-avg.ps");
     130    c->SaveAs(fname(0, fname.Last('.')+1) + "ps");
     131    c->SaveAs(fname(0, fname.Last('.')+1) + "root");
    145132}
     133
     134// -------------------------------------------------------------------------
     135//
     136//  plot.C
     137//
     138//  This macro shows how to fill and display a histogram using Mars
     139//
     140void sumcurrents(const char *dirname="/home/MAGIC/online_data/ccdata/")
     141{
     142    MDirIter Next;
     143    Next.AddDirectory(dirname, "dc_*.txt", -1);
     144
     145    TString fname;
     146    while (1)
     147    {
     148        fname = Next();
     149        if (fname.IsNull())
     150            break;
     151
     152        ProcessFile(fname);
     153    }
     154}
  • trunk/MagicSoft/Mars/mhist/MHCurrents.cc

    r2186 r2190  
    7979    Clear();
    8080
    81     fHist.SetName("currents");
     81    fHist.SetName("currents;avg");
    8282    fHist.SetTitle("Avg.Currents [nA]");
     83    fHist.SetXTitle("Pixel Index");
     84    fHist.SetYTitle("A [nA]");
    8385    fHist.SetDirectory(NULL);
    84     fHist.Sumw2();
    8586    fHist.SetLineColor(kGreen);
    8687    fHist.SetMarkerStyle(kFullDotMedium);
Note: See TracChangeset for help on using the changeset viewer.