Changeset 9005 for trunk


Ignore:
Timestamp:
07/17/08 15:58:20 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9003 r9005  
    3131     - use File-Id to order files
    3232     - added telescope number to all constructors
     33
     34   * automatic-exclusions.rc:
     35     - moved as exclusions.rc to resources and updated contents
     36       to new doeclusion.C
     37
     38   * ganymed.cc:
     39     - updated Usage output
     40     - added new option to change meximum file size
     41
     42   * merpp.cc:
     43     - merpp also MCameraDC from cc-report
     44
     45   * datacenter/macros/fillsignal.C:
     46     - replaces WARNING by ERROR if an error is returned
     47
     48   * datacenter/macros/writesequencefile.C:
     49     - completely redone using new MSequenceSQL
     50
     51   * mcamera/MCameraDC.[h,cc]:
     52     - added the Interprete member function
     53     - made MReportCamera and MReportCurrents friends clases
     54     - added fStatus
     55     - increased class version accordingly
     56
     57   * mjobs/MJCalibration.cc, mjobs/MJPedestal.cc:
     58     - tiny changes to output
     59
     60   * mreport/MReportCamera.[h,cc]:
     61     - removed fStatusDC
     62     - removed gkActiveLoadControlVersNum
     63     - added interpretation of DC
     64     - increased class version by one
     65
     66   * mreport/MReportCurrents.cc:
     67     - moved interpretation of DCs to MCameraDC
     68
     69   * resources/sequences.rc:
     70     - changed some comments
     71     - added telescope number to rules
     72
    3373
    3474
  • trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C

    r8999 r9005  
    114114    if (!cam)
    115115    {
    116         cout << "WARNING - Reading of PedRMS;avg failed." << endl;
     116        cout << "ERROR - Reading of PedRMS;avg failed." << endl;
    117117        return 2;
    118118    }
     
    122122    if (!pul)
    123123    {
    124         cout << "WARNING - Reading of PulsePos;avg failed." << endl;
     124        cout << "ERROR - Reading of PulsePos;avg failed." << endl;
    125125        return 2;
    126126    }
     
    129129    if (!difflo)
    130130    {
    131         cout << "WARNING - Reading of DiffLo;avg failed." << endl;
     131        cout << "ERROR - Reading of DiffLo;avg failed." << endl;
    132132        return 2;
    133133    }
     
    135135    if (!diffhi)
    136136    {
    137         cout << "WARNING - Reading of DiffHi;avg failed." << endl;
     137        cout << "ERROR - Reading of DiffHi;avg failed." << endl;
    138138        return 2;
    139139    }
     
    144144    if (sequence.IsNull())
    145145    {
    146         cout << "WARNING - Sequ# empty" << endl;
     146        cout << "ERROR - Sequ# empty" << endl;
    147147        cout << "Sequ# " << sequence << endl;
    148148        return 2;
     
    161161        if (!hilooff)
    162162        {
    163             cout << "WARNING - Reading of HiLoOff failed." << endl;
     163            cout << "ERROR - Reading of HiLoOff failed." << endl;
    164164            return 2;
    165165        }
     
    168168        if (!hilocal)
    169169        {
    170             cout << "WARNING - Reading of HiLoCal failed." << endl;
     170            cout << "ERROR - Reading of HiLoCal failed." << endl;
    171171            return 2;
    172172        }
     
    191191    if (meanrmsi<0 || meanrmso<0)
    192192    {
    193         cout << "WARNING - MeanPedRMS inner or outer < 0 " << endl;
     193        cout << "ERROR - MeanPedRMS inner or outer < 0 " << endl;
    194194        cout << "MeanPedRMS inner " << meanrmsi << endl;
    195195        cout << "MeanPedRMS outer " << meanrmso << endl;
     
    203203    if (!cam)
    204204    {
    205         cout << "WARNING - Reading of Interp'd;avg failed." << endl;
     205        cout << "ERROR - Reading of Interp'd;avg failed." << endl;
    206206        return 2;
    207207    }
     
    212212    if (meansigi<0 || meansigo<0)
    213213    {
    214         cout << "WARNING - MeanInterp'd inner or outer < 0 " << endl;
     214        cout << "ERRROR - MeanInterp'd inner or outer < 0 " << endl;
    215215        cout << "MeanInterp'd inner " << meansigi << endl;
    216216        cout << "MeanInterp'd outer " << meansigo << endl;
     
    225225    if (pul->GetMean()<0 || pul->GetRMS()<0)
    226226    {
    227         cout << "WARNING - PulsePos'd mean or rms < 0 " << endl;
     227        cout << "ERROR - PulsePos'd mean or rms < 0 " << endl;
    228228        cout << "PulsePos'd mean " << pul->GetMean() << endl;
    229229        cout << "PulsePos'd rms  " << pul->GetRMS() << endl;
     
    258258    if (!cam)
    259259    {
    260         cout << "WARNING - Reading of Unsuitable;avg failed." << endl;
     260        cout << "ERROR - Reading of Unsuitable;avg failed." << endl;
    261261        return 2;
    262262    }
     
    375375
    376376
    377     return serv.Update("Calibration", vars, Form("fSequenceFirst=%d", seq));
     377    return serv.Update("Calibration", vars, Form("fSequenceFirst=%d", seq)) ? 1 : 2;
    378378}
    379379
  • trunk/MagicSoft/Mars/datacenter/macros/writesequencefile.C

    r8052 r9005  
    4141// to the database is not working.
    4242//
     43//
     44// This tool will work from Period017 (2004_05_17) on...
     45//
     46// For more details see MSequence and MSequenceSQL
     47//
    4348/////////////////////////////////////////////////////////////////////////////
    44 #include <iostream>
    45 #include <iomanip>
    46 #include <fstream>
    47 
    48 #include <TSQLRow.h>
    49 #include <TSQLResult.h>
    50 
    51 #include <TEnv.h>
    52 #include <TMath.h>
    53 #include <TRegexp.h>
    54 
    55 #include "MAstro.h"
    56 #include "MTime.h"
    57 #include "MDirIter.h"
    58 
    59 #include "MSQLMagic.h"
     49#include "MSequence.h"
    6050
    6151using namespace std;
    6252
    63 Bool_t GetRuns(MSQLServer &serv, ofstream &fout, TString query, TString name, UInt_t nevts=(UInt_t)-1)
     53int writeseq(Int_t sequno, Int_t tel, TString sequpath="")
    6454{
    65     TSQLResult *res = serv.Query(query);
    66     if (!res)
    67         return kFALSE;
    68 
    69     UInt_t cnt=0;
    70     UInt_t evts=0;
    71 
    72     fout << name << ":";
    73     TSQLRow *row=0;
    74     while ((row = res->Next()) && evts<nevts)
    75     {
    76         fout << " " << (*row)[0];
    77         evts += atoi((*row)[1]);
    78         cnt++;
    79     }
    80     fout << endl;
    81 
    82     delete res;
    83 
    84     if (cnt==0)
    85     {
    86         cout << "ERROR - No " << name << " belonging to this sequence found." << endl;
    87         return kFALSE;
    88     }
    89 
    90     return kTRUE;
    91 }
    92 
    93 TString GetTime(const char *type)
    94 {
    95     return Form("if(TIME_TO_SEC(fRun%s)<12*60*60,"
    96                 " TIME_TO_SEC(fRun%s)+24*60*60,"
    97                 " TIME_TO_SEC(fRun%s))", type, type, type);
    98 }
    99 
    100 Int_t GetTimeC(MSQLServer &serv, const TString &str)
    101 {
    102     TSQLResult *res = serv.Query(str);
    103     if (!res)
    104         return -1;
    105 
    106     TSQLRow *row=res->Next();
    107     if (!row)
    108     {
    109         delete res;
    110         return -1;
    111     }
    112 
    113     Int_t rc = (*row)[0] ? atoi((*row)[0]) : -1;
    114     delete res;
    115     return rc;
    116 }
    117 
    118 Bool_t GetSequence(MSQLMagic &serv, TSQLRow &data, TString sequpath)
    119 {
    120     UShort_t y;
    121     Byte_t m, d;
    122 
    123     MTime time;
    124     time.SetSqlDateTime(data[8]);
    125     time.GetDateOfSunrise(y, m, d);
    126 
    127     TString date = Form("%04d-%02d-%02d", y, (int)m, (int)d);
    128 
    129     Int_t period = MAstro::GetMagicPeriod(time.GetMjd());
    130 
    131     TString str[6];
    132     str[0] = serv.QueryNameOfKey("Project",         data[2]);
    133     str[1] = serv.QueryNameOfKey("Source",          data[3]);
    134     str[2] = serv.QueryNameOfKey("L1TriggerTable",  data[4]);
    135     str[3] = serv.QueryNameOfKey("L2TriggerTable",  data[5]);
    136     str[4] = serv.QueryNameOfKey("HvSettings",      data[6]);
    137     str[5] = serv.QueryNameOfKey("LightConditions", data[7]);
    138 
    139     if (str[0].IsNull() || str[1].IsNull() || str[2].IsNull() || str[3].IsNull() || str[4].IsNull() || str[5].IsNull())
    140         return kFALSE;
    141 
    142     //create sequence file
    143     TString fname(Form("%s/%04d/sequence%08d.txt", sequpath.Data(), atoi(data[0])/10000, atoi(data[0])));
    144     cout << "Creating " << fname << "..." << flush;
    145 
    146     ofstream fout(fname);
    147     if (!fout)
    148     {
    149         cout << "ERROR - Cannot open file." << endl;
    150         return kFALSE;
    151     }
    152 
    153     //write information into file
    154     fout << "Sequence:        " << data[0]  << endl;
    155     fout << "Period:          " << period   << endl;
    156     fout << "Night:           " << date     << endl;
    157     fout << "LightConditions: " << str[5]   << endl;
    158     fout << endl;
    159     fout << "Start:           " << data[8]  << endl;
    160     fout << "LastRun:         " << data[1]  << endl;
    161     fout << "Project:         " << str[0]   << endl;
    162     fout << "Source:          " << str[1]   << endl;
    163     fout << "ZdMin:           " << data[10] << endl;
    164     fout << "ZdMax:           " << data[11] << endl;
    165     fout << "L1TriggerTable:  " << str[2]   << endl;
    166     fout << "L2TriggerTable:  " << str[3]   << endl;
    167     fout << "HvSettings:      " << str[4]   << endl;
    168     fout << "NumEvents:       " << data[9]  << endl;
    169     fout << endl;
    170 
    171     TString where(Form(" FROM RunData WHERE fSequenceFirst=%s AND fExcludedFDAKEY=1"
    172                        " AND fRunTypeKEY%%s", data[0]));
    173 
    174     TString query1(Form("SELECT fRunNumber, fNumEvents %s", where.Data()));
    175     TString query2(Form("SELECT %s %s", GetTime("Start").Data(), where.Data()));
    176     TString query3(Form("SELECT %s %s", GetTime("Stop").Data(),  where.Data()));
    177 
    178     TString queryA(Form(query1.Data(), " BETWEEN 2 AND 4 ORDER BY fRunNumber"));
    179     TString queryC(Form(query1.Data(), "=4 ORDER BY fRunNumber"));
    180     TString queryD(Form(query1.Data(), "=2 ORDER BY fRunNumber"));
    181     TString queryT(Form(query2.Data(), "=4 ORDER BY fRunNumber LIMIT 1"));
    182 
    183     Int_t timec = GetTimeC(serv, queryT);
    184     if (timec<0)
    185     {
    186         cout << "WARNING - Requesting start time of first calibration run failed." << endl;
    187         queryT = Form(query3.Data(), "=4 ORDER BY fRunNumber LIMIT 1");
    188         timec = GetTimeC(serv, queryT);
    189         if (timec<0)
    190         {
    191             cout << "ERROR - Neither start nor stop time of first calibration could be requested." << endl;
    192             return kFALSE;
    193         }
    194     }
    195 
    196     TString query4(Form("=3 ORDER BY ABS(%s-%d) ASC", GetTime("Stop").Data(), timec));
    197     TString queryP(Form(query1.Data(), query4.Data()));
    198 
    199     //write runs into sequence file
    200     if (!GetRuns(serv, fout, queryA, "Runs"))
    201         return kFALSE;
    202 
    203     fout << endl;
    204 
    205     if (!GetRuns(serv, fout, queryC, "CalRuns"))
    206         return kFALSE;
    207     if (!GetRuns(serv, fout, queryP, "PedRuns", 1000))
    208         return kFALSE;
    209     if (!GetRuns(serv, fout, queryD, "DatRuns"))
    210         return kFALSE;
    211 
    212     fout << endl;
    213 
    214     cout << " done <Nevts=" << data[9] << ">" << endl;
    215 
    216     return kTRUE;
    217 }
    218 
    219 // This tool will work from Period017 (2004_05_17) on...
    220 int writesequencefile(Int_t sequno, TString sequpath)
    221 {
    222     TEnv env("sql.rc");
    223 
    224     MSQLMagic serv(env);
     55    MSQLMagic serv("sql.rc");
    22556    if (!serv.IsConnected())
    22657    {
     
    23364    cout << endl;
    23465    cout << "Connected to " << serv.GetName() << endl;
     66    cout << "Sequence:  " << sequno << endl;
     67    cout << "Telescope: " << tel << endl;
    23568    cout << endl;
    23669
    237     //get sequence information from database
    238     TString query(Form("SELECT fSequenceFirst, fSequenceLast, fProjectKEY, fSourceKEY,"
    239                        " fL1TriggerTableKEY, fL2TriggerTableKEY, fHvSettingsKEY, "
    240                        " fLightConditionsKEY, fRunStart, fNumEvents, "
    241                        " fZenithDistanceMin, fZenithDistanceMax "
    242                        " FROM Sequences WHERE fSequenceFirst=%d", sequno));
    243     TSQLResult *res = serv.Query(query);
     70    const MSequenceSQL s(serv, sequno, tel);
     71    if (!s.IsValid())
     72        return 2;
    24473
    245     TSQLRow *row = 0;
    246     while ((row = res->Next()))
    247         if (!GetSequence(serv, *row, sequpath))
    248             return 2;
     74    if (sequpath.IsNull())
     75    {
     76        s.Print();
     77        return 1;
     78    }
    24979
    250     delete res;
     80    const TString fname(Form("%s/%04d/sequence%08d.txt", sequpath.Data(), sequno/10000, sequno));
    25181
    252     cout << endl;
     82    cout << "File:     " << fname << endl;
    25383
    254     return 1;
     84    return s.WriteFile(fname) ? 1 : 2;
    25585}
  • trunk/MagicSoft/Mars/ganymed.cc

    r8989 r9005  
    1 #include <TROOT.h>
     1#include <TTree.h>
    22#include <TClass.h>
    33#include <TSystem.h>
     
    4343    gLog << " ganymed [options] dataset.txt|number" << endl << endl;
    4444    gLog << " Arguments:" << endl;
    45     gLog << "   dataset.txt:              ASCII file defining a collection of datasets/sequences" << endl;
    46     gLog << "                             (for more details see MSequence/MDataSet)" << endl;
    47     gLog << "   number:                   The dataset number (using file in the datacenter)" << endl;
    48     gLog << "                             For more details see MDataSet." << endl;
     45    gLog << "   dataset.txt:              File defining a collection of datasets/sequences"  << endl;
     46    gLog << "                             (for more details see MSequence/MDataSet)"          << endl;
     47    gLog << "   number:                   The dataset number (using file in the datacenter)"  << endl;
     48    gLog << "                             For more details see MDataSet."                     << endl;
    4949    gLog << " Root Options:" << endl;
    50     gLog << "   -b                        Batch mode (no graphical output to screen)" << endl<<endl;
     50    gLog << "   -b                        Batch mode (no graphical output to screen)"         << endl;
     51    gLog << endl;
    5152    gLog << " Operation Mode:" << endl;
    52     gLog << "   -mc                       Monte Carlo dataset (no times)" << endl;
    53     gLog << "   --wobble                  Force wobble mode (overwrites dataset)" << endl;
    54     gLog << "   --no-wobble               Force normal mode (overwrites dataset)" << endl << endl;
     53    gLog << "   -mc                       Monte Carlo dataset (no times)"                     << endl;
     54    gLog << "   --wobble                  Force wobble mode (overwrites dataset)"             << endl;
     55    gLog << "   --no-wobble               Force normal mode (overwrites dataset)"             << endl;
     56    gLog << endl;
    5557    gLog << " Options:" << endl;
    5658    gLog.Usage();
    57     gLog << "   --debug-env=0             Disable debugging setting resources <default>" << endl;
    58     gLog << "   --debug-env[=1]           Display untouched resources after program execution" << endl;
    59     gLog << "   --debug-env=2             Display untouched resources after eventloop setup" << endl;
    60     gLog << "   --debug-env=3             Debug setting resources from resource file and command line" << endl;
     59    gLog << "   --debug-env=0             Disable debugging setting resources <default>"      << endl;
     60    gLog << "   --debug-env[=1]           Display untouched resources after execution"        << endl;
     61    gLog << "   --debug-env=2             Display untouched resources after eventloop setup"  << endl;
     62    gLog << "   --debug-env=3             Debug setting resources from resource file and"     << endl;
     63    gLog << "                             command line" << endl;
    6164    gLog << "   --debug-mem               Debug memory usage" << endl << endl;
    62     gLog << "   --rc=Name:option          Set or overwrite a resource of the resource file." << endl;
    63     gLog << "                             (Note, that this option can be used multiple times." << endl;
     65    gLog << "   --rc=Name:option          Set or overwrite a resource of the resource file."  << endl;
     66    gLog << "                             (Note, this option can be used multiple times)"    << endl;
    6467    gLog << endl;
    6568    gLog << "   -q                        Quit when job is finished" << endl;
    6669    gLog << "   -f                        Force overwrite of existing files" << endl;
    67     gLog << "   --n=number                Analysis number (required if not in dataset file)" << endl;
    68     gLog << "   --dataset=number          Choose a dataset from a collection of datasets in your file" << endl;
    69     gLog << "                             (for more details see MDataSet)" << endl;
    70     gLog << "   --out=path                Path to write all output to [def=local path]" << endl;
    71     gLog << "   --ind=path                Path to data/star files [default=datacenter path]" << endl;
    72     gLog << "   --ins=path                Path to sequence files [default=datacenter path]" << endl;
    73     gLog << "   --outf=filename           Filename for output file (eg. status display)" << endl;
     70    gLog << "   --n=number                Analysis number (required if not in dataset file)"  << endl;
     71    gLog << "   --dataset=number          Choose a dataset from a collection of datasets"    << endl;
     72    gLog << "                             in your file (for more details see MDataSet)"      << endl;
     73    gLog << "   --out=path                Path to write all output to [def=local path]"       << endl;
     74    gLog << "   --ind=path                Path to data/star files [default=datacenter path]"  << endl;
     75    gLog << "   --ins=path                Path to sequence files [default=datacenter path]"   << endl;
     76    gLog << "   --outf=filename           Filename for output file (eg. status display)"      << endl;
    7477    gLog << "   --sum[=filename]          Enable writing of summary file (events after cut0)" << endl;
    7578//    gLog << "   --res[=filename]          Enable writing of result file (surviving events)" << endl;
    76     gLog << "   --skip-res                Disable writing of result events" << endl;
    77     gLog << "   --write-only              Only write output files. No histograms filled." << endl;
    78     gLog << "   --print-ds                Print the information interpreted from the dataset file" << endl;
    79     gLog << "   --print-files             Print files taken from sequences ('+' found, '-' missing)" << endl;
     79    gLog << "   --skip-res                Disable writing of result events"                   << endl;
     80    gLog << "   --write-only              Only write output files. No histograms filled."     << endl;
     81    gLog << "   --print-ds                Print dataset as interpreted from the dataset file" << endl;
     82    gLog << "   --print-files             Print files from sequences, '+' found, '-' missing" << endl;
    8083//    gLog << "   --full-display            Show as many plots as possible" << endl;
    81     gLog << "   --config=ganymed.rc       Resource file [default=ganymed.rc]" << endl;
    82     gLog << endl;
    83     gLog << "   --version, -V             Show startup message with version number" << endl;
     84    gLog << "   --config=ganymed.rc       Resource file [default=ganymed.rc]"                 << endl;
     85    gLog << endl;
     86    gLog << "   --max-file-size=number    Sets the maximum size before root opens a new file" << endl;
     87    gLog << "                             automatically. The number is given in kB (1000b)."  << endl;
     88    gLog << "                             Use this option with caution it can result in"      << endl;
     89    gLog << "                             extremely large files (especially summary files),"  << endl;
     90    gLog << "                             use (e.g. lower size) cuts instead to decrease"     << endl;
     91    gLog << "                             the file size. Root's default is 1.9GB."            << endl;
     92    gLog << endl;
     93    gLog << "   --version, -V             Show startup message with version number"           << endl;
    8494    gLog << "   -?, -h, --help            This help" << endl << endl;
    8595    gLog << "Background:" << endl;
     
    8999    gLog << " 1,070,000km.  It has a magnetic field  and probably has a molten iron" << endl;
    90100    gLog << " core.  It takes  Ganymed  7.15 days to  orbit  Jupiter.  Its mass  is" << endl;
    91     gLog << " 1.5e23kg. It was independently discovered by  Galileo and S.Marius in"<< endl;
     101    gLog << " 1.5e23kg. It was independently discovered by  Galileo and S.Marius in" << endl;
    92102    gLog << " 1610.  Ganymed is  the largest moon  in the solar system;  it is also" << endl;
    93103    gLog << " larger than the planets Mercury and Pluto." << endl << endl;
     
    98108    if (!MARS::CheckRootVer())
    99109        return 0xff;
     110
     111    // FIXME: Record command line to file!!!
    100112
    101113    MLog::RedirectErrorHandler(MLog::kColor);
     
    146158    const TString kNameSummary   = arg.GetStringAndRemove("--sum=");
    147159    const Bool_t  kSkipResult    = arg.HasOnlyAndRemove("--skip-res");
     160
    148161//    const Bool_t  kWriteResult   = arg.HasOnlyAndRemove("--res");
    149162//    const TString kNameResult    = arg.GetStringAndRemove("--res=");
     163
     164    TTree::SetMaxTreeSize((Long64_t)arg.GetIntAndRemove("--max-file-size=", TTree::GetMaxTreeSize()/1000)*1000);
    150165
    151166    if (kWobbleModeOn && kWobbleModeOff)
  • trunk/MagicSoft/Mars/mcamera/MCameraDC.h

    r7489 r9005  
    1515class MCameraDC : public MParContainer, public MCamEvent
    1616{
     17    friend class MReportCamera;
     18    friend class MReportCurrents;
    1719private:
    18     TArrayF fArray; // [nA] Unsigned Int!
     20    Byte_t  fStatus; // CaCo monitored status of the High Voltage [0-9], Cam.HV.PS_state
     21
     22    TArrayF fArray;  // [nA] Unsigned Int!
     23
     24    Int_t Interprete(TString &str, Int_t len=0);
    1925
    2026public:
    2127    MCameraDC(Int_t size=577, const char *name=NULL, const char *title=NULL);
     28
     29    Byte_t GetStatus() const { return  fStatus; }
    2230
    2331    void SetCurrent(Int_t i, Float_t val) { fArray[i] = (Int_t)val; }
     
    4351    }
    4452
    45     ClassDef(MCameraDC, 1) // Storage Container for the Currents (PRELIMINARY)
     53    ClassDef(MCameraDC, 2) // Storage Container for the Currents (PRELIMINARY)
    4654};
    4755
  • trunk/MagicSoft/Mars/merpp.cc

    r8961 r9005  
    359359            write->AddContainer("MCameraActiveLoad",  "Camera",     required);
    360360            write->AddContainer("MCameraHV",          "Camera",     required);
     361            write->AddContainer("MCameraDC",          "Camera",     required);
    361362            write->AddContainer("MCameraLV",          "Camera",     required);
    362363            write->AddContainer("MCameraLids",        "Camera",     required);
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r8999 r9005  
    17621762    }
    17631763
    1764     *fLog << all << GetDescriptor() << ": Done." << endl;
     1764    *fLog << all << GetDescriptor() << ": Done." << endl << endl << endl;
    17651765
    17661766    return kTRUE;
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r8999 r9005  
    12101210        return rc;
    12111211
    1212     *fLog << all << GetDescriptor() << ": Done." << endl;
    1213     *fLog << endl << endl;
     1212    *fLog << all << GetDescriptor() << ": Done." << endl << endl << endl;
    12141213
    12151214    return kTRUE;
  • trunk/MagicSoft/Mars/mreport/MReportCamera.cc

    r8955 r9005  
    3333// there.
    3434//
     35// Version 2:
     36// ----------
     37//   - fStstusDC
     38//
    3539//////////////////////////////////////////////////////////////////////////////
    3640#include "MReportCamera.h"
     
    4347#include "MCameraCalibration.h"
    4448#include "MCameraCooling.h"
     49#include "MCameraDC.h"
    4550#include "MCameraHV.h"
    4651#include "MCameraLV.h"
     
    5358
    5459using namespace std;
    55 
    56 const Int_t  MReportCamera::gkActiveLoadControlVersNum = 200504130;
    5760
    5861// --------------------------------------------------------------------------
     
    9497        return kFALSE;
    9598
     99    fDC = (MCameraDC*)plist.FindCreateObj("MCameraDC");
     100    if (!fDC)
     101        return kFALSE;
     102
    96103    fLV = (MCameraLV*)plist.FindCreateObj("MCameraLV");
    97104    if (!fLV)
     
    122129        return kFALSE;
    123130
    124     str.Remove(0, 577*4); // Remove DC currents
    125     str=str.Strip(TString::kLeading);
    126     return kTRUE;
     131    return fDC->Interprete(str);
    127132}
    128133
     
    548553    fCalibration->fStatusLoVoltage = (Bool_t)clv;
    549554    fStatus                        = (Byte_t)stat;
    550     fStatusDC                      = (Byte_t)dc;
     555    fDC->fStatus                   = (Byte_t)dc;
    551556    fActiveLoad->fStatus           = 0xff;
    552557
    553558    Int_t len2=0;
    554     if (ver > gkActiveLoadControlVersNum)
     559    if (ver > 200504130)
    555560    {
    556561        Short_t actl;
     
    608613    }
    609614
    610     if (ver > gkActiveLoadControlVersNum)
     615    if (ver > 200504130)
    611616    {
    612617         if (!InterpreteActiveLoad(str))
  • trunk/MagicSoft/Mars/mreport/MReportCamera.h

    r8955 r9005  
    99class MCameraLids;
    1010class MCameraHV;
     11class MCameraDC;
    1112class MCameraLV;
    1213class MCameraAUX;
     
    1819{
    1920private:
    20    
    21     static const Int_t gkActiveLoadControlVersNum; //!
    22 
    2321    Byte_t fStatus;   // CaCo monitored status of the sentinel (0-9), Sentinel_state
    24     Byte_t fStatusDC; // CaCo monitored status of the DC currents (0-9), Cam.DC_state
    2522
    2623    MCameraCooling     *fCooling;     //!
     
    2825    MCameraAUX         *fAUX;         //!
    2926    MCameraHV          *fHV;          //!
     27    MCameraDC          *fDC;          //!
    3028    MCameraLV          *fLV;          //!
    3129    MCameraActiveLoad  *fActiveLoad;  //!
     
    5654
    5755    Byte_t GetStatus() const { return  fStatus; }
    58     Byte_t GetStatusDC() const { return fStatusDC; }
    5956
    60     ClassDef(MReportCamera, 1) // Class for CAMERA-REPORT information
     57    ClassDef(MReportCamera, 2) // Class for CAMERA-REPORT information
    6158};
    6259
  • trunk/MagicSoft/Mars/mreport/MReportCurrents.cc

    r8957 r9005  
    8484    fStatus2 = (Byte_t)err2;
    8585
    86     const char *pos = str.Data()+len;
    87     const char *end = pos+577*4;
     86    // FIXME: Set fDC->fStatus ???
    8887
    89     Int_t i=0;
    90     while (pos<end)
    91     {
    92         Int_t c;
    93         const Char_t hex[5] = { pos[0], pos[1], pos[2], pos[3], 0 };
    94         pos += 4;
    95 
    96         const Int_t nn=sscanf(hex, "%4x", &c);
    97         if (nn!=1)
    98         {
    99             *fLog << warn << "WARNING - Reading hexadecimal DC information." << endl;
    100             return kCONTINUE;
    101         }
    102 
    103         (*fDC)[i++] = 0.001*c;
    104     }
    105 
    106     str.Remove(0, pos-str.Data()); // Remove DC currents
    107     str=str.Strip(TString::kLeading);
    108 
    109     return str.IsNull() ? kTRUE : kCONTINUE;
     88    return fDC->Interprete(str, len);
    11089}
  • trunk/MagicSoft/Mars/resources/sequences.rc

    r8327 r9005  
     1#/////////////////////////////////////////////////////////////////////////
     2#
     3# This file is compiled from two sections. One defines which transitions
     4# are allowed to build a sequence (for example changing L1 Trigger
     5# Tables between Calibration and Pedestal runs). The other section
     6# defines a regular expression to define the allowed ordering
     7# of the P-, C- and D-runs.
     8#
     9# The sections a introduced by [Transition] and [Regexp]. For further
     10# details see below.
     11#
     12# If a section should be valid only for one telescope use:
     13#   [Transition]         # Valid for all telescope numbers
     14#   [Transition 5]       # Valid for telescope 5
     15#   [Transition: 5]      # Valid for telescope 5
     16#   [Transition: 5 6]    # Valid for telescopes 5 and 6
     17#
     18#
     19# File-Id:
     20#   A file is uniquely identified by run-number and file-number.
     21#   If you give just a number it is identical to run-number with
     22#   file-number 0. To give a dedicated file-number you can use:
     23#     run.file
     24#
     25#/////////////////////////////////////////////////////////////////////////
     26
    127##########################################################################
    228#
     29# Explanation [Transition]
     30#
    331# Rules to build blocks which will later be broken into sequences
    432#
    533# Syntax:
    634#
    7 # [keyname]
     35# [Transition]
    836# rule1
    937# rule2
     
    1240#
    1341# Colums of rule:
    14 # 1 2 3 4 [5 [6]]
     42# 0 [1 2 3 4 [5 [6]]]
    1543#
     44# 0: Table/Column to which the transition is applied
    1645# 1: Run type of previous run
    1746# 2: Run type of run to be accepted
    1847# 3: Key for previous run
    1948# 4: key for run to be accepted
    20 # 5: first run to apply this rule <default=0>
    21 # 6: last run to apply this rule <default=max>
     49# 5: first file-id to apply this rule <default=0>
     50# 6: last  file-id to apply this rule <default=max>
    2251#
    2352# Run Types:
     
    3160# A single "*" is an abbreviation for the regexp ".*" .
    3261#
    33 # A "-" is an abbreviation for "to be ignored". For example:
    34 #     [Test]
    35 #     - 4 * 1200 1300
     62# As soon as any transition (column 0) is specified this transisiton
     63# is checked not to change within a sequence.
     64#
     65# A "-" is an abbreviation for transitions "to be ignored". For example:
     66#     [Transition]
     67#     Test - 4 * 1200 1300
    3668# would mean:
    37 #     ignore all keys (*) of column test for all current runs
    38 #     with run-type 4 if its run-number is between 1200 and 1300.
     69#     ignore all keys (*) of column test for all current files
     70#     with run-type 4 if its file-id is between 1200.0 and 1300.0
    3971#     The (former) third column in this case is obsolete.
    4072#
    41 # Ignore project name for calibration runs between 20100 and 45100
    42 #
    4373# Each Transition which appears at least once is checked.
    4474#
    4575
    46 [Transition]
    47 
     76[Transition: 1]
     77
     78# Ignore project name for calibration files between 20100 and 45100
    4879Project           - 4 *    20100 45100
    4980HvSettings        - 2 *    86094 86094
     
    76107
    77108# The Discriminator Thresholds do not influence the pedestal- and
    78 # calibration-trigger and nedd therefore not to be chacked for these runs.
     109# calibration-trigger and need therefore not to be checked for these runs.
    79110# This allows all kind of transitions from P/C to P/C and from C to D.
    80111DiscriminatorThresholdTable  [34]  [34]   *   *
     
    166197
    167198#########################################################################
    168 # The regexp section MUST be the last section. This allows
    169 # regular expressions to start with a [
    170 
    171 [Regexp]
    172 
    173 # Explanation:
     199#
     200# Explanation [Regexp]
    174201#
    175202# To build sequences a string with the run-types is evaluated.
     
    185212#
    186213# The syntax is
     214#   [Regexp]
    187215#   regexp [firstrun [lastrun]]
    188216#
     217[Regexp: 1]
    189218
    190219# Allow almost everything but require at least one run of each run-type
Note: See TracChangeset for help on using the changeset viewer.