ATLAS Offline Software
Loading...
Searching...
No Matches
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
7#include <sstream>
8#include <cmath>
9#include <iostream>
10
11namespace FPTracker{
12
13 EmptySpaceElement::EmptySpaceElement(double front, double back, const TransversePoint& beamAxis, Side side):
14 m_frontFace(front), m_rearFace(back),
17 m_pos( beamAxis.x(), beamAxis.y(), front+0.5*m_signedLength),
18 m_label("Spacer"), m_side(side){
19 }
20
27
32
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());}
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
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
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
#define y
#define x
IBeamElement::ConstPtr_t clone() const
void track(IParticle &) const
EmptySpaceElement(double front, double back, const TransversePoint &beamAxis, Side side)
std::shared_ptr< const IBeamElement > ConstPtr_t
STL namespace.