VMC Examples Version 6.6
Loading...
Searching...
No Matches
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//_____________________________________________________________________________
31
32//_____________________________________________________________________________
37
38//
39// protected methods
40//
41
42//_____________________________________________________________________________
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}