Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions generators/egs5/config/src/egs5run.in
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ elif test "$MY_MACHINE" = "Linux"
#COMPILER="g77"
#DEBUG="-g -ffortran-bounds-check"
#CFLAGS="-fno-automatic -finit-local-zero"
COMPILER="gfortran"
COMPILER="gfortran -std=legacy "
DEBUG="-g -ffortran-bounds-check"
CFLAGS="-fno-automatic -finit-local-zero"
if test "$OPT_LEVEL" = ""
Expand Down Expand Up @@ -235,8 +235,8 @@ echo ""
echo "Your Compiler is $COMPILER"


CFLAGS="$CFLAGS -fno-second-underscore -L$STDHEP/lib -I$STDHEP/src/inc -ltirpc"
LIBS="-lstdhep -lFmcfio"
CFLAGS="$CFLAGS -fno-second-underscore -L$STDHEP/lib -I$STDHEP/src/inc"
LIBS="-lstdhep -lFmcfio -ltirpc"
#-------------------------
# Build the egs5job.f file
#-------------------------
Expand Down
2 changes: 1 addition & 1 deletion python/hpsmc/alignment/_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def execute(self, log_out, log_err):

### Parameters Floated
```json
{json.dumps(self.to_float, indent = 2)}
{json.dumps(self.to_float, indent=2)}
```

""")
Expand Down
85 changes: 85 additions & 0 deletions python/hpsmc/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,91 @@ def optional_parameters(self):
return ["detector", "run_number", "defs", "nevents"]


class ProcessMiniDst(Component):
"""!
Run the make_mini_dst command on the input file.

Required parameters are: **input_file**
Required configs are: **minidst_install_dir**
"""

def __init__(self, **kwargs):
"""!
Initialize ProcessMiniDst with default input file and the command to run.
"""
self.input_file = None
self.minidst_args = None
# Ensure to call the parent constructor properly
Component.__init__(self, name='makeminidst',
command='make_mini_dst',
description='Create the MiniDST ROOT file',
output_ext='.root',
**kwargs)

def setup(self):
"""! Setup the MiniDST component."""
# Check if input files exist
if not len(self.input_files()):
raise Exception("No input files provided to make_mini_dst.")

if not os.path.exists(self.minidst_install_dir):
raise Exception("minidst_install_dir does not exist: %s" % self.minidst_install_dir)

def required_parameters(self):
"""!
Return list of required parameters.

Required parameters are only the standard "input_files".
@return list of required parameters
"""
return []

def optional_parameters(self):
"""!
Return list of optional parameters.

There are currently no optional parameters.
@return list of optional parameters
"""
return []

def required_config(self):
"""!
Return list of required configs.

Required configs are: **minidst_install_dir**
@return list of required configs
"""
return ["minidst_install_dir"]

def output_files(self):
"""! Adjust names of output files."""
if self.outputs is None:
f, ext = os.path.splitext(self.input_files()[0])
self.outputs = f"{f}.root"

return self.outputs

def cmd_args(self):
"""!
Setup command arguments for make_mini_dst.
@return list of arguments
"""
args = []

print("===== Make MiniDST with input files: ", end="")
for i in range(len(self.input_files())):
print(f"{self.input_files()[i]}", end=", ")
print(f" -> {self.output_files()}")

args.extend(self.minidst_args)

args.extend(['-o', self.output_files()[0]])
args.extend(self.input_files())

return args


class HPSTR(Component):
"""!
Run the hpstr analysis tool.
Expand Down
1 change: 1 addition & 0 deletions run_cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmake .. -DPython3_EXECUTABLE=$(which python3) -DCMAKE_BUILD_TYPE=RelWithDbInfo -DCMAKE_CXX_COMPILER=$(which g++) -DCMAKE_C_COMPILER=$(which gcc) -DHPSMC_ENABLE_ROOT=ON -DHPSMC_ENABLE_EGS5=ON -DHPSMC_ENABLE_MADGRAPH=ON -DHPSMC_ENABLE_STDHEP=ON -DHPSMC_ENABLE_FIELDMAPS=OFF -DHPSMC_ENABLE_LCIO=OFF -DHPSMC_ENABLE_HPSJAVA=OFF -DHPSMC_ENABLE_PEDE=OFF -DHPSMC_ENABLE_CONDITIONS=OFF -DCMAKE_INSTALL_PREFIX=..
16 changes: 15 additions & 1 deletion tools/stdhep-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ project(stdhep-lib VERSION 5.6.1)

