VMC Examples
Version 6.8
Toggle main menu visibility
Loading...
Searching...
No Matches
examples
E03
E03c
geant4
src
Ex03RegionConstruction.cxx
Go to the documentation of this file.
1
//------------------------------------------------
2
// The Virtual Monte Carlo examples
3
// Copyright (C) 2007 - 2014 Ivana Hrivnacova
4
// All rights reserved.
5
//
6
// For the licensing terms see geant4_vmc/LICENSE.
7
// Contact: root-vmc@cern.ch
8
//-------------------------------------------------
9
10
/// \file Ex03RegionConstruction.cxx
11
/// \brief Implementation of the Ex03RegionConstruction class
12
///
13
/// Geant4 ExampleN03 adapted to Virtual Monte Carlo \n
14
///
15
/// \author I. Hrivnacova; IPN, Orsay
16
17
#include "Ex03RegionConstruction.h"
18
19
#include "TG4GeometryServices.h"
20
21
#include "G4LogicalVolume.hh"
22
#include "G4ProductionCuts.hh"
23
#include "G4Region.hh"
24
#include "G4SystemOfUnits.hh"
25
26
//_____________________________________________________________________________
27
Ex03RegionConstruction::Ex03RegionConstruction
() :
TG4VUserRegionConstruction
()
28
{
29
/// Standard constructor
30
}
31
32
//_____________________________________________________________________________
33
Ex03RegionConstruction::~Ex03RegionConstruction
()
34
{
35
/// Destructor
36
}
37
38
//
39
// protected methods
40
//
41
42
//_____________________________________________________________________________
43
void
Ex03RegionConstruction::Construct
()
44
{
45
/// Definition of regions
46
47
G4LogicalVolume* logicalVolume =
48
TG4GeometryServices::Instance()->FindLogicalVolume(
"LAYE"
);
49
if
(!logicalVolume) {
50
G4cerr <<
"Logical volume LAYE not found"
<< G4endl;
51
return
;
52
}
53
54
G4Region* testRegion =
new
G4Region(
"Test_region"
);
55
testRegion->AddRootLogicalVolume(logicalVolume);
56
testRegion->SetProductionCuts(
new
G4ProductionCuts());
57
58
std::vector<double> cuts;
59
cuts.push_back(1.0 * cm);
60
cuts.push_back(1.0 * cm);
61
cuts.push_back(1.0 * cm);
62
testRegion->GetProductionCuts()->SetProductionCuts(cuts);
63
}
Ex03RegionConstruction::~Ex03RegionConstruction
virtual ~Ex03RegionConstruction()
Definition
Ex03RegionConstruction.cxx:33
Ex03RegionConstruction::Construct
virtual void Construct()
Definition
Ex03RegionConstruction.cxx:43
Ex03RegionConstruction::Ex03RegionConstruction
Ex03RegionConstruction()
Definition
Ex03RegionConstruction.cxx:27
TG4VUserRegionConstruction
Generated on
for VMC Examples by
1.17.0