Changeset 2456 for trunk


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2455 r2456  
    11                                                 -*-*- END OF LINE -*-*-
    2   2003/11/03: Thomas Bretz
     2 2003/11/03: Thomas Bretz
    33 
    44   * manalysis/MMcPedestalCopy.[h,cc], manalysis/MMcPedestalNSBAdd.[h,cc]:
     
    2626     - added comments to the data members
    2727
    28 
    29 
    30   2003/10/31: Marcos Lopez
     28   * mars.cc:
     29     - added code for a possible use of a TGApplication
     30       (in comments)
     31
     32   * merpp.cc, readraw.cc:
     33     - unified with the other executables (StartUpMessage, etc)
     34     - removed TROOT-object
     35     - readraw.cc: added more functionality
     36
     37
     38
     39 2003/10/31: Marcos Lopez
    3140
    3241   * mhist/MFillH.cc:
     
    5160
    5261
    53   2003/10/31: Thomas Bretz
     62 2003/10/31: Thomas Bretz
    5463
    5564   * mars.cc:
     
    6069
    6170
    62   2003/10/30: Antonio Stamerra
     71 2003/10/30: Antonio Stamerra
    6372
    6473   * manalysis/MMcTriggerLvl2.[h,cc]
     
    7382
    7483
    75   2003/10/30: Thomas Bretz
     84 2003/10/30: Thomas Bretz
    7685
    7786   * manalysis/MCerPhotEvt.[h,cc]:
     
    9099
    91100
    92   2003/10/29: Thomas Bretz
     101 2003/10/29: Thomas Bretz
    93102 
    94103   * manalysis/AnalysisLinkDef.h, manalysis/Makefile:
     
    118127
    119128
    120   2003/10/28: Thomas Bretz
     129 2003/10/28: Thomas Bretz
    121130 
    122131   * macros/readCT1.C:
     
    159168
    160169
    161   2003/10/28: Wolfgang Wittek
     170 2003/10/28: Wolfgang Wittek
    162171
    163172   * manalysis/MCT1PadONOFF.cc
     
    175184
    176185
    177   2003/10/26: Oscar Blanch Bigas
     186 2003/10/26: Oscar Blanch Bigas
    178187
    179188   * mmc/MMcFadcHeader.[cc,h]
     
    184193
    185194
    186   2003/10/24: Abelardo Moralejo
     195 2003/10/24: Abelardo Moralejo
    187196
    188197   * manalysis/MMcPedestalRead.[cc,h]
     
    197206
    198207
    199   2003/10/23: Abelardo Moralejo
     208 2003/10/23: Abelardo Moralejo
    200209
    201210   * mhistmc/MHMcEnergyMigration.cc
     
    207216
    208217
    209   2003/10/23: Thomas Bretz
     218 2003/10/23: Thomas Bretz
    210219
    211220   * macros/star.C:
     
    217226
    218227
    219   2003/10/22: Thomas Bretz
     228 2003/10/22: Thomas Bretz
    220229 
    221230   * mars.cc:
     
    232241
    233242
    234   2003/10/21: Wolfgang Wittek
     243 2003/10/21: Wolfgang Wittek
    235244
    236245  * manalysis/MMatrixLoop.[h,cc]
     
    242251
    243252
    244   2003/10/20: Thomas Bretz
     253 2003/10/20: Thomas Bretz
    245254
    246255   * mraw/MRawEvtPixelIter.[h,cc]:
     
    331340
    332341
    333   2003/10/17: Oscar Blanch
     342 2003/10/17: Oscar Blanch
    334343
    335344   * mmc/MMcFadcHeader.[cxx,hxx]:
     
    348357
    349358
    350   2003/10/15: Thomas Bretz
     359 2003/10/15: Thomas Bretz
    351360
    352361   * Makefile.conf.general:
     
    402411
    403412
    404   2003/10/05: Abelardo Moralejo
     413 2003/10/05: Abelardo Moralejo
    405414
    406415   * macros/star.C:
     
    410419
    411420
    412   2003/10/04: Thomas Bretz
     421 2003/10/04: Thomas Bretz
    413422
    414423   * macros/MagicHillas.C, macros/pedestalvstime.C, macros/pixfirerate.C,
     
    456465
    457466
    458   2003/10/02: Thomas Bretz
     467 2003/10/02: Thomas Bretz
    459468
    460469   * mraw/MRawEvtData.cc:
     
    463472
    464473
    465   2003/10/01: Nicola Galante
     474 2003/10/01: Nicola Galante
    466475
    467476   * mhistmc/MHMcTriggerLvl2.[h,cc]:
     
    478487
    479488
    480   2003/09/30: Robert Wagner
     489 2003/09/30: Robert Wagner
    481490
    482491   * mfileio/MCT1ReadPreProc.cc
     
    486495
    487496
    488   2003/09/29: Nicola Galante & Antonio Stamerra
     497 2003/09/29: Nicola Galante & Antonio Stamerra
    489498
    490499   * mmc/MMcTrig.cxx:
  • trunk/MagicSoft/Mars/mars.cc

    r2447 r2456  
    1 #include <TROOT.h>
    21#include <TApplication.h>
    32
     
    1615
    1716using namespace std;
     17/*
     18#if ROOT_VERSION_CODE < ROOT_VERSION(3,10,02)
     19#include <TRootGuiFactory.h>
     20#include <TPluginManager.h>
     21void InitGuiFactory()
     22{
     23    if (gROOT->IsBatch())
     24        gROOT->SetBatch(kFALSE);
     25
     26    //
     27    // Must be loaded by hand, because it is not loaded by TGApplication.
     28    // We could also use TApplication instead, but TApplication doesn't
     29    // deal with the DISPLAY variable in a convient way.
     30    //
     31    TPluginHandler *h;
     32    if ((h = gROOT->GetPluginManager()->FindHandler("TGuiFactory", "root")))
     33    {
     34        if (h->LoadPlugin() == -1)
     35            return;
     36        gGuiFactory = (TGuiFactory*)h->ExecPlugin(0);
     37    }
     38}
     39#endif
     40*/
    1841
    1942// **********************************************************************
     
    4265static void Usage()
    4366{
     67    gLog << all << endl;
    4468    gLog << "Sorry the usage is:" << endl;
    4569    gLog << "   mars [-v#]" << endl << endl;
     
    5882
    5983    StartUpMessage();
    60 
    61     TApplication app("MarsApp", &argc, argv);
    62     if (gROOT->IsBatch() || !gClient)
    63     {
    64         gLog << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl;
    65         return 1;
    66     }
    67     /*
    68      TGApplication app("MarsApp", &argc, argv);
    69      if (gROOT->IsBatch())
    70         gROOT->SetBatch(kFALSE);
    71      */
    7284
    7385    //
     
    111123
    112124    //
     125    // initialise ROOT
     126    //
     127    TApplication app("Mars", &argc, argv);
     128    if (gROOT->IsBatch() || !gClient)
     129    {
     130        gLog << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl;
     131        return 1;
     132    }
     133
     134    //
    113135    // Swtich of TObjectStreamer in our base classes derived from TObject
    114136    //
    115137    MArray::Class()->IgnoreTObjectStreamer();
    116138    MParContainer::Class()->IgnoreTObjectStreamer();
     139
     140    /*
     141    TGApplication app("Mars", &argc, argv);
     142
     143#if ROOT_VERSION_CODE < ROOT_VERSION(3,10,02)
     144    InitGuiFactory();
     145#endif
     146    */
    117147
    118148#ifdef HAVE_XPM
  • trunk/MagicSoft/Mars/merpp.cc

    r2299 r2456  
    3636//////////////////////////////////////////////////////////////////////////////
    3737
    38 void Usage()
     38static void StartUpMessage()
    3939{
     40    gLog << all << endl;
     41
     42    //                1         2         3         4         5
     43    //       12345678901234567890123456789012345678901234567890
     44    gLog << "==================================================" << endl;
     45    gLog << "                MERPP - MARS V" << MARSVER          << endl;
     46    gLog << "     MARS - Merging and Preprocessing Program"      << endl;
     47    gLog << "            Compiled on <" << __DATE__ << ">"       << endl;
     48    gLog << "               Using ROOT v" << ROOTVER             << endl;
     49    gLog << "==================================================" << endl;
     50    gLog << endl;
     51}
     52
     53static void Usage()
     54{
     55    gLog << all << endl;
    4056    gLog << "Sorry the usage is:" << endl;
    4157    gLog << "   merpp [-a0] [-vn] [-cn] inputfile[.raw] [outputfile[.root]]" << endl << endl;
     
    4359    gLog << "     ouput file:   Merpped root file." << endl;
    4460    gLog << "     -a0: Do not use Ansii codes." << endl;
    45     gLog << "     -cn: Compression level n=1..9 [default=1]" << endl;
     61    gLog << "     -cn: Compression level n=1..9 [default=2]" << endl;
    4662    gLog << "     -vn: Verbosity level n [default=2]" << endl << endl;
    4763}
     
    4965int main(const int argc, const char **argv)
    5066{
     67    StartUpMessage();
     68
     69    //
     70    // Evaluate arguments
     71    //
    5172    MArgs arg(argc, argv);
    52 
    53     gLog << "==================================================" << endl ;
    54     gLog << "                   MERPP v0.1" << endl;
    55     gLog << "      MARS Merging and Preprocessing Program" << endl ;
    56     gLog << "            Compiled on <" << __DATE__ << ">" << endl ;
    57     gLog << "               Using ROOT v" << ROOTVER << endl ;
    58     gLog << "==================================================" << endl ;
    59     gLog << endl;
    6073
    6174    //
     
    8497    TString kNameout = arg.GetArgumentStr(1);
    8598
    86     //
    87     //     initialize ROOT  (this is obligatory here)
    88     //
    89     TROOT merpp("merpp", "Mars - Merging and Preprocessing Program");
    90     merpp.SetBatch();
    91 
    9299    if (!kNamein.EndsWith(".raw"))
    93100        kNamein += ".raw";
     
    98105    if (!kNameout.EndsWith(".root"))
    99106        kNameout += ".root";
     107
     108    //
     109    // Initialize Non-GUI (batch) mode
     110    //
     111    gROOT->SetBatch();
    100112
    101113    //
  • trunk/MagicSoft/Mars/mraw/MRawEvtData.cc

    r2438 r2456  
    184184            if (manip)
    185185                *fLog << ' ';
    186             *fLog << flush;
    187186        }
     187        *fLog << flush;
    188188
    189189        if (!(l<nLoPix && (*fLoGainPixId)[l]==(*fHiGainPixId)[i]))
     
    199199            if (manip)
    200200                *fLog << ' ';
    201             *fLog << flush;
    202201        }
     202
     203        *fLog << flush;
    203204        l++;
    204205    }
  • trunk/MagicSoft/Mars/readraw.cc

    r2173 r2456  
    1010
    1111#include "MLog.h"
     12#include "MLogManip.h"
     13
     14#include "MArgs.h"
    1215#include "MTime.h"
    1316#include "MRawRunHeader.h"
     
    2528//
    2629// This is an demonstration how to read in a merpped root file
     30// This is a demonstration how to use root, not how you should
     31// read a merpped file!
    2732//
    2833/////////////////////////////////////////////////////////////////////////////
    2934
     35static void StartUpMessage()
     36{
     37    gLog << all << endl;
     38
     39    //                1         2         3         4         5
     40    //       12345678901234567890123456789012345678901234567890
     41    gLog << "==================================================" << endl;
     42    gLog << "              ReadRaw - MARS V" << MARSVER          << endl;
     43    gLog << "       MARS - Read and print raw data files"        << endl;
     44    gLog << "            Compiled on <" << __DATE__ << ">"       << endl;
     45    gLog << "               Using ROOT v" << ROOTVER             << endl;
     46    gLog << "==================================================" << endl;
     47    gLog << endl;
     48}
     49
     50static void Usage()
     51{
     52    gLog << all << endl;
     53    gLog << "Sorry the usage is:" << endl;
     54    gLog << "   readraw [-vn] [-dec] [-a0] inputfile[.root]" << endl << endl;
     55    gLog << "     input file:   Magic DAQ binary file." << endl;
     56    gLog << "     -a0: Do not use Ansii codes." << endl;
     57    gLog << "     -vn: Verbosity level n [default=2]" << endl;
     58    gLog << "     -d1: print data in decimal values" << endl;
     59}
     60
    3061void EnableBranch(TTree *t, TString name, void *ptr)
    3162{
     
    3768}
    3869
    39 int main(const int argc, const char **argv)
    40 {
    41     gLog << "==================================================" << endl;
    42     gLog << "                   ReadRaw v0.1                   " << endl;
    43     gLog << "       MARS - Read and print raw data file        " << endl;
    44     gLog << "            Compiled on <" << __DATE__ << ">" << endl;
    45     gLog << "==================================================" << endl;
    46     gLog << endl;
     70int main(int argc, const char **argv)
     71{
     72    StartUpMessage();
     73
     74    //
     75    // Evaluate arguments
     76    //
     77    MArgs arg(argc, argv);
     78
     79    //
     80    // Set verbosity to highest level.
     81    //
     82    gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2);
     83
     84    if (arg.HasOption("-a") && arg.GetIntAndRemove("-a")==0)
     85        gLog.SetNoColors();
     86
     87    const bool kDecimal = arg.HasOption("-d") && arg.GetIntAndRemove("-d")==1;
    4788
    4889    //
    4990    // check for the right usage of the program
    5091    //
    51     if (argc!=2)
    52     {
    53         gLog << "Sorry the usage is:" << endl;
    54         gLog << "   readraw inputfile" << endl << endl;
     92    if (arg.GetNumArguments()!=1)
     93    {
     94        Usage();
    5595        return -1;
    5696    }
    5797
    5898    //
    59     //     initialize ROOT  (this is obligatory here)
    60     //
    61     TROOT simple("readraw","Mars - Read and print raw data file");
     99    // This is to make argv[i] more readable insidethe code
     100    //
     101    TString kNamein = arg.GetArgumentStr(0);
     102 
     103    if (!kNamein.EndsWith(".root"))
     104        kNamein += ".root";
     105
     106    //
     107    // Initialize Non-GUI (batch) mode
     108    //
     109    gROOT->SetBatch();
    62110
    63111    //
    64112    // check whether the given files are OK.
    65113    //
    66     if (gSystem->AccessPathName(argv[1], kFileExists))
    67     {
    68         gLog << "Sorry, the file '" << argv[1] << "' doesn't exist." << endl;
     114    if (gSystem->AccessPathName(kNamein, kFileExists))
     115    {
     116        gLog << err << "Sorry, the input file '" << kNamein << "' doesn't exist." << endl;
    69117        return -1;
    70118    }
     
    73121    //  open the file
    74122    //
    75     gLog << " Open the file '" << argv[1] << "'" << endl;
    76     TFile input(argv[1], "READ");
     123    gLog << " Open the file '" << kNamein << "'" << endl;
     124    TFile input(kNamein, "READ");
    77125
    78126    //
     
    127175    // loop over all entries
    128176    //
    129     Int_t nent = (Int_t)evttree->GetEntries();
     177    const Int_t nent = (Int_t)evttree->GetEntries();
    130178
    131179    gLog << endl;
     
    153201            evtcrate->Print();
    154202        if (evtdata)
    155             evtdata->Print();
     203            evtdata->Print(kDecimal?"dec":"hex");
     204
     205        gLog << endl;
    156206    }
    157207   
    158     //   end of small readin program
     208    // end of small readin program
    159209
    160210    return 0;
    161211}
    162 
    163 
Note: See TracChangeset for help on using the changeset viewer.