GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MetaFrame.h
Go to the documentation of this file.
1 
2 /***************************************************************************
3  * Copyright (C) 2004 by Olivier Stezowski *
4  * stezow(AT)ipnl.in2p3.fr *
5  * *
6  * This program is free software; you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as published by *
8  * the Free Software Foundation; either version 2 of the License, or *
9  * (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this program; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20  ***************************************************************************/
21 
24 #ifndef ADF_MetaFrame
25 #define ADF_MetaFrame
26 
27 #include "AgataDataFrame.h"
28 #include "GObject.h"
29 #include "Hits.h"
30 
31 #include <cmath>
32 
33 namespace ADF
34 {
35 
38 {
39 protected:
41  template<typename Precision_T> struct Vertex {
42 
43  Vertex() { ::memset(this,0,sizeof(Vertex<Precision_T>)); }
44 
45  Precision_T P[3];
46 
47  Precision_T D[3];
48  Precision_T Beta;
49 
50  Precision_T DP[3];
51 
52  Precision_T DD[3];
53  Precision_T DBeta;
54 
55  void Reset() { ::memset(this,0,sizeof(Vertex<Precision_T>)); }
56  };
57 
58 public:
60  {;}
61  virtual ~VertexInterface()
62  {;}
63 
65  virtual void SetPosition(Double_t , Double_t , Double_t ,Double_t = 0.0) = 0;
67  virtual void GetPosition(Double_t &, Double_t &, Double_t & ,Double_t = 0.0) const = 0;
69  virtual void SetDirection(Double_t , Double_t , Double_t ,Double_t = 0.0) = 0;
71  virtual void GetDirection(Double_t &, Double_t &, Double_t &,Double_t = 0.0) const = 0;
72 
74  virtual void SetBeta(Double_t, Double_t = 0.0) = 0;
76  virtual Double_t GetBeta(Double_t = 0.0) const = 0;
77  virtual Double_t GetGamma(Double_t = 0.0) const
78  { return 1.0 / ::sqrt ( 1 - GetBeta()*GetBeta() ); };
79 
80  virtual void DopplerShift(Hit *) = 0;
81  virtual void DopplerCorrection(Hit *) = 0;
82 
83  virtual Double_t DopplerShift(const Hit *) const = 0;
84  virtual Double_t DopplerCorrection(const Hit *) const = 0;
85 
87 
93  static Double_t DopplerShift(Double_t e, Double_t beta, Double_t gamma, Double_t costheta);
95 
101  static Double_t DopplerCorrection(Double_t e, Double_t beta, Double_t gamma, Double_t costheta);
102 };
103 
105 class AVertexFrame : public AgataDataFrame< VertexInterface >
106 {
107 protected:
109  AgataDataFrame< VertexInterface >(akey) {;}
110 public:
111  virtual ~AVertexFrame()
112  {;}
113 };
114 
116 class ASyncFrame : public AgataDataFrame< DataInterface >
117 {
118 protected:
119  ASyncFrame(Key *akey):
120  AgataDataFrame< DataInterface >(akey) {;}
121 public:
122  virtual ~ASyncFrame()
123  {;}
124 };
125 
126 } // namespace ADF
127 #endif
128 
129 
130 
131 
132 
133 
virtual void GetDirection(Double_t &, Double_t &, Double_t &, Double_t=0.0) const =0
get the direction of the source (last argument is used in case the position depends on time) ...
virtual ~VertexInterface()
Definition: MetaFrame.h:61
Base class for a Key.
Definition: Key.h:56
virtual void GetPosition(Double_t &, Double_t &, Double_t &, Double_t=0.0) const =0
get the position of the source (last argument is used in case the position depends on time) ...
General interface for a AgataDataFrame.
virtual void SetPosition(Double_t, Double_t, Double_t, Double_t=0.0)=0
Set the position of the source (last argument is used in case the position depends on time) ...
ASyncFrame(Key *akey)
Definition: MetaFrame.h:119
Base class for a Vertex i.e. a position, recoil direction and velocity.
Definition: MetaFrame.h:105
header file for Hits.cpp
header file for AgataDataFrame.cpp
virtual Double_t GetBeta(Double_t=0.0) const =0
get recoil velocity
virtual void DopplerShift(Hit *)=0
Vertex definition for internal use.
Definition: MetaFrame.h:41
Base class for a Hit.
Definition: Hits.h:35
virtual void DopplerCorrection(Hit *)=0
Base class Frame that helps controls of the data flow.
Definition: MetaFrame.h:116
virtual Double_t GetGamma(Double_t=0.0) const
Definition: MetaFrame.h:77
AVertexFrame(Key *akey)
Definition: MetaFrame.h:108
virtual void SetDirection(Double_t, Double_t, Double_t, Double_t=0.0)=0
set the direction of the source (last argument is used in case the position depends on time) ...
virtual void SetBeta(Double_t, Double_t=0.0)=0
set recoil velocity
Base class for a DataInterface.
Definition: GObject.h:340
virtual ~AVertexFrame()
Definition: MetaFrame.h:111
virtual ~ASyncFrame()
Definition: MetaFrame.h:122