Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
B03ImportanceDetectorConstruction Class Reference

#include <B03ImportanceDetectorConstruction.hh>

Inheritance diagram for B03ImportanceDetectorConstruction:
G4VUserParallelWorld

Public Member Functions

 B03ImportanceDetectorConstruction (G4String worldName)
 
 ~B03ImportanceDetectorConstruction ()
 
const G4VPhysicalVolumeGetPhysicalVolumeByName (const G4String &name) const
 
G4VPhysicalVolumeGetWorldVolumeAddress () const
 
G4String ListPhysNamesAsG4String ()
 
G4String GetCellName (G4int i)
 
G4GeometryCell GetGeometryCell (G4int i)
 
G4VPhysicalVolumeGetWorldVolume ()
 
void SetSensitive ()
 
virtual void ConstructSD ()
 
- Public Member Functions inherited from G4VUserParallelWorld
 G4VUserParallelWorld (G4String worldName)
 
virtual ~G4VUserParallelWorld ()
 
G4String GetName ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserParallelWorld
G4VPhysicalVolumeGetWorld ()
 
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 
- Protected Attributes inherited from G4VUserParallelWorld
G4String fWorldName
 

Detailed Description

Definition at line 49 of file B03ImportanceDetectorConstruction.hh.

Constructor & Destructor Documentation

B03ImportanceDetectorConstruction::B03ImportanceDetectorConstruction ( G4String  worldName)

Definition at line 59 of file B03ImportanceDetectorConstruction.cc.

60 :G4VUserParallelWorld(worldName),fLogicalVolumeVector()
61 {
62  // Construct();
63 }
G4VUserParallelWorld(G4String worldName)
B03ImportanceDetectorConstruction::~B03ImportanceDetectorConstruction ( )

Definition at line 67 of file B03ImportanceDetectorConstruction.cc.

68 {
69  fLogicalVolumeVector.clear();
70 }

Member Function Documentation

void B03ImportanceDetectorConstruction::ConstructSD ( )
virtual

Reimplemented from G4VUserParallelWorld.

Definition at line 266 of file B03ImportanceDetectorConstruction.cc.

References G4SDManager::AddNewDetector(), G4PSTrackLength::DivideByVelocity(), fCurrent_In, G4SDManager::GetSDMpointer(), G4PSTrackLength::MultiplyKineticEnergy(), G4MultiFunctionalDetector::RegisterPrimitive(), G4VSensitiveDetector::SetFilter(), G4VUserParallelWorld::SetSensitiveDetector(), G4PSTrackLength::Weighted(), and G4PSNofCollision::Weighted().

267 {
268 
270  //
271  // Sensitive Detector Name
272  G4String concreteSDname = "ConcreteSD";
273 
274  //------------------------
275  // MultiFunctionalDetector
276  //------------------------
277  //
278  // Define MultiFunctionalDetector with name.
279  G4MultiFunctionalDetector* MFDet =
280  new G4MultiFunctionalDetector(concreteSDname);
281  SDman->AddNewDetector( MFDet ); // Register SD to SDManager
282 
283 
284  G4String fltName,particleName;
285  G4SDParticleFilter* neutronFilter =
286  new G4SDParticleFilter(fltName="neutronFilter", particleName="neutron");
287 
288  MFDet->SetFilter(neutronFilter);
289 
290 
291  for (std::vector<G4LogicalVolume *>::iterator it =
292  fLogicalVolumeVector.begin();
293  it != fLogicalVolumeVector.end(); it++){
294  // (*it)->SetSensitiveDetector(MFDet);
295  SetSensitiveDetector((*it)->GetName(), MFDet);
296  }
297 
298  G4String psName;
299  G4PSNofCollision* scorer0 = new G4PSNofCollision(psName="Collisions");
300  MFDet->RegisterPrimitive(scorer0);
301 
302 
303  G4PSNofCollision* scorer1 = new G4PSNofCollision(psName="CollWeight");
304  scorer1->Weighted(true);
305  MFDet->RegisterPrimitive(scorer1);
306 
307 
308  G4PSPopulation* scorer2 = new G4PSPopulation(psName="Population");
309  MFDet->RegisterPrimitive(scorer2);
310 
311  G4PSTrackCounter* scorer3 =
312  new G4PSTrackCounter(psName="TrackEnter",fCurrent_In);
313  MFDet->RegisterPrimitive(scorer3);
314 
315  G4PSTrackLength* scorer4 = new G4PSTrackLength(psName="SL");
316  MFDet->RegisterPrimitive(scorer4);
317 
318  G4PSTrackLength* scorer5 = new G4PSTrackLength(psName="SLW");
319  scorer5->Weighted(true);
320  MFDet->RegisterPrimitive(scorer5);
321 
322  G4PSTrackLength* scorer6 = new G4PSTrackLength(psName="SLWE");
323  scorer6->Weighted(true);
324  scorer6->MultiplyKineticEnergy(true);
325  MFDet->RegisterPrimitive(scorer6);
326 
327  G4PSTrackLength* scorer7 = new G4PSTrackLength(psName="SLW_V");
328  scorer7->Weighted(true);
329  scorer7->DivideByVelocity(true);
330  MFDet->RegisterPrimitive(scorer7);
331 
332  G4PSTrackLength* scorer8 = new G4PSTrackLength(psName="SLWE_V");
333  scorer8->Weighted(true);
334  scorer8->MultiplyKineticEnergy(true);
335  scorer8->DivideByVelocity(true);
336  MFDet->RegisterPrimitive(scorer8);
337 }
G4bool RegisterPrimitive(G4VPrimitiveScorer *)
void Weighted(G4bool flg=true)
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
void Weighted(G4bool flg=true)
void SetFilter(G4VSDFilter *value)
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:67
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
void MultiplyKineticEnergy(G4bool flg=true)
void DivideByVelocity(G4bool flg=true)
G4String B03ImportanceDetectorConstruction::GetCellName ( G4int  i)

