#include <MaterialAccountingStep.h>
Public Member Functions | |
void | clear (void) |
double | energyLoss (void) const |
const GlobalPoint & | in (void) const |
double | length (void) const |
MaterialAccountingStep (double position, double radlen, double loss, const GlobalPoint &in, const GlobalPoint &out) | |
MaterialAccountingStep (void) | |
MaterialAccountingStep & | operator*= (const MaterialAccountingStep &step) |
multiply two steps, usefull to implement (co)variance | |
MaterialAccountingStep & | operator*= (double x) |
multiply by a scalar | |
MaterialAccountingStep & | operator+= (const MaterialAccountingStep &step) |
add a step | |
MaterialAccountingStep & | operator-= (const MaterialAccountingStep &step) |
subtract a step | |
MaterialAccountingStep & | operator/= (double x) |
divide by a scalar | |
MaterialAccountingStep & | operator= (const MaterialAccountingStep &step) |
assignement operator | |
const GlobalPoint & | out (void) const |
double | radiationLengths (void) const |
std::pair < MaterialAccountingStep, MaterialAccountingStep > | split (double fraction) const |
split the step (0..1) in (0..f) + (f..1) using linear interpolation | |
Private Attributes | |
double | m_energyLoss |
GlobalPoint | m_in |
double | m_length |
GlobalPoint | m_out |
double | m_radiationLengths |
Definition at line 9 of file MaterialAccountingStep.h.
MaterialAccountingStep::MaterialAccountingStep | ( | void | ) | [inline] |
Definition at line 11 of file MaterialAccountingStep.h.
: m_length(0.), m_radiationLengths(0.), m_energyLoss(0.), m_in(), m_out() { }
MaterialAccountingStep::MaterialAccountingStep | ( | double | position, |
double | radlen, | ||
double | loss, | ||
const GlobalPoint & | in, | ||
const GlobalPoint & | out | ||
) | [inline] |
Definition at line 19 of file MaterialAccountingStep.h.
: m_length( position ), m_radiationLengths( radlen ), m_energyLoss( loss ), m_in( in ), m_out( out ) { }
void MaterialAccountingStep::clear | ( | void | ) | [inline] |
Definition at line 27 of file MaterialAccountingStep.h.
References m_energyLoss, m_in, m_length, m_out, and m_radiationLengths.
Referenced by MaterialAccountingDetector::clear(), and MaterialAccountingTrack::reset().
{ m_length = 0.; m_radiationLengths = 0.; m_energyLoss = 0.; m_in = GlobalPoint(); m_out = GlobalPoint(); }
double MaterialAccountingStep::energyLoss | ( | void | ) | const [inline] |
Definition at line 51 of file MaterialAccountingStep.h.
References m_energyLoss.
Referenced by MaterialAccountingGroup::averageEnergyLoss(), TrackingMaterialPlotter::plotSegmentInLayer(), TrackingMaterialPlotter::plotSegmentUnassigned(), MaterialAccountingGroup::sigmaEnergyLoss(), and TrackingMaterialProducer::update().
{ return m_energyLoss; }
const GlobalPoint& MaterialAccountingStep::in | ( | void | ) | const [inline] |
Definition at line 55 of file MaterialAccountingStep.h.
References m_in.
Referenced by TrackingMaterialPlotter::plotSegmentInLayer(), and TrackingMaterialPlotter::plotSegmentUnassigned().
{ return m_in; }
double MaterialAccountingStep::length | ( | void | ) | const [inline] |
Definition at line 43 of file MaterialAccountingStep.h.
References m_length.
Referenced by MaterialAccountingGroup::averageLength(), MaterialAccountingTrack::enterDetector(), MaterialAccountingTrack::leaveDetector(), TrackingMaterialPlotter::plotSegmentInLayer(), TrackingMaterialPlotter::plotSegmentUnassigned(), MaterialAccountingGroup::sigmaLength(), TrackingMaterialAnalyser::split(), and TrackingMaterialProducer::update().
{ return m_length; }
MaterialAccountingStep& MaterialAccountingStep::operator*= | ( | const MaterialAccountingStep & | step | ) | [inline] |
multiply two steps, usefull to implement (co)variance
Definition at line 129 of file MaterialAccountingStep.h.
References m_energyLoss, m_length, and m_radiationLengths.
{ m_length *= step.m_length; m_radiationLengths *= step.m_radiationLengths; m_energyLoss *= step.m_energyLoss; return *this; }
MaterialAccountingStep& MaterialAccountingStep::operator*= | ( | double | x | ) | [inline] |
multiply by a scalar
Definition at line 137 of file MaterialAccountingStep.h.
References m_energyLoss, m_length, m_radiationLengths, and x.
{ m_length *= x; m_radiationLengths *= x; m_energyLoss *= x; return *this; }
MaterialAccountingStep& MaterialAccountingStep::operator+= | ( | const MaterialAccountingStep & | step | ) | [inline] |
add a step
Definition at line 97 of file MaterialAccountingStep.h.
References m_energyLoss, m_in, m_length, m_out, m_radiationLengths, and PV3DBase< T, PVType, FrameType >::perp2().
{ m_length += step.m_length; m_radiationLengths += step.m_radiationLengths; m_energyLoss += step.m_energyLoss; // assume that perp2 is 0 only for uninitialized steps if ((m_in.perp2() == 0.0) or (step.m_in.perp2() < m_in.perp2())) m_in = step.m_in; if ((m_out.perp2() == 0.0) or (step.m_out.perp2() > m_out.perp2())) m_out = step.m_out; return *this; }
MaterialAccountingStep& MaterialAccountingStep::operator-= | ( | const MaterialAccountingStep & | step | ) | [inline] |
subtract a step
Definition at line 113 of file MaterialAccountingStep.h.
References m_energyLoss, m_in, m_length, m_out, m_radiationLengths, and PV3DBase< T, PVType, FrameType >::perp2().
{ m_length -= step.m_length; m_radiationLengths -= step.m_radiationLengths; m_energyLoss -= step.m_energyLoss; // can anything more sensible be done for m_in and/or m_out ? if ((step.m_in.perp2() <= m_in.perp2()) and (step.m_out.perp2() >= m_in.perp2())) m_in = step.m_out; if ((step.m_out.perp2() >= m_out.perp2()) and (step.m_in.perp2() <= m_out.perp2())) m_out = step.m_in; return *this; }
MaterialAccountingStep& MaterialAccountingStep::operator/= | ( | double | x | ) | [inline] |
divide by a scalar
Definition at line 145 of file MaterialAccountingStep.h.
References m_energyLoss, m_length, m_radiationLengths, and x.
{ m_length /= x; m_radiationLengths /= x; m_energyLoss /= x; return *this; }
MaterialAccountingStep& MaterialAccountingStep::operator= | ( | const MaterialAccountingStep & | step | ) | [inline] |
assignement operator
Definition at line 87 of file MaterialAccountingStep.h.
References m_energyLoss, m_in, m_length, m_out, and m_radiationLengths.
{ m_length = step.m_length; m_radiationLengths = step.m_radiationLengths; m_energyLoss = step.m_energyLoss; m_in = step.m_in; m_out = step.m_out; return *this; }
const GlobalPoint& MaterialAccountingStep::out | ( | void | ) | const [inline] |
Definition at line 59 of file MaterialAccountingStep.h.
References m_out.
Referenced by TrackingMaterialPlotter::plotSegmentInLayer(), and TrackingMaterialPlotter::plotSegmentUnassigned().
{ return m_out; }
double MaterialAccountingStep::radiationLengths | ( | void | ) | const [inline] |
Definition at line 47 of file MaterialAccountingStep.h.
References m_radiationLengths.
Referenced by MaterialAccountingGroup::averageRadiationLengths(), TrackingMaterialPlotter::plotSegmentInLayer(), TrackingMaterialPlotter::plotSegmentUnassigned(), MaterialAccountingGroup::sigmaRadiationLengths(), and TrackingMaterialProducer::update().
{ return m_radiationLengths; }
std::pair<MaterialAccountingStep, MaterialAccountingStep> MaterialAccountingStep::split | ( | double | fraction | ) | const [inline] |
split the step (0..1) in (0..f) + (f..1) using linear interpolation
Definition at line 64 of file MaterialAccountingStep.h.
References MessageLogger_cff::limit, m_energyLoss, m_in, m_length, m_out, m_radiationLengths, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by TrackingMaterialAnalyser::split().
{ // no check is done to ensure that 0 <= f <= 1 ! GlobalPoint limit( m_in.x() * fraction + m_out.x() * (1. - fraction), m_in.y() * fraction + m_out.y() * (1. - fraction), m_in.z() * fraction + m_out.z() * (1. - fraction) ); MaterialAccountingStep part1( fraction * m_length, fraction * m_radiationLengths, fraction * m_energyLoss, m_in, limit ); MaterialAccountingStep part2( (1 - fraction) * m_length, (1 - fraction) * m_radiationLengths, (1 - fraction) * m_energyLoss, limit, m_out ); return std::make_pair( part1, part2 ); }
double MaterialAccountingStep::m_energyLoss [private] |
Definition at line 38 of file MaterialAccountingStep.h.
Referenced by clear(), energyLoss(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), and split().
GlobalPoint MaterialAccountingStep::m_in [private] |
Definition at line 39 of file MaterialAccountingStep.h.
Referenced by clear(), in(), operator+=(), operator-=(), operator=(), and split().
double MaterialAccountingStep::m_length [private] |
Definition at line 36 of file MaterialAccountingStep.h.
Referenced by clear(), length(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), and split().
GlobalPoint MaterialAccountingStep::m_out [private] |
Definition at line 40 of file MaterialAccountingStep.h.
Referenced by clear(), operator+=(), operator-=(), operator=(), out(), and split().
double MaterialAccountingStep::m_radiationLengths [private] |
Definition at line 37 of file MaterialAccountingStep.h.
Referenced by clear(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), radiationLengths(), and split().