MarlinTPC  1.2.0
EFieldVector.h
1 
2 #ifndef E_FIELDVECTOR_H
3 #define E_FIELDVECTOR_H 1
4 
5 //C++
6 #include "iostream"
7 #include "string"
8 
9 //LCIO
10 #include "lcio.h"
11 #include "UTIL/LCFixedObject.h"
12 
13 #define EFieldVectorNINTVals 3
14 #define EFieldVectorNFLOATVals 3
15 #define EFieldVectorNDOUBLEVals 0
16 
17 namespace marlintpc{
18 
19 class EFieldVector : public UTIL::LCFixedObject<EFieldVectorNINTVals,
20  EFieldVectorNFLOATVals,
21  EFieldVectorNDOUBLEVals> {
22 
23 public:
24 
25  EFieldVector(int xBin=0., int yBin=0., int zBin = 0., float Ex = 0. , float Ey = 0. , float Ez = 0. );
26 
27  EFieldVector(EVENT::LCObject* obj): UTIL::LCFixedObject<EFieldVectorNINTVals,
28  EFieldVectorNFLOATVals,
29  EFieldVectorNDOUBLEVals>(obj) { }
30 
31 
32  EFieldVector(const EFieldVector &original)
33  : UTIL::LCFixedObject<EFieldVectorNINTVals,
34  EFieldVectorNFLOATVals,
35  EFieldVectorNDOUBLEVals>(original)
36  {
37  if( _createdObject )
38  _obj = new LCGenericObjectImpl(*(original._obj));
39  }
40 
41 
42 
43 
44  virtual ~EFieldVector();
45 
47  int getXBin() const;
48 
50  int getYBin() const;
51 
53  int getZBin() const;
54 
56  void setEx(float Ex);
57  void setEy(float Ey);
58  void setEz(float Ez);
59 
60  float getEx() const;
61  float getEy() const;
62  float getEz() const;
63 
67  bool operator==(const EFieldVector &right) const;
68 
73  bool operator<(const EFieldVector &right) const; // needed for STL containers
74 
75  EFieldVector& operator=(const EFieldVector& that);
76 
78  static std::string getRevision();
79 
81  void print ( std::ostream& os = std::cout ) const;
82 
83  // -------- need to implement abstract methods from LCGenericObject
85  virtual const std::string getTypeName() const{
86  return std::string("EFieldVector");
87  }
88 
91  virtual const std::string getDataDescription() const{
92  return std::string("i:xBin,i:yBin,i:zBin,f:Ex,f:Ey,f:Ez");
93  }
94 
96  void setXBin(int xBin);
97 
99  void setYBin(int xBin);
100 
102  void setZBin(int zBin);
103 };
104 
108  std::ostream &operator<<(std::ostream &os, const EFieldVector &efv);
109 } //namespace marlintpc
110 
111 #endif // TPC_VOXEL2_H
void print(std::ostream &os=std::cout) const
Print the vector information.
Definition: EFieldVector.cc:92
int getXBin() const
Returns the xBin of the vector.
Definition: EFieldVector.cc:18
static std::string getRevision()
returns the svn revision of the code
Definition: EFieldVector.cc:139
bool operator<(const EFieldVector &right) const
< operator for e.g. sorting in STL containers.
Definition: EFieldVector.cc:58
void setZBin(int zBin)
Set the zBin, only called from the constructor.
Definition: EFieldVector.cc:117
virtual const std::string getTypeName() const
Implementation of the getTypeName method of LCGenericObject.
Definition: EFieldVector.h:85
void setXBin(int xBin)
Set the xBin, only called from the constructor.
Definition: EFieldVector.cc:106
bool operator==(const EFieldVector &right) const
Two voxels are equal if their pad index and time index are equal.
Definition: EFieldVector.cc:51
int getYBin() const
Returns the yBin of the vector.
Definition: EFieldVector.cc:24
std::ostream & operator<<(std::ostream &os, const EFieldVector &efv)
Operator to stream the vector information to an outstream:
Definition: EFieldVector.cc:101
int getZBin() const
Returns the zBin of the vector.
Definition: EFieldVector.cc:30
virtual const std::string getDataDescription() const
Implementation of the getDataDescripton method of LCGenericObject PadIndex, zBinare all ints...
Definition: EFieldVector.h:91
void setEx(float Ex)
Set the EField in the voxel.
Definition: EFieldVector.cc:123
void setYBin(int xBin)
Set the yBin, only called from the constructor.
Definition: EFieldVector.cc:111
Definition: EFieldVector.h:19