 |
ATLAS Offline Software
|
Go to the documentation of this file.
13 #include "GeoModelKernel/throwExcept.h"
23 unsigned int ntubesml1,
const LocVec2D& tube0ml0,
const LocVec2D& tube0ml1,
double tubeDist,
24 double tubeStage,
double layDist,
double stationTheta) :
27 m_sMdt = idHelperSvc->issMdt(
id);
28 m_isBarrel = idHelperSvc->mdtIdHelper().isBarrel(
id);
30 setGeometry(nml, nlay, ntubesml0, ntubesml1, tube0ml0, tube0ml1, tubeDist, tubeStage, layDist, stationTheta);
34 const LocVec2D& tube0ml0,
const LocVec2D& tube0ml1,
double tubeDist,
double tubeStage,
35 double layDist,
double stationTheta) {
48 if (m_nml < 1 || m_nml > 2)
49 THROW_EXCEPTION(
"MdtChamberGeometry::setGeometry() - got called with nml="<<
m_nml<<
" which is definitely out of range.");
50 if (m_nlay < 1 || m_nlay > 4)
51 THROW_EXCEPTION(
"MdtChamberGeometry::setGeometry() - got called with nlay="<<
m_nlay<<
" which is definitely out of range");
52 if (ntubesml0 < 1 || ntubesml0 > maxNTubesPerLayer)
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);
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) {
124 double res = resLine.residual(lp);
140 double res = resLine.residual(lp);
163 std::stable_sort(crossedTubes.begin(), crossedTubes.end(),
SortDcsByY());
175 THROW_EXCEPTION(
"Combination of multilayer ml: "<<ml<<
", layer: "<<lay<<
" and tube: "<<
tube<<
" given ");
void print(MsgStream &msg) const override
bool m_isSecondMultiLayer
singleton-like access to IMessageSvc via open function and helper
double yPosTube(unsigned int ml, unsigned int lay) const
unsigned int ntubesml1() const
std::vector< unsigned int > m_ntubesml
Function object to check whether two Segments are sub/super sets or different.
double x() const
Returns the x coordinate of the vector.
IMessageSvc * getMessageSvc(bool quiet=false)
Implementation of 2 dimensional vector class.
std::vector< DriftCircle > DCVec
unsigned int ntubesml0() const
std::vector< LocVec2D > m_firstTube
std::pair< std::vector< unsigned int >, bool > res
double y() const
Returns the y coordinate of the vector.
double stationTheta() const override
std::vector< bool > m_wasInit
double xPosTube(unsigned int ml, unsigned int lay, unsigned int tube) const
def init(v_theApp, v_rootStream=None)
#define THROW_EXCEPTION(MESSAGE)
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)
DCVec tubesPassedByLine(const Line &line, int ml) const
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
@ EmptyTube
drift time too large to be compatible with drift spectrum
LocVec2D tubePosition(unsigned int ml, unsigned int lay, unsigned int tube) const override
static constexpr int maxNTubesPerLayer
The maxNTubesPerLayer represents the absolute maximum of tubes which are built into a single multilay...
unsigned int nlay() const override
bool validId(unsigned int ml, unsigned int lay, unsigned int tube) const