CMS 3D CMS Logo

MaterialAccountingStep Class Reference

#include <SimDataFormats/ValidationFormats/interface/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 *= (double x)
 multiply by a scalar
MaterialAccountingStepoperator *= (const MaterialAccountingStep &step)
 multiply two steps, usefull to implement (co)variance
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.

00011                                  :
00012     m_length(0.),
00013     m_radiationLengths(0.),
00014     m_energyLoss(0.),
00015     m_in(),
00016     m_out() 
00017   { }

MaterialAccountingStep::MaterialAccountingStep ( double  position,
double  radlen,
double  loss,
const GlobalPoint in,
const GlobalPoint out 
) [inline]

Definition at line 19 of file MaterialAccountingStep.h.

00019                                                                                                                          :
00020     m_length( position ),
00021     m_radiationLengths( radlen ),
00022     m_energyLoss( loss ),
00023     m_in( in ),
00024     m_out( out )
00025   { }
 


Member Function Documentation

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().

00027                      {
00028     m_length           = 0.;
00029     m_radiationLengths = 0.;
00030     m_energyLoss       = 0.;
00031     m_in               = GlobalPoint();
00032     m_out              = GlobalPoint();
00033   }

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().

00051                                 {
00052     return m_energyLoss;
00053   }

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().

00055                                      {
00056     return m_in;
00057   }

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().

00043                             {
00044     return m_length;
00045   }

MaterialAccountingStep& MaterialAccountingStep::operator *= ( double  x  )  [inline]

multiply by a scalar

Definition at line 137 of file MaterialAccountingStep.h.

References m_energyLoss, m_length, and m_radiationLengths.

00137                                                   {
00138     m_length           *= x;
00139     m_radiationLengths *= x;
00140     m_energyLoss       *= x;
00141     return *this;
00142   }

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.

00129                                                                              {
00130     m_length           *= step.m_length;
00131     m_radiationLengths *= step.m_radiationLengths;
00132     m_energyLoss       *= step.m_energyLoss;
00133     return *this;
00134   }

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().

00097                                                                              {
00098     m_length           += step.m_length;
00099     m_radiationLengths += step.m_radiationLengths;
00100     m_energyLoss       += step.m_energyLoss;
00101 
00102     // assume that perp2 is 0 only for uninitialized steps
00103     if ((m_in.perp2() == 0.0) or (step.m_in.perp2() < m_in.perp2()))
00104       m_in = step.m_in;
00105 
00106     if ((m_out.perp2() == 0.0) or (step.m_out.perp2() > m_out.perp2()))
00107       m_out = step.m_out;
00108     
00109     return *this;
00110   }

MaterialAccountingStep& MaterialAccountingStep::operator-= ( const MaterialAccountingStep step  )  [inline]

subtract a step

Definition at line 113 of file MaterialAccountingStep.h.

References and, m_energyLoss, m_in, m_length, m_out, m_radiationLengths, and PV3DBase< T, PVType, FrameType >::perp2().

00113                                                                              {
00114     m_length           -= step.m_length;
00115     m_radiationLengths -= step.m_radiationLengths;
00116     m_energyLoss       -= step.m_energyLoss;
00117 
00118     // can anything more sensible be done for m_in and/or m_out ?
00119     if ((step.m_in.perp2() <= m_in.perp2()) and (step.m_out.perp2() >= m_in.perp2()))
00120       m_in = step.m_out;
00121 
00122     if ((step.m_out.perp2() >= m_out.perp2()) and (step.m_in.perp2() <= m_out.perp2()))
00123       m_out = step.m_in;
00124       
00125     return *this;
00126   }

MaterialAccountingStep& MaterialAccountingStep::operator/= ( double  x  )  [inline]

divide by a scalar

Definition at line 145 of file MaterialAccountingStep.h.

References m_energyLoss, m_length, and m_radiationLengths.

00145                                                   {
00146     m_length           /= x;
00147     m_radiationLengths /= x;
00148     m_energyLoss       /= x;
00149     return *this;
00150   }

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.

00087                                                                             {
00088     m_length           = step.m_length;
00089     m_radiationLengths = step.m_radiationLengths;
00090     m_energyLoss       = step.m_energyLoss;
00091     m_in               = step.m_in;
00092     m_out              = step.m_out;
00093     return *this;
00094   }

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().

00059                                       {
00060     return m_out;
00061   }

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().

00047                                       {
00048     return m_radiationLengths;
00049   }

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 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().

00064                                                                                          {
00065     // no check is done to ensure that 0 <= f <= 1 !
00066     GlobalPoint limit(
00067         m_in.x() * fraction + m_out.x()  * (1. - fraction),
00068         m_in.y() * fraction + m_out.y()  * (1. - fraction),
00069         m_in.z() * fraction + m_out.z()  * (1. - fraction)
00070     );
00071 
00072     MaterialAccountingStep part1( fraction * m_length,
00073                                   fraction * m_radiationLengths,
00074                                   fraction * m_energyLoss,
00075                                   m_in,
00076                                   limit );
00077 
00078     MaterialAccountingStep part2( (1 - fraction) * m_length,
00079                                   (1 - fraction) * m_radiationLengths,
00080                                   (1 - fraction) * m_energyLoss,
00081                                   limit,
00082                                   m_out );
00083     return std::make_pair( part1, part2 );
00084   }


Member Data Documentation

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().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:28:02 2009 for CMSSW by  doxygen 1.5.4