Changeset 9571 for trunk


Ignore:
Timestamp:
04/19/10 13:11:19 (15 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9570 r9571  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2010/04/19 Thomas Bretz
     22
     23   * mase/MStatusArray.cc:
     24     - added a workaround to prevent crashes in case of double
     25       deleteion of the fHistogram in TGraphs
     26
     27   * mcorsika/MCorsikaEvtHeader.cc:
     28     - replaced special characters by UTF8 characters
     29
     30   * mgeom/MGeom.[h,cc]:
     31     - implemented function to return the distance squared
     32
     33
    2034
    2135 2010/04/13 Daniela Dorner
  • trunk/MagicSoft/Mars/mbase/MStatusArray.cc

    r9569 r9571  
    4949#include <TCanvas.h>
    5050
     51#include <TGraph.h>           // For the TGraph workaround
     52#include <TPaveText.h>        // For the TPaveText workaround
     53
    5154#include "MLog.h"
    5255#include "MLogManip.h"
     
    5659
    5760ClassImp(MStatusArray);
    58 
    59 #include <TGraph.h>
    6061
    6162using namespace std;
     
    7778// name) recuresively
    7879//
    79 #include<TPaveText.h>
    8080void MStatusArray::RecursiveDelete(TVirtualPad *p, const char id) const
    8181{
     
    9898                continue;
    9999
     100            /*
     101            // This is necessary because the histogram can get deleted
     102            // but is not treated in TGraph recursive remove. Unfortunately,
     103            // we have no possibility to find out whether it was already
     104            // deleted. Fortunately these histograms don't contain data
     105            // and threfore don't consume memory.
     106            TGraph *g = dynamic_cast<TGraph*>(o);
     107            if (g)
     108                g->SetHistogram(0);
     109             */
     110
    100111            delete o;
    101112
     
    153164        if (dynamic_cast<TGraph*>(o))
    154165        {
     166            // FIXME: This should not be called for the TGraph
     167            // which is currently getting deleted.
    155168            TGraph *g = static_cast<TGraph*>(o);
    156169            if (g->GetHistogram()==obj)
    157170                g->SetHistogram(0);
     171            else
     172                g->GetHistogram()->SetBit(kMustCleanup);
    158173
    159174            continue;
     
    175190    TObjArray::RecursiveRemove(obj);
    176191
     192    // FIXME: Maybe we still have to call SetBit(kMustCleanup) ???
     193#if ROOT_VERSION_CODE <= ROOT_VERSION(5,26,00)
    177194    TObject *o = 0;
    178195
     
    180197    while ((o=Next()))
    181198        RecursiveRemove(dynamic_cast<TVirtualPad*>(o), obj);
     199#endif
    182200}
    183201
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaEvtHeader.cc

    r9524 r9571  
    1818!   Author(s): Thomas Bretz 11/2008 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: Software Development, 2000-2009
     20!   Copyright: Software Development, 2000-2010
    2121!
    2222!
     
    106106//    *fLog << "Particle ID:               " << MMcEvt::GetParticleName(fParticleID) << endl;
    107107    *fLog << "Energy:                    " << fTotalEnergy << "GeV" << endl;
    108     *fLog << "Starting Altitude:         " << fStartAltitude << "g/cm²" << endl;
     108    *fLog << "Starting Altitude:         " << fStartAltitude << "g/cm" << UTF8::kSquare << endl;
    109109    *fLog << "Number of 1st Target:      " << fFirstTargetNum << endl,
    110110    *fLog << "Height of 1st Interaction: " << fFirstInteractionHeight/100. << "m" << endl;
    111111    *fLog << "Momentum X/Y/Z (GeV/c):    " << fMomentumX << "/" << fMomentumY << "/" << fMomentumZ << endl;
    112     *fLog << "Zenith/Azimuth Angle:      " << fZd*TMath::RadToDeg() << "°/" << fAz*TMath::RadToDeg() << "°" << endl;
     112    *fLog << "Zenith/Azimuth Angle:      " << fZd*TMath::RadToDeg() << UTF8::kDeg << "/" << fAz*TMath::RadToDeg() << UTF8::kDeg << endl;
    113113    *fLog << "Impact X/Y:                " << fX/100. << "m/" << fY/100. << "m  (r=" << TMath::Hypot(fX, fY)/100. << "m)" << endl;
    114114    *fLog << "Weighted Num Photons:      " << fWeightedNumPhotons << endl;
  • trunk/MagicSoft/Mars/mgeom/MGeom.cc

    r9385 r9571  
    158158// ------------------------------------------------------------------------
    159159//
     160// Return distance squared of center to center of pix:
     161//  (fX-pix.fX)^2+(fY-pix.fY)^2
     162//
     163Float_t MGeom::GetDist2(const MGeom &pix) const
     164{
     165    const Double_t dx = fX-pix.fX;
     166    const Double_t dy = fY-pix.fY;
     167    return dx*dx + dy*dy;
     168}
     169
     170// ------------------------------------------------------------------------
     171//
    160172// Return angle defined by the center and the center of pix:
    161173//  atan2(fX-pix.fX,fY-pix.fY)
  • trunk/MagicSoft/Mars/mgeom/MGeom.h

    r9385 r9571  
    8787    Float_t GetDist() const;
    8888    Float_t GetDist(const MGeom &pix) const;
     89    Float_t GetDist2(const MGeom &pix) const;
    8990    Float_t GetAngle(const MGeom &pix) const;
    9091
Note: See TracChangeset for help on using the changeset viewer.