CMS 3D CMS Logo

Public Member Functions | Private Attributes

MaterialAccountingStep Class Reference

#include <MaterialAccountingStep.h>

List of all members.

Public Member Functions

void clear (void)
double energyLoss (void) const
const GlobalPointin (void) const
double length (void) const
 MaterialAccountingStep (double position, double radlen, double loss, const GlobalPoint &in, const GlobalPoint &out)
 MaterialAccountingStep (void)
MaterialAccountingStepoperator*= (const MaterialAccountingStep &step)
 multiply two steps, usefull to implement (co)variance
MaterialAccountingStepoperator*= (double x)
 multiply by a scalar
MaterialAccountingStepoperator+= (const MaterialAccountingStep &step)
 add a step
MaterialAccountingStepoperator-= (const MaterialAccountingStep &step)
 subtract a step
MaterialAccountingStepoperator/= (double x)
 divide by a scalar
MaterialAccountingStepoperator= (const MaterialAccountingStep &step)
 assignement operator
const GlobalPointout (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

Detailed Description

Definition at line 9 of file MaterialAccountingStep.h.


Constructor & Destructor Documentation

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 )
  { }

Member Function Documentation

void MaterialAccountingStep::clear ( void  ) [inline]
double MaterialAccountingStep::energyLoss ( void  ) const [inline]
const GlobalPoint& MaterialAccountingStep::in ( void  ) const [inline]
double MaterialAccountingStep::length ( void  ) const [inline]
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]
double MaterialAccountingStep::radiationLengths ( void  ) const [inline]
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 );
  }

Member Data Documentation

Definition at line 39 of file MaterialAccountingStep.h.

Referenced by clear(), in(), operator+=(), operator-=(), operator=(), and split().

Definition at line 40 of file MaterialAccountingStep.h.

Referenced by clear(), operator+=(), operator-=(), operator=(), out(), and split().