Ignore:
Timestamp:
01/24/09 01:49:53 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/msim
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/msim/MPhotonData.cc

    r9243 r9252  
    4040#include <iostream>
    4141
     42#include <TMath.h>
     43
    4244#include "MLog.h"
    4345#include "MLogManip.h"
     
    9597// --------------------------------------------------------------------------
    9698//
     99// return the cosine of the Theta-angle == sqrt(1-CosU^2-CosV^2)
     100//
     101Double_t MPhotonData::GetCosW() const
     102{
     103    return TMath::Sqrt(1 - fCosU*fCosU - fCosV*fCosV);
     104}
     105
     106// --------------------------------------------------------------------------
     107//
     108// Return the theta angle in radians
     109//
     110Double_t MPhotonData::GetTheta() const
     111{
     112    return TMath::ACos(GetCosW());
     113}
     114
     115// --------------------------------------------------------------------------
     116//
     117// Return a TQuaternion with the first three components x, y, and z
     118// and the fourth component the time.
     119//
     120TQuaternion MPhotonData::GetPosQ() const
     121{
     122    return TQuaternion(GetPos3(), fTime);
     123}
     124
     125// --------------------------------------------------------------------------
     126//
     127// return a TQuaternion with the first three components the direction
     128// moving in space (GetDir3()) and the fourth component is the
     129// one devided by the speed of light (converted to cm/ns)
     130//
     131// FIXME: v in air!
     132//
     133TQuaternion MPhotonData::GetDirQ() const
     134{
     135    return TQuaternion(GetDir3(), 1./(TMath::C()*100/1e9));
     136}
     137
     138// --------------------------------------------------------------------------
     139//
    97140// Set the data member according to the 8 floats read from a reflector-file.
    98141// This function MUST reset all data-members, no matter whether these are
  • trunk/MagicSoft/Mars/msim/MPhotonData.h

    r9232 r9252  
    2121//class ifstream;
    2222#include <iosfwd>
    23 /*
    24 class TH1;
    25 class TH2;
    26 class TH3;
    27 */
     23
    2824class MCorsikaRunHeader;
    2925
     
    6763    Float_t  GetCosU()  const { return fCosU; }
    6864    Float_t  GetCosV()  const { return fCosV; }
    69     Double_t GetCosW()  const { return TMath::Sqrt(1 - fCosU*fCosU - fCosV*fCosV); } // cos(Theta)
    70     Double_t GetTheta() const { return TMath::ACos(GetCosW()); }
     65    Double_t GetCosW()  const;
     66    Double_t GetTheta() const;
    7167
    7268    Double_t GetTime()  const { return fTime; }
     
    8177    TVector3 GetDir3()  const { return TVector3(fCosU, fCosV, -GetCosW()); }
    8278
    83     // Getter 4D                                      // cm   // ns
    84     TQuaternion GetPosQ() const { return TQuaternion(GetPos3(), fTime); }
    85     // FIXME: v in air!                                       // m/s  cm? / ns
    86     TQuaternion GetDirQ() const { return TQuaternion(GetDir3(), 1./(TMath::C()*100/1e9)); }
     79    // Getter 4D
     80    TQuaternion GetPosQ() const;
     81    TQuaternion GetDirQ() const;
    8782
    8883    // Getter Others
Note: See TracChangeset for help on using the changeset viewer.