message(STATUS "StdHep library version: ${stdhep-lib_VERSION}")

find_path(TIRPC_INCLUDE_DIR NAMES rpc/types.h PATHS /usr/include /usr/include/tirpc)
find_library(TIRPC_LIBRARY NAMES tirpc rpc PATHS /usr/lib /usr/lib/x86_64-linux-gnu)

if(TIRPC_INCLUDE_DIR AND TIRPC_LIBRARY)
# target_include_directories(your_target_name PRIVATE ${TIRPC_INCLUDE_DIR})
# target_link_libraries(your_target_name PRIVATE ${TIRPC_LIBRARY})
include_directories(${TIRPC_INCLUDE_DIR})
else()
message(FATAL_ERROR "libtirpc not found. Please install the development package.")
endif()

set(RPC_INCLUDE_DIR ${TIRPC_INCLUDE_DIR})
set(RPC_LIBRARY ${TIRPC_LIBRARY})

file(COPY ${PROJECT_SOURCE_DIR}/src/ DESTINATION ${CMAKE_BINARY_DIR}/stdhep-src/)

set(STDHEP_DIR ${CMAKE_BINARY_DIR}/stdhep-src)
Expand All @@ -15,7 +29,7 @@ set(STDHEP_LIBRARY_DIR ${STDHEP_LIBRARY_DIR} PARENT_SCOPE)
set(STDHEP_LIBRARIES ${STDHEP_LIBRARIES} PARENT_SCOPE)

add_custom_command(OUTPUT ${STDHEP_LIBRARIES}
COMMAND make
COMMAND make RPC_INCLUDE_DIR=${TIRPC_INCLUDE_DIR} RPC_LIBRARY=${TIRPC_LIBRARY}
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/stdhep-src"
DEPENDS "${CMAKE_BINARY_DIR}/stdhep-src")

Expand Down
13 changes: 10 additions & 3 deletions tools/stdhep-lib/src/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,24 @@ ifdef CRNLIB
endif
#------------------------------------------

all: binlib mcfio stdhep $(BUILD_DISPLAY)
all: info binlib mcfio stdhep $(BUILD_DISPLAY)

info:
$(info ----------------------- INFO ----------------------)
$(info STDHEP_DIR = $(STDHEP_DIR))
$(info RPC_INCLUDE_DIR = $(RPC_INCLUDE_DIR))
$(info RPC_LIBRARY = $(RPC_LIBRARY))
$(info DMAKE = $(DMAKE))

binlib:
-test -d $(STDHEP_DIR)/bin || mkdir -p $(STDHEP_DIR)/bin
-test -d $(STDHEP_DIR)/lib || mkdir -p $(STDHEP_DIR)/lib

mcfio:
(cd mcfio/src; $(MAKE) $(DMAKE) all) > log.mcfio.$$$$ 2>&1
(cd mcfio/src; $(MAKE) $(DMAKE) RPC_INCLUDE_DIR=$(RPC_INCLUDE_DIR) all) > log.mcfio.$$$$ 2>&1

stdhep:
(cd src/stdhep; $(MAKE) $(DMAKE) all) > log.stdhep.$$$$ 2>&1
(cd src/stdhep; $(MAKE) $(DMAKE) RPC_INCLUDE_DIR=$(RPC_INCLUDE_DIR) RPC_LIBRARY=$(RPC_LIBRARY) all) > log.stdhep.$$$$ 2>&1

spin:
(cd src/display/spin; $(MAKE) $(DMAKE) all) > log.spin.$$$$ 2>&1
Expand Down
2 changes: 1 addition & 1 deletion tools/stdhep-lib/src/mcfio/arch_mcfio
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ifeq "$(UNAME)" "IRIX64"
endif
ifeq "$(UNAME)" "Linux"
CC=gcc
F77=gfortran
F77=gfortran -std=legacy
CFLAGS= $(DFLG) -I/usr/X11R6/include
FFLAGS= $(DFLG) -fno-second-underscore
MXTLIBS = -L/usr/X11R6/lib -lXm -lX11 -lXt -lXp -lXext -lm
Expand Down
2 changes: 1 addition & 1 deletion tools/stdhep-lib/src/mcfio/src/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BINDIR = ../../bin
include ../arch_mcfio

FINC = -I.
CINC = -I. -I/usr/include/tirpc
CINC = -I. -I$(RPC_INCLUDE_DIR)
HLIB =
ifdef HISTO_DIR
CFLAGS += -DHISTO
Expand Down
Loading