ROOT logo
// $Id: ARay.h 3 2010-11-26 17:17:31Z oxon $
// Author: Akira Okumura 2007/09/24

/******************************************************************************
 * Copyright (C) 2006-, Akira Okumura                                         *
 * All rights reserved.                                                       *
 *****************************************************************************/

#ifndef A_RAY_H
#define A_RAY_H

///////////////////////////////////////////////////////////////////////////////
//
// ARay
//
// Classical ray class
//
///////////////////////////////////////////////////////////////////////////////

#include "TGeoNode.h"
#include "TGeoTrack.h"
#include "TPolyLine3D.h"
#include "TVector3.h"

class ARay : public TGeoTrack {
 private:
  enum {kRun, kStop, kExit, kFocus, kSuspend, kAbsorb};
  Double_t     fLambda;     // Wavelength
  TVector3     fDirection;  // Current direction vector
  Int_t        fStatus;     // status of ray
  TObjArray    fNodeHisotry; // History of nodes on which the photon has hi

 public:
  ARay();
  ARay(Int_t id, Double_t lambda, Double_t x, Double_t y, Double_t z,
       Double_t t, Double_t dx, Double_t dy, Double_t dz);
  virtual ~ARay();

  void         Absorb() {fStatus = kAbsorb;}
  void         Exit() {fStatus = kExit;}
  void         Focus() {fStatus = kFocus;}
  void         GetDirection(Double_t* d) const;
  const TObjArray* GetNodeHistory() const {return &fNodeHisotry;}
  Double_t     GetLambda() const {return fLambda;}
  void         GetLastPoint(Double_t* x) const;
  void         AddNode(TGeoNode* node) {fNodeHisotry.Add(node);}
  TGeoNode*    FindNode(const char* name) const {return (TGeoNode*)fNodeHisotry.FindObject(name);}
  Bool_t       IsAbsorbed() const;
  Bool_t       IsExited() const;
  Bool_t       IsFocused() const;
  Bool_t       IsRunning() const;
  Bool_t       IsStopped() const;
  Bool_t       IsSuspended() const;
  TPolyLine3D* MakePolyLine3D() const;
  void         SetDirection(Double_t dx, Double_t dy, Double_t dz);
  void         SetDirection(Double_t* d);
  void         SetLambda(Double_t lambda) {fLambda = lambda;}
  void         Stop() {fStatus = kStop;}
  void         Suspend() {fStatus = kSuspend;}

  ClassDef(ARay, 1)
};

#endif // A_RAY_H
 ARay.h:1
 ARay.h:2
 ARay.h:3
 ARay.h:4
 ARay.h:5
 ARay.h:6
 ARay.h:7
 ARay.h:8
 ARay.h:9
 ARay.h:10
 ARay.h:11
 ARay.h:12
 ARay.h:13
 ARay.h:14
 ARay.h:15
 ARay.h:16
 ARay.h:17
 ARay.h:18
 ARay.h:19
 ARay.h:20
 ARay.h:21
 ARay.h:22
 ARay.h:23
 ARay.h:24
 ARay.h:25
 ARay.h:26
 ARay.h:27
 ARay.h:28
 ARay.h:29
 ARay.h:30
 ARay.h:31
 ARay.h:32
 ARay.h:33
 ARay.h:34
 ARay.h:35
 ARay.h:36
 ARay.h:37
 ARay.h:38
 ARay.h:39
 ARay.h:40
 ARay.h:41
 ARay.h:42
 ARay.h:43
 ARay.h:44
 ARay.h:45
 ARay.h:46
 ARay.h:47
 ARay.h:48
 ARay.h:49
 ARay.h:50
 ARay.h:51
 ARay.h:52
 ARay.h:53
 ARay.h:54
 ARay.h:55
 ARay.h:56
 ARay.h:57
 ARay.h:58
 ARay.h:59
 ARay.h:60
 ARay.h:61
 ARay.h:62
 ARay.h:63
 ARay.h:64