Belle II Software  release-08-01-10
CDCDisplacement.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 #include <TObject.h>
12 #include <TVector3.h>
13 #include <cdc/dataobjects/WireID.h>
14 
15 
16 namespace Belle2 {
25  class CDCDisplacement: public TObject {
26  public:
27 
32  m_wire(65535), m_fwd(), m_bwd(), m_tension()
33  {
34  }
35 
36 
40  CDCDisplacement(const WireID& wire, TVector3 fwd, TVector3 bwd, float tension) :
41  m_wire(wire), m_fwd(fwd), m_bwd(bwd), m_tension(tension)
42  {
43  }
44 
46  unsigned short getEWire() const
47  {
48  return m_wire;
49  }
50 
51  //TODO: remove the following 4 functions (not needed).
52 
54  unsigned short getISuperLayer() const
55  {
56  return (m_wire / 4096);
57  }
58 
60  unsigned short getILayer() const
61  {
62  return ((m_wire % 4096) / 512);
63  }
64 
69  unsigned short getIWire() const
70  {
71  return (m_wire % 512);
72  }
73 
75  int getICLayer() const
76  {
77  if (getISuperLayer() == 0) { return getILayer(); }
78  return 8 + (getISuperLayer() - 1) * 6 + getILayer();
79  }
80 
82  float getXFwd() const {return m_fwd.X();}
83 
85  float getYFwd() const {return m_fwd.Y();}
86 
88  float getZFwd() const {return m_fwd.Z();}
89 
91  float getXBwd() const {return m_bwd.X();}
92 
94  float getYBwd() const {return m_bwd.Y();}
95 
97  float getZBwd() const {return m_bwd.Z();}
98 
100  float getTension() const {return m_tension;}
101 
102  private:
103  unsigned short m_wire;
104  //TODO: replace TVector3s with simple arrays to save memory.
105  TVector3 m_fwd;
106  TVector3 m_bwd;
107  float m_tension;
109  };
110 
112 } // end namespace Belle2
Database object for displacement of sense wire position.
unsigned short m_wire
Wire ID.
int getICLayer() const
Getter for continuous layer numbering.
float getXFwd() const
Getter for fwd x-position.
float getXBwd() const
Getter for bwd x-position.
float getYFwd() const
Getter for fwd y-position.
float getTension() const
Getter for wire tension.
float getZFwd() const
Getter for fwd z-position.
TVector3 m_fwd
Displacement of forward side.
TVector3 m_bwd
Displacement of backward side.
unsigned short getIWire() const
Getter for wire within the layer.
unsigned short getEWire() const
Getter for EWireID.
CDCDisplacement()
Default constructor.
ClassDef(CDCDisplacement, 3)
ClassDef.
float m_tension
Displacement of wire tension (grW)
float getZBwd() const
Getter for bwd z-position.
unsigned short getISuperLayer() const
Getter for Super-Layer.
CDCDisplacement(const WireID &wire, TVector3 fwd, TVector3 bwd, float tension)
Constructor.
float getYBwd() const
Getter for bwd y-position.
unsigned short getILayer() const
Getter for layer within the Super-Layer.
Class to identify a wire inside the CDC.
Definition: WireID.h:34
Abstract base class for different kinds of events.