Skip to content

Commit

Permalink
Merge branch 'develop' into v2.2-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
wdconinc committed Aug 29, 2019
2 parents f626940 + 4d2d029 commit 59d7928
Show file tree
Hide file tree
Showing 112 changed files with 4,113 additions and 15,873 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ log
.cproject
.project

#ignore build type file
.buildtype

#ignore dot files
*.dot

Expand Down
22 changes: 15 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@ services:
script:
- docker build -t jeffersonlab/remoll .
- for suite in load validate overlap ; do
docker run -t jeffersonlab/remoll "scripts/tests/test_geometries.sh ${suite}" ;
docker run --rm -t jeffersonlab/remoll scripts/tests/test_geometries.sh ${suite} ;
done
- for suite in unit commit release ; do
docker run -t jeffersonlab/remoll "scripts/tests/test_macros.sh ${suite}" || exit 1 ;
docker start $(docker ps -l -q) ;
docker exec $(docker ps -l -q) scripts/tests/targz_macros.sh ${suite} ;
- for suite in unit ; do
docker run --rm -t jeffersonlab/remoll scripts/tests/test_macros.sh ${suite} ;
done
- for suite in commit release ; do
docker run -t jeffersonlab/remoll sh -c "
scripts/tests/test_macros.sh ${suite} &&
scripts/tests/targz_macros.sh ${suite} &&
scripts/tests/watermark.sh rootfiles/tests/${suite}/analysis
" || exit 1 ;
docker cp $(docker ps -l -q):"/jlab/remoll/remolltest.${suite}.log.tar.gz" . ;
docker cp $(docker ps -l -q):"/jlab/remoll/remolltest.${suite}.root.tar.gz" . ;
docker cp $(docker ps -l -q):"/jlab/remoll/remolltest.${suite}.analysis.log.tar.gz" . ;
docker cp $(docker ps -l -q):"/jlab/remoll/remolltest.${suite}.analysis.pdf.tar.gz" . ;
docker cp $(docker ps -l -q):"/jlab/remoll/remolltest.${suite}.analysis.root.tar.gz" . ;
docker stop $(docker ps -l -q) ;
docker cp $(docker ps -l -q):"/jlab/remoll/rootfiles_tests_${suite}_analysis.pdf" . ;
docker rm $(docker ps -l -q) ;
done

after_success:
Expand All @@ -38,13 +44,15 @@ deploy:
- remolltest.commit.log.tar.gz
- remolltest.commit.root.tar.gz
- remolltest.commit.analysis.log.tar.gz
- remolltest.commit.analysis.png.tar.gz
- remolltest.commit.analysis.pdf.tar.gz
- remolltest.commit.analysis.root.tar.gz
- rootfiles_tests_release_analysis.pdf
- remolltest.release.log.tar.gz
- remolltest.release.root.tar.gz
- remolltest.release.analysis.log.tar.gz
- remolltest.release.analysis.pdf.tar.gz
- remolltest.release.analysis.root.tar.gz
- rootfiles_tests_release_analysis.pdf
skip_cleanup: true
on:
repo: JeffersonLab/remoll
Expand Down
29 changes: 29 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,18 @@ foreach(file ${exefiles})
)
endforeach()

#
# custom targets
#
add_custom_target(create-manual
COMMAND ./remoll -g ${PROJECT_SOURCE_DIR}/geometry/mollerMother.gdml ${PROJECT_SOURCE_DIR}/macros/manual.mac | awk '/Command directory path/,/Graphics systems deleted/' > manual.txt
BYPRODUCTS manual.txt
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS remoll)
add_custom_target(check-manual
COMMAND diff ${PROJECT_SOURCE_DIR}/manual.txt manual.txt || true
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS create-manual)

#----------------------------------------------------------------------------
# Copy all scripts to the build directory, i.e. the directory in which we
Expand Down Expand Up @@ -307,6 +319,23 @@ install(FILES
${REMOLL_MAP_DIR}/blockyHybrid_rm_3.0.txt
${REMOLL_MAP_DIR}/blockyUpstream_rm_1.1.txt
DESTINATION ${CMAKE_INSTALL_DATADIR}/remoll)
if(ADDITIONAL_FIELDS)
message(STATUS "Ensuring additional fields are available")
file(DOWNLOAD
${REMOLL_DOWNLOADS}/upstreamSymmetric_sensR_0.1.txt
${REMOLL_MAP_DIR}/upstreamSymmetric_sensR_0.1.txt
EXPECTED_MD5 849d9dc5abab0842fc13fef7f4918648)
file(DOWNLOAD
${REMOLL_DOWNLOADS}/hybridSymmetric_sensR_0.1.txt
${REMOLL_MAP_DIR}/hybridSymmetric_sensR_0.1.txt
EXPECTED_MD5 78fad2ffa5b5ae129df11bdf0ce25333)
install(FILES
${REMOLL_MAP_DIR}/upstreamSymmetric_sensR_0.0.txt
${REMOLL_MAP_DIR}/hybridSymmetric_sensR_0.0.txt
DESTINATION ${CMAKE_INSTALL_DATADIR}/remoll)
else()
message(STATUS "Download additional fields with '-DADDITIONAL_FIELDS=ON'.")
endif()


#----------------------------------------------------------------------------
Expand Down
24 changes: 15 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
FROM jeffersonlab/jlabce:2.3

# Install libgcj and pdftk
RUN wget https://copr.fedorainfracloud.org/coprs/robert/gcj/repo/epel-7/robert-gcj-epel-7.repo -P /etc/yum.repos.d && \
wget https://copr.fedorainfracloud.org/coprs/robert/pdftk/repo/epel-7/robert-pdftk-epel-7.repo -P /etc/yum.repos.d && \
yum install -y pdftk ghostscript

