ATLAS Offline Software
Loading...
Searching...
No Matches
ForwardDetectors
FPTracker
src
EmptySpaceElement.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
FPTracker/EmptySpaceElement.h
"
6
#include "
FPTracker/Particle.h
"
7
#include <sstream>
8
#include <cmath>
9
#include <iostream>
10
11
namespace
FPTracker
{
12
13
EmptySpaceElement::EmptySpaceElement
(
double
front,
double
back,
const
TransversePoint
& beamAxis,
Side
side
):
14
m_frontFace
(front),
m_rearFace
(back),
15
m_signedLength
(
m_rearFace
-
m_frontFace
),
16
m_absLength
(
std
::fabs(
m_signedLength
)),
17
m_pos
( beamAxis.
x
(), beamAxis.
y
(), front+0.5*
m_signedLength
),
18
m_label
(
"Spacer"
),
m_side
(
side
){
19
}
20
21
EmptySpaceElement::EmptySpaceElement
(
const
IBeamElement::ConstPtr_t
& p,
const
IBeamElement::ConstPtr_t
& c):
22
m_frontFace
(p->
rearFace
()),
m_rearFace
(c->
frontFace
()),
m_signedLength
(
m_rearFace
-
m_frontFace
),
23
m_absLength
(
std
::fabs(
m_signedLength
)),
24
m_pos
( p->
position
() ),
25
m_label
(
"Spacer"
),
m_side
(c->
side
()){
26
}
27
28
IBeamElement::ConstPtr_t
EmptySpaceElement::clone
()
const
{
29
IBeamElement::ConstPtr_t
pbe(
new
EmptySpaceElement
(*
this
));
30
return
pbe;
31
}
32
33
double
EmptySpaceElement::frontFace
()
const
{
return
m_frontFace
;}
34
double
EmptySpaceElement::rearFace
()
const
{
return
m_rearFace
;}
35
std::string
EmptySpaceElement::label
()
const
{
return
m_label
;}
36
double
EmptySpaceElement::zsignedpos
()
const
{
return
m_frontFace
+
/*0.5* */
m_signedLength
;}
//Added dpelikan @ 110308
37
double
EmptySpaceElement::zabspos
()
const
{
return
std::fabs(this->
zsignedpos
());}
38
Point
EmptySpaceElement::position
()
const
{
return
m_pos
;}
39
Side
EmptySpaceElement::side
()
const
{
return
m_side
;}
40
bool
EmptySpaceElement::isEndElement
()
const
{
return
false
;}
41
42
void
EmptySpaceElement::track
(
IParticle
& particle)
const
43
{
44
//Added dpelikan @ 110308
45
double
TransLength=
m_absLength
-(std::abs(particle.position().z())-std::abs(
m_frontFace
));
46
//std::cout<<m_absLength<<"\t"<<TransLength<<std::endl;
47
48
particle.setBeamCoordinateShift(
this
);
49
50
51
52
//particle.position() += m_absLength*particle.direction();
53
particle.position() += TransLength*particle.direction();
54
particle.position()[2] =
m_rearFace
;
55
56
}
57
58
void
EmptySpaceElement::calibrate
(
IParticle
& particle)
59
{
60
return
this->
track
(particle);
61
}
62
63
std::string
EmptySpaceElement::str
()
const
{
64
65
std::ostringstream ost;
66
ost <<
" \n\n-- EmptySpaceElement --\n"
67
<<
"frontFace "
<<
m_frontFace
<<
'\n'
68
<<
"rearFace "
<<
m_rearFace
<<
'\n'
;
69
return
ost.str();
70
}
71
72
EmptySpaceElement::~EmptySpaceElement
(){}
73
/*
74
double EmptySpaceElement::rearFace() const {return 0.;}
75
double EmptySpaceElement::frontFace() const {return 0.;}
76
std::string EmptySpaceElement::label() const {return "";}
77
double EmptySpaceElement::zsignedpos() const {return 0.;}
78
double EmptySpaceElement::zabspos() const {return 0.;}
79
Point EmptySpaceElement::position() const {return Point(0., 0., 0.);}
80
int EmptySpaceElement::side() const {return 0;}
81
bool EmptySpaceElement::isEndElement() const {return false;}
82
void EmptySpaceElement::track(Particle& particle) const {}
83
84
std::string EmptySpaceElement::str() const {return " ";}
85
*/
86
87
}
88
EmptySpaceElement.h
Particle.h
y
#define y
x
#define x
FPTracker::EmptySpaceElement::m_absLength
double m_absLength
Definition
EmptySpaceElement.h:53
FPTracker::EmptySpaceElement::clone
IBeamElement::ConstPtr_t clone() const
Definition
EmptySpaceElement.cxx:28
FPTracker::EmptySpaceElement::str
std::string str() const
Definition
EmptySpaceElement.cxx:63
FPTracker::EmptySpaceElement::m_rearFace
double m_rearFace
Definition
EmptySpaceElement.h:51
FPTracker::EmptySpaceElement::zabspos
double zabspos() const
Definition
EmptySpaceElement.cxx:37
FPTracker::EmptySpaceElement::track
void track(IParticle &) const
Definition
EmptySpaceElement.cxx:42
FPTracker::EmptySpaceElement::zsignedpos
double zsignedpos() const
Definition
EmptySpaceElement.cxx:36
FPTracker::EmptySpaceElement::side
Side side() const
Definition
EmptySpaceElement.cxx:39
FPTracker::EmptySpaceElement::rearFace
double rearFace() const
Definition
EmptySpaceElement.cxx:34
FPTracker::EmptySpaceElement::calibrate
void calibrate(IParticle &)
Definition
EmptySpaceElement.cxx:58
FPTracker::EmptySpaceElement::position
Point position() const
Definition
EmptySpaceElement.cxx:38
FPTracker::EmptySpaceElement::~EmptySpaceElement
~EmptySpaceElement()
Definition
EmptySpaceElement.cxx:72
FPTracker::EmptySpaceElement::m_signedLength
double m_signedLength
Definition
EmptySpaceElement.h:52
FPTracker::EmptySpaceElement::m_side
Side m_side
Definition
EmptySpaceElement.h:56
FPTracker::EmptySpaceElement::frontFace
double frontFace() const
Definition
EmptySpaceElement.cxx:33
FPTracker::EmptySpaceElement::EmptySpaceElement
EmptySpaceElement(double front, double back, const TransversePoint &beamAxis, Side side)
Definition
EmptySpaceElement.cxx:13
FPTracker::EmptySpaceElement::label
std::string label() const
Definition
EmptySpaceElement.cxx:35
FPTracker::EmptySpaceElement::m_label
std::string m_label
Definition
EmptySpaceElement.h:55
FPTracker::EmptySpaceElement::m_pos
Point m_pos
Definition
EmptySpaceElement.h:54
FPTracker::EmptySpaceElement::isEndElement
bool isEndElement() const
Definition
EmptySpaceElement.cxx:40
FPTracker::EmptySpaceElement::m_frontFace
double m_frontFace
Definition
EmptySpaceElement.h:50
FPTracker::IBeamElement::ConstPtr_t
std::shared_ptr< const IBeamElement > ConstPtr_t
Definition
FPTracker/FPTracker/IBeamElement.h:40
FPTracker::IParticle
Definition
ForwardDetectors/FPTracker/FPTracker/IParticle.h:17
FPTracker::Point
Definition
FPTracker/FPTracker/Point.h:14
FPTracker::TransversePoint
Definition
FPTracker/FPTracker/TransversePoint.h:12
FPTracker
Definition
FPTracker/FPTracker/Beamline.h:12
FPTracker::Side
Side
Definition
FPTrackerConstants.h:12
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.14.0