Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
CCalG4Able Class Referenceabstract

#include <CCalG4Able.hh>

Inheritance diagram for CCalG4Able:
CCalG4Ecal CCalG4Hall CCalG4Hcal

Public Member Functions

 CCalG4Able (G4String name)
 
virtual ~CCalG4Able ()
 
G4VPhysicalVolumePhysicalVolume (G4VPhysicalVolume *)
 
void setVisType (CCalVisualisable::visType, G4LogicalVolume *)
 
void setSensitivity (G4bool sens=true)
 
G4bool isSensitive () const
 
G4String G4Name () const
 
void setName (const G4String &name)
 
G4bool operator== (const CCalG4Able &right) const
 

Protected Member Functions

void AddCCalG4Able (CCalG4Able *)
 
virtual G4VPhysicalVolumeconstructIn (G4VPhysicalVolume *)=0
 
virtual void constructSensitive ()
 

Protected Attributes

G4VPhysicalVolumedetPhysicalVolume
 
CCalG4AbleTable theG4DetectorsInside
 
G4String g4ableName
 
G4bool sensitivity
 
CCalVisualisable visProperties
 
G4VisAttributesg4VisAtt [CCalVisualisable::TotalVisTypes]
 

Friends

std::ostream & operator<< (std::ostream &, const CCalG4Able &)
 

Detailed Description

Definition at line 51 of file CCalG4Able.hh.

Constructor & Destructor Documentation

CCalG4Able::CCalG4Able ( G4String  name)

Definition at line 49 of file CCalG4Able.cc.

References g4VisAtt, CCalSensitiveConfiguration::getInstance(), CCalSensitiveConfiguration::getSensitiveFlag(), sensitivity, and CCalVisualisable::TotalVisTypes.

49  :
50  detPhysicalVolume(0), g4ableName(name), sensitivity(false),
51  visProperties(CCalSensitiveConfiguration::getInstance()->getFileName(name)+".vis") {
52  //Initialize g4VisAtt pointers
53  for (int i=0; i<CCalVisualisable::TotalVisTypes; i++) {
54  g4VisAtt[i]=0;
55  }
56  sensitivity =
58 }
G4bool sensitivity
Definition: CCalG4Able.hh:104
static CCalSensitiveConfiguration * getInstance()
G4String g4ableName
Definition: CCalG4Able.hh:102
G4VisAttributes * g4VisAtt[CCalVisualisable::TotalVisTypes]
Definition: CCalG4Able.hh:108
G4VPhysicalVolume * detPhysicalVolume
Definition: CCalG4Able.hh:99
int getSensitiveFlag(const G4String &n)
CCalVisualisable visProperties
Definition: CCalG4Able.hh:107
CCalG4Able::~CCalG4Able ( )
virtual

Definition at line 60 of file CCalG4Able.cc.

References detPhysicalVolume.

60  {
61  if (detPhysicalVolume)
62  delete[] detPhysicalVolume;
63 }
G4VPhysicalVolume * detPhysicalVolume
Definition: CCalG4Able.hh:99

Member Function Documentation

void CCalG4Able::AddCCalG4Able ( CCalG4Able det)
protected

Definition at line 100 of file CCalG4Able.cc.

References theG4DetectorsInside.

Referenced by CCalG4Hall::constructDaughters().

100  {
101  theG4DetectorsInside.push_back(det);
102 }
CCalG4AbleTable theG4DetectorsInside
Definition: CCalG4Able.hh:100
virtual G4VPhysicalVolume* CCalG4Able::constructIn ( G4VPhysicalVolume )
protectedpure virtual

Implemented in CCalG4Ecal, CCalG4Hcal, and CCalG4Hall.

Referenced by PhysicalVolume().

virtual void CCalG4Able::constructSensitive ( )
inlineprotectedvirtual

Reimplemented in CCalG4Ecal, and CCalG4Hcal.

Definition at line 94 of file CCalG4Able.hh.

Referenced by PhysicalVolume().

94 {}
G4String CCalG4Able::G4Name ( ) const
inline

