CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Types
MaterialAccountingTrack Class Reference

#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 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.

Constructor & Destructor Documentation

MaterialAccountingTrack::MaterialAccountingTrack ( void  )
inline

Definition at line 17 of file MaterialAccountingTrack.h.

References kDetectors, kSteps, m_detectors, and m_steps.

17  :
18  m_total(),
20  m_detector(),
21  m_steps(),
22  m_detectors()
23  {
24  m_steps.reserve(kSteps);
25  m_detectors.reserve(kDetectors);
26  }
const G4VPhysicalVolume * m_current_volume
std::vector< MaterialAccountingDetector > m_detectors
std::vector< MaterialAccountingStep > m_steps
MaterialAccountingStep m_total
MaterialAccountingDetector m_detector

Member Function Documentation

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

Definition at line 51 of file MaterialAccountingTrack.h.

References m_detectors.

51  {
52  return m_detectors;
53  }
std::vector< MaterialAccountingDetector > 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.

7  {
8  if (m_current_volume != 0) {
9  // error: entering a volume while inside an other (or the same) one !
10  if (m_current_volume != volume)
11  std::cerr << "MaterialAccountingTrack::leaveDetector(...): ERROR: entering volume (" << volume << ") while inside volume (" << m_current_volume << ")" << std::endl;
12  else
13  std::cerr << "MaterialAccountingTrack::leaveDetector(...): ERROR: entering volume (" << volume << ") twice" << std::endl;
14  m_detector.clear();
15  return;
16  }
17 
18  m_current_volume = volume;
21  m_detector.m_cosThetaIn = cosTheta;
22 }
const G4VPhysicalVolume * m_current_volume
double length(void) const
MaterialAccountingStep m_total
MaterialAccountingDetector m_detector
static int position[264][3]
Definition: ReadPGInfo.cc:509
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.

24  {
25  if (m_current_volume != volume) {
26  // error: leaving the wrong (or no) volume !
27  if (m_current_volume)
28  std::cerr << "MaterialAccountingTrack::leaveDetector(...): ERROR: leaving volume (" << volume << ") while inside volume (" << m_current_volume << ")" << std::endl;
29  else
30  std::cerr << "MaterialAccountingTrack::leaveDetector(...): ERROR: leaving volume (" << volume << ") while not inside any volume" << std::endl;
31  m_detector.clear();
32  return;
33  }
34 
35  m_current_volume = 0;
37  m_detector.m_cosThetaOut = cosTheta;
38  m_detectors.push_back( m_detector );
39  m_detector.clear();
40 }
const G4VPhysicalVolume * m_current_volume
std::vector< MaterialAccountingDetector > m_detectors
double length(void) const
MaterialAccountingStep m_total
MaterialAccountingDetector m_detector
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.

39  {
40  m_total += step;
41  m_steps.push_back( step );
42  }
std::vector< MaterialAccountingStep > m_steps
MaterialAccountingStep m_total
void step(const MaterialAccountingStep &step)
const std::vector<MaterialAccountingStep>& MaterialAccountingTrack::steps ( )
inline

Definition at line 55 of file MaterialAccountingTrack.h.

References m_steps.

55  {
56  return m_steps;
57  }
std::vector< MaterialAccountingStep > m_steps
const MaterialAccountingStep& MaterialAccountingTrack::summary ( void  )
inline

Definition at line 47 of file MaterialAccountingTrack.h.

References m_total.

47  {
48  return m_total;
49  }
MaterialAccountingStep 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().

MaterialAccountingDetector MaterialAccountingTrack::m_detector
mutable

Definition at line 62 of file MaterialAccountingTrack.h.

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

std::vector<MaterialAccountingDetector> MaterialAccountingTrack::m_detectors
std::vector<MaterialAccountingStep> MaterialAccountingTrack::m_steps
MaterialAccountingStep MaterialAccountingTrack::m_total