Changeset 2521 for trunk/MagicSoft/Mars


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2519 r2521  
    1212   * mbase/MStatusDisplay.cc:
    1313     - removed ==13 using TryLock() (this was wrong)
     14
     15   * mreport/*
     16     - added
     17
     18   * macros/readrep.C:
     19     - added
    1420
    1521
  • trunk/MagicSoft/Mars/NEWS

    r2519 r2521  
    55     multi-telescope files which can be produced with the coming
    66     camera version 0.7.
     7
     8   - added classes to read and interprete central control report files
     9     (Directory: mreport, Base-Class: MReport, Reader: MReportFileRead, ...)
    710
    811
  • trunk/MagicSoft/Mars/mdata/MDataChain.cc

    r2328 r2521  
    7777//   floor(x)  round down to the nearest integer (floor(9.9)=9)
    7878//   ceil(x)   round up   to the nearest integer (floor(9.1)=10)
     79//   round(x)  round      to the nearest integer
    7980//   r2d(x)    transform radians to degrees
    8081//   d2r(x)    transform degrees to radians
     
    565566    case kEFloor:    return TMath::Floor(val);
    566567    case kECeil:     return TMath::Ceil(val);
     568    case kERound:    return TMath::Nint(val);
    567569    case kERad2Deg:  return val*180/TMath::Pi();
    568570    case kEDeg2Rad:  return val*TMath::Pi()/180;
     
    664666    case kEFloor:    str += "floor" ; break;
    665667    case kECeil:     str += "ceil"  ; break;
     668    case kERound:    str += "round" ; break;
    666669    case kERad2Deg:  str += "r2d"   ; break;
    667670    case kEDeg2Rad:  str += "d2r"   ; break;
  • trunk/MagicSoft/Mars/mdata/MDataChain.h

    r2328 r2521  
    3131        kEPositive,
    3232        kENegative,
    33         kEFloor, kECeil,
     33        kEFloor, kECeil, kERound,
    3434        kERad2Deg, kEDeg2Rad, kERandom,
    3535        kERandomP, kERandomE, kERandomI, kERandomG, kERandomL,
  • trunk/MagicSoft/Mars/merpp.cc

    r2456 r2521  
    5555    gLog << all << endl;
    5656    gLog << "Sorry the usage is:" << endl;
    57     gLog << "   merpp [-a0] [-vn] [-cn] inputfile[.raw] [outputfile[.root]]" << endl << endl;
     57    gLog << "   merpp [-h] [-?] [-a0] [-vn] [-cn] inputfile[.raw] [outputfile[.root]]" << endl << endl;
    5858    gLog << "     input file:   Magic DAQ binary file." << endl;
    5959    gLog << "     ouput file:   Merpped root file." << endl;
    6060    gLog << "     -a0: Do not use Ansii codes." << endl;
    6161    gLog << "     -cn: Compression level n=1..9 [default=2]" << endl;
    62     gLog << "     -vn: Verbosity level n [default=2]" << endl << endl;
     62    gLog << "     -vn: Verbosity level n [default=2]" << endl;
     63    gLog << "     -?/-h: This help" << endl << endl;
    6364}
    6465
     
    7172    //
    7273    MArgs arg(argc, argv);
     74
     75    if (arg.HasOption("-?") || arg.HasOption("-h"))
     76    {
     77        Usage();
     78        return -1;
     79    }
    7380
    7481    //
  • trunk/MagicSoft/Mars/mfilter/FilterLinkDef.h

    r2510 r2521  
    1717#pragma link C++ class MFDataChain+;
    1818#pragma link C++ class MFDataMember+;
     19#pragma link C++ class MFRealTimePeriod+;
    1920
    2021#pragma link C++ class MFCT1SelBasic+;
  • trunk/MagicSoft/Mars/mfilter/Makefile

    r2510 r2521  
    4343           MFGeomag.cc \
    4444           MFParticleId.cc \
     45           MFRealTimePeriod.cc \
    4546           MFAlpha.cc \
    4647           MFCT1SelBasic.cc \
  • trunk/MagicSoft/Mars/mgeom/MGeomCam.h

    r2463 r2521  
    3535    void CalcNumSectors();
    3636    void InitOuterRing();
     37    void InitGeometry()
     38    {
     39        CalcNumSectors();
     40        CalcMaxRadius();
     41        CalcPixRatio();
     42        InitOuterRing();
     43    }
     44
    3745
    3846public:
     
    6068
    6169#endif
    62 
  • trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc

    r2463 r2521  
    5656    CreateCam();
    5757    CreateNN();
    58     CalcNumSectors();
    59     CalcMaxRadius();
    60     CalcPixRatio();
     58    InitGeometry();
    6159}
    6260
     
    200198      (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
    201199                              nn[i][3], nn[i][4], nn[i][5]);
    202 
    203   InitOuterRing();
    204200}
    205201
  • trunk/MagicSoft/Mars/mgeom/MGeomCamCT1Daniel.cc

    r2463 r2521  
    6060    CreateCam();
    6161    CreateNN();
    62     CalcNumSectors();
    63     CalcMaxRadius();
    64     CalcPixRatio();
     62    InitGeometry();
    6563}
    6664
     
    204202      (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
    205203                              nn[i][3], nn[i][4], nn[i][5]);
    206 
    207   InitOuterRing();
    208204}
    209205
  • trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000.cc

    r2463 r2521  
    5252    CreateCam();
    5353    CreateNN();
    54     CalcNumSectors();
    55     CalcMaxRadius();
    56     CalcPixRatio();
     54    InitGeometry();
    5755}
    5856
     
    895893      (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
    896894                              nn[i][3], nn[i][4], nn[i][5]);
    897 
    898   InitOuterRing();
    899895}
  • trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000HG.cc

    r2463 r2521  
    5656    CreateCam();
    5757    CreateNN();
    58     CalcNumSectors();
    59     CalcMaxRadius();
    60     CalcPixRatio();
     58    InitGeometry();
    6159}
    6260
     
    34033401    {  2285,  2286,  2398,  2400,  -1,  -1},
    34043402    {  2286,  2399,  -1,  -1,  -1,  -1} // 2400
    3405     };
     3403  };
    34063404
    34073405  for (Int_t i=0; i<2401; i++)
    34083406      (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
    34093407                              nn[i][3], nn[i][4], nn[i][5]);
    3410 
    3411   InitOuterRing();
    34123408}
  • trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc

    r2463 r2521  
    4848    CreateCam();
    4949    CreateNN();
    50     CalcPixRatio();
    51     CalcNumSectors();
    52     CalcMaxRadius();
    53     CalcPixRatio();
     50    InitGeometry();
    5451}
    5552
     
    925922        (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
    926923                                nn[i][3], nn[i][4], nn[i][5]);
    927 
    928     InitOuterRing();
    929924}
  • trunk/MagicSoft/Mars/mgeom/MGeomCamMagic919.cc

    r2463 r2521  
    4949    CreateCam();
    5050    CreateNN();
    51     CalcMaxRadius();
    52     CalcPixRatio();
     51    InitGeometry();
    5352}
    5453
     
    13621361      (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
    13631362                              nn[i][3], nn[i][4], nn[i][5]);
    1364 
    1365   InitOuterRing();
    13661363}
  • trunk/MagicSoft/Mars/mgeom/MGeomCamMagicHG.cc

    r2463 r2521  
    4848    CreateCam();
    4949    CreateNN();
    50     CalcNumSectors();
    51     CalcMaxRadius();
    52     CalcPixRatio();
     50    InitGeometry();
    5351}
    5452
     
    33973395        (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
    33983396                                nn[i][3], nn[i][4], nn[i][5]);
    3399 
    3400     InitOuterRing();
    34013397}
  • trunk/MagicSoft/Mars/mgeom/MGeomCorsikaCT.cc

    r2463 r2521  
    6464  fCTdiam=ctdiam;
    6565  fCTfocal=ctfocal;
    66 
    6766}
  • trunk/MagicSoft/Mars/mgeom/MGeomMirror.cc

    r2394 r2521  
    103103}
    104104
    105 void MGeomMirror::SetMirrorDeviations(Float_t dev_x, Float_t dev_y){
     105void MGeomMirror::SetMirrorDeviations(Float_t dev_x, Float_t dev_y)
     106{
    106107    fDeviationX=dev_x;  // deviation in x [cm]
    107108    fDeviationY=dev_y;  // deviation in y [cm]
     
    127128    fReflectivity = ref;
    128129}
    129 
    130 
    131 
    132 
    133 
    134 
    135 
    136 
  • trunk/MagicSoft/Mars/mgeom/MGeomPMT.cc

    r2173 r2521  
    6969    fQE = qe;
    7070}
    71 
    72 
    73 
    74 
    75 
  • trunk/MagicSoft/Mars/mmain/MEventDisplay.cc

    r2512 r2521  
    6060#include "MReadMarsFile.h"       // MReadMarsFile
    6161#include "MGeomApply.h"          // MGeomApply
     62#include "MFDataMember.h"        // MFDataMember
    6263#include "MMcPedestalCopy.h"     // MMcPedestalCopy
    6364#include "MMcPedestalNSBAdd.h"   // MMcPedestalNSBAdd
    6465#include "MCerPhotCalc.h"        // MCerPhotCalc
     66#include "MCerPhotAnal2.h"       // MCerPhotAnal2
    6567#include "MImgCleanStd.h"        // MImgCleanStd
    6668#include "MHillasCalc.h"         // MHillasCalc
     
    182184    MMcPedestalNSBAdd *pdnsb = new MMcPedestalNSBAdd;
    183185    MCerPhotCalc      *ncalc = new MCerPhotCalc;
     186    MCerPhotAnal2     *nanal = new MCerPhotAnal2;
    184187    MFillH            *fill1 = new MFillH(evt1, "MCerPhotEvt",  "MFillH1");
    185188    MImgCleanStd      *clean = new MImgCleanStd;
     
    193196    MHillasSrcCalc    *scalc = new MHillasSrcCalc;
    194197
     198    MFilter *f1=new MFDataMember("MRawRunHeader.fRunType", '>', 255.5);
     199    MFilter *f2=new MFDataMember("MRawRunHeader.fRunType", '<', 255.5);
     200
     201    ncalc->SetFilter(f1);
     202    nanal->SetFilter(f2);
     203
     204    tlist->AddToList(f1);
     205    tlist->AddToList(f2);
    195206    tlist->AddToList(pcopy);
    196207    tlist->AddToList(pdnsb);
    197208    tlist->AddToList(ncalc);
     209    tlist->AddToList(nanal);
    198210    tlist->AddToList(fill1);
    199211    tlist->AddToList(clean);
  • trunk/MagicSoft/Mars/mmain/Makefile

    r2506 r2521  
    2424INCLUDES = -I. -I../mbase -I../manalysis -I../mdatacheck -I../mraw       \
    2525           -I../mgui -I../mgeom -I../mhist -I../mmontecarlo -I../mfileio \
    26            -I../mimage -I../mhistmc -I../mgbase
     26           -I../mimage -I../mhistmc -I../mgbase -I../mfilter -I../mdata
    2727
    2828#------------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mona.cc

    r2497 r2521  
    1515#include "MFillH.h"
    1616#include "MFRealTimePeriod.h"
    17 #include "MOnlineDump2.h"
    1817#include "MHTriggerLvl0.h"
    1918#include "MHCamera.h"         // ::Class()
     
    2423#include "MHillasCalc.h"
    2524#include "MHillasSrcCalc.h"
     25
     26#include "MArgs.h"
     27
     28// --------------------------------------------------------------------
     29
     30#include "MTime.h"
     31#include "MRawEvtHeader.h"       // MRawEvtHeader
     32#include "MRawRunHeader.h"       // MRawRunHeader
     33
     34class MOnlineDump : public MTask
     35{
     36private:
     37    MFillH *fFill1;
     38    MFillH *fFill2;
     39    MFillH *fFill3;
     40    MFRealTimePeriod *fFilter;
     41
     42    UInt_t fRunNumber;
     43    UInt_t fEvtNumber;
     44
     45    MRawEvtHeader *fRawEvtHeader;
     46    MRawRunHeader *fRawRunHeader;
     47
     48    MTime *fEvtTime;
     49    Double_t fTime;
     50
     51    void SetNoContextMenu(TObject *c)
     52    {
     53        if (fDisplay->HasCanvas((TCanvas*)c))
     54            c->ResetBit(kNoContextMenu);
     55    }
     56    void DisplayTriggerRate()
     57    {
     58        if (*fEvtTime==0)
     59            fEvtTime->SetTime(gSystem->Now());
     60   
     61        if (fEvtNumber==0 || fRawRunHeader->GetRunNumber()!=fRunNumber)
     62        {
     63            fEvtNumber = fRawEvtHeader->GetDAQEvtNumber();
     64            fRunNumber = fRawRunHeader->GetRunNumber();
     65            fTime      = *fEvtTime;
     66            return;
     67        }
     68   
     69        const UInt_t  evts = fRawEvtHeader->GetDAQEvtNumber() - fEvtNumber;
     70        const Double_t sec = *fEvtTime-fTime;
     71   
     72        if (evts>0 && sec>0 && fDisplay)
     73            fDisplay->SetStatusLine2(Form("Trigger Rate: %.1fHz", evts/sec));
     74    }
     75
     76public:
     77    MOnlineDump() { fName = "MOnlineDump"; }
     78    Int_t PreProcess(MParList *pList)
     79    {
     80        if (gROOT->IsBatch())
     81        {
     82            *fLog << err << "We are in batch mode!" << endl;
     83            return kFALSE;
     84        }
     85        if (!fDisplay)
     86        {
     87            *fLog << err << "fDisplay not set." << endl;
     88            return kFALSE;
     89        }
     90   
     91        MTaskList *tasks = (MTaskList*)pList->FindObject("MTaskList");
     92        if (!tasks)
     93        {
     94            *fLog << err << "MTaskList not found... abort." << endl;
     95            return kFALSE;
     96        }
     97   
     98        fFill1 = (MFillH*)tasks->FindObject("MFillCamEvent");
     99        if (!fFill1)
     100        {
     101            *fLog << err << "MFillCamEvent not found... abort." << endl;
     102            return kFALSE;
     103        }
     104        fFill2 = (MFillH*)tasks->FindObject("MFillEvent");
     105        if (!fFill2)
     106        {
     107            *fLog << err << "MFillEvent not found... abort." << endl;
     108            return kFALSE;
     109        }
     110        fFill3 = (MFillH*)tasks->FindObject("MFillTriggerLvl0");
     111        if (!fFill3)
     112        {
     113            *fLog << err << "MFillTriggerLvl0 not found... abort." << endl;
     114            return kFALSE;
     115        }
     116        fRawEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
     117        if (!fRawEvtHeader)
     118        {
     119            *fLog << err << "MRawEvtHeader not found... abort." << endl;
     120            return kFALSE;
     121        }
     122   
     123        fRawRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     124        if (!fRawRunHeader)
     125        {
     126            *fLog << err << "MRawRunHeader not found... abort." << endl;
     127            return kFALSE;;
     128        }
     129   
     130        fEvtTime = (MTime*)pList->FindObject("MRawEvtTime");
     131        if (!fEvtTime)
     132        {
     133            *fLog << err << "MRawEvtTime not found... abort." << endl;
     134            return kFALSE;
     135        }
     136   
     137        fRunNumber = 0xffffffff;
     138        fEvtNumber = 0;
     139   
     140        SetNoContextMenu((TObject*)fFill1->GetCanvas());
     141        SetNoContextMenu((TObject*)fFill2->GetCanvas());
     142        SetNoContextMenu((TObject*)fFill3->GetCanvas());
     143   
     144        return kTRUE;
     145    }
     146    Int_t Process()
     147    {
     148        DisplayTriggerRate();
     149   
     150        if (fDisplay)
     151            fDisplay->SetProgressBarPosition((Float_t)fEvtNumber/fRawRunHeader->GetNumEvents());
     152   
     153        return kTRUE;
     154    }
     155    Int_t PostProcess()
     156    {
     157        if (fDisplay)
     158            fDisplay->SetProgressBarPosition(1);
     159   
     160        return kTRUE;
     161    }
     162//    ClassDef(MOnlineDump, 0) // Task to fill a histogram with data from a parameter container
     163};
     164//ClassImp(MOnlineDump);
     165// --------------------------------------------------------------------
    26166
    27167void StartUpMessage()
     
    73213}
    74214
    75 Bool_t Loop(MStatusDisplay *display)
     215Bool_t Loop(MStatusDisplay *display, Int_t port)
    76216{
    77217    //
     
    81221    //
    82222    MRawSocketRead reader;
    83     reader.SetPort(7000);
     223    reader.SetPort(port);
    84224
    85225    //
     
    112252    tasks.AddToList(&fill3);
    113253
    114     MOnlineDump2 dump;
     254    MOnlineDump dump;
    115255    dump.SetFilter(&filter);
    116256    tasks.AddToList(&dump);
     
    151291void *thread(void *ptr)
    152292{
     293    const Int_t port = *(Int_t*)ptr;
     294
    153295    MStatusDisplay d;
    154296    d.Resize(740, 600);
     
    159301    //
    160302    while (d.CheckStatus()!=MStatusDisplay::kFileExit)
    161         Loop(&d);
     303        Loop(&d, port);
    162304
    163305    gLog << dbg << "Exit System Loop... " << flush;
     
    194336*/
    195337
     338static void Usage()
     339{
     340    gLog << all << endl;
     341    gLog << "Sorry the usage is:" << endl;
     342    gLog << "   mona [-?] [-h] [-a0] [-h] [-pn] [-vn]" << endl << endl;
     343    gLog << "     -a0: Do not use Ansii codes." << endl;
     344    gLog << "     -pn: TCP/IP port n [default=7000]" << endl;
     345    gLog << "     -vn: Verbosity level n [default=2]" << endl << endl;
     346    gLog << "     -?/-h: This help" << endl << endl;
     347}
     348
     349
    196350int main(int argc, char **argv)
    197351{
    198352    StartUpMessage();
     353
     354    //
     355    // Evaluate arguments
     356    //
     357    MArgs arg(argc, (const char**)argv);
     358
     359    if (arg.HasOption("-?") || arg.HasOption("-h"))
     360    {
     361        Usage();
     362        return -1;
     363    }
     364
     365    //
     366    // Set verbosity to highest level.
     367    //
     368    gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2);
     369
     370    if (arg.HasOption("-a") && arg.GetIntAndRemove("-a")==0)
     371        gLog.SetNoColors();
     372
     373    const Int_t port = arg.HasOption("-p") ? arg.GetIntAndRemove("-p") : 7000;
     374
     375    //
     376    // check for the right usage of the program
     377    //
     378    if (arg.GetNumArguments()>0)
     379    {
     380        Usage();
     381        return -1;
     382    }
    199383
    200384    TApplication app("Mars", &argc, argv);
     
    204388        return 1;
    205389    }
     390
    206391    /*
    207392    TGApplication app("Mona", &argc, argv);
     
    219404    //
    220405    gLog << dbg << "Starting Thread..." << endl;
    221     TThread t(thread);
     406    TThread t(thread, (void*)&port);
    222407    t.Run();
    223408
  • trunk/MagicSoft/Mars/mraw/MRawFileRead.cc

    r2299 r2521  
    242242Int_t MRawFileRead::PostProcess()
    243243{
     244    fIn->close();
     245
    244246    //
    245247    // Sanity check for the number of events
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.h

    r2386 r2521  
    2323const UShort_t kMagicNumber = 0xc0c0;
    2424
     25//
     26// enum for the Run Type. Monte Carlo Runs have
     27// to have a value greater than 255 (>0xff)
     28//
    2529enum {
    2630    kRTData        = 0,
  • trunk/MagicSoft/Mars/mraw/RawIncl.h

    r454 r2521  
    11#ifndef __CINT__
    22
    3 #include "MTime.h"
    43#include "MArrayB.h"
    54#include "MArrayS.h"
    6 #include "MParList.h"
    7 
    8 #include <TClonesArray.h>
    95
    106#endif // __CINT__
  • trunk/MagicSoft/Mars/readraw.cc

    r2456 r2521  
    5252    gLog << all << endl;
    5353    gLog << "Sorry the usage is:" << endl;
    54     gLog << "   readraw [-vn] [-dec] [-a0] inputfile[.root]" << endl << endl;
     54    gLog << "   readraw [-h] [-?] [-vn] [-dec] [-a0] inputfile[.root]" << endl << endl;
    5555    gLog << "     input file:   Magic DAQ binary file." << endl;
    5656    gLog << "     -a0: Do not use Ansii codes." << endl;
    5757    gLog << "     -vn: Verbosity level n [default=2]" << endl;
    5858    gLog << "     -d1: print data in decimal values" << endl;
     59    gLog << "     -?/-h: This help" << endl << endl;
    5960}
    6061
     
    7677    //
    7778    MArgs arg(argc, argv);
     79
     80    if (arg.HasOption("-?") || arg.HasOption("-h"))
     81    {
     82        Usage();
     83        return -1;
     84    }
    7885
    7986    //
  • trunk/MagicSoft/Mars/status.cc

    r2506 r2521  
    5353#include "MFillH.h"
    5454#include "MEvtLoop.h"
     55#include "MFDataMember.h"
    5556
    5657#include <TApplication.h>
     
    8081    gLog << "     input file:   Mars root file." << endl;
    8182    gLog << "     -a0: Do not use Ansii codes." << endl;
    82     gLog << "     -vn: Verbosity level n [default=2]" << endl << endl;
     83    gLog << "     -vn: Verbosity level n [default=2]" << endl;
     84    gLog << "     -?/-h: This help" << endl << endl;
    8385}
    8486
     
    9294    //
    9395    MArgs arg(argc, (const char**)argv);
     96
     97    if (arg.HasOption("-?") || arg.HasOption("-h"))
     98    {
     99        Usage();
     100        return -1;
     101    }
    94102
    95103    //
     
    181189    MMcPedestalNSBAdd pnsb;
    182190    MCerPhotCalc      ncalc;
    183 //    MCerPhotAnal2     ncalc;
     191    MCerPhotAnal2     nanal;
     192
     193    MFDataMember f1("MRawRunHeader.fRunType", '>', 255.5);
     194    MFDataMember f2("MRawRunHeader.fRunType", '<', 255.5);
     195
     196    ncalc.SetFilter(&f1);
     197    nanal.SetFilter(&f2);
    184198/*
    185199    TArrayS blinds(6);
     
    230244
    231245    tlist.AddToList(&read);
     246    tlist.AddToList(&f1);
     247    tlist.AddToList(&f2);
    232248    tlist.AddToList(&geomapl);
    233249    tlist.AddToList(&pcopy);
    234250    tlist.AddToList(&pnsb);
    235251    tlist.AddToList(&ncalc);
     252    tlist.AddToList(&nanal);
    236253    //tlist.AddToList(&blind);
    237254    tlist.AddToList(&hfill0);
Note: See TracChangeset for help on using the changeset viewer.