ATLAS Offline Software
Loading...
Searching...
No Matches
FPTracker::Beamline Class Reference

#include <Beamline.h>

Collaboration diagram for FPTracker::Beamline:

Public Member Functions

 Beamline ()
 Beamline (IBeamElement::ListIter_t, IBeamElement::ListIter_t)
 Beamline (const Beamline &)
Beamlineoperator= (Beamline)
void track (IParticle &) const
void calibrate (IParticle &)
std::string str () const

Private Member Functions

void swap (Beamline &other)

Private Attributes

IBeamElement::Container_t m_elements

Detailed Description

Definition at line 15 of file FPTracker/FPTracker/Beamline.h.

Constructor & Destructor Documentation

◆ Beamline() [1/3]

FPTracker::Beamline::Beamline ( )

Definition at line 43 of file FPTracker/src/Beamline.cxx.

43{}

◆ Beamline() [2/3]

FPTracker::Beamline::Beamline ( IBeamElement::ListIter_t begin,
IBeamElement::ListIter_t end )

Definition at line 45 of file FPTracker/src/Beamline.cxx.

46 { // exception aware: attemt to create as a temp, if no exception, do safe swap ....
47 IBeamElement::Container_t temp(begin, end);
49 IBeamElement::Container_t temp2(temp.begin(), tempIter);
50
51 m_elements.swap(temp2);
52 }
IBeamElement::Container_t m_elements
IBeamElement::Iter_t findBeamLineEnd(IBeamElement::Container_t &container)

◆ Beamline() [3/3]

FPTracker::Beamline::Beamline ( const Beamline & rhs)

Definition at line 54 of file FPTracker/src/Beamline.cxx.

55 {
56
57 IBeamElement::Container_t temp = rhs.m_elements; // exception aware any exceptions occur here
58 m_elements.swap(temp); //nothrow op
59 }

Member Function Documentation

◆ calibrate()

void FPTracker::Beamline::calibrate ( IParticle & particle)

Definition at line 110 of file FPTracker/src/Beamline.cxx.

111 {
112 IBeamElement::Iter_t nextElement = std::lower_bound(m_elements.begin(),
113 m_elements.end(),
114 particle.z(),
115 zPosNextElement() );
116
117 // pass the particle to succesive beam elements until either it goes out of aperture, or it reaches the end plane.
118
120 for (iter = nextElement; iter!=m_elements.end(); ++iter) {
121 (*iter)->calibrate(particle);
122 if (particle.isOutOfAperture()) break;
123 }
124
125
126 if( iter != m_elements.end() )
127 {
128 std::ostringstream s;
129 s<<"Calibration particle did not reach end of beamline\n"<<particle<<'\n';
130 s<<"Particle stopped at beam element "<<**iter<<'\n';
131 throw std::runtime_error(s.str());
132 }
133
134 }
Container_t::const_iterator ConstIter_t
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses

◆ operator=()

Beamline & FPTracker::Beamline::operator= ( Beamline rhs)

Definition at line 61 of file FPTracker/src/Beamline.cxx.

62 {
63 this->swap(rhs);
64 return *this;
65 }
void swap(Beamline &other)

◆ str()

std::string FPTracker::Beamline::str ( ) const

Definition at line 159 of file FPTracker/src/Beamline.cxx.

159 {
160 return (std::for_each(m_elements.begin(), m_elements.end(), Stringer())).str();
161 }

◆ swap()

void FPTracker::Beamline::swap ( Beamline & other)
private

Definition at line 67 of file FPTracker/src/Beamline.cxx.

68 {
69 m_elements.swap(other.m_elements);
70 }

◆ track()

void FPTracker::Beamline::track ( IParticle & particle) const

Definition at line 94 of file FPTracker/src/Beamline.cxx.

94 {
95 IBeamElement::ConstIter_t nextElement = std::lower_bound(m_elements.begin(),
96 m_elements.end(),
97 particle.z(),
98 zPosNextElement() );
99
100 // pass the particle to succesive beam elements until either it goes out of aperture, or it reaches the end plane.
101 //cppcheck-suppress ignoredReturnValue
102 (void)std::find_if(nextElement,
103 m_elements.end(),
104 ParticleTracker(particle)
105 );
106
107 }

Member Data Documentation

◆ m_elements

IBeamElement::Container_t FPTracker::Beamline::m_elements
private

Definition at line 27 of file FPTracker/FPTracker/Beamline.h.


The documentation for this class was generated from the following files: