IAP GITLAB

Commit ffc3e8b9 authored by Tanguy Pierog's avatar Tanguy Pierog

update parameters


git-svn-id: https://devel-ik.fzk.de/svn/mc/crmc/tags/sumEt.r2856@2864 c7a5e08c-de06-0410-9364-b41cf42a0b17
parent c413b7e1
include build.cfg
SYSTEM=$(shell uname)
SYSTEM2=$(shell uname -m)
m32=$(shell if [ "$(SYSTEM2)" = "i686" ]; then echo "-m32"; fi)
ifndef CRMCROOT
CRMCROOT=$(PWD)
endif
PARAMS = $(patsubst src/%.paramin, %.param, $(wildcard src/*.paramin))
SOURCE_DIR=src/
PARAM_DIR=tabs/
VER=199
LIBDIR=obj/$(SYSTEM)/
FFLAGS= -w -fno-second-underscore -fno-automatic -g -Wall -O0 -I$(PARAM_DIR)
CFLAGS= ${m32} -ggdb3 -O2 -pipe -Wall
CXXFLAGS= ${m32} -ggdb3 -O2 -pipe -Wall
COMP=`which gfortran 2>&1 | grep -v which`
COMPIL="$(shell echo $(COMP))"
ifeq ($(COMPIL),"")
FC =g77 # for g77
G2C=g2c # for g77
else
FC =gfortran # for gfortran
G2C=gfortran # for gfortran
FFLAGS+=-std=legacy
endif
ifndef CXX
CXX = g++
endif
ifndef CC
CC = gcc
endif
ROOTCFLAGS = $(shell root-config --cflags)
ROOTLIBS = $(shell root-config --libs)
ROOTLDFLAGS+= -lEG
LDFLAGS+=$(ROOTLDFLAGS)
CXXFLAGS+=$(ROOTCFLAGS)
# NA61 framework
ifndef NA61BROWSER
NA61BROWSER = $(HOME)/NA61/EventBrowser/trunk
endif
CXXFLAGS+=-I$(NA61BROWSER)/EventIO \
-I$(NA61BROWSER)/Utilities \
-I$(NA61BROWSER)/Detector \
-I$(NA49)/T61/T61DST/inc \
-I$(NA49)/T61/T61ANA/inc \
-I$(NA49)/T61/inc \
-I$(NA49)/DSPACK/inc
LDFLAGS+=-L$(NA61BROWSER)/lib -lNDST61 -lDetector -lEventServerNA61 -ltinyxml \
-L$(NA49_LIB1) -lT61ANA -L$(NA49_LIB2) -lT61DST \
-L$(DSPACK_HOME)/lib -ldspack \
$(NA49)/T61/src/TRootDS.o \
$(NA49)/T61/src/dspack_rootds.o \
$(NA49)/T61/src/T49Dict.o\
$(NA49)/T61/src/T49StrDict.o \
$(NA49)/T61/src/TRootDSMC.o \
$(NA49)/T61/src/TRootDSmini.o
###############MAKE OPTIONS###############
ifdef __QGSJET01__
FFLAGS += -D __QGSJET01__
CFLAGS += -D __QGSJET01__
CXXFLAGS += -D __QGSJET01__
endif
ifdef __GHEISHA__
FFLAGS += -D __GHEISHA__
CFLAGS += -D __GHEISHA__
CXXFLAGS += -D __GHEISHA__
endif
ifdef __PYTHIA__
FFLAGS += -D __PYTHIA__
CFLAGS += -D __PYTHIA__
CXXFLAGS += -D __PYTHIA__
endif
ifdef __HIJING__
FFLAGS += -D __HIJING__
CFLAGS += -D __HIJING__
CXXFLAGS += -D __HIJING__
endif
ifdef __SIBYLL__
FFLAGS += -D __SIBYLL__
CFLAGS += -D __SIBYLL__
CXXFLAGS += -D __SIBYLL__
endif
ifdef __QGSJETII__
FFLAGS += -D __QGSJETII__
CFLAGS += -D __QGSJETII__
CXXFLAGS += -D __QGSJETII__
endif
ifdef __Phojet__
FFLAGS += -D __Phojet__
CFLAGS += -D __Phojet__
CXXFLAGS += -D __Phojet__
endif
##########################################
FILES=\
epos/epos-bas.f epos/epos-con.f \
epos/epos-dky.f epos/epos-dro.f epos/epos-ems.f \
epos/epos-fra.f epos/epos-ico.f epos/epos-hnb.f \
epos/epos-ids.f epos/epos-int.f epos/epos-jps.f \
epos/epos-omg.f epos/epos-par.f epos/epos-sem.f \
epos/epos-rsh.f epos/epos-qsh.f epos/epos-tim.f \
epos/epos-uti.f epos/epos-xan.f epos/epos-xpr.f \
epos/eposu_no.f \
epos/epos_j.f
ifdef __QGSJET01__
FILES+=\
qgsjet/qgsjet03.f \
qgsjet/qgsjet_epos.f
endif
ifdef __GHEISHA__
FILES+=\
gheisha/gheisha_2002d.f \
gheisha/gheisha_epos.f
endif
ifdef __PYTHIA__
FILES+=\
pythia/pythia_epos.f \
pythia/pythia6115.f
endif
ifdef __HIJING__
FILES+=\
hijing/hijing1.383.f \
hijing/hipyset1.35.f \
hijing/hijing_epos.f
endif
ifdef __SIBYLL__
FILES+=\
sibyll/sibyll_21.f \
sibyll/nuclib_21.f \
sibyll/sibyll_epos.f
endif
ifdef __QGSJETII__
FILES+=\
qgsjetII/qgsjet-II-03.f \
qgsjetII/qgsjetII_epos.f
endif
ifdef __Phojet__
FILES+=\
phojet/phojet.f \
phojet/phojet_epos.f \
pythia/pythia6115.f
endif
FILES:=$(sort $(FILES)) #removes duplicates
PREPROCFILES=models.F
AFILE=crmc-aaa.f
CFILES=crmctrapfpe.c
CXXFILES=crmc2ndst.cc
EXE_FILES=crmc.bin
OBJS=$(FILES:%.f=$(LIBDIR)%.o) $(AFILE:%.f=$(LIBDIR)%.o)
PREPROCOBJS=$(PREPROCFILES:%.F=$(LIBDIR)%.o)
COBJS=$(CFILES:%.c=$(LIBDIR)%.o)
CXXOBJS=$(CXXFILES:%.cc=$(LIBDIR)%.o)
all: dirs bin_dir bin/crmcNDST bin/crmcNDST$(SYSTEM) $(PARAMS)
bin/crmcNDST$(SYSTEM): $(OBJS) $(PREPROCOBJS) $(COBJS) $(CXXOBJS)
@(echo "")
@(echo "==> Linking executable...")
@(echo "")
$(CXX) $(CXXFLAGS) $(OBJS) $(PREPROCOBJS) $(COBJS) $(CXXOBJS) -o $@ $(ROOTLIBS) $(LDFLAGS) -l$(G2C)
@(echo "")
@(echo -n "==> compilation with EPOS")
ifdef __QGSJET01__
@(echo -n ", QGSJET01")
endif
ifdef __GHEISHA__
@(echo -n ", GHEISHA")
endif
ifdef __PYTHIA__
@(echo -n ", PYTHIA")
endif
ifdef __HIJING__
@(echo -n ", HIJING")
endif
ifdef __SIBYLL__
@(echo -n ", SIBYLL")
endif
ifdef __QGSJETII__
@(echo -n ", QGSJETII")
endif
ifdef __Phojet__
@(echo -n ", Phojet")
endif
@(echo " successful!")
@(echo "==> type bin/crmc -h")
@(echo "")
$(OBJS) : $(LIBDIR)%.o : $(SOURCE_DIR)%.f
$(FC) $(FFLAGS) -o $@ -c $<
$(PREPROCOBJS) : $(LIBDIR)%.o : $(SOURCE_DIR)%.F build.cfg
$(FC) $(FFLAGS) -o $@ -c $<
$(COBJS) : $(LIBDIR)%.o : $(SOURCE_DIR)%.c
$(CC) $(CFLAGS) -o $@ -c $<
$(CXXOBJS) : $(LIBDIR)%.o : $(SOURCE_DIR)%.cc build.cfg
$(CXX) $(CXXFLAGS) $(ROOTCFLAGS) -o $@ -c $<
%.param: src/%.paramin
@(echo "==[make]==> generating $@ from : $^")
@if [ ! -e $@ ] ; then \
cat $^ | sed s%@CRMCROOT@%$(CRMCROOT)%g > $@ ; \
fi
tar: $(SOURCE_DIR) $(PARAM_DIR) Makefile
tar czvf crmc$(VER).tgz $^
dirs:
@if [ ! -d $(LIBDIR) ] ;then \
set -x; mkdir -p $(LIBDIR); set +x;\
fi
@if [ ! -d $(LIBDIR)epos ] ;then \
set -x; mkdir -p $(LIBDIR)epos; set +x; \
fi
@if [ ! -d $(LIBDIR)qgsjet ] ;then \
set -x; mkdir -p $(LIBDIR)qgsjet; set +x; \
fi
@if [ ! -d $(LIBDIR)qgsjetII ] ;then \
set -x; mkdir -p $(LIBDIR)qgsjetII; set +x; \
fi
@if [ ! -d $(LIBDIR)gheisha ] ;then \
set -x; mkdir -p $(LIBDIR)gheisha; set +x; \
fi
@if [ ! -d $(LIBDIR)sibyll ] ;then \
set -x; mkdir -p $(LIBDIR)sibyll; set +x; \
fi
@if [ ! -d $(LIBDIR)pythia ] ;then \
set -x; mkdir -p $(LIBDIR)pythia; set +x; \
fi
@if [ ! -d $(LIBDIR)phojet ] ;then \
set -x; mkdir -p $(LIBDIR)phojet; set +x; \
fi
@if [ ! -d $(LIBDIR)hijing ] ;then \
set -x; mkdir -p $(LIBDIR)hijing; set +x; \
fi
bin/crmcNDST: $(SOURCE_DIR)/$(EXE_FILES)
@(echo "==> redo executable files")
@(cat $^ | sed 's/crmc/crmcNDST/' > $@)
@(chmod +x $@)
bin_dir:
@if [ ! -d bin ] ;then \
set -x; mkdir -p bin; set +x; \
fi
clean:
@rm -rf $(LIBDIR)
@rm -rf bin
@rm -f *.histo *.data *.copy *.check fort*
include build.cfg
SYSTEM=$(shell uname)
SYSTEM2=$(shell uname -m)
m32=$(shell if [ "$(SYSTEM2)" = "i686" ]; then echo "-m32"; fi)
ifndef CRMCROOT
CRMCROOT=$(PWD)
endif
PARAMS = $(patsubst src/%.paramin, %.param, $(wildcard src/*.paramin))
SOURCE_DIR=src/
PARAM_DIR=tabs/
VER=199
LIBDIR=obj/$(SYSTEM)/
FFLAGS += -w -fno-second-underscore -fno-automatic -g -Wall -O0 -I$(PARAM_DIR)
CFLAGS += $(m32) -ggdb3 -O2 -pipe -Wall
CXXFLAGS += $(m32) -ggdb3 -O2 -pipe -Wall
CXXFLAGS += -Wpacked -mpreferred-stack-boundary=8
COMP=`which gfortran 2>&1 | grep -v which`
COMPIL="$(shell echo $(COMP))"
ifeq ($(COMPIL),"")
FC =g77 # for g77
G2C=g2c # for g77
else
FC =gfortran # for gfortran
G2C=gfortran # for gfortran
FFLAGS+=-std=legacy
endif
ifndef CXX
CXX = g++
endif
ifndef CC
CC = gcc
endif
HEPCFLAGS = -I$(HEP_ROOT)/include
HEPLIBS = -L$(HEP_ROOT)/lib -lHepMC -lHepMCfio
###############MAKE OPTIONS###############
ifndef __WITHOUTBOOST__
BOOSTLIBS = -L$(BOOST_LIB_DIR) -lboost_iostreams -lboost_filesystem
else
BOOSTLIBS =
FFLAGS += -D __WITHOUTBOOST__
CFLAGS += -D __WITHOUTBOOST__
CXXFLAGS += -D __WITHOUTBOOST__
endif
ifdef __QGSJET01__
FFLAGS += -D __QGSJET01__
CFLAGS += -D __QGSJET01__
CXXFLAGS += -D __QGSJET01__
endif
ifdef __GHEISHA__
FFLAGS += -D __GHEISHA__
CFLAGS += -D __GHEISHA__
CXXFLAGS += -D __GHEISHA__
endif
ifdef __PYTHIA__
FFLAGS += -D __PYTHIA__
CFLAGS += -D __PYTHIA__
CXXFLAGS += -D __PYTHIA__
endif
ifdef __HIJING__
FFLAGS += -D __HIJING__
CFLAGS += -D __HIJING__
CXXFLAGS += -D __HIJING__
endif
ifdef __SIBYLL__
FFLAGS += -D __SIBYLL__
CFLAGS += -D __SIBYLL__
CXXFLAGS += -D __SIBYLL__
endif
ifdef __QGSJETII__
FFLAGS += -D __QGSJETII__
CFLAGS += -D __QGSJETII__
CXXFLAGS += -D __QGSJETII__
endif
ifdef __Phojet__
FFLAGS += -D __Phojet__
CFLAGS += -D __Phojet__
CXXFLAGS += -D __Phojet__
endif
##########################################
FILES=\
epos/epos-bas.f epos/epos-con.f \
epos/epos-dky.f epos/epos-dro.f epos/epos-ems.f \
epos/epos-fra.f epos/epos-ico.f epos/epos-hnb.f \
epos/epos-ids.f epos/epos-int.f epos/epos-jps.f \
epos/epos-omg.f epos/epos-par.f epos/epos-sem.f \
epos/epos-rsh.f epos/epos-qsh.f epos/epos-tim.f \
epos/epos-uti.f epos/epos-xan.f epos/epos-xpr.f \
epos/eposu_no.f \
epos/epos_j.f
ifdef __QGSJET01__
FILES+=\
qgsjet/qgsjet03.f \
qgsjet/qgsjet_epos.f
endif
ifdef __GHEISHA__
FILES+=\
gheisha/gheisha_2002d.f \
gheisha/gheisha_epos.f
endif
ifdef __PYTHIA__
FILES+=\
pythia/pythia_epos.f \
pythia/pythia6115.f
endif
ifdef __HIJING__
FILES+=\
hijing/hijing1.383.f \
hijing/hipyset1.35.f \
hijing/hijing_epos.f
endif
ifdef __SIBYLL__
FILES+=\
sibyll/sibyll_21.f \
sibyll/nuclib_21.f \
sibyll/sibyll_epos.f
endif
ifdef __QGSJETII__
FILES+=\
qgsjetII/qgsjet-II-03.f \
qgsjetII/qgsjetII_epos.f
endif
ifdef __Phojet__
FILES+=\
phojet/phojet.f \
phojet/phojet_epos.f \
pythia/pythia_epos.f \
pythia/pythia6115.f
endif
FILES:=$(sort $(FILES)) #removes duplicates
PREPROCFILES=models.F
AFILE=crmc-aaa.f
CFILES=crmctrapfpe.c
CXXFILES=crmchep.cc
EXE_FILES=crmc.bin
OBJS=$(FILES:%.f=$(LIBDIR)%.o) $(AFILE:%.f=$(LIBDIR)%.o)
PREPROCOBJS=$(PREPROCFILES:%.F=$(LIBDIR)%.o)
COBJS=$(CFILES:%.c=$(LIBDIR)%.o)
CXXOBJS=$(CXXFILES:%.cc=$(LIBDIR)%.o)
.PHONY : all
all: check dirs bin_dir bin/crmc bin/crmc$(SYSTEM) $(PARAMS)
.PHONY : check
check:
@if [ -z "$(HEP_ROOT)" ]; then echo "Please set HEP_ROOT to the root directory of HepMC2"; exit 1; fi
ifndef __WITHOUTBOOST__
@if [ -z "$(BOOST_LIB_DIR)" ]; then echo 'Please set BOST_LIB_DIR to the directory where the boost libraries are stored or disble it with build option "-d __WITHOUTBOOST__"'; exit 1; fi
endif
bin/crmc$(SYSTEM): $(OBJS) $(PREPROCOBJS) $(COBJS) $(CXXOBJS)
@(echo "")
@(echo "==> Linking executable...")
@(echo "")
$(CXX) $(LDFLAGS) $(CXXFLAGS) $(OBJS) $(PREPROCOBJS) $(COBJS) $(CXXOBJS) -o $@ $(HEPLIBS) $(BOOSTLIBS) -l$(G2C)
@(echo "")
@(echo -n "==> compilation with EPOS")
ifdef __QGSJET01__
@(echo -n ", QGSJET01")
endif
ifdef __GHEISHA__
@(echo -n ", GHEISHA")
endif
ifdef __PYTHIA__
@(echo -n ", PYTHIA")
endif
ifdef __HIJING__
@(echo -n ", HIJING")
endif
ifdef __SIBYLL__
@(echo -n ", SIBYLL")
endif
ifdef __QGSJETII__
@(echo -n ", QGSJETII")
endif
ifdef __Phojet__
@(echo -n ", Phojet")
endif
@(echo " successful!")
@(echo "==> type bin/crmc -h")
@(echo "")
$(OBJS) : $(LIBDIR)%.o : $(SOURCE_DIR)%.f
$(FC) $(FFLAGS) -o $@ -c $<
$(PREPROCOBJS) : $(LIBDIR)%.o : $(SOURCE_DIR)%.F build.cfg
$(FC) $(FFLAGS) -o $@ -c $<
$(COBJS) : $(LIBDIR)%.o : $(SOURCE_DIR)%.c
$(CC) $(CFLAGS) -o $@ -c $<
$(CXXOBJS) : $(LIBDIR)%.o : $(SOURCE_DIR)%.cc $(SOURCE_DIR)%.h build.cfg
$(CXX) $(CXXFLAGS) $(HEPCFLAGS) -o $@ -c $<
%.param: src/%.paramin
@(echo "==[make]==> generating $@ from : $^")
@if [ ! -e $@ ] ; then \
cat $^ | sed s%@CRMCROOT@%$(CRMCROOT)%g > $@ ; \
fi
.PHONY : tar
tar: $(SOURCE_DIR) $(PARAM_DIR) Makefile
tar czvf crmc$(VER).tgz $^
.PHONY : dirs
dirs:
@if [ ! -d $(LIBDIR) ] ;then \
set -x; mkdir -p $(LIBDIR); set +x;\
fi
@if [ ! -d $(LIBDIR)epos ] ;then \
set -x; mkdir -p $(LIBDIR)epos; set +x; \
fi
@if [ ! -d $(LIBDIR)qgsjet ] ;then \
set -x; mkdir -p $(LIBDIR)qgsjet; set +x; \
fi
@if [ ! -d $(LIBDIR)qgsjetII ] ;then \
set -x; mkdir -p $(LIBDIR)qgsjetII; set +x; \
fi
@if [ ! -d $(LIBDIR)gheisha ] ;then \
set -x; mkdir -p $(LIBDIR)gheisha; set +x; \
fi
@if [ ! -d $(LIBDIR)sibyll ] ;then \
set -x; mkdir -p $(LIBDIR)sibyll; set +x; \
fi
@if [ ! -d $(LIBDIR)pythia ] ;then \
set -x; mkdir -p $(LIBDIR)pythia; set +x; \
fi
@if [ ! -d $(LIBDIR)phojet ] ;then \
set -x; mkdir -p $(LIBDIR)phojet; set +x; \
fi
@if [ ! -d $(LIBDIR)hijing ] ;then \
set -x; mkdir -p $(LIBDIR)hijing; set +x; \
fi
bin/crmc: $(SOURCE_DIR)/$(EXE_FILES)
@(echo "==> redo executable files")
@(cat $^ > $@)
@(chmod +x $@)
.PHONY : bin_dir
bin_dir:
@if [ ! -d bin ] ;then \
set -x; mkdir -p bin; set +x; \
fi
install: bin/crmc$(SYSTEM)
if [[ "$(CRMCROOT)" != "$(PWD)" ]] ; then \
mkdir -p $(CRMCROOT)/bin && \
cp -rf crmc.param tabs $(CRMCROOT)/ && \
cp bin/crmc$(SYSTEM) $(CRMCROOT)/bin/crmc ; \
fi
.PHONY : clean
clean:
rm -rf $(LIBDIR)
rm -rf bin
rm -f *.histo *.data *.copy *.check fort*
rm -f IO_GenEvent.dat
rm -f *~ \#*\# */*~
#;;; Emacs Setup
#;;; Local Variables:
#;;; mode: Makefile
#;;; End:
*****************************
The Program "crmc"
*****************************
The program "crmc" (Cosmic Ray Monte Carlo) is an interface giving access to different cosmic ray and non cosmic ray particle generators by an easy command line interface. The outport can be stored in different formats. It can store a root TTree or a HepMC event file (http://lcgapp.cern.ch/project/simu/HepMC/).
*****************************
Installation
*****************************
To install please check out the newest trunk version from the svn server. The next optional step is to modify the ./build.cfg file to your needs of which models should be compiled.
After you have done so, you have the choice between three different versions which are installed by
make #installs program with normal root output
make ndst #no idea what it does
make hep #installs program with HepMC ouptut
*****************************
Notes
*****************************
Please note, if you have boost installed please enable the build option in build.cfg like this:
#__WITHOUTBOOST__=1
and define the environment variable BOOST_LIB_DIR
If you want Hep Output you need to specify the environment variable HEP_ROOT to the base path where the lib/ and include/ folder can be found.
To set environment variables use either "export" (bash shell) or "setenv" (csh environment) commands.
*****************************
Run
*****************************
Please run the program by executing
./bin/crmc -h
#####UNCOMMENT MODELS WHICH SHOULD BE COMPILED#####
#__QGSJET01__=1
#__GHEISHA__=1
#__PYTHIA__=1
#__HIJING__=1
#__SIBYLL__=1
#__QGSJETII__=1
#__Phojet__=1
##################################################
#####UNCOMMENT TO ENABLE COMPRESSION FEATURE#####
__WITHOUTBOOST__=1
##################################################
#;;; Emacs Setup
#;;; Local Variables:
#;;; mode: Makefile
#;;; End:
include build.cfg
SYSTEM=$(shell uname)
SYSTEM2=$(shell uname -m)
m32=$(shell if [ "$(SYSTEM2)" = "i686" ]; then echo "-m32"; fi)
ifndef CRMCROOT
CRMCROOT=$(PWD)
endif
PARAMS = $(patsubst src/%.paramin, %.param, $(wildcard src/*.paramin))
SOURCE_DIR=src/
PARAM_DIR=tabs/
VER=199
LIBDIR=obj/$(SYSTEM)/
FFLAGS= -w -fno-second-underscore -fno-automatic -g -Wall -O0 -I$(PARAM_DIR)
CFLAGS= ${m32} -ggdb3 -O2 -pipe -Wall
CXXFLAGS= ${m32} -ggdb3 -O2 -pipe -Wall
COMP=`which gfortran 2>&1 | grep -v which`