13#include "GeoModelKernel/throwExcept.h"
49 THROW_EXCEPTION(
"MdtChamberGeometry::setGeometry() - got called with nml="<<
m_nml<<
" which is definitely out of range.");
51 THROW_EXCEPTION(
"MdtChamberGeometry::setGeometry() - got called with nlay="<<
m_nlay<<
" which is definitely out of range");
53 THROW_EXCEPTION(
"MdtChamberGeometry::setGeometry() - got called with ntubesml0="<<
ntubesml0<<
" which is definitely out of range");
56 THROW_EXCEPTION(
"MdtChamberGeometry::setGeometry() - got called with ntubesml1="<<
ntubesml1<<
" which is definitely out of range");
81 msg <<MSG::ERROR <<
" Wrong index: ml " << ml <<
" max " <<
m_nml <<
endmsg;
87 msg <<MSG::ERROR <<
" Wrong index: lay " << lay <<
" max " <<
m_nlay <<
endmsg;
100 crossedTubes.reserve(50);
102 const LocVec2D& linepos = line.position();
103 const LocVec2D& linedir = line.direction();
104 double dxdy = std::abs(linedir.
y()) > 0.0001 ? linedir.
x() / linedir.
y() : linedir.
x() / 0.0001;
105 for (
unsigned int ml = 0; ml <
m_nml; ++ml) {
110 if (inMultilayer != -1 && inMultilayer != (
int)ml) {
continue; }
111 for (
unsigned int lay = 0; lay <
m_nlay; ++lay) {
113 double xfirsttube =
xPosTube(ml, lay, 0);
114 double xintersect = dxdy * (ylay - linepos.
y()) + linepos.
x();
115 double relpos = (xintersect - xfirsttube) /
m_tubeDist;
116 int ctube = (int)relpos;
117 if (ctube < 0) ctube = 0;
120 if (inMultilayer != -1)
122 for (
int i = ctube - 1; i >= 0; --i) {
138 for (
int i = ctube; i < (int)
m_ntubesml[ml]; ++i) {
167 msg << MSG::ALWAYS <<
" MdtChamberGeometry " <<
m_id <<std::endl
175 THROW_EXCEPTION(
"Combination of multilayer ml: "<<ml<<
", layer: "<<lay<<
" and tube: "<<tube<<
" given ");
std::pair< std::vector< unsigned int >, bool > res
static constexpr int maxNTubesPerLayer
The maxNTubesPerLayer represents the absolute maximum of tubes which are built into a single multilay...
bool isBarrel(const Identifier &id) const
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
virtual bool issMdt(const Identifier &id) const =0
returns whether this is a sMDT Identifier or not
virtual const MdtIdHelper & mdtIdHelper() const =0
access to MdtIdHelper
@ EmptyTube
drift time too large to be compatible with drift spectrum
Implementation of 2 dimensional vector class.
double y() const
Returns the y coordinate of the vector.
double x() const
Returns the x coordinate of the vector.
void print(MsgStream &msg) const override
LocVec2D tubePosition(unsigned int ml, unsigned int lay, unsigned int tube) const override
double xPosTube(unsigned int ml, unsigned int lay, unsigned int tube) const
unsigned int ntubesml0() const
void setGeometry(unsigned int nml, unsigned int nlay, unsigned int ntubesml0, unsigned int ntubesml1, const LocVec2D &tube0ml0, const LocVec2D &tube0ml1, double tubeDist, double tubeStage, double layDist, double stationTheta)
unsigned int nlay() const override
std::vector< unsigned int > m_ntubesml
bool m_isSecondMultiLayer
double stationTheta() const override
bool validId(unsigned int ml, unsigned int lay, unsigned int tube) const
std::vector< bool > m_wasInit
unsigned int ntubesml1() const
std::vector< LocVec2D > m_firstTube
DCVec tubesPassedByLine(const Line &line, int ml) const
double yPosTube(unsigned int ml, unsigned int lay) const
double residual(const LocVec2D &pos) const
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)
Function object to check whether two Segments are sub/super sets or different.
std::vector< DriftCircle > DCVec
void stable_sort(DataModel_detail::iterator< DVL > beg, DataModel_detail::iterator< DVL > end)
Specialization of stable_sort for DataVector/List.
#define THROW_EXCEPTION(MESSAGE)