Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4GflashFastSimulation.cxx
Go to the documentation of this file.
1//------------------------------------------------
2// The Geant4 Virtual Monte Carlo package
3// Copyright (C) 2007 - 2015 Ivana Hrivnacova
4// All rights reserved.
5//
6// For the licensing terms see geant4_vmc/LICENSE.
7// Contact: root-vmc@cern.ch
8//-------------------------------------------------
9
14
17#include "TG4Globals.h"
18
19#include <G4Material.hh>
20#include <G4RegionStore.hh>
21#include <GFlashHitMaker.hh>
22#include <GFlashHomoShowerParameterisation.hh>
23#include <GFlashParticleBounds.hh>
24#include <GFlashShowerModel.hh>
25
26#include <Riostream.h>
27
28using namespace std;
29
30//_____________________________________________________________________________
33 fMessenger(0),
34 fMaterialName(),
35 fGflashShowerModel(0)
36{
38
39 // create the model in contsructor
40 // to make available its messenger commands
41 fGflashShowerModel = new GFlashShowerModel("GflashShowerModel");
42 // region will be set via the model configuration
43
45}
46
47//_____________________________________________________________________________
52
53//
54// protected methods
55//
56
57//_____________________________________________________________________________
59{
62
63 if (!fMaterialName.size()) {
64 TG4Globals::Warning("TG4GflashFastSimulation", "Construct",
65 "The material for Gflash parameterisation is not defined.");
66 return;
67 }
68
69 // Get material from G4MaterialTable
70 G4Material* material = G4Material::GetMaterial(fMaterialName);
71 if (!material) {
72 TString text = "The material ";
73 text += fMaterialName.data();
74 text += " was not found.";
75 TG4Globals::Warning("TG4GflashFastSimulation", "Construct", text);
76 return;
77 }
78
79 // Initializing shower model
80 //
81 G4cout << "Configuring shower parameterization model" << G4endl;
82
83 fGflashShowerModel->SetFlagParamType(1);
84
85 GFlashHomoShowerParameterisation* parameterisation =
86 new GFlashHomoShowerParameterisation(material);
87 fGflashShowerModel->SetParameterisation(*parameterisation);
88
89 // Energy cuts to kill particles:
90 GFlashParticleBounds* particleBounds = new GFlashParticleBounds();
91 fGflashShowerModel->SetParticleBounds(*particleBounds);
92
93 // Makes the EnergieSpots
94 GFlashHitMaker* hitMaker = new GFlashHitMaker();
95 fGflashShowerModel->SetHitMaker(*hitMaker);
96
97 // Register model in VMC frameworks
99
100 G4cout << "end configuring shower parameterization." << G4endl;
101 //
102 // end Initializing shower model
103}
Definition of the TG4GflashFastSimulationMessenger class.
Definition of the TG4GflashFastSimulation class.
Definition of the TG4Globals class and basic container types.
Messenger class that defines commands for the Gflash fast simulation model.
GFlashShowerModel * fGflashShowerModel
Gflash shower model.
G4String fMaterialName
The name of material for shower parameterisation.
virtual void Construct()
Method to be overriden by user.
TG4GflashFastSimulationMessenger * fMessenger
Messenger.
static void Warning(const TString &className, const TString &methodName, const TString &text)
The abstract base class which is used to build fast simulation models.
void Register(G4VFastSimulationModel *fastSimulationModel)
Method to be utilized to register each fast simulation model.