Import Geant4 9.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:46:55 +02:00
parent 89a9605df1
commit b1eb5424d2
10957 changed files with 888481 additions and 160139 deletions
@@ -52,6 +52,7 @@
#include "GFlashHitMaker.hh"
#include "GFlashParticleBounds.hh"
using namespace std;
ExGflashDetectorConstruction::ExGflashDetectorConstruction()
:m_experimentalHall_log(0),
@@ -59,7 +60,7 @@ m_calo_log(0),
m_experimentalHall_phys(0),
m_calo_phys(0)
{
cout<<"ExGflashDetectorConstruction::Detector constructor"<<endl;
G4cout<<"ExGflashDetectorConstruction::Detector constructor"<<G4endl;
// Simplified `CMS-like` PbWO4 crystal calorimeter
m_calo_xside=31*cm;
@@ -86,7 +87,7 @@ G4VPhysicalVolume* ExGflashDetectorConstruction::Construct()
{
//--------- Definitions of Solids, Logical Volumes, Physical Volumes ---------
G4String mat= "PbWO4";
cout<<"Defining the materials"<<endl;
G4cout<<"Defining the materials"<<G4endl;
ExGflashMaterialManager *matManager=ExGflashMaterialManager::GetMaterialManager();
/*******************************
@@ -177,10 +178,10 @@ G4VPhysicalVolume* ExGflashDetectorConstruction::Construct()
1); //Visibility
}
}
cout << "There are " << m_NbOfCrystals << " crystals per row in the calorimeter, so in total "<<
m_NbOfCrystals*m_NbOfCrystals << " crystals" << endl;
cout << "The have widthof " << m_CrystalWidht /cm << " cm and a lenght of " << m_CrystalLenght /cm
<<" cm. The Material is "<< matManager->getMaterial(mat) << endl;
G4cout << "There are " << m_NbOfCrystals << " crystals per row in the calorimeter, so in total "<<
m_NbOfCrystals*m_NbOfCrystals << " crystals" << G4endl;
G4cout << "The have widthof " << m_CrystalWidht /cm << " cm and a lenght of " << m_CrystalLenght /cm
<<" cm. The Material is "<< matManager->getMaterial(mat) << G4endl;
// Sensitive Detector part
G4SDManager* SDman = G4SDManager::GetSDMpointer();
@@ -206,13 +207,13 @@ G4VPhysicalVolume* ExGflashDetectorConstruction::Construct()
/**********************************************
* Initializing shower modell
***********************************************/
cout<<"Shower parameterization"<<endl;
G4cout<<"Shower parameterization"<<G4endl;
m_theFastShowerModel = new GFlashShowerModel("fastShowerModel",aRegion);
m_theParameterisation = new GFlashHomoShowerParameterisation(matManager->getMaterial(mat));
m_theFastShowerModel->SetParameterisation(*m_theParameterisation);
m_theFastShowerModel->SetParticleBounds(*m_theParticleBounds) ;
m_theFastShowerModel->SetHitMaker(*m_theHMaker);
cout<<"end shower parameterization"<<endl;
G4cout<<"end shower parameterization"<<G4endl;
/**********************************************/
return m_experimentalHall_phys;
@@ -24,7 +24,7 @@
// ********************************************************************
//
// Created by Joanna Weng 26.11.2004
using namespace std;
#include "ExGflashEventAction.hh"
#include "ExGflashHit.hh"
@@ -37,7 +37,7 @@ using namespace std;
#include <iostream>
#include <algorithm>
//Gflash
using namespace std;
#include "G4Timer.hh"
extern G4Timer Timer;
@@ -52,32 +52,32 @@ nevent(0),dtime(0.0),calorimeterCollectionId(-1)
ExGflashEventAction::~ExGflashEventAction()
{
cout << "Internal Real Elapsed Time /event is: "<< dtime /nevent<< endl;
G4cout << "Internal Real Elapsed Time /event is: "<< dtime /nevent<< G4endl;
}
void ExGflashEventAction::BeginOfEventAction(const G4Event *evt){
Timerintern.Start();
cout<<" ------ Start ExGflashEventAction ----- "<<endl;
G4cout<<" ------ Start ExGflashEventAction ----- "<<G4endl;
nevent=evt->GetEventID();
cout<<" Start generating event Nr "<<nevent<<endl<<endl;
G4cout<<" Start generating event Nr "<<nevent<<G4endl<<G4endl;
}
void ExGflashEventAction::EndOfEventAction(const G4Event *evt)
{
Timerintern.Stop();
cout << endl;
cout << "******************************************";
cout << endl;
cout << "Internal Real Elapsed Time is: "<< Timerintern.GetRealElapsed();
cout << endl;
cout << "Internal System Elapsed Time: " << Timerintern.GetSystemElapsed();
cout << endl;
cout << "Internal GetUserElapsed Time: " << Timerintern.GetUserElapsed();
cout << endl;
cout << "******************************************"<< endl;
G4cout << G4endl;
G4cout << "******************************************";
G4cout << G4endl;
G4cout << "Internal Real Elapsed Time is: "<< Timerintern.GetRealElapsed();
G4cout << G4endl;
G4cout << "Internal System Elapsed Time: " << Timerintern.GetSystemElapsed();
G4cout << G4endl;
G4cout << "Internal GetUserElapsed Time: " << Timerintern.GetUserElapsed();
G4cout << G4endl;
G4cout << "******************************************"<< G4endl;
dtime+=Timerintern.GetRealElapsed();
cout<<" ------ ExGflashEventAction::End of event nr. "<<nevent<<" -----"<< endl;
G4cout<<" ------ ExGflashEventAction::End of event nr. "<<nevent<<" -----"<< G4endl;
G4SDManager * SDman = G4SDManager::GetSDMpointer();
G4String colNam;
@@ -91,7 +91,7 @@ void ExGflashEventAction::EndOfEventAction(const G4Event *evt)
if (THC) {
/// Hits in sensitive Detector
int n_hit = THC->entries();
cout<<" " << n_hit<< " hits are stored in ExGflashHitsCollection "<<endl;
G4cout<<" " << n_hit<< " hits are stored in ExGflashHitsCollection "<<G4endl;
G4PrimaryVertex* pvertex=evt->GetPrimaryVertex();
///Computing (x,y,z) of vertex of initial particles
G4ThreeVector vtx=pvertex->GetPosition();
@@ -114,10 +114,9 @@ void ExGflashEventAction::EndOfEventAction(const G4Event *evt)
G4int num=(*THC)[i]->GetCrystalNum();
energyincrystal[num]+=(*THC)[i]->GetEdep()/GeV;
//std::cout << num << std::endl;
//@@@ExGflashEventAction: was bringen die namespace statt using namespace std ?
// std::cout << " Crystal Nummer " << (*THC)[i]->GetCrystalNum() << std::endl;
// std::cout << (*THC)[i]->GetCrystalNum() /10 << " "<<(*THC)[i]->GetCrystalNum()%10 << std::endl;
//G4cout << num << G4endl;
// G4cout << " Crystal Nummer " << (*THC)[i]->GetCrystalNum() << G4endl;
// G4cout << (*THC)[i]->GetCrystalNum() /10 << " "<<(*THC)[i]->GetCrystalNum()%10 << G4endl;
G4ThreeVector hitpos=(*THC)[i]->GetPos();
G4ThreeVector l (hitpos.x(), hitpos.y(), hitpos.z());
@@ -134,14 +133,14 @@ void ExGflashEventAction::EndOfEventAction(const G4Event *evt)
//Find crystal with maximum energy
for (int i=0;i<100;i++)
{
//std::cout << i <<" " << energyincrystal[i] << std::endl;
//G4cout << i <<" " << energyincrystal[i] << G4endl;
if (max <energyincrystal[i])
{
max=energyincrystal[i];
index = i;
}
}
//std::cout << index <<" NMAX " << index << std::endl;
//G4cout << index <<" NMAX " << index << G4endl;
// 3x3 matrix of crystals around the crystal with the maximum energy deposit
G4double e3x3 = energyincrystal[index]+energyincrystal[index+1]+energyincrystal[index-1]+
@@ -153,14 +152,14 @@ void ExGflashEventAction::EndOfEventAction(const G4Event *evt)
energyincrystal[index-10]+energyincrystal[index-9]+energyincrystal[index-11]+energyincrystal[index-8]+energyincrystal[index-12]+
energyincrystal[index+10]+energyincrystal[index+11]+energyincrystal[index+9]+energyincrystal[index+12]+energyincrystal[index+8];
std::cout << " e1 " << energyincrystal[index] << " e3x3 " << e3x3<< " GeV e5x5 " <<e5x5 <<std::endl;
G4cout << " e1 " << energyincrystal[index] << " e3x3 " << e3x3<< " GeV e5x5 " <<e5x5 <<G4endl;
}
G4cout << " Total energy deposited in the calorimeter: " << totE << " (GeV)" << G4endl;
G4TrajectoryContainer * trajectoryContainer = evt->GetTrajectoryContainer();
G4int n_trajectories = 0;
if(trajectoryContainer){ n_trajectories = trajectoryContainer->entries(); }
G4cout << " " << n_trajectories << " trajectories stored in this event." << endl;
G4cout << " " << n_trajectories << " trajectories stored in this event." << G4endl;
}
@@ -24,15 +24,15 @@
// ********************************************************************
//
#include "ExGflashMaterialManager.hh"
using namespace std;
ExGflashMaterialManager* ExGflashMaterialManager::mpointer=0;
void ExGflashMaterialManager::storeElement(G4String name,G4String symbol, double z, double a)
{
if (elist.find(symbol)!=elist.end())
{
cout<<"attempt of redefining an existing element "<<symbol<<endl;
cout<<elist[symbol]<<endl;
G4cout<<"attempt of redefining an existing element "<<symbol<<G4endl;
G4cout<<elist[symbol]<<G4endl;
}
else
{
@@ -45,7 +45,7 @@ G4Element* ExGflashMaterialManager::getElement(G4String symbol)
{
if (elist.find(symbol)==elist.end())
{
cout<<" element "<<symbol<<" not found!"<<endl;
G4cout<<" element "<<symbol<<" not found!"<<G4endl;
return NULL;
}
else
@@ -56,8 +56,8 @@ void ExGflashMaterialManager::storeMaterial(G4String name, double z, double a, d
{
if (mlist.find(name)!=mlist.end())
{
cout<<"attempt of redefining an existing material "<<endl;
cout<<mlist[name]<<endl;
G4cout<<"attempt of redefining an existing material "<<G4endl;
G4cout<<mlist[name]<<G4endl;
}
else
{
@@ -70,8 +70,8 @@ void ExGflashMaterialManager::storeMaterial(G4String name, double d, int ncompon
{
if (mlist.find(name)!=mlist.end())
{
cout<<"attempt of redefining an existing material "<<endl;
cout<<mlist[name]<<endl;
G4cout<<"attempt of redefining an existing material "<<G4endl;
G4cout<<mlist[name]<<G4endl;
}
else
{
@@ -84,12 +84,12 @@ G4Material* ExGflashMaterialManager::getMaterial(G4String name)
{
if (mlist.find(name)==mlist.end())
{
cout<<" material "<<name<<" not found!"<<endl;
G4cout<<" material "<<name<<" not found!"<<G4endl;
return NULL;
}
else
{
// cout<<"returning material "<<name<<endl;
// G4cout<<"returning material "<<name<<G4endl;
return mlist[name];
}
}
@@ -115,13 +115,13 @@ void ExGflashMaterialManager::addElement(G4String n1,G4String n2,int natoms)
void ExGflashMaterialManager::printMaterialTable()
{
MaterialList::iterator it;
for (it=mlist.begin();it!=mlist.end();it++) cout<<(*it).second<<endl;
for (it=mlist.begin();it!=mlist.end();it++) G4cout<<(*it).second<<G4endl;
}
void ExGflashMaterialManager::printElementTable()
{
ElementList::iterator it;
for (it=elist.begin();it!=elist.end();it++) cout<<(*it).second<<endl;
for (it=elist.begin();it!=elist.end();it++) G4cout<<(*it).second<<G4endl;
}
void ExGflashMaterialManager::initialize()
@@ -41,6 +41,7 @@
#include "G4FastSimulationManagerProcess.hh"
using namespace std;
ExGflashPhysicsList::ExGflashPhysicsList(): G4VUserPhysicsList()
{
@@ -154,7 +155,7 @@ void ExGflashPhysicsList::AddTransportation()
void ExGflashPhysicsList::ConstructEM()
{
cout<<"Physics List constructor"<<endl;
G4cout<<"Physics List constructor"<<G4endl;
SetCuts();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
@@ -302,7 +303,7 @@ void ExGflashPhysicsList::AddParameterisation()
G4FastSimulationManagerProcess*
theFastSimulationManagerProcess =
new G4FastSimulationManagerProcess();
G4cout << "FastSimulationManagerProcess" <<endl;
G4cout << "FastSimulationManagerProcess" <<G4endl;
theParticleIterator->reset();
//std::cout<<"---"<<std::endl;
while( (*theParticleIterator)() ){
@@ -33,7 +33,7 @@
#include "G4TouchableHistory.hh"
#include "G4SDManager.hh"
#include <iostream>
using namespace std;
//WARNING : You have to use also G4VGFlashSensitiveDetector() as base class
ExGflashSensitiveDetector::ExGflashSensitiveDetector(G4String name, ExGflashDetectorConstruction* det):
G4VSensitiveDetector(name), G4VGFlashSensitiveDetector(), Detector(det)
@@ -47,12 +47,12 @@ ExGflashSensitiveDetector::~ExGflashSensitiveDetector() {}
void ExGflashSensitiveDetector::Initialize(G4HCofThisEvent*HCE)
{
cout<<"::Initializing the sensitive detector"<<endl;
G4cout<<"::Initializing the sensitive detector"<<G4endl;
static G4int HCID = -1;
if(HCID<0){ HCID = GetCollectionID(0); }
HCE->AddHitsCollection( HCID, caloHitsCollection );
caloHitsCollection=new
ExGflashHitsCollection(SensitiveDetectorName,collectionName[0]); // first collection
HCE->AddHitsCollection( HCID, caloHitsCollection );
}
void ExGflashSensitiveDetector::EndOfEvent(G4HCofThisEvent*HCE)