ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 ....
48  IBeamElement::Iter_t tempIter = findBeamLineEnd(temp);
49  IBeamElement::Container_t temp2(temp.begin(), tempIter);
50 
51  m_elements.swap(temp2);
52  }

◆ 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  }

◆ 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  }

◆ 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:
FPTracker::IBeamElement::Container_t
std::vector< Ptr_t > Container_t
Definition: FPTracker/FPTracker/IBeamElement.h:43
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
FPTracker::Beamline::m_elements
IBeamElement::Container_t m_elements
Definition: FPTracker/FPTracker/Beamline.h:27
FPTracker::Beamline::swap
void swap(Beamline &other)
Definition: FPTracker/src/Beamline.cxx:67
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
FPTracker::findBeamLineEnd
IBeamElement::Iter_t findBeamLineEnd(IBeamElement::Container_t &container)
Definition: FPTracker/src/Beamline.cxx:22
FPTracker::IBeamElement::Iter_t
Container_t::iterator Iter_t
Definition: FPTracker/FPTracker/IBeamElement.h:44
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
FPTracker::IBeamElement::ConstIter_t
Container_t::const_iterator ConstIter_t
Definition: FPTracker/FPTracker/IBeamElement.h:45