CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Types

MaterialAccountingTrack Class Reference

#include <MaterialAccountingTrack.h>

List of all members.

Public Member Functions

const std::vector
< MaterialAccountingDetector > & 
detectors ()
void enterDetector (const G4VPhysicalVolume *volume, const GlobalPoint &position, double cosTheta)
void leaveDetector (const G4VPhysicalVolume *volume, double cosTheta)
 MaterialAccountingTrack (void)
void reset (void)
void step (const MaterialAccountingStep &step)
const std::vector
< MaterialAccountingStep > & 
steps ()
const MaterialAccountingStepsummary (void)

Public Attributes

const G4VPhysicalVolume * m_current_volume
MaterialAccountingDetector m_detector
std::vector
< MaterialAccountingDetector
m_detectors
std::vector
< MaterialAccountingStep
m_steps
MaterialAccountingStep m_total

Private Types

enum  { kSteps = 600, kDetectors = 30 }

Detailed Description

Definition at line 11 of file MaterialAccountingTrack.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
kSteps 
kDetectors 

Definition at line 14 of file MaterialAccountingTrack.h.

{ kSteps = 600, kDetectors = 30 };

Constructor & Destructor Documentation

MaterialAccountingTrack::MaterialAccountingTrack ( void  ) [inline]

Definition at line 17 of file MaterialAccountingTrack.h.

References kDetectors, kSteps, m_detectors, and m_steps.


Member Function Documentation

const std::vector<MaterialAccountingDetector>& MaterialAccountingTrack::detectors ( ) [inline]

Definition at line 51 of file MaterialAccountingTrack.h.

References m_detectors.

Referenced by TrackingMaterialProducer::update().

                                                            {
    return m_detectors;
  }
void MaterialAccountingTrack::enterDetector ( const G4VPhysicalVolume *  volume,
const GlobalPoint position,
double  cosTheta 
)

Definition at line 7 of file MaterialAccountingTrack.cc.

References dtNoiseDBValidation_cfg::cerr, MaterialAccountingDetector::clear(), MaterialAccountingStep::length(), MaterialAccountingDetector::m_cosThetaIn, m_current_volume, MaterialAccountingDetector::m_curvilinearIn, m_detector, MaterialAccountingDetector::m_position, m_total, and position.

Referenced by TrackingMaterialProducer::update().

                                                                                                                           {
  if (m_current_volume != 0) {
    // error: entering a volume while inside an other (or the same) one !
    if (m_current_volume != volume)
      std::cerr << "MaterialAccountingTrack::leaveDetector(...): ERROR: entering volume (" << volume << ") while inside volume (" << m_current_volume << ")" << std::endl;
    else
      std::cerr << "MaterialAccountingTrack::leaveDetector(...): ERROR: entering volume (" << volume << ") twice" << std::endl;
    m_detector.clear();
    return;
  } 

  m_current_volume            = volume;
  m_detector.m_position       = position;
  m_detector.m_curvilinearIn  = m_total.length();
  m_detector.m_cosThetaIn     = cosTheta;
}
void MaterialAccountingTrack::leaveDetector ( const G4VPhysicalVolume *  volume,
double  cosTheta 
)

Definition at line 24 of file MaterialAccountingTrack.cc.

References dtNoiseDBValidation_cfg::cerr, MaterialAccountingDetector::clear(), MaterialAccountingStep::length(), MaterialAccountingDetector::m_cosThetaOut, m_current_volume, MaterialAccountingDetector::m_curvilinearOut, m_detector, m_detectors, and m_total.

Referenced by TrackingMaterialProducer::update().

                                                                                              {
  if (m_current_volume != volume) {
    // error: leaving the wrong (or no) volume !
    if (m_current_volume)
      std::cerr << "MaterialAccountingTrack::leaveDetector(...): ERROR: leaving volume (" << volume << ") while inside volume (" << m_current_volume << ")" << std::endl;
    else
      std::cerr << "MaterialAccountingTrack::leaveDetector(...): ERROR: leaving volume (" << volume << ") while not inside any volume" << std::endl;
    m_detector.clear();
    return;
  } 

  m_current_volume = 0;
  m_detector.m_curvilinearOut = m_total.length();
  m_detector.m_cosThetaOut    = cosTheta;
  m_detectors.push_back( m_detector );
  m_detector.clear();
}
void MaterialAccountingTrack::reset ( void  ) [inline]
void MaterialAccountingTrack::step ( const MaterialAccountingStep step) [inline]

Definition at line 39 of file MaterialAccountingTrack.h.

References m_steps, and m_total.

Referenced by TrackingMaterialProducer::update().

                                                   {
    m_total += step;
    m_steps.push_back( step );
  }
const std::vector<MaterialAccountingStep>& MaterialAccountingTrack::steps ( ) [inline]

Definition at line 55 of file MaterialAccountingTrack.h.

References m_steps.

Referenced by TrackingMaterialProducer::update().

                                                    {
    return m_steps;
  }
const MaterialAccountingStep& MaterialAccountingTrack::summary ( void  ) [inline]

Definition at line 47 of file MaterialAccountingTrack.h.

References m_total.

Referenced by TrackingMaterialProducer::update().

                                                {
    return m_total;
  }

Member Data Documentation

const G4VPhysicalVolume* MaterialAccountingTrack::m_current_volume [mutable]

Definition at line 61 of file MaterialAccountingTrack.h.

Referenced by enterDetector(), leaveDetector(), and reset().

Definition at line 62 of file MaterialAccountingTrack.h.

Referenced by enterDetector(), leaveDetector(), and reset().