Definition at line 204 of file B03ImportanceDetectorConstruction.cc.

Referenced by B03RunAction::EndOfRunAction(), and GetGeometryCell().

204  {
205  std::ostringstream os;
206  os << "cell_";
207  if (i<10) {
208  os << "0";
209  }
210  os << i;
211  G4String name = os.str();
212  return name;
213 }
const XML_Char * name
G4GeometryCell B03ImportanceDetectorConstruction::GetGeometryCell ( G4int  i)

Definition at line 217 of file B03ImportanceDetectorConstruction.cc.

References G4cout, G4endl, GetCellName(), and B03PVolumeStore::GetPVolume().

Referenced by main().

217  {
219  const G4VPhysicalVolume *p=0;
220  p = fPVolumeStore.GetPVolume(name);
221  if (p) {
222  return G4GeometryCell(*p,0);
223  }
224  else {
225  G4cout << "B03ImportanceDetectorConstruction::GetGeometryCell: " << G4endl
226  << " couldn't get G4GeometryCell" << G4endl;
227  return G4GeometryCell(*fGhostWorld,-2);
228  }
229 }
const char * p
Definition: xmltok.h:285
const XML_Char * name
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
const G4VPhysicalVolume * GetPVolume(const G4String &name) const
const G4VPhysicalVolume & B03ImportanceDetectorConstruction::GetPhysicalVolumeByName ( const G4String name) const

Definition at line 191 of file B03ImportanceDetectorConstruction.cc.

References B03PVolumeStore::GetPVolume().

191  {
192  return *fPVolumeStore.GetPVolume(name);
193 }
const G4VPhysicalVolume * GetPVolume(const G4String &name) const
G4VPhysicalVolume * B03ImportanceDetectorConstruction::GetWorldVolume ( )

Definition at line 240 of file B03ImportanceDetectorConstruction.cc.

Referenced by main().

240  {
241  return fGhostWorld;
242 }
G4VPhysicalVolume & B03ImportanceDetectorConstruction::GetWorldVolumeAddress ( ) const

Definition at line 234 of file B03ImportanceDetectorConstruction.cc.

Referenced by main().

234  {
235  return *fGhostWorld;
236 }
G4String B03ImportanceDetectorConstruction::ListPhysNamesAsG4String ( )

Definition at line 197 of file B03ImportanceDetectorConstruction.cc.

References B03PVolumeStore::GetPNames().

197  {
198  G4String names(fPVolumeStore.GetPNames());
199  return names;
200 }
G4String GetPNames() const
void B03ImportanceDetectorConstruction::SetSensitive ( )

Definition at line 246 of file B03ImportanceDetectorConstruction.cc.

246  {
247 
248  // -------------------------------------------------
249  // The collection names of defined Primitives are
250  // 0 ConcreteSD/Collisions
251  // 1 ConcreteSD/CollWeight
252  // 2 ConcreteSD/Population
253  // 3 ConcreteSD/TrackEnter
254  // 4 ConcreteSD/SL
255  // 5 ConcreteSD/SLW
256  // 6 ConcreteSD/SLWE
257  // 7 ConcreteSD/SLW_V
258  // 8 ConcreteSD/SLWE_V
259  // -------------------------------------------------
260 
261  //now moved to ConstructSD()
262 
263 }

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