Belle II Software development
RealisticCDCGeometryTranslator.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 <cdc/translators/CDCGeometryTranslatorBase.h>
12#include <cdc/geometry/CDCGeometryPar.h>
13
14namespace Belle2 {
19 namespace CDC {
22 public:
24 explicit RealisticCDCGeometryTranslator(bool wireSag = false) : m_wireSag(wireSag) {}
25
28
30 const B2Vector3D getWireForwardPosition(const WireID& wireID) override
31 {
32 return CDCGeometryPar::Instance().wireForwardPosition(wireID, CDCGeometryPar::c_Aligned);
33 }
34
36 const B2Vector3D getWireForwardPosition(const WireID& wireID, float z) override
37 {
38 B2Vector3D wPos = (m_wireSag) ?
39 CDCGeometryPar::Instance().wireForwardPosition(wireID, z, CDCGeometryPar::c_Aligned) :
40 CDCGeometryPar::Instance().wireForwardPosition(wireID, CDCGeometryPar::c_Aligned);
41 return wPos;
42 }
43
45 const B2Vector3D getWireBackwardPosition(const WireID& wireID) override
46 {
47 return CDCGeometryPar::Instance().wireBackwardPosition(wireID, CDCGeometryPar::c_Aligned);
48 }
49
51 const B2Vector3D getWireBackwardPosition(const WireID& wireID, float z) override
52 {
53 B2Vector3D wPos = m_wireSag ?
54 CDCGeometryPar::Instance().wireBackwardPosition(wireID, z, CDCGeometryPar::c_Aligned) :
55 CDCGeometryPar::Instance().wireBackwardPosition(wireID, CDCGeometryPar::c_Aligned);
56 return wPos;
57 }
58
59 private:
66 };
67 }
69}
const B2Vector3D wireForwardPosition(uint layerId, int cellId, EWirePosition set=c_Base) const
Returns the forward position of the input sense wire.
const B2Vector3D wireBackwardPosition(uint layerId, int cellId, EWirePosition set=c_Base) const
Returns the backward position of the input sense wire.
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
Abstract Base class for the geometry translator.
This class uses the realistic detector geometry (the one after alignment procedure) for the translati...
const B2Vector3D getWireForwardPosition(const WireID &wireID, float z) override
Get virtual wire position at forward end, corresponding to tangent line to wire at input z-position.
bool m_wireSag
Flag to activate the sense wire sag effect.
const B2Vector3D getWireBackwardPosition(const WireID &wireID) override
Get wire position at backward end.
RealisticCDCGeometryTranslator(bool wireSag=false)
Constructor, with the additional parameter to control wire sag.
const B2Vector3D getWireBackwardPosition(const WireID &wireID, float z) override
Get virtual wire position at backward end, corresponding to tangent line to wire at input z-position.
const B2Vector3D getWireForwardPosition(const WireID &wireID) override
Get wire position at forward end.
Class to identify a wire inside the CDC.
Definition: WireID.h:34
Abstract base class for different kinds of events.