Changeset 1853


Ignore:
Timestamp:
03/21/03 15:27:44 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1852 r1853  
    11                                                 -*-*- END OF LINE -*-*-
    2 
    3  2003/03/21: Thomas Bretz
    4     * manalysis/MEnergyEstParam.[h,cc]
    5       - Added StopMapping and Print functions.
    62
    73 2003/03/21: Abelardo Moralejo
     
    1612
    1713
     14
    1815 2003/03/21: Thomas Bretz
     16
     17    * manalysis/MEnergyEstParam.[h,cc]
     18      - Added StopMapping and Print functions.
    1919
    2020    * manalysis/MSel*.h:
     
    3232      - added a events counter which counts the real number of
    3333        processed events.
     34
     35    * mdata/MDataChain.[h,cc]:
     36      - implemented random numbers
     37      - implemented a conversion from degrees to radians and vice versa
    3438
    3539
  • trunk/MagicSoft/Mars/mdata/MDataChain.cc

    r1661 r1853  
    1818!   Author(s): Thomas Bretz  04/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2002
     20!   Copyright: MAGIC Software Development, 2000-2003
    2121!
    2222!
     
    7272//   abs(x)    absolute value of x, |x|
    7373//   floor(x)  round down to the nearest integer (floor(9.9)=9)
    74 //
     74//   r2d(x)    transform radians to degrees
     75//   d2r(x)    transform degrees to radians
     76//   rand(x)   returns a uniform deviate on the interval ( 0, x ].
     77//             (gRandom->Uniform(x) is returned)
     78//   randp(x)  returns gRandom->Poisson(x)
     79//   rande(x)  returns gRandom->Exp(x)
     80//   randi(x)  returns gRandom->Integer(x)
     81//   randg(x)  returns gRandom->Gaus(0, x)
     82//   randl(x)  returns gRandom->Landau(0, x)
     83//
     84// REMARK:
     85//         - All the random functions are returning 0 if gRandom==0
     86//         - You may get better results if you are using a TRandom3
    7587//
    7688// FIXME: The possibility to use other objects inheriting from MData
     
    8698#include <ctype.h>        // isalnum, ...
    8799#include <stdlib.h>       // strtod, ...
     100
     101#include <TRandom.h>
    88102
    89103#include "MLog.h"
     
    231245    if (txt=="sgn")   return kESgn;
    232246    if (txt=="floor") return kEFloor;
     247    if (txt=="r2d")   return kERad2Deg;
     248    if (txt=="d2r")   return kEDeg2Rad;
     249    if (txt=="rand")  return kERandom;
     250    if (txt=="randp") return kERandomP;
     251    if (txt=="rande") return kERandomE;
     252    if (txt=="randi") return kERandomI;
     253    if (txt=="randg") return kERandomG;
     254    if (txt=="randl") return kERandomL;
    233255    if (txt[0]=='-')  return kENegative;
    234256    if (txt[0]=='+')  return kEPositive;
     
    477499    case kEPositive: return val;
    478500    case kEFloor:    return floor(val);
     501    case kERad2Deg:  return val*180/TMath::Pi();
     502    case kEDeg2Rad:  return val*TMath::Pi()/180;
     503    case kERandom:   return gRandom ? gRandom->Uniform(val)   : 0;
     504    case kERandomP:  return gRandom ? gRandom->Poisson(val)   : 0;
     505    case kERandomE:  return gRandom ? gRandom->Exp(val)       : 0;
     506    case kERandomI:  return gRandom ? gRandom->Integer(val)   : 0;
     507    case kERandomG:  return gRandom ? gRandom->Gaus(0, val)   : 0;
     508    case kERandomL:  return gRandom ? gRandom->Landau(0, val) : 0;
    479509    case kENoop:     return val;
    480510    }
     
    561591    case kEPositive: str += "+"    ; break;
    562592    case kEFloor:    str += "floor"; break;
     593    case kERad2Deg:  str += "r2d"  ; break;
     594    case kEDeg2Rad:  str += "d2r"  ; break;
     595    case kERandom:   str += "rand" ; break;
     596    case kERandomP:  str += "randp"; break;
     597    case kERandomE:  str += "rande"; break;
     598    case kERandomI:  str += "randi"; break;
     599    case kERandomG:  str += "randg"; break;
     600    case kERandomL:  str += "randl"; break;
    563601    case kENoop:
    564602        break;
     
    585623    return fMember->GetDataMember();
    586624}
     625
  • trunk/MagicSoft/Mars/mdata/MDataChain.h

    r1661 r1853  
    4040        kEPositive,
    4141        kENegative,
    42         kEFloor
     42        kEFloor,
     43        kERad2Deg,
     44        kEDeg2Rad,
     45        kERandom,
     46        kERandomP,
     47        kERandomE,
     48        kERandomI,
     49        kERandomG,
     50        kERandomL
    4351    } OperatorType_t;
    4452
  • trunk/MagicSoft/Mars/mhist/MHMatrix.cc

    r1852 r1853  
    617617    tlist.AddToList(read);
    618618
    619 
    620619    if (filter)
    621       {
    622         tlist.AddToList(filter);
    623         fillh.SetFilter(filter);
    624       }
     620    {
     621        tlist.AddToList(filter);
     622        fillh.SetFilter(filter);
     623    }
    625624
    626625    tlist.AddToList(&fillh);
    627 
    628626
    629627    MEvtLoop evtloop;
  • trunk/MagicSoft/Mars/mhist/MHMatrix.h

    r1852 r1853  
    9393    Double_t operator[](Int_t col) { return fM(fRow, col); }
    9494
    95     Bool_t Fill(MParList *plist, MTask *read, MF *filter=0);
     95    Bool_t Fill(MParList *plist, MTask *read, MF *filter=NULL);
    9696
    9797    TString GetDataMember() const;
Note: See TracChangeset for help on using the changeset viewer.