42 (
const std::string&
t,
const std::string&
n,
const IInterface*
p)
45 declareInterface<ITRT_DetElementsRoadMaker>(
this);
99 std::string s1;
for(
int i=0;
i<
n; ++
i) s1.append(
" "); s1.append(
"|");
101 std::string fieldmode[9] ={
"NoField" ,
"ConstantField",
"SolenoidalField",
102 "ToroidalField" ,
"Grid3DField" ,
"RealisticField" ,
103 "UndefinedField",
"AthenaField" ,
"?????" };
110 fieldCondObj->getInitializedCache (fieldCache);
115 if(mode<0 || mode>8 )
mode = 8;
117 n = 62-fieldmode[
mode].size();
118 std::string
s3;
for(
int i=0;
i<
n; ++
i)
s3.append(
" ");
s3.append(
"|");
127 out<<
"|----------------------------------------------------------------------"
128 <<
"-------------------|"
130 out<<
"| Tool for propagation | "<<
m_proptool.type()<<s1<<std::endl;
131 out<<
"| Magnetic field mode | "<<fieldmode[
mode]<<
s3<<std::endl;
132 out<<
"| Width of the road (mm) | "
133 <<std::setw(12)<<std::setprecision(5)<<
m_width
135 out<<
"|----------------------------------------------------------------------"
136 <<
"-------------------|"
142 int nl =
layer[1].size();
144 for(
const auto &
i :
layer[1])
nc+=
i.nElements();
145 out<<
"|----------------------------------------------------------------|"
147 out<<
"| Barrel map containt "
148 <<std::setw(4)<<nl<<
" layers and "
149 <<std::setw(6)<<
nc<<
" elements |"
151 out<<
"|------|-----------|------------|------------|------------|------|"
153 out<<
"| n | R | Z min | Z max | max dF | nEl |"
155 out<<
"|------|-----------|------------|------------|------------|------|"
157 for(
unsigned int i=0;
i!=
layer[1].size(); ++
i) {
161 <<std::setw(4)<<
i<<
" |"
162 <<std::setw(10)<<std::setprecision(4)<<
layer[1][
i].r ()<<
" | "
163 <<std::setw(10)<<std::setprecision(4)<<
zmin<<
" | "
164 <<std::setw(10)<<std::setprecision(4)<<
zmax<<
" | "
165 <<std::setw(10)<<std::setprecision(4)<<
layer[1][
i].dfe()<<
" | "
166 <<std::setw(4)<<
layer[1][
i].nElements()<<
" | "
169 out<<
"|------|-----------|------------|------------|------------|------|"
175 int nl =
layer[0].size();
177 for(
const auto &
i :
layer[0])
nc+=
i.nElements();
178 out<<
"|----------------------------------------------------------------|"
180 out<<
"| L.Endcap map containt "
181 <<std::setw(4)<<nl<<
" layers and "
182 <<std::setw(6)<<
nc<<
" elements |"
185 out<<
"|------|-----------|------------|------------|------------|------|"
187 out<<
"| n | Z | R min | R max | max dF | nEl |"
189 out<<
"|------|-----------|------------|------------|------------|------|"
191 for(
unsigned int i=0;
i!=
layer[0].size(); ++
i) {
195 <<std::setw(4)<<
i<<
" |"
196 <<std::setw(10)<<std::setprecision(4)<<
layer[0][
i].z()<<
" | "
197 <<std::setw(10)<<std::setprecision(4)<< rmin<<
" | "
198 <<std::setw(10)<<std::setprecision(4)<< rmax<<
" | "
199 <<std::setw(10)<<std::setprecision(4)<<
layer[0][
i].dfe()<<
" | "
200 <<std::setw(4)<<
layer[0][
i].nElements()<<
" | "
203 out<<
"|------|-----------|------------|------------|------------|------|"
207 int nl =
layer[2].size();
209 for(
const auto &
i :
layer[2])
nc+=
i.nElements();
210 out<<
"|----------------------------------------------------------------|"
212 out<<
"| R.Endcap map containt "
213 <<std::setw(4)<<nl<<
" layers and "
214 <<std::setw(6)<<
nc<<
" elements |"
216 out<<
"|------|-----------|------------|------------|------------|------|"
218 out<<
"| n | Z | R min | R max | max dF | nEl |"
220 out<<
"|------|-----------|------------|------------|------------|------|"
222 for(
unsigned int i=0;
i!=
layer[2].size(); ++
i) {
226 <<std::setw(4)<<
i<<
" |"
227 <<std::setw(10)<<std::setprecision(4)<<
layer[2][
i].z()<<
" | "
228 <<std::setw(10)<<std::setprecision(4)<< rmin<<
" | "
229 <<std::setw(10)<<std::setprecision(4)<< rmax<<
" | "
230 <<std::setw(10)<<std::setprecision(4)<<
layer[2][
i].dfe()<<
" | "
231 <<std::setw(4)<<
layer[2][
i].nElements()<<
" | "
234 out<<
"|------|-----------|------------|------------|------------|------|"
246 out<<
"|--------------------------------------------------------------------|"
248 out<<
"| Road size | "<<std::setw(12)<<size_road
250 out<<
"|--------------------------------------------------------------------|"
268 std::vector<const InDetDD::TRT_BaseElement*>
270 (
const EventContext& ctx,
275 double qp = std::abs(500.*Tp.parameters()[4]) ;
276 if( qp < 1.
e-10 ) qp = 1.e-10;
278 if(
S > 200. )
S = 200. ;
282 std::vector<const InDetDD::TRT_BaseElement*>
result;
283 if( CB.r() > rminTRT) {
287 std::deque<Amg::Vector3D>
G;
303 (std::deque<Amg::Vector3D>& GP,
304 std::vector<const InDetDD::TRT_BaseElement*>& Road,
306 const EventContext& ctx)
const
316 float(std::sqrt((*g).x()*(*g).x()+(*g).y()*(*g).y())),
m_width,0.};
322 std::vector<std::pair<const InDet::TRT_DetElementLink_xk*,float> > lDE;
323 for (
unsigned int module_i = 0; module_i < 3; ++module_i) {
324 size_t layersSize =
layer[module_i].size();
326 used[module_i].resize(layersSize);
327 for (
unsigned int layer_i = 0; layer_i < layersSize; ++layer_i) {
330 used[module_i][layer_i].clear();
332 used[module_i][layer_i].resize(
layer[module_i][layer_i].nElements());
336 for(++
g;
g!=ge; ++
g) {
339 float(std::sqrt((*g).x()*(*g).x()+(*g).y()*(*g).y()))};
341 float dx = Pn[0]-Po[0];
342 float dy = Pn[1]-Po[1];
343 float dz = Pn[2]-Po[2];
344 float st = std::sqrt(
dx*
dx+
dy*
dy+dz*dz);
345 if(st <=0.)
continue;
356 assert(
used.at(1).size() >
static_cast<unsigned int>(
n1));
360 for (--
n1;
n1 >= 0; --
n1) {
363 assert(
used.at(1).size() >
static_cast<unsigned int>(
n1));
374 if (Pn[2] <
layer[2][n2].
z())
376 assert(
used.at(2).size() >
static_cast<unsigned int>(n2));
377 layer[2][n2].getEndcapDetElements(Po,
A, lDE,
used[2][n2]);
380 for (--n2; n2 >= 0; --n2) {
381 if (Pn[2] >
layer[2][n2].
z())
383 assert(
used.at(2).size() >
static_cast<unsigned int>(n2));
384 layer[2][n2].getEndcapDetElements(Po,
A, lDE,
used[2][n2]);
394 if (Pn[2] >
layer[0][n0].
z())
396 assert(
used.at(0).size() >
static_cast<unsigned int>(n0));
397 layer[0][n0].getEndcapDetElements(Po,
A, lDE,
used[0][n0]);
400 for (--n0; n0 >= 0; --n0) {
401 if (Pn[2] <
layer[0][n0].
z())
403 assert(
used.at(0).size() >
static_cast<unsigned int>(n0));
404 layer[0][n0].getEndcapDetElements(Po,
A, lDE,
used[0][n0]);
417 std::vector<std::pair<const InDet::TRT_DetElementLink_xk*,float> >
::iterator l=lDE.begin(),le=lDE.end(),
n,
m;
424 for(++
n;
n!=le; ++
n) {
426 if( (*m).second > (*n).second ) {
427 std::pair<const InDet::TRT_DetElementLink_xk*,float>
d=(*m); (*m)=(*n); (*n)=
d;
nc=
true;
435 for(
l=lDE.begin();
l!=le; ++
l) {
436 Road.push_back((*l).first->detElement());
446 (std::deque<Amg::Vector3D>& GP,
447 std::vector<const InDetDD::TRT_BaseElement*>& Road,
449 const EventContext& ctx)
const
457 float(std::sqrt((*g).x()*(*g).x()+(*g).y()*(*g).y())),
m_width,0.};
461 std::vector<std::pair<const InDet::TRT_DetElementLink_xk*,float> > lDE;
462 for (
unsigned int module_i = 0; module_i < 3; ++module_i) {
463 size_t layersSize =
layer[module_i].size();
465 used[module_i].resize(layersSize);
466 for (
unsigned int layer_i = 0; layer_i < layersSize; ++layer_i) {
469 used[module_i][layer_i].clear();
471 used[module_i][layer_i].resize(
layer[module_i][layer_i].nElements());
475 for(++
g;
g!=ge; ++
g) {
478 float(std::sqrt((*g).x()*(*g).x()+(*g).y()*(*g).y()))};
480 float dx = Pn[0]-Po[0];
481 float dy = Pn[1]-Po[1];
482 float dz = Pn[2]-Po[2];
483 float st = std::sqrt(
dx*
dx+
dy*
dy+dz*dz);
492 assert(
used.at(1).size() >
static_cast<unsigned int>(
n1) );
507 std::vector<std::pair<const InDet::TRT_DetElementLink_xk*, float> >
::iterator l=lDE.begin(),le=lDE.end(),
n;
514 for(++
n;
n!=le; ++
n) {
516 if( (*l).second > (*n).second ) {
517 std::pair<const InDet::TRT_DetElementLink_xk*,float>
d = (*l); (*l) = (*n); (*n) =
d;
526 for(
l=lDE.begin();
l!=le; ++
l) {
527 Road.push_back((*l).first->detElement());
540 double D =
a.x()*
A.x()+
a.y()*
A.y()+
a.z()*
A.z();
if(D==0.)
return D;
541 return ((
A.x()*(R.x()-
r.x())+
A.y()*(R.y()-
r.y())+
A.z()*(R.z()-
r.z()))/D);
551 const double cor = 0.8;
558 zfield = 299.7925*
f[2];
563 if( std::abs(zfield) < .0000001 )
return bounds;
565 const AmgVector(5)& Vp = Tp.parameters();
569 if( std::abs(
cur)*bounds.
r() < cor )
return bounds;
572 if(cor*std::abs(
rad) > bounds.
r() )
return bounds;
575 double sn,cs; sincos(Vp[2],&sn,&cs);
576 double xc = Gp.x()+sn*
rad ;
577 double yc = Gp.y()-cs*
rad ;
578 double rm = (std::sqrt(xc*xc+yc*yc)+std::abs(
rad))*cor;
579 if( rm > bounds.
r() )
return bounds;