diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d0396a27478175a6353b288037de0588631e38e8..6604d58495355ebd610f5c68a6734025ddcc7456 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,7 @@ include: - local: 'ecal/ecal_config.yml' - local: 'tracking/tracking_config.yml' - local: 'clustering/clustering_config.yml' + - local: 'rich/rich_config.yml' final_report: diff --git a/rich/forward_hadrons.sh b/rich/forward_hadrons.sh index 4ef74e96e0b93b4fd9e4cc95d459e2dccad9b91f..784a1c34cb315dffbb442beab4fdbe7dceb434a5 100644 --- a/rich/forward_hadrons.sh +++ b/rich/forward_hadrons.sh @@ -8,23 +8,7 @@ if [[ ! -n "${JUGGLER_N_EVENTS}" ]] ; then export JUGGLER_N_EVENTS=100 fi -if [[ ! -n "${P_start}" ]] ; then - 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_FILE_NAME_TAG="rich_forward_hadrons" export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc" export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root" @@ -47,17 +31,17 @@ popd python rich/scripts/rich_data_gen.py \ ${JUGGLER_FILE_NAME_TAG}.hepmc \ -n ${JUGGLER_N_EVENTS} \ - --pmin ${P_start} \ - --pmax ${P_end} \ - --angmin ${Angle_start} \ - --angmax ${Angle_end} + --pmin 5.0 \ + --pmax 100.0 \ + --angmin 3.0 \ + --angmax 8.0 pushd ${JUGGLER_DETECTOR} ls -l # run geant4 simulations python options/ForwardRICH/simu.py \ --compact=${JUGGLER_DETECTOR}.xml \ - -i ../${JUGGLER_FILE_NAME_TAG} \ + -i ../${JUGGLER_FILE_NAME_TAG}.hepmc \ -o ${JUGGLER_SIM_FILE} -n ${JUGGLER_N_EVENTS} diff --git a/rich/options/rich_reco.py b/rich/options/rich_reco.py index d0557aebe01cfdbadf9814dfc33bf356de0f6261..d6faddc5cab1f8519099006c1fc7857c35759874 100644 --- a/rich/options/rich_reco.py +++ b/rich/options/rich_reco.py @@ -4,29 +4,46 @@ from GaudiKernel import SystemOfUnits as units from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc -geo_service = GeoSvc("GeoSvc", detectors=["topside.xml"]) -podioevent = EICDataSvc("EventDataSvc", inputs=["rich_test.root"], OutputLevel=DEBUG) +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__PhotoMultiplierDigi as PhotoMultiplierDigi from Configurables import Jug__Reco__PhotoMultiplierReco as PhotoMultiplierReco 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),] 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", quantumEfficiency=[(a*units.eV, b) for a, b in qe_data]) pmtreco = PhotoMultiplierReco(inputHitCollection="DigiForwardRICHHits", outputHitCollection="RecoForwardRICHHits") -richcluster = PhotoRingClusters(inputHitCollection="RecoForwardRICHHits", inputTrackCollection="mcparticles", +richcluster = PhotoRingClusters(inputHitCollection="RecoForwardRICHHits", #inputTrackCollection="mcparticles", outputClusterCollection="RICHClusters") -out = PodioOutput("out", filename="rich_test_reco.root") +out = PodioOutput("out", filename=output_rec_file) out.outputCommands = ["keep *"] ApplicationMgr( - TopAlg = [podioinput, pmtdigi, pmtreco, richcluster, out], + TopAlg = [podioinput, copier, pmtcopier, pmtdigi, pmtreco, richcluster, out], EvtSel = 'NONE', - EvtMax = 100000, + EvtMax = n_events, ExtSvc = [podioevent], OutputLevel=DEBUG )