Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DigiPhoton.h

Go to the documentation of this file.
00001 
00002 // $Id: DigiPhoton.h,v 1.3 2005/02/01 19:09:19 tagg Exp $
00003 //
00004 // A single photon in the scintillator system. The coordinate system
00005 // should always be the local coordinate frame. For example, in a
00006 // scintillator strip x should be the distance along the width of the
00007 // strip, y should be the the distance along the thickness of the
00008 // strip and z should be the distance along the length.
00009 //
00010 // messier@indiana.edu
00011 //
00012 // Fundamental redesign by n.tagg1@physics.ox.ac.uk (I AM my email address.)
00014 #ifndef DIGIPHOTON_H
00015 #define DIGIPHOTON_H
00016 #include "TObject.h"
00017 #include "TRef.h"
00018 #ifndef PLEXSTRIPENDID_H
00019 # include "Plex/PlexStripEndId.h"
00020 #endif
00021 #ifndef MUNITS_H
00022 # include "Conventions/Munits.h"
00023 #endif
00024 
00025 #include "TVector3.h"
00026 #include "TMath.h"
00027 
00028 class DigiScintHit;
00029 
00030 class DigiPhoton : public TObject
00031 {
00032 public:
00033   DigiPhoton();
00034   DigiPhoton( const DigiScintHit* hit,
00035              double wavelength, double t, 
00036              double x, double y, double z,
00037              double u, double v, double w);
00038 
00039   DigiPhoton(const DigiScintHit* hit,
00040              double wavelength, double t,
00041              const TVector3& pos,
00042              const TVector3& dir );
00043 
00044   // Getters:
00045   const DigiScintHit*  ParentHit()     const { return fHit; };
00046 
00047   Double_t             WaveLength()  const { return fWavelength; };
00048   Double_t             E()           const;
00049   Double_t             T()           const { return fT;   }
00050 
00051   const TVector3&      GetPos()      const { return fPos; };
00052   Double_t             X()           const { return fPos.X();   }
00053   Double_t             Y()           const { return fPos.Y();   }
00054   Double_t             Z()           const { return fPos.Z();   }
00055 
00056   const TVector3&      GetDir()      const { return fDir; };
00057   Double_t             GetCosX()     const { return fDir.X(); };
00058   Double_t             GetCosY()     const { return fDir.Y(); };
00059   Double_t             GetCosZ()     const { return fDir.Z(); };
00060   Double_t             U()           const { return fDir.X(); };
00061   Double_t             V()           const { return fDir.Y(); };
00062   Double_t             W()           const { return fDir.Z(); };
00063   Double_t             DxDz()        const { return fDir.Z()>0?(fDir.X()/fDir.Z()):999.;}
00064   Double_t             DyDz()        const { return fDir.Z()>0?(fDir.Y()/fDir.Z()):999.;}
00065 
00066   // Setters:
00067   void  SetParentHit( const DigiScintHit* hit )          { fHit = hit; };
00068   void  SetWavelength( double l )                        { fWavelength = l; };
00069   void  SetTime( double t )                              { fT = t; };
00070   void  SetPosition(const TVector3& in)                  { fPos = in; };
00071   void  SetPosition(Double_t x, Double_t y, Double_t z)  { fPos.SetXYZ(x,y,z); };
00072   void  SetDirection(const TVector3& in)                 { fDir = in; fDir.SetMag(1.0); };
00073   void  SetDirection(Double_t u, Double_t v, Double_t w) { fDir.SetXYZ(u,v,w); };
00074 
00075   virtual void Print( Option_t* option="") const;
00076 
00077 public:
00078   const DigiScintHit* fHit;  // The parent energy deposition
00079   
00080   Double_t  fWavelength; // in Munits.
00081   Double_t  fT;    // Time at position
00082   TVector3  fPos;  // Position in strip.
00083   TVector3  fDir;  // Direction.
00084     
00085   ClassDef(DigiPhoton,2) // A photon in the scintillator system
00086 };
00087 
00088 
00089 inline Double_t DigiPhoton::E() const
00090 {
00091   // E = hc/lambda
00092   // H() in Js, C() in m/s, fWavelength in meters, convert J to energy standard..
00093   return  (TMath::H() * TMath::C() / fWavelength) * TMath::Qe() / Munits::eV;  
00094 }
00095 
00096 #endif // DIGIPHTON
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105 

Generated on Mon Feb 15 11:06:37 2010 for loon by  doxygen 1.3.9.1