Definition at line 78 of file CCalG4Able.hh.

References g4ableName.

Referenced by PhysicalVolume().

78 {return g4ableName;}
G4String g4ableName
Definition: CCalG4Able.hh:102
G4bool CCalG4Able::isSensitive ( ) const
inline

Definition at line 75 of file CCalG4Able.hh.

References sensitivity.

Referenced by operator<<().

75 {return sensitivity;}
G4bool sensitivity
Definition: CCalG4Able.hh:104
G4bool CCalG4Able::operator== ( const CCalG4Able right) const

Definition at line 133 of file CCalG4Able.cc.

References detPhysicalVolume.

133  {
134  return detPhysicalVolume==right.detPhysicalVolume;
135 }
G4VPhysicalVolume * detPhysicalVolume
Definition: CCalG4Able.hh:99
G4VPhysicalVolume * CCalG4Able::PhysicalVolume ( G4VPhysicalVolume pv)

Definition at line 65 of file CCalG4Able.cc.

References constructIn(), constructSensitive(), detPhysicalVolume, G4cout, G4endl, G4Name(), CCalGeometryConfiguration::getInstance(), G4VPhysicalVolume::GetName(), sensitivity, G4Timer::Start(), G4Timer::Stop(), tab(), and theG4DetectorsInside.

Referenced by CCalDetectorConstruction::Construct().

65  {
66  //If detPhysicalVolume is not (nil) the volume has already been built
67  //so return it. In other case, construct it and its daughters, then
68  //check for sensitivity and build it if set.
69 #ifdef ddebug
70  G4Timer timer;
71  timer.Start();
72 #endif
73  if (CCalGeometryConfiguration::getInstance()->getConstructFlag(G4Name())!=0){
74  if (!detPhysicalVolume) {
76  for (unsigned int i = 0; i < theG4DetectorsInside.size(); i++) {
77  theG4DetectorsInside[i]->PhysicalVolume(detPhysicalVolume);
78  }
79  if (sensitivity) {
80 #ifdef debug
81  G4cout << "==> Making " << detPhysicalVolume->GetName() << " sensitive..."
82  << G4endl;
83 #endif
85  } //if sensitivity
86  } //if sensitive
87  } //if construct
88  else {
89  G4cout << "NOTE: You decided to skip the construction of "
90  << G4Name() << G4endl;
91  }
92 #ifdef ddebug
93  timer.Stop();
94  G4cout << tab << "CCalG4Able::PhysicalVolume(...) --> time spent: "
95  << timer << G4endl;
96 #endif
97  return detPhysicalVolume;
98 }
G4String G4Name() const
Definition: CCalG4Able.hh:78
G4bool sensitivity
Definition: CCalG4Able.hh:104
CCalG4AbleTable theG4DetectorsInside
Definition: CCalG4Able.hh:100
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
std::ostream & tab(std::ostream &)
Definition: CCalutils.cc:89
static CCalGeometryConfiguration * getInstance()
G4VPhysicalVolume * detPhysicalVolume
Definition: CCalG4Able.hh:99
void Stop()
#define G4endl
Definition: G4ios.hh:61
void Start()
virtual void constructSensitive()
Definition: CCalG4Able.hh:94
virtual G4VPhysicalVolume * constructIn(G4VPhysicalVolume *)=0
void CCalG4Able::setName ( const G4String name)
inline

Definition at line 79 of file CCalG4Able.hh.

References g4ableName.

79 {g4ableName = name;}
const XML_Char * name
G4String g4ableName
Definition: CCalG4Able.hh:102
void CCalG4Able::setSensitivity ( G4bool  sens = true)
inline

Definition at line 74 of file CCalG4Able.hh.

References sensitivity.

74 {sensitivity=sens;}
G4bool sensitivity
Definition: CCalG4Able.hh:104
void CCalG4Able::setVisType ( CCalVisualisable::visType  vt,
G4LogicalVolume log 
)

Definition at line 104 of file CCalG4Able.cc.