ENV JLAB_VERSION=2.3
ENV JLAB_ROOT=/jlab
ENV JLAB_SOFTWARE=/jlab/2.3/Linux_CentOS7.2.1511-x86_64-gcc4.8.5
Expand All @@ -17,14 +22,15 @@ RUN source $JLAB_ROOT/$JLAB_VERSION/ce/jlab.sh && \
make -j$(nproc) && \
make install

# Create entry point bash script
RUN echo '#!/bin/bash' > /usr/local/bin/entrypoint.sh && \
echo 'unset OSRELEASE' >> /usr/local/bin/entrypoint.sh && \
echo 'source $JLAB_ROOT/$JLAB_VERSION/ce/jlab.sh' >> /usr/local/bin/entrypoint.sh && \
echo 'export PATH=${REMOLL}/bin:${PATH}' >> /usr/local/bin/entrypoint.sh && \
echo 'export REMOLL=${REMOLL}' >> /usr/local/bin/entrypoint.sh && \
echo 'cd $REMOLL && exec $*' >> /usr/local/bin/entrypoint.sh && \
chmod +x /usr/local/bin/entrypoint.sh
# Create environment point bash script
RUN echo '#!/bin/bash' > /entrypoint.sh && \
echo 'unset OSRELEASE' >> /entrypoint.sh && \
echo 'source $JLAB_ROOT/$JLAB_VERSION/ce/jlab.sh' >> /entrypoint.sh && \
echo 'export PATH=${REMOLL}/bin:${PATH}' >> /entrypoint.sh && \
echo 'export REMOLL=${REMOLL}' >> /entrypoint.sh && \
echo 'cd $REMOLL && exec "$@"' >> /entrypoint.sh && \
chmod +x /entrypoint.sh

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]

CMD ["build/remoll","-h"]
36 changes: 36 additions & 0 deletions analysis/hyperon/hyperon_pion_rates.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Run using (for example):
// build/reroot -l -q 'analysis/hyperon/hyperon_pion_rates.C("hyperon_lambda_2M.root")'

void hyperon_pion_rates(const TString& files)
{
TChain* T = new TChain("T");
T->Add(files);

std::vector<remollEventParticle_t>* parts = 0;
std::vector<remollGenericDetectorHit_t>* hits = 0;

T->SetBranchAddress("hit", &hits);
T->SetBranchAddress("part", &parts);

TH1F h_hit_r("h_hit_r","Pion hit radius at the main detector plane",20,0,2000);

// Loop over events
for (size_t iev = 0; iev < T->GetEntries(); iev++) {
T->GetEntry(iev);

// Store hits on main detector
for (size_t ihit = 0; ihit < hits->size(); ihit++) {
remollGenericDetectorHit_t hit = hits->at(ihit);
if (hit.det == 28 && hit.pid == -211) {
h_hit_r.Fill(hit.r);
}
}
for (size_t ipart = 0; ipart < parts->size(); ipart++) {
remollEventParticle_t part = parts->at(ipart);
}
}

TCanvas c;
h_hit_r.Draw();
c.SaveAs("images/hyperon_pion_rates_hit_r.png");
}
5 changes: 4 additions & 1 deletion cmake/modules/BuildType.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Set a default build type if none was specified
set(DEFAULT_CMAKE_BUILD_TYPE "Release")
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(DEFAULT_CMAKE_BUILD_TYPE "Debug")
set(DEFAULT_CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
if (EXISTS "${CMAKE_SOURCE_DIR}/.buildtype")
file(STRINGS "${CMAKE_SOURCE_DIR}/.buildtype" DEFAULT_CMAKE_BUILD_TYPE)
endif()
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${DEFAULT_CMAKE_BUILD_TYPE}' as none was specified.")
Expand Down
4 changes: 2 additions & 2 deletions generators/aniol/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
a.out
hyperon-gen
hyperon_decay
lambda_decay

hyperon_outp.dat
hyperon_particle_decays.dat
*.dat
6 changes: 3 additions & 3 deletions generators/aniol/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ CC=g++
CFLAGS=
LIBS=-lm

EXES=hyperon_decay hyperon-gen
EXES=hyperon_decay hyperon-gen lambda_decay

all: $(EXES)

%.o: %.c
%.o: %.c %.h
$(CC) -c -o $@ $< $(CFLAGS)

%: %.o
%: %.o %.h
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

.PHONY: clean
Expand Down
8 changes: 6 additions & 2 deletions generators/aniol/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
Note: this directory and included files are obtained from Konrad Aniol's personal page at:
https://userweb.jlab.org/~aniol/moller/scripts/readme.dat

They represent the code as of 19-Jun-2013 (accessed 16-Jul-2018).

Since the order of output of these codes is strongly correlated with physical parameters
(in particular position in target), it makes sense to shuffle the data before using it.
---

In order to create the code which produces the lambda distribution file (x,y,v,px,py,pz,weight) simply
compile
```
g++ hyperon-gen.cpp
g++ -o hyperon-gen hyperon-gen.cpp
```

There is an input file used by hyperon-gen.cpp called hyperon-gen.h. You can set the parameters used in the code here.
Expand All @@ -32,7 +36,7 @@ edit lambda_decay.cpp to set the electron helicity, h. This is found in the foll
```

```
g++ lambda_decay.cpp
g++ -o lambda_decay lambda_decay.cpp
```

The include file, hyperon_decay.h must be adjusted to indicate the desired decay products.
Expand Down
Loading

0 comments on commit 59d7928

Please sign in to comment.