#include <MaterialAccountingTrack.h>
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 MaterialAccountingStep & | summary (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 } |
Definition at line 11 of file MaterialAccountingTrack.h.
anonymous enum [private] |
Definition at line 14 of file MaterialAccountingTrack.h.
{ kSteps = 600, kDetectors = 30 };
MaterialAccountingTrack::MaterialAccountingTrack | ( | void | ) | [inline] |
Definition at line 17 of file MaterialAccountingTrack.h.
References kDetectors, kSteps, m_detectors, and m_steps.
: m_total(), m_current_volume(0), m_detector(), m_steps(), m_detectors() { m_steps.reserve(kSteps); m_detectors.reserve(kDetectors); }
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 benchmark_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 benchmark_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] |
Definition at line 28 of file MaterialAccountingTrack.h.
References MaterialAccountingDetector::clear(), MaterialAccountingStep::clear(), kDetectors, kSteps, m_current_volume, m_detector, m_detectors, m_steps, and m_total.
Referenced by TrackingMaterialProducer::update().
{ m_total.clear(); m_current_volume = 0; m_steps.clear(); m_steps.reserve(kSteps); m_steps.push_back( m_total ); m_detector.clear(); m_detectors.clear(); m_detectors.reserve(kDetectors); }
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().
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; }
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().
Definition at line 64 of file MaterialAccountingTrack.h.
Referenced by detectors(), leaveDetector(), MaterialAccountingTrack(), reset(), and TrackingMaterialAnalyser::split().
std::vector<MaterialAccountingStep> MaterialAccountingTrack::m_steps |
Definition at line 63 of file MaterialAccountingTrack.h.
Referenced by MaterialAccountingTrack(), reset(), TrackingMaterialAnalyser::split(), step(), and steps().
Definition at line 60 of file MaterialAccountingTrack.h.
Referenced by enterDetector(), leaveDetector(), reset(), TrackingMaterialAnalyser::split(), step(), and summary().