Skip to content
Snippets Groups Projects
Commit 1eb3f32a authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Added new ecal directory

- working on unifying the filenames through env vars.
parent 4dd9753c
No related branches found
No related tags found
1 merge request!5Full ecal example
...@@ -32,7 +32,7 @@ stages: ...@@ -32,7 +32,7 @@ stages:
get_data: get_data:
stage: data_init stage: data_init
tags: tags:
- sodium - silicon
script: script:
- mkdir -p results - mkdir -p results
- mkdir -p sim_output - mkdir -p sim_output
...@@ -41,10 +41,11 @@ generate_config: ...@@ -41,10 +41,11 @@ generate_config:
stage: config stage: config
needs: ["get_data"] needs: ["get_data"]
tags: tags:
- sodium - silicon
script: script:
- mkdir -p config && ./bin/gen_ci_config -p test_ -i dummy > config/dummy_config.yml - mkdir -p config && ./bin/gen_ci_config -p test_ -i dummy > config/dummy_config.yml
- mkdir -p config && ./bin/gen_ci_config -p clustering_ -i clustering > config/clustering_config.yml - mkdir -p config && ./bin/gen_ci_config -p clustering_ -i clustering > config/clustering_config.yml
- mkdir -p config && ./bin/gen_ci_config -p ecal_ -i ecal > config/ecal_config.yml
dummy-pipeline: dummy-pipeline:
stage: run stage: run
...@@ -64,6 +65,15 @@ clustering-pipeline: ...@@ -64,6 +65,15 @@ clustering-pipeline:
job: generate_config job: generate_config
strategy: depend strategy: depend
ecal-pipeline:
stage: run
needs: ["generate_config"]
trigger:
include:
- artifact: config/ecal_config.yml
job: generate_config
strategy: depend
#crystal_electron_simulation: #crystal_electron_simulation:
# stage: run # stage: run
# needs: ["get_data"] # needs: ["get_data"]
...@@ -82,7 +92,7 @@ clustering-pipeline: ...@@ -82,7 +92,7 @@ clustering-pipeline:
final_report: final_report:
stage: finish stage: finish
tags: tags:
- sodium - silicon
needs: ["clustering-pipeline","dummy-pipeline"] needs: ["clustering-pipeline","dummy-pipeline"]
script: script:
- echo "It was a success!" - echo "It was a success!"
......
...@@ -3,7 +3,7 @@ set -o nounset ...@@ -3,7 +3,7 @@ set -o nounset
set -o errexit set -o errexit
BENCHMARK_SCRIPT_DIR=./dummy BENCHMARK_SCRIPT_DIR=./dummy
CI_TAG=sodium CI_TAG=silicon
CI_JOB_PREFIX=test_ CI_JOB_PREFIX=test_
CI_FAILURE="true" CI_FAILURE="true"
......
#!/bin/bash
git clone https://eicweb.phy.anl.gov/EIC/datasets.git datasets
ln -s datasets/data
git clone https://eicweb.phy.anl.gov/EIC/detectors/topside.git
mkdir topside/build && cd topside/build
cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j30 install
cd ../..
ls -lrth
root -b -q "datasets/emcal_electrons.cxx(1e6, \"emcal_uniform_electrons.hepmc\")"
cd topside && ls -l
npsim --runType batch --numberOfEvents 100000 --compactFile topside.xml --inputFiles ../emcal_uniform_electrons.hepmc --outputFile sim_emcal_electrons.root
pwd
ls -lrth ../
xenv -x /usr/local/Juggler.xenv gaudirun.py options/example_crystal.py
cd ..
ls -lrth
echo " directory: "
pwd
mkdir -p results
root -b -q "./scripts/makeplot.C(\"topside/sim_emcal_electrons_output.root\")"
#!/bin/bash
export JUGGLER_FILE_NAME_TAG="emcal_uniform_electrons"
export JUGGLER_N_EVENTS=1000
export JUGGLER_DETECTOR="topside"
export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
git clone https://eicweb.phy.anl.gov/EIC/datasets.git datasets
root -b -q "datasets/emcal_electrons.cxx(1e4, \"${JUGGLER_FILE_NAME_TAG}.hepmc\")"
git clone https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git
mkdir ${JUGGLER_DETECTOR}/build
pushd ${JUGGLER_DETECTOR}/build
cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j30 install
popd
pushd ${JUGGLER_DETECTOR}
ls -l
# run geant4 simulations
npsim --runType batch \
--numberOfEvents ${JUGGLER_N_EVENTS} \
--compactFile ${JUGGLER_DETECTOR}.xml \
--inputFiles ../${JUGGLER_FILE_NAME_TAG}.hepmc \
--outputFile ${JUGGLER_SIM_FILE}
# Need to figure out how to pass file name to juggler from the commandline
xenv -x /usr/local/Juggler.xenv gaudirun.py ../ecal/options/example_crystal.py
popd
pwd
mkdir -p results
root -b -q "./scripts/makeplot.C(\"${JUGGLER_DETECTOR}/${JUGGLER_SIM_FILE}\")"
from Gaudi.Configuration import *
from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase
from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc
from GaudiKernel import SystemOfUnits as units
geo_service = GeoSvc("GeoSvc", detectors=["topside.xml"])
podioevent = EICDataSvc("EventDataSvc", inputs=["sim_emcal_electrons.root"], OutputLevel=DEBUG)
from Configurables import PodioInput
from Configurables import Jug__Digi__CrystalEndcapsDigi as CrystalEndcapsDigi
from Configurables import Jug__Reco__CrystalEndcapsReco as CrystalEndcapsReco
from Configurables import Jug__Reco__CalorimeterIslandCluster as IslandCluster
from Configurables import Jug__Reco__ClusterRecoCoG as RecoCoG
podioinput = PodioInput("PodioReader", collections=["mcparticles","CrystalEcalHits"], OutputLevel=DEBUG)
emcaldigi = CrystalEndcapsDigi("ecal_digi", inputHitCollection="CrystalEcalHits", outputHitCollection="RawDigiEcalHits")
emcalreco = CrystalEndcapsReco("ecal_reco", inputHitCollection="RawDigiEcalHits", outputHitCollection="RecoEcalHits",
minModuleEdep=1.0*units.MeV)
emcalcluster = IslandCluster("emcal_cluster", inputHitCollection="RecoEcalHits", outputClusterCollection="EcalClusters",
minClusterCenterEdep=30*units.MeV, groupRange=2.0)
clusterreco = RecoCoG("cluster_reco", clusterCollection="EcalClusters", logWeightBase=4.2, moduleDimZName="CrystalBox_z_length")
out = PodioOutput("out", filename="sim_emcal_electrons_output.root")
out.outputCommands = ["keep *"]
ApplicationMgr(
TopAlg = [podioinput, emcaldigi, emcalreco, emcalcluster, clusterreco, out],
EvtSel = 'NONE',
EvtMax = 100000,
ExtSvc = [podioevent],
OutputLevel=DEBUG
)
from Gaudi.Configuration import *
import os
from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase
from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc
from GaudiKernel import SystemOfUnits as units
detector_name = "topside"
if "JUGGLER_DETECTOR" in os.environ :
detector_name = str(os.environ["JUGGLER_DETECTOR"])
# todo add checks
input_sim_file = str(os.environ["JUGGLER_SIM_FILE"])
output_rec_file = str(os.environ["JUGGLER_REC_FILE"])
n_events = str(os.environ["JUGGLER_N_EVENTS"])
geo_service = GeoSvc("GeoSvc", detectors=["{}.xml".format(detector_name)])
podioevent = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=DEBUG)
from Configurables import PodioInput
from Configurables import Jug__Digi__CrystalEndcapsDigi as CrystalEndcapsDigi
from Configurables import Jug__Reco__CrystalEndcapsReco as CrystalEndcapsReco
from Configurables import Jug__Reco__CalorimeterIslandCluster as IslandCluster
from Configurables import Jug__Reco__ClusterRecoCoG as RecoCoG
podioinput = PodioInput("PodioReader", collections=["mcparticles","CrystalEcalHits"], OutputLevel=DEBUG)
emcaldigi = CrystalEndcapsDigi("ecal_digi", inputHitCollection="CrystalEcalHits", outputHitCollection="RawDigiEcalHits")
emcalreco = CrystalEndcapsReco("ecal_reco", inputHitCollection="RawDigiEcalHits", outputHitCollection="RecoEcalHits",
minModuleEdep=1.0*units.MeV)
emcalcluster = IslandCluster("emcal_cluster", inputHitCollection="RecoEcalHits", outputClusterCollection="EcalClusters",
minClusterCenterEdep=30*units.MeV, groupRange=2.0)
clusterreco = RecoCoG("cluster_reco", clusterCollection="EcalClusters", logWeightBase=4.2, moduleDimZName="CrystalBox_z_length")
out = PodioOutput("out", filename=output_rec_file)
out.outputCommands = ["keep *"]
ApplicationMgr(
TopAlg = [podioinput, emcaldigi, emcalreco, emcalcluster, clusterreco, out],
EvtSel = 'NONE',
EvtMax = n_events,
ExtSvc = [podioevent],
OutputLevel=DEBUG
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment