|
ATLAS Offline Software
|
Go to the documentation of this file.
13 #include "GeoModelHelpers/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");
85 msg <<MSG::ERROR <<
" Wrong index: ml " << ml <<
" max " <<
m_nml <<
endmsg;
91 msg <<MSG::ERROR <<
" Wrong index: lay " << lay <<
" max " <<
m_nlay <<
endmsg;
104 crossedTubes.reserve(50);
108 double dxdy = std::abs(linedir.
y()) > 0.0001 ? linedir.
x() / linedir.
y() : linedir.
x() / 0.0001;
109 for (
unsigned int ml = 0; ml <
m_nml; ++ml) {
114 if (inMultilayer != -1 && inMultilayer != (
int)ml) {
continue; }
115 for (
unsigned int lay = 0; lay <
m_nlay; ++lay) {
117 double xfirsttube =
xPosTube(ml, lay, 0);
118 double xintersect = dxdy * (ylay - linepos.
y()) + linepos.
x();
119 double relpos = (xintersect - xfirsttube) /
m_tubeDist;
120 int ctube = (
int)relpos;
121 if (ctube < 0) ctube = 0;
124 if (inMultilayer != -1)
126 for (
int i = ctube - 1;
i >= 0; --
i) {
128 double res = resLine.residual(lp);
144 double res = resLine.residual(lp);
167 std::stable_sort(crossedTubes.begin(), crossedTubes.end(),
SortDcsByY());
179 THROW_EXCEPTION(
"Combination of multilayer ml: "<<ml<<
", layer: "<<lay<<
" and tube: "<<
tube<<
" given ");
189 if (
m_nlay == 4 && ml == 1)
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.
#define THROW_EXCEPTION(MSG)
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)
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