Skip to content
Snippets Groups Projects
Commit 2636a021 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

v95r2p6

parent 15d1b05d
Branches
Tags v95r2p6
No related merge requests found
Showing
with 1069 additions and 78 deletions
#ifndef HadronPhysicsQGSP_BERT_HP_h
#define HadronPhysicsQGSP_BERT_HP_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VPhysicsConstructor.hh"
#include "G4HadronQEDBuilder.hh"
#include "G4StoppingHadronBuilder.hh"
#include "G4MiscLHEPBuilder.hh"
#include "G4PiKBuilder.hh"
#include "G4LEPPiKBuilder.hh"
#include "G4QGSPPiKBuilder.hh"
#include "G4BertiniPiKBuilder.hh"
#include "G4ProtonBuilder.hh"
#include "G4LEPProtonBuilder.hh"
#include "G4QGSPProtonBuilder.hh"
#include "G4BertiniProtonBuilder.hh"
#include "G4NeutronBuilder.hh"
#include "G4LEPNeutronBuilder.hh"
#include "G4QGSPNeutronBuilder.hh"
#include "G4BertiniNeutronBuilder.hh"
#include "G4NeutronHPBuilder.hh"
class HadronPhysicsQGSP_BERT_HP : public G4VPhysicsConstructor
{
public:
HadronPhysicsQGSP_BERT_HP(const G4String& name ="hadron");
virtual ~HadronPhysicsQGSP_BERT_HP();
public:
virtual void ConstructParticle();
virtual void ConstructProcess();
private:
G4NeutronBuilder theNeutrons;
G4LEPNeutronBuilder theLEPNeutron;
G4QGSPNeutronBuilder theQGSPNeutron;
G4BertiniNeutronBuilder theBertiniNeutron;
G4NeutronHPBuilder theHPNeutron;
G4PiKBuilder thePiK;
G4LEPPiKBuilder theLEPPiK;
G4QGSPPiKBuilder theQGSPPiK;
G4BertiniPiKBuilder theBertiniPiK;
G4ProtonBuilder thePro;
G4LEPProtonBuilder theLEPPro;
G4QGSPProtonBuilder theQGSPPro;
G4BertiniProtonBuilder theBertiniPro;
G4MiscLHEPBuilder theMiscLHEP;
G4StoppingHadronBuilder theStoppingHadron;
G4HadronQEDBuilder theHadronQED;
};
// 2002 by J.P. Wellisch
#endif
......@@ -3,7 +3,7 @@
# Maintainer : Gloria CORTI
#============================================================================
package G4LHCblists
version v2r2
version v3r0
# Structure, i.e. directories to process.
#============================================================================
......
v2r2
v3r0
......@@ -4,6 +4,11 @@
! Purpose : Private LHCb physics lists
!-----------------------------------------------------------------------------
!======================== G4LHCblists v3r0 2013-09-16 ========================
! 2013-09-16 - Gloria Corti
- Remove obsolete header of physics list that was left over
. HadronPhysicsQGSP_BERT_HP.hh
!======================== G4LHCblists v2r2 2011-10-03 ========================
! 2011-10-03 - Gloria Corti
- Add new list with suggestion from Matt Reid for improvement of Multiple
......
# This configuration is not really for the package, but
# to build Geant4.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(G4VERBOSE OFF)
else()
set(G4VERBOSE ON)
endif()
include(ExternalProject)
ExternalProject_Add(Geant4
URL http://geant4.cern.ch/support/source/geant${Geant4_version}.tar.gz
PATCH_COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Geant4/G4config/patches/patch_g4_sources.py ${CMAKE_SOURCE_DIR} ${Geant4_version}
CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/toolchain.cmake
-DGEANT4_INSTALL_DATA=OFF
-DGEANT4_USE_SYSTEM_CLHEP=ON
-DGEANT4_USE_XM=ON
-DGEANT4_USE_GDML=ON
-DGEANT4_USE_OPENGL=ON
-DGEANT4_USE_OPENGL_X11=ON
-DGEANT4_USE_RAYTRACER_X11=ON
-DGEANT4_USE_NETWORKVRML=ON
-DGEANT4_USE_NETWORKDAWN=ON
-DGEANT4_USE_INVENTOR=OFF
-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/InstallArea/$ENV{CMTCONFIG}
-DCMAKE_INSTALL_INCLUDEDIR=../include
-DCMAKE_INSTALL_DATAROOTDIR=../share
-DGEANT4_BUILD_VERBOSE_CODE=${G4VERBOSE}
-DCMAKE_USE_CCACHE=${CMAKE_USE_CCACHE}
-DCMAKE_USE_DISTCC=${CMAKE_USE_DISTCC}
-DLCG_USE_NATIVE_COMPILER=${LCG_USE_NATIVE_COMPILER}
)
# Hardcoded list of external packages used by Geant4, needed to prepare the
# runtime environment.
foreach(ext CLHEP EXPAT XercesC X11 OpenGL Motif)
find_package(${ext})
endforeach()
package G4config
version v95r2p5
version v95r2p6
branches cmt doc
......@@ -11,13 +11,14 @@ use CLHEP v* LCG_Interfaces
#==============================================================================
# set versions of Geant4
#==============================================================================
set G4_native_version "9.5.p02"
set G4VERS v95r2p5
set G4_native_version "9.5.p02" \
override-geant4-version "${G4_NATIVE_VERSION}"
set G4VERS v95r2p6
# =============================================================================
# set Geant4 environment variables
#=============================================================================
set G4PATH "${SITEROOT}/sw/lcg/external/geant4"
set G4PATH "${LCG_external}/geant4"
set G4SHARE "${G4PATH}/${G4_native_version}/share"
......
v95r2p5
v95r2p6
......@@ -4,6 +4,41 @@
! Purpose : Configuration package for Geant4 build
!-----------------------------------------------------------------------------
! ======================= G4config v95r2p6 2013-12-19 ========================
! 2013-12-19 - Nigel Watson
- Updated Marco's (much improved, for cmake) source patching script
scripts for another fix in Geant4/G4processes.
! 2013-09-17 - Marco Clemencic
- Fixes for compatibility between CMake build and CMT.
! 2013-09-12 - Marco Clemencic
- Disabled Geant4 backward-compatibility and config scripts in the CMake
build (causing troubles with the nightly builds).
! 2013-09-11 - Marco Clemencic
- Splitted the top level CMakeLists.txt to better fit in the Gaudi CMake
configuration framework.
- Fixed the LD_LIBRARY_PATH for the externals.
! 2013-09-11 - Marco Clemencic
- Modified the CMake configuration to use the CLHEP granular libraries
instead of the monolithic one (importing FindCLHEP.cmake from Gaudi).
! 2013-09-10 - Marco Clemencic
- Added a script and a patch file to patch the Geant4 sources for the build
with CMake a-la LHCb.
! 2013-08-02 - Marco Clemencic
- Modified the configuration to allow overriding of the Geant4 version to
use.
To pick up a non default version, one needs to add the CMT tag
'override-geant4-version' and set the new verison in the environment
variable G4_NATIVE_VERSION. For example
export CMTEXTRATAGS=override-geant4-version,$CMTEXTRATAGS
export G4_NATIVE_VERSION=9.6.p02
! ======================= G4config v95r2p4 2013-05-16 ========================
- Latest attempt to fix FTF-related job hangs (new G4processes/diffractive)
......
# - Try to find CLHEP
# Defines:
#
# CLHEP_FOUND
# CLHEP_VERSION
# CLHEP_INCLUDE_DIR
# CLHEP_INCLUDE_DIRS (not cached)
# CLHEP_<component>_LIBRARY
# CLHEP_<component>_FOUND
# CLHEP_LIBRARIES (not cached)
# CLHEP_LIBRARY_DIRS (not cached)
#
# Note: version detection inspired by FindBoost.cmake
find_path(CLHEP_INCLUDE_DIR CLHEP/ClhepVersion.h
HINTS $ENV{CLHEP_ROOT_DIR}/include ${CLHEP_ROOT_DIR}/include)
if(CLHEP_INCLUDE_DIR)
if(NOT DEFINED CLHEP_VERSION)
file(READ "${CLHEP_INCLUDE_DIR}/CLHEP/ClhepVersion.h" _CLHEP_VERSION_H_CONTENTS)
string(REGEX REPLACE ".*static std::string String\\(\\)[^\"]*return \"([^\"]*)\".*" "\\1" CLHEP_VERSION "${_CLHEP_VERSION_H_CONTENTS}")
set(CLHEP_VERSION ${CLHEP_VERSION} CACHE INTERNAL "Detected version of CLHEP")
message(STATUS "CLHEP version: ${CLHEP_VERSION}")
endif()
endif()
set(_CLHEP_COMPONENTS Cast Evaluator Exceptions GenericFunctions Geometry Random RandomObjects RefCount Vector Matrix)
foreach(component ${_CLHEP_COMPONENTS})
find_library(CLHEP_${component}_LIBRARY NAMES CLHEP-${component}-${CLHEP_VERSION}
HINTS $ENV{CLHEP_ROOT_DIR}/lib ${CLHEP_ROOT_DIR}/lib)
if (CLHEP_${component}_LIBRARY)
set(CLHEP_${component}_FOUND 1)
list(APPEND CLHEP_LIBRARIES ${CLHEP_${component}_LIBRARY})
get_filename_component(libdir ${CLHEP_${component}_LIBRARY} PATH)
list(APPEND CLHEP_LIBRARY_DIRS ${libdir})
else()
set(CLHEP_${component}_FOUND 0)
endif()
mark_as_advanced(CLHEP_${component}_LIBRARY)
endforeach()
if(CLHEP_LIBRARY_DIRS)
list(REMOVE_DUPLICATES CLHEP_LIBRARY_DIRS)
endif()
set(CLHEP_INCLUDE_DIRS ${CLHEP_INCLUDE_DIR})
# handle the QUIETLY and REQUIRED arguments and set CLHEP_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CLHEP DEFAULT_MSG CLHEP_INCLUDE_DIR CLHEP_LIBRARIES)
mark_as_advanced(CLHEP_FOUND CLHEP_INCLUDE_DIR)
# Hack for Geeant4 compatibility (we choose a random library)
set(CLHEP_LIBRARY ${CLHEP_Random_LIBRARY})
This diff is collapsed.
#!/usr/bin/env python
'''
Script to patch Geant 4 sources for LHCb.
'''
import sys
import os
import shutil
import logging
from subprocess import call
from os.path import join
logging.basicConfig(level=logging.INFO)
log = logging.getLogger()
# root directory of the project and Geant4 version
root_dir, g4vers = sys.argv[1:]
script_dir = os.path.realpath(os.path.dirname(sys.argv[0]))
# apply patch to CMake configuration
log.info('patching Geant4 CMake configuration')
call(['patch', '-p2', '-i', join(script_dir, 'geant4.cmake.patch')])
# copy physics lists
def copydir(src, dst):
if not os.path.exists(dst):
log.info('creating directory %s', dst)
os.makedirs(dst)
for f in os.listdir(src):
if f in ('.', '..', '.svn'):
continue
if os.path.isdir(join(src, f)):
copydir(join(src, f), join(dst, f))
else:
log.info('copying %s -> %s', join(src, f), join(dst, f))
shutil.copy(join(src, f), join(dst, f))
copydir(join(root_dir, 'Geant4', 'G4LHCblists', 'G4LHCblists'),
join('source', 'physics_lists', 'LHCb', 'include'))
copydir(join(root_dir, 'Geant4', 'G4LHCblists', 'src'),
join('source', 'physics_lists', 'LHCb', 'src'))
# replace fixed files
fixes_root = join(root_dir, 'Geant4', 'G4processes', 'srcnew')
fixes_dst_root = join('source', 'processes', 'hadronic', 'models')
# (fixes is a list of pairs, src+dst)
fixes = [('G4QHadronInelasticDataSet.hh', join(fixes_dst_root, 'chiral_inv_phase_space', 'interface', 'include')),
('G4QHadronInelasticDataSet.cc', join(fixes_dst_root, 'chiral_inv_phase_space', 'interface', 'src')),
(join('diffraction', 'G4FTFModel.cc'), join(fixes_dst_root, 'parton_string', 'diffraction', 'src')),
(join('management', 'G4VPartonStringModel.cc'), join(fixes_dst_root, 'parton_string', 'management', 'src'))]
for src, dst in fixes:
log.info('copying %s to dir %s', join(fixes_root, src), dst)
shutil.copy(join(fixes_root, src), dst)
# override Geant4 cmake modules
copydir(join(script_dir, 'cmake', 'Modules'),
join('cmake', 'Modules'))
......@@ -11,11 +11,13 @@ def main():
# Dir in which we keep updated source/headers.
SRCNEW_Dir="../srcnew"
SRCNEW_diffraction_Dir="../srcnew/diffraction"
SRCNEW_management_Dir="../srcnew/management"
# Dir for original source
SRC_Dir="../hadronic/models/chiral_inv_phase_space/interface/src"
# Dir for original FTF source to be replaced
SRC_diffraction_Dir="../hadronic/models/parton_string/diffraction/src"
SRC_management_Dir="../hadronic/models/parton_string/management/src"
# Can we get cmt macro values in .python?
# Expanded by cmt to be $(GEANT4_home)/$(GEANT4_installarea_prefix)/include
......@@ -52,5 +54,18 @@ def main():
fname = os.path.join(SRCNEW_diffraction_Dir, newfile)
shutil.copy2(fname,SRC_diffraction_Dir)
# Find any files in the srcnew dir (string max. retries problem fixes)
for newfile in os.listdir(SRCNEW_management_Dir):
# Only .cc to replace for max. retries fix.
# if fnmatch.fnmatch(newfile, '*.hh'):
#Replace old headers in install areas with new.
# fname = os.path.join(SRCNEW_Dir, newfile)
# shutil.copy2(fname,INSTALLAREA_project)
# shutil.copy2(fname,INSTALLAREA_package)
# Replace old .cc with new.
if fnmatch.fnmatch(newfile, '*.cc'):
fname = os.path.join(SRCNEW_management_Dir, newfile)
shutil.copy2(fname,SRC_management_Dir)
if __name__ == "__main__":
main()
......@@ -3,7 +3,7 @@
# Maintainer : Gloria CORTI
#============================================================================
package G4processes
version v8r3p3
version v8r3p4
# Structure, i.e. directories to process.
#============================================================================
......
v8r3p3
v8r3p4
......@@ -4,6 +4,11 @@
! Purpose :
!-----------------------------------------------------------------------------
! ======================= G4processes v8r3p4 2013-12-19 ========================
! 2013-12-19 - Nigel Watson
- Updated G4VPartonStringModel.cc, increase max. attempts before exception thrown (bug found by Paul Szczypka),
should fix 0.5% of production job failures.
! ======================= G4processes v8r3p3 2013-05-16 ========================
! 2013-05-16 - Paul Szczypka
- Updated G4FTFModel.cc to include fixes from the Geant4 team. Should fix the
......
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4VPartonStringModel.cc,v 1.8 2010-12-07 10:42:40 vuzhinsk Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
//
//// ------------------------------------------------------------
// GEANT 4 class implementation file
//
// ---------------- G4VPartonStringModel ----------------
// by Gunter Folger, May 1998.
// abstract class for all Parton String Models
// ------------------------------------------------------------
// debug switch
//#define debug_PartonStringModel
#include "G4VPartonStringModel.hh"
#include "G4ios.hh"
#include "G4ShortLivedConstructor.hh"
G4VPartonStringModel::G4VPartonStringModel() : G4VHighEnergyGenerator(),
stringFragmentationModel(0), theThis(0)
{
// Make shure Shotrylived partyicles are constructed.
G4ShortLivedConstructor ShortLived;
ShortLived.ConstructParticle();
}
G4VPartonStringModel::G4VPartonStringModel(const G4VPartonStringModel &) : G4VHighEnergyGenerator(),
stringFragmentationModel(0), theThis(0)
{
throw G4HadronicException(__FILE__, __LINE__, "G4VPartonStringModel::copy ctor not accessible");
}
G4VPartonStringModel::~G4VPartonStringModel()
{
}
const G4VPartonStringModel & G4VPartonStringModel::operator=(const G4VPartonStringModel &)
{
throw G4HadronicException(__FILE__, __LINE__, "G4VPartonStringModel::operator= meant to not be accessable");
return *this;
}
int G4VPartonStringModel::operator==(const G4VPartonStringModel &) const
{
return 0;
}
int G4VPartonStringModel::operator!=(const G4VPartonStringModel &) const
{
return 1;
}
G4KineticTrackVector * G4VPartonStringModel::Scatter(const G4Nucleus &theNucleus,
const G4DynamicParticle &aPrimary)
{
G4ExcitedStringVector * strings = NULL;
G4DynamicParticle thePrimary=aPrimary;
G4LorentzRotation toZ;
G4LorentzVector Ptmp=thePrimary.Get4Momentum();
toZ.rotateZ(-1*Ptmp.phi());
toZ.rotateY(-1*Ptmp.theta());
thePrimary.Set4Momentum(toZ*Ptmp);
G4LorentzRotation toLab(toZ.inverse());
//Nigel Watson 20131219 Increase to fix aborts in production jobs.
//Nigel Watson 20131219 G4int attempts = 0, maxAttempts=20;
G4int attempts = 0, maxAttempts=100;
while ( strings == NULL )
{
if (attempts++ > maxAttempts )
{
throw G4HadronicException(__FILE__, __LINE__, "G4VPartonStringModel::Scatter(): fails to generate strings");
}
theThis->Init(theNucleus,thePrimary);
strings = GetStrings();
}
G4double stringEnergy(0);
G4LorentzVector SumStringMom(0.,0.,0.,0.);
for ( unsigned int astring=0; astring < strings->size(); astring++)
{
// rotate string to lab frame, models have it aligned to z
stringEnergy += (*strings)[astring]->GetLeftParton()->Get4Momentum().t();
stringEnergy += (*strings)[astring]->GetRightParton()->Get4Momentum().t();
(*strings)[astring]->LorentzRotate(toLab);
SumStringMom+=(*strings)[astring]->Get4Momentum();
}
G4double InvMass=SumStringMom.mag();
//#define debug_PartonStringModel
#ifdef debug_PartonStringModel
G4V3DNucleus * fancynucleus=theThis->GetWoundedNucleus();
// loop over wounded nucleus
G4int hits(0);
G4Nucleon * theCurrentNucleon = fancynucleus->StartLoop() ? fancynucleus->GetNextNucleon() : NULL;
while(theCurrentNucleon != NULL)
{
if(theCurrentNucleon->AreYouHit())
{
hits++;
}
theCurrentNucleon = fancynucleus->GetNextNucleon();
}
G4cout << "G4VPSM: strE, nucleons,SumStringE, inE "
<< stringEnergy << " "
<< hits << " "
<< Ptmp.e() << " "
<< SumStringMom.e() << " "
<< Ptmp.e() + 939.*hits - stringEnergy << G4endl;
#endif
// Fragment strings
G4KineticTrackVector * theResult = 0;
G4double SumMass(0.);
attempts = 0;
maxAttempts=100;
do
{
attempts++;
if(theResult != 0)
{
std::for_each(theResult->begin(), theResult->end(), DeleteKineticTrack());
delete theResult;
}
theResult = stringFragmentationModel->FragmentStrings(strings);
if(attempts > maxAttempts ) break;
//G4cout<<"G4endl<<"G4VPartonStringModel:: Final Result, Size "<<theResult->size()<<G4endl;
SumMass=0.;
//G4LorentzVector SumP(0.,0.,0.,0.);
for ( unsigned int i=0; i < theResult->size(); i++)
{
SumMass+=(*theResult)[i]->GetDefinition()->GetPDGMass();
//SumP+=(*theResult)[i]->Get4Momentum();
//G4cout<<i<<" : "<<(*theResult)[i]->GetDefinition()->GetParticleName();
//G4cout<<"p= " << (*theResult)[i]->Get4Momentum()<<" m= "<<(*theResult)[i]->Get4Momentum().mag()<<G4endl;
}
//G4cout<<"SumP "<<SumP<<G4endl;
} while(SumMass > InvMass);
std::for_each(strings->begin(), strings->end(), DeleteString() );
delete strings;
return theResult;
}
package Geant4Sys
version v95r2p5
version v95r2p6
branches cmt doc
use G4config v95r2p5 Geant4
use G4config v95r2p6 Geant4
# =============================================================================
# =========== global libraries ================================================
......@@ -13,7 +13,7 @@ use G4intercoms v4r1p1 Geant4
use G4particles v6r2p1 Geant4
use G4track v5r1p1 Geant4
use G4geometry v6r2p1 Geant4
use G4processes v8r3p3 Geant4
use G4processes v8r3p4 Geant4
use G4physics_lists v1r3 Geant4
use G4tracking v6r1p1 Geant4
use G4global v5r1p1 Geant4
......@@ -46,7 +46,7 @@ use G4UIbasic v4r3 Geant4
use G4UIGAG v4r2 Geant4
# LHCb additional package (eg. for MC11 G4LHCblists)
use G4LHCblists v2r2 Geant4
use G4LHCblists v3r0 Geant4
#=============================================================================
# ======== the end ============================================================
......
v95r2p5
v95r2p6
......@@ -3,6 +3,14 @@ Package : Geant4Sys
Package manager(s) : Gloria Corti, Hubert DeGaudenzi, Nigel Watson
Purpose : LHCb build using cmt of Geant4
!=============================================================================
!</PRE><H1><A NAME=v95r2p62013-12-19 Geant4Sys v95r2p6</A></H1><PRE>
! 2013-12-19 - Nigel Watson
- Pick up revised G4processes to fix looping events, and corresponding
fix in G4config to use this for cmake builds.
! 2013-09-16 - Gloria Corti
- Pick up a LHCbLists where unused header is removed
!=============================================================================
!</PRE><H1><A NAME=v95r2p5>2013-05-16 Geant4Sys v95r2p5</A></H1><PRE>
! 2013-05-16 - Nigel Watson
......
project GEANT4
use GAUDI GAUDI_v23r10
use GAUDI GAUDI_v24r2
build_strategy with_installarea
setup_strategy root
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment