Changeset 6253


Ignore:
Timestamp:
02/04/05 13:31:19 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6252 r6253  
    129129   
    130130   * mjobs/MJExtractCalibTest.[h,cc]
    131      - remove
     131     - removed
    132132
    133133   * mjobs/MJCalibrateSignal.cc
  • trunk/MagicSoft/Mars/callisto.cc

    r6252 r6253  
    379379            return 1;
    380380        }
    381         MJCalibTest job4(Form("MJCalibTest #%d", seq.GetSequence()));
     381
    382382        if (kUseTest)
    383           {
    384             job4.SetBadPixels(job3.GetBadPixels());           
     383        {
     384            MJCalibTest job4(Form("MJCalibTest #%d", seq.GetSequence()));
     385            job4.SetBadPixels(job3.GetBadPixels());
    385386            job4.SetSequence(seq);
    386387            job4.SetEnv(kConfig);
     
    390391            job4.SetPathOut(kOutpathC);
    391392            job4.SetPathData(kInpathD);
    392             //            job4.SetPathIn(kInpathC);
    393393
    394394            if (!job4.ProcessFile(job1.GetPedestalCam()))
    395               {
     395            {
    396396                gLog << err << "Calibration of calibration failed." << endl << endl;
    397397                return -1;
    398               }
    399            
     398            }
     399
    400400            if (!job4.GetDisplay())
    401               {
     401            {
    402402                gLog << warn << "Display closed by user... execution aborted." << endl << endl;
    403403                return 1;
    404               }
    405           }
     404            }
     405        }
    406406    }
    407407
  • trunk/MagicSoft/Mars/mbase/MFilter.cc

    r4991 r6253  
    9595TString MFilter::GetRule() const
    9696{
    97     return "<GetRule n/a for " + fName + ">";
     97    return ClassName(); //"<GetRule n/a for " + fName + ">";
    9898}
    9999
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r5994 r6253  
    534534MParContainer *MParContainer::GetNewObject(const char *name, TClass *base) const
    535535{
     536    return base ? GetNewObject(name, base->GetName()) : 0;
     537}
     538
     539// --------------------------------------------------------------------------
     540//
     541// Return a new object of class 'name'. Make sure that the object
     542// derives from the class base.
     543//
     544// In case of failure return NULL
     545//
     546// The caller is responsible of deleting the object!
     547//
     548MParContainer *MParContainer::GetNewObject(const char *name, const char *base) const
     549{
    536550    TClass *cls = GetConstructor(name);
    537551    if (!cls || !base)
     
    540554    if (!cls->InheritsFrom(base))
    541555    {
    542         *fLog << " - Class doesn't inherit from " << base->GetName() << endl;
     556        *fLog << err;
     557        *fLog << dbginf << GetDescriptor() << " - Cannot create new instance of class '" << name << "': ";
     558        *fLog << " - Class " << cls->GetName() << " doesn't inherit from " << base << endl;
    543559        return NULL;
    544560    }
     
    550566    if (!obj)
    551567    {
    552         *fLog << " - Class has no default constructor." << endl;
    553         *fLog << " - An abstract member functions of a base class is not overwritten." << endl;
    554         return NULL;
    555     }
    556 
    557     return (MParContainer*)obj;
    558 }
    559 
    560 // --------------------------------------------------------------------------
    561 //
    562 // Return a new object of class 'name'. Make sure that the object
    563 // derives from the class base.
    564 //
    565 // In case of failure return NULL
    566 //
    567 // The caller is responsible of deleting the object!
    568 //
    569 MParContainer *MParContainer::GetNewObject(const char *name, const char *base) const
    570 {
    571     TClass *cls = GetConstructor(name);
    572     if (!cls || !base)
    573         return NULL;
    574 
    575     if (!cls->InheritsFrom(base))
    576     {
    577         *fLog << " - Class doesn't inherit from " << base << endl;
    578         return NULL;
    579     }
    580 
    581     //
    582     // create the parameter container of the the given class type
    583     //
    584     TObject *obj = (TObject*)cls->New();
    585     if (!obj)
    586     {
    587         *fLog << " - Class has no default constructor." << endl;
     568        *fLog << err;
     569        *fLog << dbginf << GetDescriptor() << " - Cannot create new instance of class '" << name << "': ";
     570        *fLog << " - Class " << cls->GetName() << " has no default constructor." << endl;
    588571        *fLog << " - An abstract member functions of a base class is not overwritten." << endl;
    589572        return NULL;
     
    766749        return kFALSE;
    767750
    768     *fLog << warn << "WARNING - Resource " << prefix+fName << " found, but no " << ClassName() << "::ReadEnv." << endl;
     751    *fLog << warn << "WARNING - " << fName << ": Resource " << prefix << " found, but no " << ClassName() << "::ReadEnv." << endl;
    769752    return kTRUE;
    770753}
  • trunk/MagicSoft/Mars/merpp.cc

    r5796 r6253  
    7373    gLog << " Options:" << endl;
    7474    gLog.Usage();
     75    gLog << "   --version, -V             Show startup message with version number" << endl;
    7576    gLog << "   -?, -h, --help            This help" << endl << endl;
    7677    gLog << " File Options:" << endl;
     
    150151    //
    151152    MArgs arg(argc, argv);
     153
     154    if (arg.HasOnly("-V") || arg.HasOnly("--version"))
     155        return 0;
    152156
    153157    if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
  • trunk/MagicSoft/Mars/mfbase/MF.cc

    r5956 r6253  
    172172    if (fg<0 && fl<0)
    173173    {
    174         *fLog << err << dbginf << "Syntax Error: No coditional sign found in " << txt << endl;
    175         return NULL;
    176     }
     174        MFilter *f = (MFilter*)GetNewObject(txt, MFilter::Class());
     175        if (!f)
     176        {
     177            *fLog << err << dbginf << "Syntax Error: '" << txt << "' is neither a MFilter nor conditional sign found." << endl;
     178            return NULL;
     179        }
     180        // FIXME: Search object through list...?
     181        txt = "";
     182        return f;
     183    }
     184
    177185    if (fg>=0 && fl>=0)
    178186    {
     
    199207
    200208    txt = "";
    201 
    202209    return f;
    203210}
  • trunk/MagicSoft/Mars/mraw/MRawEvtData.cc

    r5399 r6253  
    376376    fLoGainFadcSamples = new MArrayB(numconnected*numlo);
    377377
    378     fABFlags           = new MArrayB(maxid/8+1);
     378    fABFlags           = new MArrayB(maxid==0 ? 0 : maxid/8+1);
    379379
    380380    fConnectedPixels   = 0;
  • trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc

    r5728 r6253  
    7373// return kTRUE  the lo gains exist for the actual pixel, else return kFALSE
    7474//
    75 #include <iostream>
    7675Bool_t MRawEvtPixelIter::HasLoGain() const
    7776{
     
    8584        return kTRUE;
    8685
    87 //    cout << fNumLoGainEntry << " " << flush;
    88 //    cout << fData->fLoGainPixId->GetSize() << " " << flush;
    89 
    9086    if (fNumLoGainEntry>fData->fLoGainPixId->GetSize())
    9187        return kFALSE;
    9288
    93 /*
    94     cout << fNumLoGainEntry << " " << flush;
    95     cout << fData->fLoGainPixId->GetSize() << " " << flush;
    96     cout << fData->fLoGainPixId->GetArray() << " " << flush;
    97     cout << fLoGainId << endl;
    98     */
    99 //    cout << (int)(fLoGainId-fData->fLoGainPixId->GetArray()) << " " << flush;
    100 //    cout << (int)(fHiGainId-fData->fHiGainPixId->GetArray()) << " " << flush;
    101 
    10289    Bool_t rc = *fHiGainId!=*fLoGainId;
    103 
    104 //    cout << "done." << endl;
    105 
    10690
    10791    if (rc)
    10892        return kFALSE;
    109     /*
    110     // We have no lo-gain at all
    111     if (!fLoGainId)
    112         return kFALSE;
    113 
    114     // This is to make the first call of this function in Next()
    115     // work properly! NEVER call this function before Next()
    116     if (fNumLoGainEntry==0)
    117         return kTRUE;
    118 
    119     // Make sure, that we don't exceed the last entry in the array!
    120     if (fNumLoGainEntry==fData->fLoGainPixId->GetSize())
    121         return kFALSE;
    122 
    123     // Check whether the current position in lo-gain fits the hi-gain
    124     return *fHiGainId!=*fLoGainId;
    125      */
     93
    12694    return kTRUE;
    12795}
  • trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h

    r5728 r6253  
    9797        // return kTRUE  the lo gains exist for the actual pixel, else return kFALSE
    9898        //
    99         return fABFlags ? TESTBIT(fABFlags[GetPixelId()/8], GetPixelId()%8) : 0;
     99        return TESTBIT(GetABFlag(), GetPixelId()%8);
    100100    }
    101101    Byte_t GetABFlag() const
  • trunk/MagicSoft/Mars/showlog.cc

    r4887 r6253  
    1919    gLog << "   showlog [options] < filename" << endl << endl;
    2020    gLog.Usage();
    21     gLog << "   -?, -h, --help            This help" << endl << endl;
     21    gLog << "   --version, -V             Show startup message with version number" << endl;
     22    gLog << "   -?, -h, --help            This help" << endl;
    2223    gLog << endl;
    2324    gLog << " This program converts colored output  made with ansi codes" << endl;
     
    4950{
    5051    MArgs arg(argc, argv);
     52
     53    if (arg.HasOnly("-V") || arg.HasOnly("--version"))
     54        return 0;
    5155
    5256    if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
  • trunk/MagicSoft/Mars/showplot.cc

    r6167 r6253  
    4141    gLog << "   --save-as-gif[=filename]  Save plots as gif files" << endl;
    4242    gLog << "   --save-as-C[=filename]    Save plots as root scripts" << endl;
    43     gLog << "   --tab=num                 Save only tab number num" << endl << endl;
     43    gLog << "   --tab=num                 Save only tab number num" << endl;
     44    gLog << endl;
     45    gLog << "   --version, -V             Show startup message with version number" << endl;
     46    gLog << "   -?, -h, --help            This help" << endl;
     47    gLog << endl;
    4448    gLog << "Description:" << endl;
    4549    gLog << " Use showplot to display a MStatusArray in an MStatusDisplay." << endl;
     
    5761    //
    5862    MArgs arg(argc, argv, kTRUE);
     63
     64    if (arg.HasOnly("-V") || arg.HasOnly("--version"))
     65        return 0;
    5966
    6067    if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
  • trunk/MagicSoft/Mars/star.cc

    r5564 r6253  
    6666    gLog << "   --config=star.rc          Resource file [default=star.rc]" << endl;
    6767    gLog << endl;
     68    gLog << "   --version, -V             Show startup message with version number" << endl;
    6869    gLog << "   -?, -h, --help            This help" << endl << endl;
    6970}
     
    7778    //
    7879    MArgs arg(argc, argv, kTRUE);
     80
     81    if (arg.HasOnly("-V") || arg.HasOnly("--version"))
     82        return 0;
    7983
    8084    if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
Note: See TracChangeset for help on using the changeset viewer.