[1199] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // $Id: A01ParallelWorld.cc,v 1.3 2006/12/13 15:49:20 gunter Exp $ |
---|
| 27 | // -------------------------------------------------------------- |
---|
| 28 | // |
---|
| 29 | |
---|
| 30 | #include "A01ParallelWorld.hh" |
---|
| 31 | |
---|
| 32 | #include "G4Box.hh" |
---|
| 33 | #include "G4LogicalVolume.hh" |
---|
| 34 | #include "G4VPhysicalVolume.hh" |
---|
| 35 | #include "G4PVPlacement.hh" |
---|
| 36 | #include "G4PVReplica.hh" |
---|
| 37 | |
---|
| 38 | #include "G4SDManager.hh" |
---|
| 39 | #include "G4MultiFunctionalDetector.hh" |
---|
| 40 | #include "G4PSNofStep.hh" |
---|
| 41 | #include "G4PSTrackLength.hh" |
---|
| 42 | #include "G4PSNofSecondary.hh" |
---|
| 43 | #include "G4PSEnergyDeposit.hh" |
---|
| 44 | |
---|
| 45 | #include "G4VisAttributes.hh" |
---|
| 46 | |
---|
| 47 | A01ParallelWorld::A01ParallelWorld(G4String worldName) |
---|
| 48 | :G4VUserParallelWorld(worldName) |
---|
| 49 | {;} |
---|
| 50 | |
---|
| 51 | A01ParallelWorld::~A01ParallelWorld() |
---|
| 52 | {;} |
---|
| 53 | |
---|
| 54 | void A01ParallelWorld::Construct() |
---|
| 55 | { |
---|
| 56 | G4VPhysicalVolume* ghostWorld = GetWorld(); |
---|
| 57 | G4LogicalVolume* worldLogical = ghostWorld->GetLogicalVolume(); |
---|
| 58 | worldLogical->SetVisAttributes(G4VisAttributes::GetInvisible()); |
---|
| 59 | |
---|
| 60 | G4Box * ghostSolid = new G4Box("GhostdBox", 60.*cm, 60.*cm, 60.*cm); |
---|
| 61 | G4LogicalVolume * ghostLogical |
---|
| 62 | = new G4LogicalVolume(ghostSolid, 0, "GhostLogical", 0, 0, 0); |
---|
| 63 | new G4PVPlacement(0, G4ThreeVector(), ghostLogical, "GhostPhysical", |
---|
| 64 | worldLogical, 0, 0); |
---|
| 65 | G4Box * layerSolid = new G4Box("GhostLayerBox", 60.*cm, 60.*cm, 2.*cm); |
---|
| 66 | G4LogicalVolume * layerLogical |
---|
| 67 | = new G4LogicalVolume(layerSolid, 0, "GhostLayerLogical", 0, 0, 0); |
---|
| 68 | new G4PVReplica("GhostLayerPhysical",layerLogical,ghostLogical,kZAxis,30,4.*cm); |
---|
| 69 | |
---|
| 70 | |
---|
| 71 | G4SDManager* SDman = G4SDManager::GetSDMpointer(); |
---|
| 72 | G4String SDname; |
---|
| 73 | G4MultiFunctionalDetector* aSD = new G4MultiFunctionalDetector(SDname="ParallelWorld"); |
---|
| 74 | SDman->AddNewDetector(aSD); |
---|
| 75 | layerLogical->SetSensitiveDetector(aSD); |
---|
| 76 | |
---|
| 77 | aSD->RegisterPrimitive(new G4PSNofStep("NofStep")); |
---|
| 78 | aSD->RegisterPrimitive(new G4PSTrackLength("TrackLength")); |
---|
| 79 | aSD->RegisterPrimitive(new G4PSNofSecondary("NofSecondary")); |
---|
| 80 | aSD->RegisterPrimitive(new G4PSEnergyDeposit("EnergyDeposit")); |
---|
| 81 | } |
---|
| 82 | |
---|
| 83 | |
---|