Changeset 2557 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
11/22/03 21:14:14 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2551 r2557  
    44
    55                                                 -*-*- END OF LINE -*-*-
     6  2003/11/22: Thomas Bretz
     7
     8   * mreport/MReportCamera.cc:
     9     - implemented real reading
     10     - changed some loops to poinbter arithmetics
     11
     12   * mreport/Makefile:
     13     - added mcamera
     14
     15   * merpp.cc:
     16     - implemented preliminary support for report-files
     17     
     18   * star.cc:
     19     - small changes to handling of update-mode
     20     
     21   * mbase/MParList.cc:
     22     - fixed a wrong output
     23     
     24   * mbase/MTask.cc:
     25     - fixed AddToBranchList(TString&)
     26     
     27   * mbase/MTime.[h,cc]:
     28     - setfill only once
     29     - fixed ()-operator
     30     - removed nonsens GetTime()
     31     
     32   * mcamera/MCameraAUX.h, mcamera/MCameraCalibration.h,
     33     mcamera/MCameraCooling.h, mcamera/MCameraHV.h,
     34     mcamera/MCameraLV.h, mcamera/MCameraLid.h,
     35     mcamera/MCameraLids.h, mcamera/MCameraPowerSupply.h:
     36     - set version in ClassDef to 1
     37
     38   * mcamera/MCameraCooling.h:
     39     - added Getter-functions
     40
     41   * mcamera/MCameraLV.h:
     42     - changed fHumidity to Byte_t
     43
     44   * mcamera/MCameraLid.h:
     45     - derived from MParContainer instead of TObject
     46     
     47   * mfileio/FileIOLinkDef.h, mfileio/Makefile:
     48     - added MReadReports
     49
     50   * mfileio/MReadReports.[h.cc]:
     51     - added
     52
     53   * mfileio/MReadTree.h:
     54     - added MReadReports as friend class to allow access to fChain
     55
     56   * mfileio/MWriteRootFile.cc:
     57     - fixed output (didn't have the correct debug flags)
     58     
     59   * mhist/HistLinkDef.h, mhist/Makefile:
     60     - added MHVsTime
     61
     62   * mhist/MHVsTime.[h,cc];
     63     - added
     64     
     65   * mhist/MFillH.cc:
     66     - add eveything I know to BranchList
     67     
     68   * mraw/MRawFileWrite.[h,cc]:
     69     - changed name of MTime from MRawEvtTime to MTime
     70     - changed Tree names to:
     71       + Events
     72       + Pedestals
     73       + Calibration
     74     
     75   * mreport/MReportTrigger.[h,cc]:
     76     - fixed accoring to a discussion with Riccardo
     77     - changed version number in ClassDef to 1
     78
     79   * mreport/Makefile:
     80     - added mcamera
     81
     82   * macros/rootlogon.C:
     83     - added colors
     84     - changed the search path for libmars.so a bit
     85     
     86   * mdata/MDataList.[h,cc]:
     87     - added support for '%'
     88
     89   * mhist/MHCamera.[h,cc]:
     90     - removed DrawPixelIndices and DrawSectorIndices
     91     - replaced by new Draw-options: 'sectorindex' and 'pixelindex'
     92     - put together in PaintIndices
     93     
     94   * mmain/MEventDisplay.cc:
     95     - added Sectors to tabs
     96     - code for adding tab was in class twice (removed in
     97       ReadinFirstEvent, uses AddGeometryTabs instead)
     98       
     99   * mreport/MReport.[h,cc]: 
     100     - prpared to read new DC-REPORT files
     101     
     102   * mreport/MReportDrive.[h,cc]:
     103     - removed debug 'D'
     104     - added Getter-functions
     105
     106
    6107
    7108  2003/11/21: Thomas Bretz
     
    36137   * mmain/MEventDisplay.cc:
    37138     - made 'Mini-Canvas' working in all Tabs by catching kCM_TAB
     139
     140   * mhist/MFillH.[h,cc], mhist/MH.[h,cc]:
     141     - implemented ReInit
     142
     143   * mbase/MParList.cc:
     144     - implemented more sanity check whether a class can be created
     145
     146   * Makefile:
     147     - added mcamera
     148     - added mreport
     149     - added status
     150     - added OBJS and MCint.o to the shared object
     151     
     152   * macros/readCT1.C:
     153     - do not add non-existing geomcam to parlist
     154     - add geomapl to tasklist
     155     
     156   * mcamera/MCameraCalibration.h, mcamera/MCameraCooling.h,
     157     mcamera/MCameraHV.h, mcamera/MCameraLV.h,
     158     mcamera/MCameraLid.h, mcamera/MCameraLids.h,
     159     mcamera/MCameraPowerSupply.h, mreport/MReportCamera.h:
     160     - changed according to discussion with Pepe
     161
     162   * mtools/Makefile, mtools/ToolsLinkDef.h:
     163     - added MAstro
     164     
     165   * mtools/MAstro.[h,cc]:
     166     - added
     167
     168   * macros/readMagic.C, macros/readCT1.C:
     169     - changed to display relative signal (which is compared to the
     170       cleaning levels) and the cleaning levels
    38171
    39172
  • trunk/MagicSoft/Mars/Makefile

    r2505 r2557  
    2121
    2222#PROGRAMS = readraw merpp mars test mona status
    23 PROGRAMS = readraw merpp star mars
     23PROGRAMS = readraw merpp star status mars
    2424SOLIB    = libmars.so
    2525CINT     = M
     
    4949          mmc \
    5050          mraw \
     51          mcamera \
     52          mreport \
    5153          mgui \
    5254          mranforest \
     
    8688$(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o
    8789        @echo " Linking $(SOLIB) ..."
    88         $(CXX) $(DYNLIB) $(CXXFLAGS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
     90        $(CXX) $(DYNLIB) $(CXXFLAGS) $(OBJS) MCint.o $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
    8991
    9092$(PROGRAMS): $(SOLIB) $(PROGRAMS:=.o)
  • trunk/MagicSoft/Mars/NEWS

    r2530 r2557  
    99     (Directory: mreport, Base-Class: MReport, Reader: MReportFileRead, ...)
    1010
     11   - enhanced merpp (the executable) to support .raw and .rep files.
     12
    1113   - added classes for light calibration (MCalibration* and
    1214     MHCalibration*) by Markus Gaug. Further work has to be and will
    1315     be done soon.
     16
     17   - Added a preliminary 'synchronizer' (MReadReports) which will
     18     replace MReadMarsFile as soon as it is finished.
     19
     20   - Added a generalized histogram (similar to MH3) called MVsTime
     21     which allows to plot variables (or rules - MDataChain - of
     22     variables) vs time. For an example have a look at tempvstime.C.
     23
     24   - Changed the name of the event trees:
     25       + Events    --> Events
     26       + PedEvents --> Pedestals
     27       + CalEvents --> Calibration
     28
     29  - changed name of MTime in the event trees from MRawEvtTime to MTime
    1430
    1531
  • trunk/MagicSoft/Mars/macros/rootlogon.C

    r2491 r2557  
    4242}
    4343
    44 void load(TString &dir)
     44bool load(TString &dir)
    4545{
    4646    if (isloaded())
    4747        return;
    4848
    49     cout << "Loading 'libmars.so'... " << flush;
     49    cout << "\033[33m\033[1m" << "Loading '" << dir << "libmars.so'... " << "\033[31m" << flush;
    5050
    51     if (gSystem->Load(dir.IsNull() ? "libmars.so" : dir+"libmars.so")!=0)
    52         cout << "error." << endl;
     51    if (dir.IsNull())
     52        dir = "./";
     53
     54    if (gSystem->Load(dir+"libmars.so")!=0)
     55    {
     56        cout << "\033[33m\033[1m" << "error." << endl;
     57        cout << "\033[0m" << endl;
     58        return false;
     59    }
    5360    else
    5461    {
    5562        MParContainer::Class()->IgnoreTObjectStreamer();
    5663        MArray::Class()->IgnoreTObjectStreamer();
    57         cout << "done." << endl;
     64        cout << "\033[33m\033[1m" << "done." << endl;
     65        cout << "\033[0m" << endl;
     66        return true;
    5867    }
    59 
    60     cout << endl;
    6168}
    6269/*
     
    7986
    8087    TString dir = gSystem->Getenv("MARSSYS");
    81 
    8288    if (!dir.IsNull())
    8389    {
    84         cout << "Mars found in " << dir << " (MARSSYS)" << endl << endl;
     90        cout << "\033[34m\033[1m" << "Searching Mars in " << dir << " (MARSSYS)" << "\033[0m" << endl << endl;
    8591
    8692        if (!dir.EndsWith("/"))
     
    8894    }
    8995
    90     load(dir);
     96    if (!load(dir))
     97        return;
    9198
    9299    gInterpreter->AddIncludePath(dir+"macros");
     
    119126    }
    120127
    121     cout << "Welcome to the Mars Root environment." << endl;
    122 
     128    cout << "\033[32m" << "Welcome to the Mars Root environment." << "\033[0m" << endl;
    123129    cout << endl;
    124130}
  • trunk/MagicSoft/Mars/mdata/MDataList.cc

    r2206 r2557  
    7676        fSign = kEPlus;
    7777        return;
     78    case '%':
     79        fSign = kEModul;
     80        return;
    7881    default:
    7982        fSign = kENone;
     
    148151        }
    149152        break;
     153
     154    case kEModul:
     155        while ((member=(MData*)Next()))
     156        {
     157            Double_t d = member->GetValue();
     158            if (d==0)
     159            {
     160                *fLog << warn << "Warning: Modulo division by zero (" << member->GetName() << ")" << endl;
     161                return 0;
     162            }
     163            val = fmod(val, d);
     164        }
     165        break;
    150166    }
    151167    return val;
     
    315331            str += "/";
    316332            break;
     333
     334        case kEModul:
     335            str += "%";
     336            break;
    317337        }
    318338
  • trunk/MagicSoft/Mars/mdata/MDataList.h

    r1574 r2557  
    2323    TOrdCollection fMembers;    // Container for the filters
    2424
    25     typedef enum { kENone, kEPlus, kEMinus, kEMult, kEDiv } SignType_t;
     25    typedef enum { kENone, kEPlus, kEMinus, kEMult, kEDiv, kEModul } SignType_t;
    2626    SignType_t fSign;
    2727
  • trunk/MagicSoft/Mars/merpp.cc

    r2531 r2557  
    77#include "MRawFileRead.h"
    88#include "MRawFileWrite.h"
     9
     10#include "MReportFileRead.h"
     11#include "MWriteRootFile.h"
    912
    1013#include "MLog.h"
     
    5558    gLog << all << endl;
    5659    gLog << "Sorry the usage is:" << endl;
    57     gLog << "   merpp [-h] [-?] [-a0] [-vn] [-cn] inputfile[.raw] [outputfile[.root]]" << endl << endl;
    58     gLog << "     input file:   Magic DAQ binary file." << endl;
    59     gLog << "     ouput file:   Merpped root file." << endl;
     60    gLog << "   merpp [-h] [-?] [-a0] [-vn] [-cn] [-u1]" << endl;
     61    gLog << "         inputfile[.rep,[.raw]] [outputfile[.root]]" << endl << endl;
     62    gLog << "     inputfile.raw:  Magic DAQ binary file." << endl;
     63    gLog << "     inputfile.rep:  Magic Central Control report file." << endl;
     64    gLog << "     ouputfile.root: Merpped root file." << endl;
    6065    gLog << "     -a0: Do not use Ansii codes." << endl;
     66    gLog << "     -u1: Update file." << endl;
    6167    gLog << "     -cn: Compression level n=1..9 [default=2]" << endl;
    6268    gLog << "     -vn: Verbosity level n [default=2]" << endl;
    6369    gLog << "     -?/-h: This help" << endl << endl;
     70    gLog << "   REMARK: At the moment you can process a .raw _or_ a .rep file, only!" << endl << endl;
    6471}
    6572
     
    8289        gLog.SetNoColors();
    8390
    84     const int kComprlvl = arg.HasOption("-c") ? arg.GetIntAndRemove("-c") : 1;
     91    const Int_t kComprlvl = arg.HasOption("-c") ? arg.GetIntAndRemove("-c") : 1;
     92    Bool_t kUpdate = arg.HasOption("-u") && arg.GetIntAndRemove("-u")==1;
    8593
    8694    gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2);
     
    101109    TString kNameout = arg.GetArgumentStr(1);
    102110
    103     if (!kNamein.EndsWith(".raw"))
     111    const Bool_t isreport = kNamein.EndsWith(".rep");
     112
     113    if (!kNamein.EndsWith(".raw") && !isreport)
    104114        kNamein += ".raw";
    105115
     
    124134    }
    125135
    126     if (!gSystem->AccessPathName(kNameout, kFileExists))
    127         gLog << warn << "Warning: A file '" << kNameout << "' exists." << endl;
    128     else
    129         if (!gSystem->AccessPathName(kNameout, kWritePermission))
    130         {
    131             gLog << err << "Sorry, you don't have write permission for '" << kNameout << "'." << endl;
    132             return -1;
    133         }
     136    const Bool_t fileexist = !gSystem->AccessPathName(kNameout, kFileExists);
     137    const Bool_t writeperm = !gSystem->AccessPathName(kNameout, kWritePermission);
     138
     139    if (fileexist && !writeperm)
     140    {
     141        gLog << err << "Sorry, you don't have write permission for '" << kNameout << "'." << endl;
     142        return -1;
     143    }
     144
     145    if (fileexist && !kUpdate)
     146    {
     147        gLog << err << "Sorry, file '" << kNameout << "' already existing." << endl;
     148        return -1;
     149    }
     150
     151    if (!fileexist && kUpdate)
     152    {
     153        gLog << warn << "File '" << kNameout << "' doesn't yet exist." << endl;
     154        kUpdate=kFALSE;
     155    }
    134156
    135157    MArray::Class()->IgnoreTObjectStreamer();
     
    143165
    144166    MTaskList tasks;
     167    tasks.SetOwner();
    145168    plist.AddToList(&tasks);
    146169
     
    160183    plist.AddToList(&cratearray);
    161184
    162     MTime evttime("MRawEvtTime");
     185    MTime evttime;
    163186    plist.AddToList(&evttime);
    164187
     
    168191    // be created by MRawFileRead::PreProcess
    169192    //
    170     MRawFileRead  reader(kNamein);
    171     MRawFileWrite writer(kNameout, "RECREATE", "Magic root-file", kComprlvl);
    172     tasks.AddToList(&reader);
    173     tasks.AddToList(&writer);
     193    MTask *read  = 0;
     194    MTask *write = 0;
     195
     196    const TString option(kUpdate ? "UPDATE" : "RECREATE");
     197    if (isreport)
     198    {
     199        MReportFileRead *r = new MReportFileRead(kNamein);
     200        r->AddToList("MReportDAQ");
     201        r->AddToList("MReportDrive");
     202        r->AddToList("MReportCamera");
     203        r->AddToList("MReportTrigger");
     204        read = r;
     205
     206        MWriteRootFile *w = new MWriteRootFile(kNameout, option, "Magic root-file", kComprlvl);
     207        /*
     208         w->AddContainer("MReportDAQ",         "DAQ");
     209         w->AddContainer("MTimeDAQ",           "DAQ");
     210         w->AddContainer("MReportDrive",       "Drive");
     211         w->AddContainer("MTimeDrive",         "Drive");
     212         */
     213        w->AddContainer("MReportCamera",      "Camera");
     214        w->AddContainer("MTimeCamera",        "Camera");
     215        w->AddContainer("MCameraAUX",         "Camera");
     216        w->AddContainer("MCameraCalibration", "Camera");
     217        w->AddContainer("MCameraCooling",     "Camera");
     218        w->AddContainer("MCameraHV",          "Camera");
     219        w->AddContainer("MCameraLV",          "Camera");
     220        w->AddContainer("MCameraLids",        "Camera");
     221        w->AddContainer("MReportTrigger",     "Trigger");
     222        w->AddContainer("MTimeTrigger",       "Trigger");
     223        w->AddContainer("MReportDrive",       "Drive");
     224        w->AddContainer("MTimeDrive",         "Drive");
     225        write = w;
     226    }
     227    else
     228    {
     229        read  = new MRawFileRead(kNamein);
     230        write = new MRawFileWrite(kNameout, option, "Magic root-file", kComprlvl);
     231    }
     232    tasks.AddToList(read);
     233    tasks.AddToList(write);
    174234
    175235    //
  • trunk/MagicSoft/Mars/mhist/MFillH.cc

    r2556 r2557  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  07/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
     18!   Author(s): Thomas Bretz, 07/2001 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2002
     20!   Copyright: MAGIC Software Development, 2000-2003
    2121!
    2222!
     
    155155
    156156    AddToBranchList(Form("%s.*", (const char*)ExtractName(hist)));
    157     AddToBranchList(Form("%s.*", (const char*)ExtractName(par)));
     157    if (par)
     158        AddToBranchList(Form("%s.*", (const char*)ExtractName(par)));
    158159
    159160    if (title)
     
    224225
    225226    AddToBranchList(fH->GetDataMember());
    226     AddToBranchList(Form("%s.*", (const char*)ExtractName(par)));
     227    if (par)
     228        AddToBranchList(Form("%s.*", (const char*)ExtractName(par)));
    227229
    228230    if (title)
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r2550 r2557  
    568568    Update(gPad->GetLogy(), isbox, iscol);
    569569    PaintAxisTitle();
     570
     571    if (opt.Contains("pixelindex"))
     572        PaintIndices(kFALSE);
     573    if (opt.Contains("sectorindex"))
     574        PaintIndices(kTRUE);
    570575}
    571576
     
    627632}
    628633
    629 void MHCamera::DrawPixelIndices()
     634void MHCamera::PaintIndices(Bool_t sector)
    630635{
    631636    if (fNcells<=1)
    632637        return;
    633 
    634     // FIXME: Is this correct?
    635     for (int i=0; i<kItemsLegend; i++)
    636         fColors[i] = 16;
    637 
    638     if (!gPad)
    639         Draw();
    640638
    641639    TText txt;
     
    645643    for (Int_t i=0; i<fNcells-2; i++)
    646644    {
     645        const MGeomPix &h = (*fGeomCam)[i];
     646
    647647        TString num;
    648         num += i;
    649 
    650         const MGeomPix &h = (*fGeomCam)[i];
    651         TText *nt = txt.DrawText(h.GetX(), h.GetY(), num);
    652         nt->SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05);
    653     }
    654 }
    655 
    656 void MHCamera::DrawSectorIndices()
    657 {
    658     if (fNcells<=1)
    659         return;
    660 
    661     for (int i=0; i<kItemsLegend; i++)
    662         fColors[i] = 16;
    663 
    664     if (!gPad)
    665         Draw();
    666 
    667     TText txt;
    668     txt.SetTextFont(122);
    669     txt.SetTextAlign(22);   // centered/centered
    670 
    671     for (Int_t i=0; i<fNcells-2; i++)
    672     {
    673         TString num;
    674         num += (*fGeomCam)[i].GetSector();
    675 
    676         const MGeomPix &h = (*fGeomCam)[i];
    677         TText *nt = txt.DrawText(h.GetX(), h.GetY(), num);
    678         nt->SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05);
     648        num += sector ? h.GetSector() : i;
     649
     650        txt.SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05);
     651        txt.PaintText(h.GetX(), h.GetY(), num);
    679652    }
    680653}
  • trunk/MagicSoft/Mars/mhist/MHCamera.h

    r2484 r2557  
    5959    Int_t GetColor(Float_t val, Float_t min, Float_t max, Bool_t islog);
    6060
     61    void  PaintIndices(Bool_t sector);
    6162    void  Update(Bool_t islog, Bool_t isbox, Bool_t iscol);
    6263    void  UpdateLegend(Float_t min, Float_t max, Bool_t islog);
     
    144145    void  FillRandom(TH1 *h, Int_t ntimes=5000) { TH1::FillRandom(h, ntimes); }
    145146    void  FillRandom();
    146 
    147     void  DrawPixelIndices();
    148     void  DrawSectorIndices();
    149147
    150148    void  PrintInfo() const { Print(""); } // *MENU*
  • trunk/MagicSoft/Mars/mhist/MHVsTime.cc

    r2556 r2557  
    6060//
    6161MHVsTime::MHVsTime(const char *rule)
    62     : fHist(NULL), fData(NULL), fScale(1)
     62    : fGraph(NULL), fData(NULL), fScale(1)
    6363
    6464    fName  = gsDefName;
     
    6868        return;
    6969
    70     fHist = new TGraph;
     70    fGraph = new TGraph;
    7171    fData = new MDataChain(rule);
    7272}
     
    7878MHVsTime::~MHVsTime()
    7979{
    80     if (fHist)
    81         delete fHist;
     80    if (fGraph)
     81        delete fGraph;
    8282
    8383    if (fData)
     
    9292TString MHVsTime::GetDataMember() const
    9393{
    94     *fLog << dbg << fData->GetDataMember() << endl;
    9594    return fData ? fData->GetDataMember() : (TString)"";
    9695}
     
    105104{
    106105    // reset histogram (necessary if the same eventloop is run more than once)
    107     //fHist->Reset();
     106    //fGraph->Reset();
    108107
    109108    if (fData && !fData->PreProcess(plist))
    110109        return kFALSE;
    111110
    112     if (fHist)
     111    if (fGraph)
    113112    {
    114         delete fHist;
    115         fHist = new TGraph;
     113        delete fGraph;
     114        fGraph = new TGraph;
    116115    }
    117116
     
    119118    title += " vs Time";
    120119
    121     fHist->SetNameTitle(fName, title);
     120    fGraph->SetNameTitle(fName, title);
    122121
    123122    return kTRUE;
     
    130129void MHVsTime::SetName(const char *name)
    131130{
    132     fHist->SetName(name);
     131    fGraph->SetName(name);
    133132    MParContainer::SetName(name);
    134133}
     
    140139void MHVsTime::SetTitle(const char *title)
    141140{
    142     fHist->SetTitle(title);
     141    fGraph->SetTitle(title);
    143142    MParContainer::SetTitle(title);
    144143}
     
    160159    const Double_t T = (*t);///3600;
    161160
    162     fHist->SetPoint(fHist->GetN(), T>12*3600?T-24*3600:T, v);
     161    fGraph->SetPoint(fGraph->GetN(), T>12*3600?T-24*3600:T, v);
    163162
    164163    return kTRUE;
     
    182181void MHVsTime::Draw(Option_t *opt)
    183182{
    184     if (fHist->GetN()==0)
     183    if (fGraph->GetN()==0)
    185184        return;
    186185
    187     TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
     186    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fGraph);
    188187    pad->SetBorderMode(0);
    189188
     
    192191    TString str(opt);
    193192
    194     fHist->GetHistogram()->SetXTitle("Time");
    195     fHist->GetHistogram()->SetYTitle(GetRule());
    196     fHist->GetHistogram()->GetXaxis()->SetTimeFormat("%H:%M:%S");
    197     fHist->GetHistogram()->GetXaxis()->SetTimeDisplay(1);
    198     fHist->GetHistogram()->GetXaxis()->SetLabelSize(0.033);
    199     fHist->Draw("AP");
    200     if (fHist->TestBit(kIsLogy))
     193    fGraph->GetHistogram()->SetXTitle("Time");
     194    fGraph->GetHistogram()->SetYTitle(GetRule());
     195    fGraph->GetHistogram()->GetXaxis()->SetTimeFormat("%H:%M:%S");
     196    fGraph->GetHistogram()->GetXaxis()->SetTimeDisplay(1);
     197    fGraph->GetHistogram()->GetXaxis()->SetLabelSize(0.033);
     198    fGraph->Draw("AP");
     199    if (fGraph->TestBit(kIsLogy))
    201200        pad->SetLogy();
    202201
     
    229228Int_t MHVsTime::GetNbins() const
    230229{
    231     return fHist->GetN();
    232 }
    233 
     230    return fGraph->GetN();
     231}
     232/*
    234233TH1 *MHVsTime::GetHist()
    235234{
    236     return fHist ? fHist->GetHistogram() : 0;
     235    return fGraph ? fGraph->GetHistogram() : 0;
    237236}
    238237
    239238const TH1 *MHVsTime::GetHist() const
    240239{
    241     return fHist ? fHist->GetHistogram() : 0;
     240    return fGraph ? fGraph->GetHistogram() : 0;
    242241}
    243242
     
    246245    return GetHist();
    247246}
     247*/
  • trunk/MagicSoft/Mars/mhist/MHVsTime.h

    r2556 r2557  
    1313protected:
    1414    // Could be const but root < 3.02/06 doesn't like this...
    15     TGraph     *fHist;  // Histogram to fill
     15    TGraph     *fGraph;  // Histogram to fill
    1616    MDataChain *fData;  // Object from which the data is filled
    1717    Double_t    fScale; // Scale for axis (eg unit)
     
    3838    TString GetRule() const;
    3939
    40     const TH1 *GetHist() const;
    41     TH1 *GetHist();
    42     TH1 *GetHistByName(const TString name="");
     40    /*
     41//    const TH1 *GetHist() const;
     42//    TH1 *GetHist();
     43//    TH1 *GetHistByName(const TString name="");
     44*/
     45    const TGraph *GetGraph() const { return fGraph; }
     46    TGraph *GetGraph() { return fGraph; }
     47
    4348
    4449    void Draw(Option_t *opt=NULL);
  • trunk/MagicSoft/Mars/mmain/MEventDisplay.cc

    r2550 r2557  
    446446    // Add Geometry tab
    447447    //
    448     MGeomCam *geom = (MGeomCam*)plist->FindObject("MGeomCam");
    449 
    450     TCanvas &c=AddTab("Geometry");
    451 
    452     c.SetFillColor(16);
    453 
    454     MHCamera *cam = new MHCamera(*geom);
    455     cam->SetBit(TH1::kNoStats|MHCamera::kNoLegend);
    456     cam->Draw();
    457     cam->DrawPixelIndices();
    458     fList->Add(cam);
    459 
    460     c.Modified();
    461     c.Update();
     448    AddGeometryTabs();
    462449
    463450    //
     
    485472//  Adds the geometry tab
    486473//
    487 void MEventDisplay::AddGeometryTab()
     474void MEventDisplay::AddGeometryTabs()
    488475{
    489476    MGeomCam *geom = (MGeomCam*)fEvtLoop->GetParList()->FindObject("MGeomCam");
     
    491478        return;
    492479
    493     TCanvas &c=AddTab("Geometry");
     480    TCanvas &c1=AddTab("Geometry");
    494481
    495482    MHCamera *cam = new MHCamera(*geom);
    496     cam->SetBit(TH1::kNoStats);
    497     cam->Draw();
    498     cam->DrawPixelIndices();
     483    cam->SetBit(TH1::kNoStats|MHCamera::kNoLegend|kCanDelete);
     484    cam->Draw("pixelindex");
    499485    fList->Add(cam);
    500486
    501     c.Modified();
    502     c.Update();
     487    c1.Modified();
     488    c1.Update();
     489
     490    TCanvas &c2=AddTab("Sectors");
     491
     492    cam = new MHCamera(*geom);
     493    cam->SetBit(TH1::kNoStats|MHCamera::kNoLegend|kCanDelete);
     494    cam->Draw("sectorindex");
     495    fList->Add(cam);
     496
     497    c2.Modified();
     498    c2.Update();
    503499}
    504500
  • trunk/MagicSoft/Mars/mreport/MReport.cc

    r2532 r2557  
    4545
    4646    int n = sscanf(str.Data(),
     47                   fHasReportTime ?
    4748                   " %d %*d %*d %*d %d %d %d %d "
    48                    "%*d %*d %*d %*d %*d %*d %*d %*d"
    49                    "%n",
     49                   "%*d %*d %*d %*d %*d %*d %*d %*d %n" :
     50                   " %d %*d %*d %*d %d %d %d %d ",
    5051                   &state, &hor, &min, &sec, &ms, &len);
    5152    if (n!=5)
  • trunk/MagicSoft/Mars/mreport/MReport.h

    r2532 r2557  
    1212{
    1313private:
    14     const TString fIdentifier; //!
     14    const TString fIdentifier;    //!
     15    const Bool_t  fHasReportTime; //!
    1516
    1617    Byte_t  fState;
     
    2122
    2223public:
    23     MReport(const char *id) : fIdentifier(id), fState(0xff), fTime(0) { }
     24    MReport(const char *id, Bool_t time=kTRUE) : fIdentifier(id), fHasReportTime(time), fState(0xff), fTime(0) { }
    2425
    2526    virtual Bool_t SetupReading(MParList &plist);
  • trunk/MagicSoft/Mars/mreport/MReportCamera.cc

    r2555 r2557  
    106106        return kFALSE;
    107107
    108     for (int i=0; i<577; i++)
    109     {
    110         const Char_t hex[4] = { str[i*3], str[i*3+1], str[i*3+2], 0 };
    111         const Int_t n=sscanf(hex, "%3hx", &fHV->fHV[i]);
     108    const char *pos = str.Data();
     109    const char *end = str.Data()+577*3;
     110
     111    Int_t i=0;
     112    while (pos<end)
     113    {
     114        const Char_t hex[4] = { pos[0], pos[1], pos[2], 0 };
     115        pos += 3;
     116
     117        const Int_t n=sscanf(hex, "%3hx", &fHV->fHV[i++]);
    112118        if (n==1)
    113119            continue;
     
    116122        return kFALSE;
    117123    }
    118     str.Remove(0, 577*3); // Remove DC currents
     124
     125    str.Remove(0, end-str.Data()); // Remove DC currents
    119126    str=str.Strip(TString::kLeading);
    120127    return kTRUE;
  • trunk/MagicSoft/Mars/mreport/MReportDrive.cc

    r2520 r2557  
    6969    str = str.Strip(TString::kBoth);
    7070
    71     *fLog << dbg << "D" << flush;
    72 
    7371    return str.IsNull();
    7472}
  • trunk/MagicSoft/Mars/mreport/MReportDrive.h

    r2520 r2557  
    2828    Bool_t InterpreteBody(TString &str);
    2929
    30     ClassDef(MReportDrive, 0) // Base class for control reports
     30    Double_t GetMjd() const           { return fMjd;       }
     31
     32    Double_t GetRa() const            { return fRa;        }
     33    Double_t GetDec() const           { return fDec;       }
     34    Double_t GetHa() const            { return fHa;        }
     35
     36        Double_t GetNominalZd() const { return fNominalZd; }
     37    Double_t GetNominalAz() const     { return fNominalAz; }
     38    Double_t GetCurrentZd() const     { return fCurrentZd; }
     39    Double_t GetCurrentAz() const     { return fCurrentAz; }
     40
     41    Double_t GetErrorZd() const       { return fErrorZd;   }
     42    Double_t GetErrorAz() const       { return fErrorAz;   }
     43
     44    ClassDef(MReportDrive, 1) // Base class for control reports
    3145};
    3246
  • trunk/MagicSoft/Mars/star.cc

    r2531 r2557  
    5858    gLog << "     -cn: Compression level n=1..9 [default=2]" << endl;
    5959    gLog << "     -vn: Verbosity level n [default=2]" << endl;
    60     gLog << "     -u1: Update File (instead or Recreate)" << endl;
     60    gLog << "     -u1: Update File (instead of Recreate)" << endl;
    6161    gLog << "     -tn: Telescope Serial Number n [default=0]" << endl << endl;
    6262    gLog << " -> Further setup is not possible at the moment, please use" << endl;
     
    123123    if (!gSystem->AccessPathName(kNameout, kFileExists))
    124124    {
    125         if (!kUpdate)
    126             gLog << warn << "Warning: A file '" << kNameout << "' exists." << endl;
    127     }
    128     else
     125        if (kUpdate)
     126            gLog << warn << "Warning: File doesn't '" << kNameout << "' exist... recreating." << endl;
     127    }
     128
     129    if (kUpdate || gSystem->AccessPathName(kNameout, kFileExists))
    129130        if (!gSystem->AccessPathName(kNameout, kWritePermission))
    130131        {
     
    140141    // The tasklist is identified in the eventloop by its name
    141142    //
    142     MParList  plist;
     143    MParList plist;
    143144
    144145    MTaskList tlist;
Note: See TracChangeset for help on using the changeset viewer.