References CCalVisualisable::colorBlue(), CCalVisualisable::colorGreen(), CCalVisualisable::colorRed(), G4cout, G4endl, g4VisAtt, G4LogicalVolume::GetName(), CCalVisualisable::isVisible(), CCalVisualisable::isWireFrame(), G4VisAttributes::SetForceWireframe(), G4LogicalVolume::SetVisAttributes(), G4VisAttributes::SetVisibility(), tab(), and visProperties.

Referenced by CCalG4Hcal::constructAbsorberLayer(), CCalG4Hall::constructIn(), CCalG4Hcal::constructIn(), and CCalG4Hcal::constructScintillatorLayer().

104  {
105  if (!g4VisAtt[vt]) {
106 #ifdef debug
107  G4cout << "CCalG4Able::setVisType: Constructing G4VisAttributes for "
108  << log->GetName() << " as " << vt << G4endl;
109 #endif
114  G4bool visible = visProperties.isVisible(vt);
115 
116 #ifdef debug
117  G4cout << "Color: "
118  << visProperties.colorRed(vt) << ", "
119  << visProperties.colorGreen(vt) << ", "
120  << visProperties.colorBlue(vt) << tab
121  << "Wireframe: " << wf << tab
122  << "Visible: " << visible << G4endl;
123 #endif
124  g4VisAtt[vt] = new G4VisAttributes(col);
125  g4VisAtt[vt]->SetForceWireframe(wf);
126  g4VisAtt[vt]->SetVisibility(visible);
127  }
128  log->SetVisAttributes(g4VisAtt[vt]);
129 }
void SetForceWireframe(G4bool)
G4String GetName() const
void SetVisibility(G4bool)
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
std::ostream & tab(std::ostream &)
Definition: CCalutils.cc:89
G4VisAttributes * g4VisAtt[CCalVisualisable::TotalVisTypes]
Definition: CCalG4Able.hh:108
double colorBlue(visType v) const
double colorRed(visType v) const
#define G4endl
Definition: G4ios.hh:61
bool isVisible(visType v) const
CCalVisualisable visProperties
Definition: CCalG4Able.hh:107
void SetVisAttributes(const G4VisAttributes *pVA)
bool isWireFrame(visType v) const
double colorGreen(visType v) const

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CCalG4Able det 
)
friend

Definition at line 144 of file CCalG4Able.cc.

144  {
145  if (det.detPhysicalVolume)
146  os << "Physical volume already constructed." << G4endl;
147  else
148  os << "Physical volume still not constructed." << G4endl;
149 
150  if (det.isSensitive())
151  os << "and it is Sensitive" << G4endl;
152  else
153  os << "and it is not Sensitive" << G4endl;
154 
155  return os;
156 }
G4bool isSensitive() const
Definition: CCalG4Able.hh:75
G4VPhysicalVolume * detPhysicalVolume
Definition: CCalG4Able.hh:99
#define G4endl
Definition: G4ios.hh:61

Field Documentation

G4VPhysicalVolume* CCalG4Able::detPhysicalVolume
protected

Definition at line 99 of file CCalG4Able.hh.

Referenced by operator<<(), operator==(), PhysicalVolume(), and ~CCalG4Able().

G4String CCalG4Able::g4ableName
protected

Definition at line 102 of file CCalG4Able.hh.

Referenced by G4Name(), and setName().

G4VisAttributes* CCalG4Able::g4VisAtt[CCalVisualisable::TotalVisTypes]
protected

Definition at line 108 of file CCalG4Able.hh.

Referenced by CCalG4Able(), and setVisType().

G4bool CCalG4Able::sensitivity
protected

Definition at line 104 of file CCalG4Able.hh.

Referenced by CCalG4Able(), isSensitive(), PhysicalVolume(), and setSensitivity().

CCalG4AbleTable CCalG4Able::theG4DetectorsInside
protected

Definition at line 100 of file CCalG4Able.hh.

Referenced by AddCCalG4Able(), and PhysicalVolume().

CCalVisualisable CCalG4Able::visProperties
protected

Definition at line 107 of file CCalG4Able.hh.

Referenced by setVisType().


The documentation for this class was generated from the following files: