Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/DetectorConstruction.cc
|
||||
/// \brief Implementation of the DetectorConstruction class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: DetectorConstruction.cc 67268 2013-02-13 11:38:40Z ihrivnac $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -56,10 +56,11 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorConstruction::DetectorConstruction()
|
||||
:fDefaultMaterial(0),fSolidWorld(0),fLogicWorld(0),fPhysiWorld(0),
|
||||
:G4VUserDetectorConstruction(),
|
||||
fDefaultMaterial(0),fSolidWorld(0),fLogicWorld(0),fPhysiWorld(0),
|
||||
fSolidCalor(0),fLogicCalor(0),fPhysiCalor(0),
|
||||
fSolidLayer(0),fLogicLayer(0),fPhysiLayer(0),
|
||||
fMagField(0)
|
||||
fMagField(0),fDetectorMessenger(0)
|
||||
{
|
||||
// default parameter values of the calorimeter
|
||||
fNbOfAbsor = 2;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/DetectorMessenger.cc
|
||||
/// \brief Implementation of the DetectorMessenger class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: DetectorMessenger.cc 67268 2013-02-13 11:38:40Z ihrivnac $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -46,7 +46,15 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
:Detector(Det)
|
||||
:G4UImessenger(),Detector(Det),
|
||||
fTestemDir(0),
|
||||
fDetDir(0),
|
||||
fSizeYZCmd(0),
|
||||
fNbLayersCmd(0),
|
||||
fNbAbsorCmd(0),
|
||||
fAbsorCmd(0),
|
||||
fMagFieldCmd(0),
|
||||
fUpdateCmd(0)
|
||||
{
|
||||
fTestemDir = new G4UIdirectory("/testem/");
|
||||
fTestemDir->SetGuidance("UI commands specific to this example");
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/EmAcceptance.cc
|
||||
/// \brief Implementation of the Emeptance class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: EmAcceptance.cc 67268 2013-02-13 11:38:40Z ihrivnac $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -36,6 +36,7 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EmAcceptance::EmAcceptance()
|
||||
: fIsAccepted(false)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/EventAction.cc
|
||||
/// \brief Implementation of the EventAction class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: EventAction.cc 67268 2013-02-13 11:38:40Z ihrivnac $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -42,7 +42,8 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EventAction::EventAction(DetectorConstruction* det, RunAction* run)
|
||||
:fDetector(det), fRunAct(run)
|
||||
:G4UserEventAction(),fDetector(det), fRunAct(run),
|
||||
fEventMessenger(0)
|
||||
{
|
||||
fDrawFlag = "none";
|
||||
fPrintModulo = 10000;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/EventActionMessenger.cc
|
||||
/// \brief Implementation of the EventActionMessenger class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: EventActionMessenger.cc 67268 2013-02-13 11:38:40Z ihrivnac $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -42,7 +42,10 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EventActionMessenger::EventActionMessenger(EventAction* EvAct)
|
||||
:fEventAction(EvAct)
|
||||
:G4UImessenger(),fEventAction(EvAct),
|
||||
fEventDir(0),
|
||||
fDrawCmd(0),
|
||||
fPrintCmd(0)
|
||||
{
|
||||
fEventDir = new G4UIdirectory("/testem/event/");
|
||||
fEventDir->SetGuidance("event control");
|
||||
|
||||
@@ -1,805 +0,0 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm3/src/ExG4HbookAnalysisManager.cc
|
||||
/// \brief Implementation of the ExG4HbookAnalysisManager class
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
/// \file ExG4HbookAnalysisManager.cc
|
||||
/// \brief Implementation of the ExG4HbookAnalysisManager class
|
||||
|
||||
// Author: Ivana Hrivnacova, 15/06/2011 (ivana@ipno.in2p3.fr)
|
||||
|
||||
#ifdef G4_USE_HBOOK
|
||||
|
||||
#include "ExG4HbookAnalysisManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
extern "C" int setpawc();
|
||||
extern "C" int setntuc();
|
||||
|
||||
ExG4HbookAnalysisManager* ExG4HbookAnalysisManager::fgInstance = 0;
|
||||
const G4int ExG4HbookAnalysisManager::fgkDefaultH2HbookIdOffset = 100;
|
||||
const G4int ExG4HbookAnalysisManager::fgkDefaultNtupleHbookId = 1;
|
||||
const G4String ExG4HbookAnalysisManager::fgkDefaultNtupleDirectoryName = "ntuple";
|
||||
|
||||
//_____________________________________________________________________________
|
||||
ExG4HbookAnalysisManager* ExG4HbookAnalysisManager::Instance()
|
||||
{
|
||||
if ( fgInstance == 0 ) {
|
||||
fgInstance = new ExG4HbookAnalysisManager();
|
||||
}
|
||||
|
||||
return fgInstance;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
ExG4HbookAnalysisManager::ExG4HbookAnalysisManager()
|
||||
: G4VAnalysisManager("Hbook"),
|
||||
fH1HbookIdOffset(-1),
|
||||
fH2HbookIdOffset(-1),
|
||||
fNtupleHbookId(-1),
|
||||
fFile(0),
|
||||
fH1Vector(),
|
||||
fH1MapByName(),
|
||||
fH2Vector(),
|
||||
fH2MapByName(),
|
||||
fNtupleName(),
|
||||
fNtupleTitle(),
|
||||
fNtuple(0),
|
||||
fNtupleIColumnMap(),
|
||||
fNtupleFColumnMap(),
|
||||
fNtupleDColumnMap()
|
||||
{
|
||||
if ( fgInstance ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " "
|
||||
<< "G4HbookAnalysisManager already exists."
|
||||
<< "Cannot create another instance.";
|
||||
G4Exception("G4HbookAnalysisManager::G4HbookAnalysisManager()",
|
||||
"Analysis_F001", FatalException, description);
|
||||
}
|
||||
|
||||
fgInstance = this;
|
||||
|
||||
// Initialize HBOOK :
|
||||
tools::hbook::CHLIMIT(setpawc());
|
||||
setntuc(); //for ntuple.
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
ExG4HbookAnalysisManager::~ExG4HbookAnalysisManager()
|
||||
{
|
||||
std::vector<tools::hbook::h1*>::iterator it;
|
||||
for ( it = fH1Vector.begin(); it != fH1Vector.end(); it++ ) {
|
||||
delete *it;
|
||||
}
|
||||
std::vector<tools::hbook::h2*>::iterator it2;
|
||||
for ( it2 = fH2Vector.begin(); it2 != fH2Vector.end(); it2++ ) {
|
||||
delete *it2;
|
||||
}
|
||||
delete fNtuple;
|
||||
delete fFile;
|
||||
|
||||
fgInstance = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// private methods
|
||||
//
|
||||
|
||||
//_____________________________________________________________________________
|
||||
tools::hbook::wntuple::column<int>*
|
||||
ExG4HbookAnalysisManager::GetNtupleIColumn(G4int id) const
|
||||
{
|
||||
std::map<G4int, tools::hbook::wntuple::column<int>* >::const_iterator it
|
||||
= fNtupleIColumnMap.find(id);
|
||||
if ( it == fNtupleIColumnMap.end() ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "column " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::GetNtupleIColumn()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
tools::hbook::wntuple::column<float>*
|
||||
ExG4HbookAnalysisManager::GetNtupleFColumn(G4int id) const
|
||||
{
|
||||
std::map<G4int, tools::hbook::wntuple::column<float>* >::const_iterator it
|
||||
= fNtupleFColumnMap.find(id);
|
||||
if ( it == fNtupleFColumnMap.end() ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "column " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::GetNtupleFColumn()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
||||
|
||||
//_____________________________________________________________________________
|
||||
tools::hbook::wntuple::column<double>*
|
||||
ExG4HbookAnalysisManager::GetNtupleDColumn(G4int id) const
|
||||
{
|
||||
std::map<G4int, tools::hbook::wntuple::column<double>* >::const_iterator it
|
||||
= fNtupleDColumnMap.find(id);
|
||||
if ( it == fNtupleDColumnMap.end() ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "column " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::GetNtupleDColumn()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
||||
//
|
||||
// public methods
|
||||
//
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::OpenFile(const G4String& fileName)
|
||||
{
|
||||
G4String name(fileName);
|
||||
if ( name.find(".") == std::string::npos ) {
|
||||
name.append(".");
|
||||
name.append(GetFileType());
|
||||
}
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("open", "analysis file", name);
|
||||
#endif
|
||||
|
||||
tools::hbook::CHCDIR("//PAWC"," ");
|
||||
|
||||
unsigned int unit = 1;
|
||||
fFile = new tools::hbook::wfile(std::cout, name, unit);
|
||||
if ( ! fFile->is_valid() ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "Cannot open file " << fileName;
|
||||
G4Exception("G4HbookAnalysisManager::OpenFile()",
|
||||
"Analysis_W001", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
// At this point, in HBOOK, we should have :
|
||||
// - created a //LUN1 directory attached to the file
|
||||
// - created a //PAWC/LUN1 in memory
|
||||
// - be in the directory //PAWC/LUN1.
|
||||
|
||||
// create an "histo" HBOOK directory both in memory and in the file :
|
||||
if ( fHistoDirectoryName != "" ) {
|
||||
tools::hbook::CHCDIR("//PAWC/LUN1"," ");
|
||||
tools::hbook::CHMDIR(fHistoDirectoryName.data()," ");
|
||||
tools::hbook::CHCDIR("//LUN1"," ");
|
||||
tools::hbook::CHMDIR(fHistoDirectoryName.data()," ");
|
||||
}
|
||||
|
||||
fLockHistoDirectoryName = true;
|
||||
|
||||
// the five upper lines could have been done with :
|
||||
//fFile->cd_home();
|
||||
//fFile->mkcd("histo");
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("open", "analysis file", name);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::Write()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("write", "file", "");
|
||||
#endif
|
||||
|
||||
// ntuple
|
||||
//if ( fNtuple ) fNtuple->add_row_end();
|
||||
|
||||
G4bool result = fFile->write();
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("write", "file", "", result);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::CloseFile()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("close", "file", "");
|
||||
#endif
|
||||
|
||||
//WARNING : have to delete the ntuple before closing the file.
|
||||
delete fNtuple;
|
||||
fNtuple = 0;
|
||||
|
||||
G4bool result = fFile->close();
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("close", "file", "", result);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4int ExG4HbookAnalysisManager::CreateH1(const G4String& name, const G4String& title,
|
||||
G4int nbins, G4double xmin, G4double xmax)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("create", "H1", name);
|
||||
#endif
|
||||
|
||||
// Go to histograms directory
|
||||
if ( fHistoDirectoryName != "" ) {
|
||||
G4String histoPath = "//PAWC/LUN1/";
|
||||
histoPath.append(fHistoDirectoryName.data());
|
||||
tools::hbook::CHCDIR(histoPath.data()," ");
|
||||
}
|
||||
|
||||
// Set fH1HbookIdOffset if needed
|
||||
if ( fH1Vector.size() == 0 ) {
|
||||
if ( fH1HbookIdOffset == -1 ) {
|
||||
if ( fFirstHistoId > 0 )
|
||||
fH1HbookIdOffset = 0;
|
||||
else
|
||||
fH1HbookIdOffset = 1;
|
||||
|
||||
if ( fH1HbookIdOffset > 0 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << "H1 will be defined in HBOOK with ID = G4_firstHistoId + 1";
|
||||
G4Exception("ExG4HbookAnalysisManager::CreateH1()",
|
||||
"Analysis_W011", JustWarning, description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create histogram
|
||||
G4int index = fH1Vector.size();
|
||||
G4int hbookIndex = fH1HbookIdOffset + fH1Vector.size() + fFirstHistoId;
|
||||
tools::hbook::h1* h1 = new tools::hbook::h1(hbookIndex, title, nbins, xmin, xmax);
|
||||
fH1Vector.push_back(h1);
|
||||
fH1MapByName[name] = h1;
|
||||
|
||||
if ( fHistoDirectoryName != "" ) {
|
||||
// Return to //PAWC/LUN1 :
|
||||
tools::hbook::CHCDIR("//PAWC/LUN1"," ");
|
||||
}
|
||||
|
||||
fLockFirstHistoId = true;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " name : " << name << " hbook index : " << hbookIndex;
|
||||
fpVerboseL1->Message("create", "H1", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
return index + fFirstHistoId;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4int ExG4HbookAnalysisManager::CreateH2(const G4String& name, const G4String& title,
|
||||
G4int nxbins, G4double xmin, G4double xmax,
|
||||
G4int nybins, G4double ymin, G4double ymax)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("create", "H2", name);
|
||||
#endif
|
||||
|
||||
// Go to histograms directory
|
||||
if ( fHistoDirectoryName != "" ) {
|
||||
G4String histoPath = "//PAWC/LUN1/";
|
||||
histoPath.append(fHistoDirectoryName.data());
|
||||
tools::hbook::CHCDIR(histoPath.data()," ");
|
||||
}
|
||||
|
||||
// Set fH2HbookIdOffset if needed
|
||||
if ( fH2Vector.size() == 0 ) {
|
||||
if ( fH2HbookIdOffset == -1 ) {
|
||||
if ( fFirstHistoId > 0 )
|
||||
fH2HbookIdOffset = fgkDefaultH2HbookIdOffset;
|
||||
else
|
||||
fH2HbookIdOffset = fgkDefaultH2HbookIdOffset + 1;
|
||||
|
||||
if ( fH2HbookIdOffset != fgkDefaultH2HbookIdOffset ) {
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< "H2 will be defined in HBOOK with ID = "
|
||||
<< fgkDefaultH2HbookIdOffset << " + G4_firstHistoId + 1";
|
||||
G4Exception("ExG4HbookAnalysisManager::CreateH2()",
|
||||
"Analysis_W011", JustWarning, description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
G4int index = fH2Vector.size();
|
||||
G4int hbookIndex = fH2HbookIdOffset + fH2Vector.size() + fFirstHistoId;
|
||||
tools::hbook::h2* h2
|
||||
= new tools::hbook::h2(hbookIndex, title, nxbins, xmin, xmax, nybins, ymin, ymax);
|
||||
fH2Vector.push_back(h2);
|
||||
fH2MapByName[name] = h2;
|
||||
|
||||
// Return to //PAWC/LUN1 :
|
||||
if ( fHistoDirectoryName != "" ) {
|
||||
tools::hbook::CHCDIR("//PAWC/LUN1"," ");
|
||||
}
|
||||
|
||||
fLockFirstHistoId = true;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " name : " << name << " hbook index : " << hbookIndex;
|
||||
fpVerboseL1->Message("create", "H2", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
return index + fFirstHistoId;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
void ExG4HbookAnalysisManager::CreateNtuple(const G4String& name,
|
||||
const G4String& title)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("create", "ntuple", name);
|
||||
#endif
|
||||
|
||||
if ( fNtuple ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " "
|
||||
<< "Ntuple already exists. "
|
||||
<< "(Only one ntuple is currently supported.)";
|
||||
G4Exception("G4HbookAnalysisManager::CreateNtuple()",
|
||||
"Analysis_W006", JustWarning, description);
|
||||
return;
|
||||
}
|
||||
|
||||
// Create an "ntuple" directory both in memory and in the file
|
||||
fFile->cd_home(); //go under //PAWC/LUN1
|
||||
if ( fNtupleDirectoryName == "" )
|
||||
fFile->mkcd(fgkDefaultNtupleDirectoryName.data());
|
||||
else
|
||||
fFile->mkcd(fNtupleDirectoryName.data());
|
||||
|
||||
// Define ntuple ID in HBOOK
|
||||
if ( fNtupleHbookId == -1 ) fNtupleHbookId = fgkDefaultNtupleHbookId;
|
||||
|
||||
// We should be under //PAWC/LUN1/ntuple
|
||||
fNtuple = new tools::hbook::wntuple(fNtupleHbookId, name);
|
||||
fNtupleName = name;
|
||||
fNtupleTitle = title;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " name : " << name << " hbook index : " << fNtupleHbookId;
|
||||
fpVerboseL1->Message("create", "ntuple", description);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4int ExG4HbookAnalysisManager::CreateNtupleIColumn(const G4String& name)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("create", "ntuple I column", name);
|
||||
#endif
|
||||
|
||||
G4int index = fNtuple->columns().size();
|
||||
tools::hbook::wntuple::column<int>* column = fNtuple->create_column<int>(name);
|
||||
fNtupleIColumnMap[index] = column;
|
||||
fLockFirstNtupleColumnId = true;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("create", "ntuple I column", name);
|
||||
#endif
|
||||
|
||||
return index + fFirstNtupleColumnId;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4int ExG4HbookAnalysisManager::CreateNtupleFColumn(const G4String& name)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("create", "ntuple F column", name);
|
||||
#endif
|
||||
|
||||
G4int index = fNtuple->columns().size();
|
||||
tools::hbook::wntuple::column<float>* column = fNtuple->create_column<float>(name);
|
||||
fNtupleFColumnMap[index] = column;
|
||||
fLockFirstNtupleColumnId = true;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("create", "ntuple F column", name);
|
||||
#endif
|
||||
|
||||
return index + fFirstNtupleColumnId;
|
||||
}
|
||||
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4int ExG4HbookAnalysisManager::CreateNtupleDColumn(const G4String& name)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("create", "ntuple D column", name);
|
||||
#endif
|
||||
|
||||
G4int index = fNtuple->columns().size();
|
||||
tools::hbook::wntuple::column<double>* column = fNtuple->create_column<double>(name);
|
||||
fNtupleDColumnMap[index] = column;
|
||||
fLockFirstNtupleColumnId = true;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("create", "ntuple D column", name);
|
||||
#endif
|
||||
|
||||
return index + fFirstNtupleColumnId;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
void ExG4HbookAnalysisManager::FinishNtuple()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("finish", "ntuple", fNtupleName);
|
||||
#endif
|
||||
|
||||
// Return to //PAWC/LUN1 :
|
||||
tools::hbook::CHCDIR("//PAWC/LUN1"," ");
|
||||
|
||||
//fNtuple->add_row_beg();
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL1 )
|
||||
fpVerboseL1->Message("finish", "ntuple", fNtupleName);
|
||||
#endif
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::FillH1(G4int id, G4double value, G4double weight)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL3->Message("fill", "H1", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
tools::hbook::h1* h1 = GetH1(id);
|
||||
if ( ! h1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "histogram " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::FillH1()",
|
||||
"Analysis_W007", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
h1->fill(value, weight);
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL2 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL2->Message("fill", "H1", description);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::FillH2(G4int id,
|
||||
G4double xvalue, G4double yvalue,
|
||||
G4double weight)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id
|
||||
<< " xvalue " << xvalue << " yvalue " << yvalue;
|
||||
fpVerboseL3->Message("fill", "H2", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
tools::hbook::h2* h2 = GetH2(id);
|
||||
if ( ! h2 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "histogram " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::FillH2()",
|
||||
"Analysis_W007", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
h2->fill(xvalue, yvalue, weight);
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL2 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id
|
||||
<< " xvalue " << xvalue << " yvalue " << yvalue;
|
||||
fpVerboseL2->Message("fill", "H2", description);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::FillNtupleIColumn(G4int id, G4int value)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL3->Message("fill", "ntuple I column", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
tools::hbook::wntuple::column<int>* column = GetNtupleIColumn(id);
|
||||
if ( ! column ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "column " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::FillNtupleIColumn()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
column->fill(value);
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL2 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL2->Message("fill", "ntuple I column", description);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::FillNtupleFColumn(G4int id, G4float value)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL3->Message("fill", "ntuple F column", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
tools::hbook::wntuple::column<float>* column = GetNtupleFColumn(id);
|
||||
if ( ! column ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "column " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::FillNtupleFColumn()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
column->fill(value);
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL2 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL2->Message("fill", "ntuple F column", description);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::FillNtupleDColumn(G4int id, G4double value)
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL3->Message("fill", "ntuple D column", description);
|
||||
}
|
||||
#endif
|
||||
|
||||
tools::hbook::wntuple::column<double>* column = GetNtupleDColumn(id);
|
||||
if ( ! column ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "column " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::FillNtupleDColumn()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
column->fill(value);
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL2 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " id " << id << " value " << value;
|
||||
fpVerboseL2->Message("fill", "ntuple D column", description);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::AddNtupleRow()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL3 )
|
||||
fpVerboseL3->Message("add", "ntuple row", "");
|
||||
#endif
|
||||
|
||||
//G4cout << "Hbook: Going to add Ntuple row ..." << G4endl;
|
||||
if ( ! fNtuple ) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "ntuple does not exist. ";
|
||||
G4Exception("G4HbookAnalysisManager::AddNtupleRow()",
|
||||
"Analysis_W008", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
//fNtuple->add_row_fast();
|
||||
fNtuple->add_row();
|
||||
#ifdef G4VERBOSE
|
||||
if ( fpVerboseL2 )
|
||||
fpVerboseL2->Message("add", "ntuple row", "");
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
tools::hbook::h1* ExG4HbookAnalysisManager::GetH1(G4int id, G4bool warn) const
|
||||
{
|
||||
G4int index = id - fFirstHistoId;
|
||||
if ( index < 0 || index >= G4int(fH1Vector.size()) ) {
|
||||
if ( warn) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "histo " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::GetH1()",
|
||||
"Analysis_W007", JustWarning, description);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return fH1Vector[index];
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
tools::hbook::h2* ExG4HbookAnalysisManager::GetH2(G4int id, G4bool warn) const
|
||||
{
|
||||
G4int index = id - fFirstHistoId;
|
||||
if ( index < 0 || index >= G4int(fH2Vector.size()) ) {
|
||||
if ( warn) {
|
||||
G4ExceptionDescription description;
|
||||
description << " " << "histo " << id << " does not exist.";
|
||||
G4Exception("G4HbookAnalysisManager::GetH2()",
|
||||
"Analysis_W007", JustWarning, description);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return fH2Vector[index];
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
tools::hbook::wntuple* ExG4HbookAnalysisManager::GetNtuple() const
|
||||
{
|
||||
return fNtuple;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::SetH1HbookIdOffset(G4int offset)
|
||||
{
|
||||
if ( fH1Vector.size() ) {
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< "Cannot set H1HbookIdOffset as some H1 histogramms already exist.";
|
||||
G4Exception("G4HbookAnalysisManager::SetH1HbookIdOffset()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( fFirstHistoId + offset < 1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << "The first histogram HBOOK id must be >= 1.";
|
||||
G4Exception("G4HbookAnalysisManager::SetH1HbookIdOffset()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
fH1HbookIdOffset = offset;
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::SetH2HbookIdOffset(G4int offset)
|
||||
{
|
||||
if ( fH2Vector.size() ) {
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< "Cannot set H2HbookIdOffset as some H2 histogramms already exist.";
|
||||
G4Exception("G4HbookAnalysisManager::SetH2HbookIdOffset()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( fFirstHistoId + offset < 1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << "The first histogram HBOOK id must be >= 1.";
|
||||
G4Exception("G4HbookAnalysisManager::SetH1HbookIdOffset()",
|
||||
"Analysis_W009", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
fH2HbookIdOffset = offset;
|
||||
return true;
|
||||
}
|
||||
|
||||
//_____________________________________________________________________________
|
||||
G4bool ExG4HbookAnalysisManager::SetNtupleHbookId(G4int ntupleId)
|
||||
{
|
||||
if ( fNtuple ) {
|
||||
G4ExceptionDescription description;
|
||||
description
|
||||
<< "Cannot set NtupleHbookId as an ntuple already exists.";
|
||||
G4Exception("G4HbookAnalysisManager::SetNtupleHbookId()",
|
||||
"Analysis_W010", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ntupleId < 1 ) {
|
||||
G4ExceptionDescription description;
|
||||
description << "The ntuple HBOOK id must be >= 1.";
|
||||
G4Exception("G4HbookAnalysisManager::SetNtupleHbookId()",
|
||||
"Analysis_W010", JustWarning, description);
|
||||
return false;
|
||||
}
|
||||
|
||||
fNtupleHbookId = ntupleId;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: HistoManager.cc 72233 2013-07-12 08:35:48Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -81,6 +81,6 @@ void HistoManager::Book()
|
||||
if (k == 2*MaxAbsor+1) title = "energy flow (MeV/event)";
|
||||
if (k == 2*MaxAbsor+2) title = "lateral energy leak (MeV/event)";
|
||||
G4int ih = analysisManager->CreateH1(id[k], title, nbins, vmin, vmax);
|
||||
analysisManager->SetActivation(G4VAnalysisManager::kH1, ih, false);
|
||||
analysisManager->SetH1Activation(ih, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id$
|
||||
// $Id: PhysListEmStandard.cc 68558 2013-04-01 22:45:08Z adotti $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -40,7 +40,6 @@
|
||||
#include "G4KleinNishinaModel.hh"
|
||||
|
||||
#include "G4eMultipleScattering.hh"
|
||||
#include "G4UrbanMscModel96.hh"
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
@@ -86,9 +85,9 @@ void PhysListEmStandard::ConstructProcess()
|
||||
|
||||
// Add standard EM Processes
|
||||
//
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
aParticleIterator->reset();
|
||||
while( (*aParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = aParticleIterator->value();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "gamma") {
|
||||
@@ -96,15 +95,13 @@ void PhysListEmStandard::ConstructProcess()
|
||||
////ph->RegisterProcess(new G4RayleighScattering, particle);
|
||||
ph->RegisterProcess(new G4PhotoElectricEffect, particle);
|
||||
G4ComptonScattering* cs = new G4ComptonScattering;
|
||||
cs->SetModel(new G4KleinNishinaModel());
|
||||
cs->SetEmModel(new G4KleinNishinaModel());
|
||||
ph->RegisterProcess(cs, particle);
|
||||
ph->RegisterProcess(new G4GammaConversion, particle);
|
||||
|
||||
} else if (particleName == "e-") {
|
||||
|
||||
G4eMultipleScattering* msc = new G4eMultipleScattering();
|
||||
msc -> AddEmModel(0, new G4UrbanMscModel96());
|
||||
ph->RegisterProcess(msc, particle);
|
||||
ph->RegisterProcess(new G4eMultipleScattering(), particle);
|
||||
//
|
||||
G4eIonisation* eIoni = new G4eIonisation();
|
||||
eIoni->SetStepFunction(0.1, 100*um);
|
||||
@@ -114,9 +111,7 @@ void PhysListEmStandard::ConstructProcess()
|
||||
|
||||
} else if (particleName == "e+") {
|
||||
|
||||
G4eMultipleScattering* msc = new G4eMultipleScattering();
|
||||
msc -> AddEmModel(0, new G4UrbanMscModel96());
|
||||
ph->RegisterProcess(msc, particle);
|
||||
ph->RegisterProcess(new G4eMultipleScattering(), particle);
|
||||
//
|
||||
G4eIonisation* eIoni = new G4eIonisation();
|
||||
eIoni->SetStepFunction(0.1, 100*um);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/PhysListEmStandardWVI.cc
|
||||
/// \brief Implementation of the PhysListEmStandardWVI class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: PhysListEmStandardWVI.cc 68585 2013-04-01 23:35:07Z adotti $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -85,9 +85,9 @@ void PhysListEmStandardWVI::ConstructProcess()
|
||||
// Add standard EM Processes
|
||||
//
|
||||
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
aParticleIterator->reset();
|
||||
while( (*aParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = aParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/PhysicsList.cc
|
||||
/// \brief Implementation of the PhysicsList class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: PhysicsList.cc 67268 2013-02-13 11:38:40Z ihrivnac $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -50,7 +50,10 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PhysicsList::PhysicsList() : G4VModularPhysicsList()
|
||||
PhysicsList::PhysicsList() : G4VModularPhysicsList(),
|
||||
fEmPhysicsList(0),
|
||||
fStepMaxProcess(0),
|
||||
fMessenger(0)
|
||||
{
|
||||
fCurrentDefaultCut = 1.0*mm;
|
||||
fCutForGamma = fCurrentDefaultCut;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/PhysicsListMessenger.cc
|
||||
/// \brief Implementation of the PhysicsListMessenger class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: PhysicsListMessenger.cc 67268 2013-02-13 11:38:40Z ihrivnac $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -41,7 +41,13 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
|
||||
:fPhysicsList(pPhys)
|
||||
:G4UImessenger(),fPhysicsList(pPhys),
|
||||
fPhysDir(0),
|
||||
fGammaCutCmd(0),
|
||||
fElectCutCmd(0),
|
||||
fProtoCutCmd(0),
|
||||
fAllCutCmd(0),
|
||||
fListCmd(0)
|
||||
{
|
||||
fPhysDir = new G4UIdirectory("/testem/phys/");
|
||||
fPhysDir->SetGuidance("physics list commands");
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/PrimaryGeneratorAction.cc
|
||||
/// \brief Implementation of the PrimaryGeneratorAction class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: PrimaryGeneratorAction.cc 67268 2013-02-13 11:38:40Z ihrivnac $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -47,12 +47,15 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* det)
|
||||
:fDetector(det)
|
||||
:G4VUserPrimaryGeneratorAction(),
|
||||
fParticleGun(0),
|
||||
fDetector(det),
|
||||
fRndmBeam(0.),
|
||||
fGunMessenger(0)
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
fParticleGun = new G4ParticleGun(n_particle);
|
||||
SetDefaultKinematic();
|
||||
fRndmBeam = 0.;
|
||||
|
||||
//create a messenger for this class
|
||||
fGunMessenger = new PrimaryGeneratorMessenger(this);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/PrimaryGeneratorMessenger.cc
|
||||
/// \brief Implementation of the PrimaryGeneratorMessenger class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: PrimaryGeneratorMessenger.cc 67268 2013-02-13 11:38:40Z ihrivnac $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -42,7 +42,10 @@
|
||||
|
||||
PrimaryGeneratorMessenger::PrimaryGeneratorMessenger(
|
||||
PrimaryGeneratorAction* Gun)
|
||||
:fAction(Gun)
|
||||
:G4UImessenger(),fAction(Gun),
|
||||
fGunDir(0),
|
||||
fDefaultCmd(0),
|
||||
fRndmCmd(0)
|
||||
{
|
||||
fGunDir = new G4UIdirectory("/testem/gun/");
|
||||
fGunDir->SetGuidance("gun control");
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/RunAction.cc
|
||||
/// \brief Implementation of the RunAction class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: RunAction.cc 67268 2013-02-13 11:38:40Z ihrivnac $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -58,7 +58,8 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
RunAction::RunAction(DetectorConstruction* det, PrimaryGeneratorAction* prim)
|
||||
:fDetector(det), fPrimary(prim), fRunMessenger(0), fHistoManager(0)
|
||||
:G4UserRunAction(),fDetector(det), fPrimary(prim), fRunMessenger(0),
|
||||
fHistoManager(0)
|
||||
{
|
||||
fRunMessenger = new RunActionMessenger(this);
|
||||
fHistoManager = new HistoManager();
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/RunActionMessenger.cc
|
||||
/// \brief Implementation of the RunActionMessenger class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: RunActionMessenger.cc 67268 2013-02-13 11:38:40Z ihrivnac $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -44,7 +44,10 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
RunActionMessenger::RunActionMessenger(RunAction* run)
|
||||
:fRunAction(run)
|
||||
:G4UImessenger(),fRunAction(run),
|
||||
fRunDir(0),
|
||||
fAccCmd(0),
|
||||
fLimCmd(0)
|
||||
{
|
||||
fRunDir = new G4UIdirectory("/testem/run/");
|
||||
fRunDir->SetGuidance("run commands");
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/StepMax.cc
|
||||
/// \brief Implementation of the StepMax class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: StepMax.cc 67268 2013-02-13 11:38:40Z ihrivnac $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -37,7 +37,7 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
StepMax::StepMax(const G4String& processName)
|
||||
: G4VDiscreteProcess(processName)
|
||||
: G4VDiscreteProcess(processName),fMess(0)
|
||||
{
|
||||
for (G4int k=0; k<MaxAbsor; k++) fStepMax[k] = DBL_MAX;
|
||||
fMess = new StepMaxMessenger(this);
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
/// \brief Implementation of the StepMaxMessenger class
|
||||
//
|
||||
// $Id: fStepMaxMessenger.cc,v 1.3 2006-06-29 16:53:21 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -41,7 +40,9 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
StepMaxMessenger::StepMaxMessenger(StepMax* stepM)
|
||||
:fStepMax(stepM)
|
||||
:G4UImessenger(),fStepMax(stepM),
|
||||
fStepMaxDir(0),
|
||||
fStepMaxCmd(0)
|
||||
{
|
||||
fStepMaxDir = new G4UIdirectory("/testem/stepMax/");
|
||||
fStepMaxDir->SetGuidance("histograms control");
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/// \file electromagnetic/TestEm3/src/SteppingAction.cc
|
||||
/// \brief Implementation of the SteppingAction class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: SteppingAction.cc 66241 2012-12-13 18:34:42Z gunter $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,24 +23,26 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file electromagnetic/TestEm3/src/SteppingVerbose.cc
|
||||
/// \file radioactivedecay/rdecay01/src/SteppingVerbose.cc
|
||||
/// \brief Implementation of the SteppingVerbose class
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: SteppingVerbose.cc 71645 2013-06-19 15:37:57Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "SteppingVerbose.hh"
|
||||
|
||||
#include "G4SteppingManager.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
SteppingVerbose::SteppingVerbose()
|
||||
{}
|
||||
: G4SteppingVerbose()
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -49,10 +51,46 @@ SteppingVerbose::~SteppingVerbose()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void SteppingVerbose::StepInfo()
|
||||
{
|
||||
void SteppingVerbose::TrackingStarted()
|
||||
{
|
||||
CopyState();
|
||||
|
||||
G4int prec = G4cout.precision(3);
|
||||
|
||||
//Step zero
|
||||
//
|
||||
if( verboseLevel > 0 ){
|
||||
G4cout << std::setw( 5) << "Step#" << " "
|
||||
<< std::setw( 6) << "X" << " "
|
||||
<< std::setw( 6) << "Y" << " "
|
||||
<< std::setw( 6) << "Z" << " "
|
||||
<< std::setw( 9) << "KineE" << " "
|
||||
<< std::setw( 9) << "dEStep" << " "
|
||||
<< std::setw(10) << "StepLeng"
|
||||
<< std::setw(10) << "TrakLeng"
|
||||
<< std::setw(10) << "Volume" << " "
|
||||
<< std::setw(10) << "Process" << G4endl;
|
||||
|
||||
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
|
||||
<< std::setw(10) << fTrack->GetVolume()->GetName()
|
||||
<< " initStep" << G4endl;
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void SteppingVerbose::StepInfo()
|
||||
{
|
||||
CopyState();
|
||||
|
||||
G4int prec = G4cout.precision(3);
|
||||
|
||||
if( verboseLevel >= 1 ){
|
||||
@@ -89,30 +127,27 @@ void SteppingVerbose::StepInfo()
|
||||
G4cout << " " << std::setw(10) << procName;
|
||||
G4cout << G4endl;
|
||||
|
||||
if( verboseLevel == 2 ){
|
||||
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
|
||||
fN2ndariesAlongStepDoIt +
|
||||
fN2ndariesPostStepDoIt;
|
||||
if(tN2ndariesTot>0){
|
||||
G4cout << "\n :----- List of secondaries ----------------"
|
||||
<< G4endl;
|
||||
if (verboseLevel == 2) {
|
||||
const std::vector<const G4Track*>* secondary
|
||||
= fStep->GetSecondaryInCurrentStep();
|
||||
size_t nbtrk = (*secondary).size();
|
||||
if (nbtrk) {
|
||||
G4cout << "\n :----- List of secondaries ----------------" << G4endl;
|
||||
G4cout.precision(4);
|
||||
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
|
||||
lp1<(*fSecondary).size(); lp1++){
|
||||
for (size_t lp=0; lp<(*secondary).size(); lp++) {
|
||||
G4cout << " "
|
||||
<< std::setw(13)
|
||||
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName()
|
||||
<< (*secondary)[lp]->GetDefinition()->GetParticleName()
|
||||
<< ": energy ="
|
||||
<< std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
|
||||
<< G4BestUnit((*secondary)[lp]->GetKineticEnergy(),"Energy")
|
||||
<< " time ="
|
||||
<< std::setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetGlobalTime(),"Time");
|
||||
<< G4BestUnit((*secondary)[lp]->GetGlobalTime(),"Time");
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
G4cout << " :------------------------------------------\n"
|
||||
<< G4endl;
|
||||
G4cout << " :------------------------------------------\n" << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,37 +156,3 @@ void SteppingVerbose::StepInfo()
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void SteppingVerbose::TrackingStarted()
|
||||
{
|
||||
|
||||
CopyState();
|
||||
G4int prec = G4cout.precision(3);
|
||||
if( verboseLevel > 0 ){
|
||||
|
||||
G4cout << std::setw( 5) << "Step#" << " "
|
||||
<< std::setw( 6) << "X" << " "
|
||||
<< std::setw( 6) << "Y" << " "
|
||||
<< std::setw( 6) << "Z" << " "
|
||||
<< std::setw( 9) << "KineE" << " "
|
||||
<< std::setw( 9) << "dEStep" << " "
|
||||
<< std::setw(10) << "StepLeng"
|
||||
<< std::setw(10) << "TrakLeng"
|
||||
<< std::setw(10) << "Volume" << " "
|
||||
<< std::setw(10) << "Process" << G4endl;
|
||||
|
||||
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
|
||||
<< std::setw(10) << fTrack->GetVolume()->GetName()
|
||||
<< " initStep" << G4endl;
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
/// \brief Implementation of the TrackingAction class
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: TrackingAction.cc 73035 2013-08-15 09:27:10Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -45,9 +45,8 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
TrackingAction::TrackingAction(DetectorConstruction* det,RunAction* run,
|
||||
EventAction* evt)
|
||||
:fDetector(det), fRunAct(run), fEventAct(evt)
|
||||
TrackingAction::TrackingAction(DetectorConstruction* det,RunAction* run)
|
||||
:G4UserTrackingAction(),fDetector(det), fRunAct(run)
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user