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

Added input collection copiers

- Removed env variables in rich script:
- removed the momentum/angle env variables from the script.
- This is to avoid abusing this mechanism.  We really only want to
change the detector and # of events. The benchmarks themselves should be
static between comparisons otherwise they don't make a good benchmark
for comparison.
- Adding the rich to the master CI
- fixed up scripts and file names
parent 7622c507
No related branches found
No related tags found
1 merge request!24Added input collection copiers
...@@ -28,6 +28,7 @@ include: ...@@ -28,6 +28,7 @@ include:
- local: 'ecal/ecal_config.yml' - local: 'ecal/ecal_config.yml'
- local: 'tracking/tracking_config.yml' - local: 'tracking/tracking_config.yml'
- local: 'clustering/clustering_config.yml' - local: 'clustering/clustering_config.yml'
- local: 'rich/rich_config.yml'
final_report: final_report:
......
...@@ -8,23 +8,7 @@ if [[ ! -n "${JUGGLER_N_EVENTS}" ]] ; then ...@@ -8,23 +8,7 @@ if [[ ! -n "${JUGGLER_N_EVENTS}" ]] ; then
export JUGGLER_N_EVENTS=100 export JUGGLER_N_EVENTS=100
fi fi
if [[ ! -n "${P_start}" ]] ; then export JUGGLER_FILE_NAME_TAG="rich_forward_hadrons"
export P_start=5.0
fi
if [[ ! -n "${P_end}" ]] ; then
export P_end=100.0
fi
if [[ ! -n "${Angle_start}" ]] ; then
export Angle_start=3.0
fi
if [[ ! -n "${Angle_end}" ]] ; then
export Angle_end=8.0
fi
export JUGGLER_FILE_NAME_TAG="emcal_uniform_electrons"
export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc" export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root" export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root"
...@@ -47,17 +31,17 @@ popd ...@@ -47,17 +31,17 @@ popd
python rich/scripts/rich_data_gen.py \ python rich/scripts/rich_data_gen.py \
${JUGGLER_FILE_NAME_TAG}.hepmc \ ${JUGGLER_FILE_NAME_TAG}.hepmc \
-n ${JUGGLER_N_EVENTS} \ -n ${JUGGLER_N_EVENTS} \
--pmin ${P_start} \ --pmin 5.0 \
--pmax ${P_end} \ --pmax 100.0 \
--angmin ${Angle_start} \ --angmin 3.0 \
--angmax ${Angle_end} --angmax 8.0
pushd ${JUGGLER_DETECTOR} pushd ${JUGGLER_DETECTOR}
ls -l ls -l
# run geant4 simulations # run geant4 simulations
python options/ForwardRICH/simu.py \ python options/ForwardRICH/simu.py \
--compact=${JUGGLER_DETECTOR}.xml \ --compact=${JUGGLER_DETECTOR}.xml \
-i ../${JUGGLER_FILE_NAME_TAG} \ -i ../${JUGGLER_FILE_NAME_TAG}.hepmc \
-o ${JUGGLER_SIM_FILE} -o ${JUGGLER_SIM_FILE}
-n ${JUGGLER_N_EVENTS} -n ${JUGGLER_N_EVENTS}
......
...@@ -4,29 +4,46 @@ from GaudiKernel import SystemOfUnits as units ...@@ -4,29 +4,46 @@ from GaudiKernel import SystemOfUnits as units
from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase
from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc
geo_service = GeoSvc("GeoSvc", detectors=["topside.xml"]) detector_name = "topside"
podioevent = EICDataSvc("EventDataSvc", inputs=["rich_test.root"], OutputLevel=DEBUG) 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 PodioInput
from Configurables import Jug__Digi__PhotoMultiplierDigi as PhotoMultiplierDigi from Configurables import Jug__Digi__PhotoMultiplierDigi as PhotoMultiplierDigi
from Configurables import Jug__Reco__PhotoMultiplierReco as PhotoMultiplierReco from Configurables import Jug__Reco__PhotoMultiplierReco as PhotoMultiplierReco
from Configurables import Jug__Reco__PhotoRingClusters as PhotoRingClusters from Configurables import Jug__Reco__PhotoRingClusters as PhotoRingClusters
from Configurables import Jug__Base__InputCopier_dd4pod__Geant4ParticleCollection_dd4pod__Geant4ParticleCollection_ as MCCopier
from Configurables import Jug__Base__InputCopier_dd4pod__PhotoMultiplierHitCollection_dd4pod__PhotoMultiplierHitCollection_ as PMTCopier
qe_data = [(1.0, 0.25), (7.5, 0.25),] qe_data = [(1.0, 0.25), (7.5, 0.25),]
podioinput = PodioInput("PodioReader", collections=["mcparticles", "ForwardRICHHits"], OutputLevel=DEBUG) podioinput = PodioInput("PodioReader", collections=["mcparticles", "ForwardRICHHits"], OutputLevel=DEBUG)
## copiers to get around input --> output copy bug. Note the "2" appended to the output collection.
# copy these inputs to the output (a bug work around for now...). Note the the output name has a "2" at the end.
copier = MCCopier("MCCopier", inputCollection="mcparticles", outputCollection="mcparticles2",OutputLevel=DEBUG)
pmtcopier = PMTCopier("PMTCopier", inputCollection="ForwardRICHHits", outputCollection="ForwardRICHHits2",OutputLevel=DEBUG)
pmtdigi = PhotoMultiplierDigi(inputHitCollection="ForwardRICHHits", outputHitCollection="DigiForwardRICHHits", pmtdigi = PhotoMultiplierDigi(inputHitCollection="ForwardRICHHits", outputHitCollection="DigiForwardRICHHits",
quantumEfficiency=[(a*units.eV, b) for a, b in qe_data]) quantumEfficiency=[(a*units.eV, b) for a, b in qe_data])
pmtreco = PhotoMultiplierReco(inputHitCollection="DigiForwardRICHHits", outputHitCollection="RecoForwardRICHHits") pmtreco = PhotoMultiplierReco(inputHitCollection="DigiForwardRICHHits", outputHitCollection="RecoForwardRICHHits")
richcluster = PhotoRingClusters(inputHitCollection="RecoForwardRICHHits", inputTrackCollection="mcparticles", richcluster = PhotoRingClusters(inputHitCollection="RecoForwardRICHHits", #inputTrackCollection="mcparticles",
outputClusterCollection="RICHClusters") outputClusterCollection="RICHClusters")
out = PodioOutput("out", filename="rich_test_reco.root") out = PodioOutput("out", filename=output_rec_file)
out.outputCommands = ["keep *"] out.outputCommands = ["keep *"]
ApplicationMgr( ApplicationMgr(
TopAlg = [podioinput, pmtdigi, pmtreco, richcluster, out], TopAlg = [podioinput, copier, pmtcopier, pmtdigi, pmtreco, richcluster, out],
EvtSel = 'NONE', EvtSel = 'NONE',
EvtMax = 100000, EvtMax = n_events,
ExtSvc = [podioevent], ExtSvc = [podioevent],
OutputLevel=DEBUG OutputLevel=DEBUG
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment