IAP GITLAB

Commit b34525e9 authored by Ralf Ulrich's avatar Ralf Ulrich

Now the CRMC package during cmake checks for the size of the common block in...

Now the CRMC package during cmake checks for the size of the common block in HEPMC. This is then automatically used in epos-bas and CRMCinterface. This ensures consistency and makes it much easier to change this setting.



git-svn-id: https://devel-ik.fzk.de/svn/mc/crmc/trunk@4066 c7a5e08c-de06-0410-9364-b41cf42a0b17
parent adf50827
......@@ -73,6 +73,15 @@ FIND_PACKAGE (Boost 1.35 REQUIRED COMPONENTS filesystem iostreams system program
# TODO HepMC NOT REQUIRED
FIND_PACKAGE (HepMC REQUIRED COMPONENTS HepMC HepMCfio)
# prepare crmc to use same size HEPMC common block than HepMC was compiled with
FILE(READ ${PROJECT_SOURCE_DIR}/src/epos.inc-HEPMC-TEMPLATE template)
STRING( REGEX REPLACE "HEPEVT_SIZE_REPLACE" "${HepMC_HEPEVT_SIZE}" template2 "${template}")
FILE(WRITE ${PROJECT_SOURCE_DIR}/src/epos.inc "${template2}")
FILE(READ ${PROJECT_SOURCE_DIR}/src/CRMCinterface.h-HEPMC-TEMPLATE template3)
STRING( REGEX REPLACE "HEPEVT_SIZE_REPLACE" "${HepMC_HEPEVT_SIZE}" template4 "${template3}")
FILE(WRITE ${PROJECT_SOURCE_DIR}/src/CRMCinterface.h "${template4}")
## configure a header file to pass some of the CMake settings to the source code
CONFIGURE_FILE (
"${PROJECT_SOURCE_DIR}/src/CRMCconfig.h.in"
......
......@@ -9,10 +9,15 @@
# ${HepMC_LIBRARY_DIRS}
# ${HepMC_LIBRARIES}
#
# ${HepMC_HEPEVT_SIZE}
#
##################################################################
MESSAGE(STATUS "Looking for HepMC...")
# default hepmc common block size:
Set( HepMC_HEPEVT_SIZE 99990 )
## try to find each HepMC components in user defined path
FOREACH (COMPONENT ${HepMC_FIND_COMPONENTS})
FIND_LIBRARY(${COMPONENT}_PATH
......@@ -90,11 +95,25 @@ IF(${HEPMC_FOUND} MATCHES "FALSE")
)
ENDIF (HepMC_FIND_REQUIRED)
# if found
# end if not found
# if found :
ELSE(${HEPMC_FOUND} MATCHES "FALSE")
SET(HEPMC_FOUND TRUE)
# find length of hepmc common block pre-defined and use this for epos
EXECUTE_PROCESS (COMMAND cat ${HepMC_INCLUDE_DIRS}/HepMC/HEPEVT_Wrapper.h
COMMAND grep "#define HEPEVT_EntriesAllocation"
COMMAND awk "{print $3}"
COMMAND tr "\n" " "
COMMAND sed "s/ //"
OUTPUT_VARIABLE HepMC_HEPEVT_SIZE
)
MESSAGE( INFO "-HepMC: HEPEVT_EntriesAllocation in file \"${HepMC_INCLUDE_DIRS}/HepMC/HEPEVT_Wrapper.h\" is \"${HepMC_HEPEVT_SIZE}\"" )
MESSAGE( INFO "-HepMC: This limits the maximum number of particles per event you can have. " )
MESSAGE( INFO "-HepMC: Change you HepMC library if you run into limitation! " )
#set HepMC_LIBRARY_DIRS (extract from first component)
list(GET HepMC_FIND_COMPONENTS 0 TMP)
#extract the path from variable component_path and put in hepmc_library_dirs
......
......@@ -188,19 +188,16 @@ AB collisions (OK for p-Pb, pi-C but not for C-C or Pb-Pb for instance). So if y
a correct cross-section for PbPb scattering for example, you should uncomment the line "set isigma 2" in the
crmc.param file but it will take several minutes to compute the cross-section each time you start CRMC.
The current IO library of HepMC (2.06) has a limitation of the number of produced particles.
In particular, it will return an error message if the number of particles is larger than 10000.
To simulate heavy ion collisions where more than 10k particles are produced we recommend to
change the following variables and recompile.
Index: CRMCinterface.h
- const static unsigned int fMaxParticles = 199990; // HEP max number of particles
+ const static unsigned int fMaxParticles = 9990; // HEP max number of particles
Index: epos.inc
- parameter (nmxhep=199990) !max nr of particles in hep ptl list
+ parameter (nmxhep=9990) !max nr of particles in hep ptl list
When running the program you will receive lots of warning messages that can safely be ignored.
One solution to get rid of those would be to pipe it through: crmc 2>&1 | grep -v "exceeds"
The HepMC (2.06) IO library has a default limitation of the number of produced particles of 10000.
Thus, events with more than that number of secondaries are either truncated or skipped. For heavy ion
collisions this easily can become a problem in crmc. Please consider changing thie limiation to a
higher value. We suggest 200000, which works for all models at LHC energies so far. We are happy for
feedback on this issue if problems are encountered.
The CRMC code automatically checks for the
limit in the HepMC library and uses this during compile time. In order to change the limit, you
need to re-compile HepMC package and change the value in the line
#define HEPEVT_EntriesAllocation 199990
in the top of the file HepMC/HEPEVT_Wrapper.h
When you run into this limitation you will receive lots of warning messages.
......@@ -33,7 +33,7 @@ CRMCdata() :
void Clean() { fNParticles = 0; }
// fortran output
const static unsigned int fMaxParticles = 9990; // HEP max number of particles
const static unsigned int fMaxParticles = HEPEVT_SIZE_REPLACE;
int fNParticles;
double fImpactParameter;
......
......@@ -9,7 +9,7 @@ c---------------------------------------------------------------------------
parameter (mmry=1) !memory saving factor
parameter (mxptl=200000/mmry) !max nr of particles in epos ptl list
parameter (nmxhep=9990) !max nr of particles in hep ptl list
parameter (nmxhep=HEPEVT_SIZE_REPLACE) !max nr of particles in hep ptl list
parameter (myptl=1000) !max nr of droplets in epos ptl list
parameter (nzeta=60) !max nr of zeta bins for droplets
parameter (nflav=6) !max nr of flavors
......
......@@ -1300,7 +1300,10 @@ c print *,'clean',i,iorptl(io),pptl(3,i),jm1io
if(nhep2+iadd.gt.nmxhep)then
print *,'Warning : produced number of particles is too high'
print *,' Particle list is truncated, skip event !'
print *,' Particle list is truncated at, ', nmxhep
print *,' Skip event !'
print *,' CHANGE HEPEVT_EntriesAllocation in your ',
& 'HepMC library (HEPEVT_Wrapper.h) to fix this !!!!'
goto 10000
endif
do j=1,iadd
......@@ -1833,7 +1836,9 @@ c jtpevt ........ number of absolute target proton spectators
nhep=nhep+1
if(nhep.gt.nmxhep)then
print *,'Warning : produced number of particles is too high'
print *,' Particle list is truncated'
print *,' Particle list is truncated at ', nmxhep
print *,' CHANGE HEPEVT_EntriesAllocation in your ',
& 'HepMC library (HEPEVT_Wrapper.h) to fix this !!!!'
goto 1000
endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment