Changeset 1542


Ignore:
Timestamp:
10/16/02 10:40:39 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1540 r1542  
    11                                                                  -*-*- END -*-*-
     2 2002/10/16: Thomas Bretz
     3
     4   * macros/readMagic.C:
     5     - added MPrint for MRawEvtHeader
     6     - changed to MPrint to new Skip-Style
     7
     8   * manalysis/MHillasCalc.cc, manalysis/MHillasSrcCalc.cc:
     9     - corrected output stream in case of hex or setfill was used
     10
     11   * mbase/MPrint.[h,cc]:
     12     - introduced new behaviour of PreProcess (EnableSkip)
     13
     14   * mbase/MTaskList.cc:
     15     - fixed a bug in Process which caused Histograms to be written
     16       after each event
     17
     18   * meventdisp/MGEvtDisplay.cc:
     19     - introduced printing of MRawEvtHeader
     20
     21   * mmc/MMcEvt.cxx:
     22     - some small changes
     23     - changed Print output from cout to fLog
     24     - changes to the default values
     25
     26   * mraw/MRawEvtHeader.[h,cc]:
     27     - removed the second empty line after Print
     28     - added Getter-function for the DAQEvtNumber
     29
     30
     31
    232 2002/10/15: Thomas Bretz
    333
  • trunk/MagicSoft/Mars/macros/readMagic.C

    r1540 r1542  
    5858    plist.AddToList(&tlist);
    5959
    60     MReadMarsFile     read("Events", fname);
     60    MReadMarsFile read("Events", fname);
    6161    read.DisableAutoScheme();
    6262
    63     MPrint            print("MMcEvt");
     63    MPrint print1("MMcEvt");
     64    MPrint print2("MRawEvtHeader");
     65    print1.EnableSkip();
     66    print2.EnableSkip();
     67
    6468    MMcPedestalCopy   pcopy;
    6569    MMcPedestalNSBAdd pnsb;
     
    7377
    7478    tlist.AddToList(&read);
    75     tlist.AddToList(&print);
     79    tlist.AddToList(&print1);
     80    tlist.AddToList(&print2);
    7681    tlist.AddToList(&pcopy);
    7782    tlist.AddToList(&pnsb);
  • trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc

    r1540 r1542  
    125125    *fLog << inf << endl;
    126126    *fLog << GetDescriptor() << " execution statistics:" << endl;
     127    *fLog << dec << setfill(' ');
    127128    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Event has less than 3 pixels" << endl;
    128129    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) << (int)(fErrors[2]*100/GetNumExecutions()) << "%) Evts skipped due to: Calculated Size == 0" << endl;
  • trunk/MagicSoft/Mars/manalysis/MHillasSrcCalc.cc

    r1540 r1542  
    122122    *fLog << inf << endl;
    123123    *fLog << GetDescriptor() << " execution statistics:" << endl;
     124    *fLog << dec << setfill(' ');
    124125    *fLog << " " << fErrors << " (" << (int)(fErrors*100/GetNumExecutions()) << "%) Evts skipped due to: Dist==0" << endl;
    125126    *fLog << endl;
  • trunk/MagicSoft/Mars/mbase/MPrint.cc

    r1080 r1542  
    6767//  must be overloaded. You can also set an option string to use
    6868//  when calling TObject::Print
     69//  If you want that the MPrint instance is removed from the tasklist
     70//  if the container to be printed is not found in the PreProcess, call:
     71//     MPrint::EnableSkip();
    6972//
    7073MPrint::MPrint(const char *obj, const char *option,
     
    8487//  must be overloaded. You can also set an option string to use
    8588//  when calling TObject::Print
     89//  if the container to be printed is not found in the PreProcess, call:
     90//     MPrint::EnableSkip();
    8691//
    8792MPrint::MPrint(const TObject *obj, const char *option,
     
    118123    // If it couldn't get found stop Eventloop
    119124    //
    120     *fLog << err << dbginf << fObjName << " not found... aborting." << endl;
    121     return kFALSE;
     125    *fLog << err << dbginf << fObjName << " not found... ";
     126    if (TestBit(kSKIP))
     127    {
     128        *fLog << "removing task from list." << endl;
     129        return kSKIP;
     130    }
     131    else
     132    {
     133        *fLog << "aborting." << endl;
     134        return kFALSE;
     135    }
    122136}
    123137
  • trunk/MagicSoft/Mars/mbase/MPrint.h

    r1014 r1542  
    1515    TString fOption;         // Print option
    1616
     17    enum { kSkip = BIT(14) };
     18
    1719    void Init(const char *name, const char *title);
    1820
     
    2224
    2325    void SetOption(Option_t *option) { fOption = option; }
     26    void EnableSkip(Bool_t skip=kTRUE) { skip ? SetBit(kSkip) : ResetBit(kSkip); }
    2427
    2528    Bool_t PreProcess(MParList *pList);
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r1540 r1542  
    380380    if (!noreset)
    381381    {
    382         fParList->SetReadyToSave();
     382        fParList->SetReadyToSave(kFALSE);
    383383        fParList->Reset();
    384384        fParList->SetBit(MParList::kDoNotReset);
  • trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc

    r1540 r1542  
    4646#include "MReadMarsFile.h"
    4747#include "MGeomCamMagic.h"
     48#include "MRawEvtHeader.h"
    4849
    4950#include "MMcEvt.hxx"
     
    484485    txt += "PhEl";
    485486
     487    const MRawEvtHeader *hed = (MRawEvtHeader*)GetParList()->FindObject("MRawEvtHeader");
     488    if (hed)
     489    {
     490        txt += "  DAQEvt #";
     491        txt += hed->GetDAQEvtNumber();
     492    }
     493
    486494    fEvtInfo->SetText(txt);
    487495}
  • trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc

    r1082 r1542  
    214214        }
    215215    }
    216 
    217     *fLog << endl;
    218216    *fLog << endl;
    219217}
  • trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h

    r1018 r1542  
    5454
    5555    UShort_t GetTrigType() const { return fTrigType; }
     56    UInt_t GetDAQEvtNumber() const { return fDAQEvtNumber; }
    5657
    5758    int ReadEvt(istream& fin);
  • trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx

    r1353 r1542  
    11#include "MMcEvt.hxx"
    22
    3 #include <iostream.h>
    4 #include <fstream.h>
    5 
     3#include "MLog.h"
     4#include "MLogManip.h"
    65
    76//==========
     
    1817
    1918
    20 MMcEvt::MMcEvt() {
    21   //
    22   //  default constructor
    23   //  set all values to zero
     19MMcEvt::MMcEvt()
     20{
     21    //
     22    //  default constructor
     23    //  set all values to zero
    2424    fName  = "MMcEvt";
    2525    fTitle = "Event info from Monte Carlo";
    2626
    27   fPartId = 0  ;
    28   fEnergy  = 0. ;
    29 
    30   fTheta   = 0. ;
    31   fPhi     = 0. ;
    32 
    33   fCoreD   = 0. ;
    34   fCoreX   = 0. ;
    35   fCoreY   = 0. ;
    36   fImpact  = 0. ;
    37 
    38   fPhotIni      = 0 ;
    39   fPassPhotAtm  = 0 ;
    40   fPassPhotRef  = 0 ;
    41   fPassPhotCone = 0 ;
    42   fPhotElfromShower = 0 ;
    43   fPhotElinCamera = 0 ;
    44 }
    45 
    46 MMcEvt::MMcEvt( UShort_t usPId,
     27    Clear();
     28}
     29
     30MMcEvt::MMcEvt( UShort_t usPId,
    4731                Float_t  fEner,
    4832                Float_t  fThet,
     
    9983
    10084
    101 void MMcEvt::Clear(Option_t *opt) {
    102   //
    103   // 
    104   //  reset all values to zero
    105 
    106   fPartId = 0  ;
    107   fEnergy  = 0. ;
    108 
    109   fTheta   = 0. ;
    110   fPhi     = 0. ;
    111 
    112   fCoreD   = 0. ;
    113   fCoreX   = 0. ;
    114   fCoreY   = 0. ;
    115   fImpact  = 0. ;
    116 
    117   fPhotIni      = 0 ;
    118   fPassPhotAtm  = 0 ;
    119   fPassPhotRef  = 0 ;
    120   fPassPhotCone = 0 ;
    121   fPhotElfromShower = 0 ;
    122   fPhotElinCamera   = 0 ;
     85void MMcEvt::Clear(Option_t *opt)
     86{
     87    //
     88    //  reset all values to values as nonsense as possible
     89    //
     90    fPartId = 0;
     91    fEnergy = -1;
     92
     93    fTheta = 0;
     94    fPhi   = 0;
     95
     96    fCoreD  =  0;
     97    fCoreX  =  0;
     98    fCoreY  =  0;
     99    fImpact = -1;
     100
     101    fPhotIni          = 0;
     102    fPassPhotAtm      = 0;
     103    fPassPhotRef      = 0;
     104    fPassPhotCone     = 0;
     105    fPhotElfromShower = 0;
     106    fPhotElinCamera   = 0;
    123107}
    124108
     
    186170    if (str.IsNull())
    187171    {
    188         cout << endl;
    189         cout << "Monte Carlo output:" << endl;
    190         cout << " Particle Id:    ";
     172        *fLog << all << endl;
     173        *fLog << "Monte Carlo output:" << endl;
     174        *fLog << " Particle Id:    ";
    191175        switch(fPartId)
    192176        {
    193177        case kGAMMA:
    194             cout << "Gamma" << endl;
     178            *fLog << "Gamma" << endl;
    195179            break;
    196180        case kPROTON:
    197             cout << "Proton" << endl;
     181            *fLog << "Proton" << endl;
    198182            break;
    199183        case kHELIUM:
    200             cout << "Helium" << endl;
     184            *fLog << "Helium" << endl;
    201185            break;
    202186        }
    203         cout << " Energy:         " << fEnergy << "GeV" << endl;
    204         cout << " Impactpar.:     " << fImpact/100 << "m" << endl;
    205         cout << " Photoelectrons: " << fPhotElfromShower << endl;
    206         cout << endl;
     187        *fLog << " Energy:         " << fEnergy << "GeV" << endl;
     188        *fLog << " Impactpar.:     " << fImpact/100 << "m" << endl;
     189        *fLog << " Photoelectrons: " << fPhotElfromShower << endl;
     190        *fLog << endl;
    207191        return;
    208192    }
     
    211195        {
    212196        case kGAMMA:
    213             cout << "Particle: Gamma" << endl;
     197            *fLog << "Particle: Gamma" << endl;
    214198            break;
    215199        case kPROTON:
    216             cout << "Particle: Proton" << endl;
     200            *fLog << "Particle: Proton" << endl;
    217201            break;
    218202        case kHELIUM:
    219             cout << "Particle: Helium" << endl;
     203            *fLog << "Particle: Helium" << endl;
    220204            break;
    221205        }
    222206    if (str.Contains("energy", TString::kIgnoreCase))
    223         cout << "Energy: " << fEnergy << "GeV" << endl;
     207        *fLog << "Energy: " << fEnergy << "GeV" << endl;
    224208    if (str.Contains("impact", TString::kIgnoreCase))
    225         cout << "Impact: " << fImpact << "cm" << endl;
    226 }
     209        *fLog << "Impact: " << fImpact << "cm" << endl;
     210}
Note: See TracChangeset for help on using the changeset viewer.