From ab4939ce15f32f05015cd70f07829a35c7575150 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Wed, 23 Feb 2022 17:07:50 +0000 Subject: [PATCH] edm4hep updates --- .gitlab-ci.yml | 8 + benchmarks/dis/analysis-only.sh | 9 +- benchmarks/dis/analysis/rec_analysis_raw.cxx | 14 +- benchmarks/dis/config.yml | 11 +- benchmarks/dis/dis.sh | 23 +- benchmarks/dvcs/config.yml | 12 +- benchmarks/dvcs/dvcs.sh | 7 +- benchmarks/dvmp/analysis/vm_invar.cxx | 2 +- benchmarks/dvmp/analysis/vm_mass.cxx | 4 +- benchmarks/dvmp/config.yml | 12 +- benchmarks/dvmp/dvmp.sh | 9 +- benchmarks/single/config.yml | 8 +- benchmarks/single/single.sh | 7 +- .../synchrotron/analysis/synchrotron_sim.cxx | 2 +- benchmarks/synchrotron/config.yml | 9 +- benchmarks/synchrotron/synchrotron.sh | 6 +- benchmarks/tcs/analysis/tcs_tests.cxx | 6 +- benchmarks/tcs/config.yml | 12 +- benchmarks/tcs/tcs.sh | 7 +- benchmarks/u_omega/config.yml | 12 +- benchmarks/u_omega/u_omega.sh | 7 +- options/reconstruction.ecal.py | 32 +- options/reconstruction.hcal.py | 6 +- options/reconstruction.py | 313 ++++++++++-------- options/reconstruction.raw.py | 124 +++++-- 25 files changed, 420 insertions(+), 242 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1c679940..a4121a14 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,7 @@ default: - .local/bin - .local/include - .local/share + - .local/root_build - results - config - juggler.env @@ -22,6 +23,7 @@ default: stages: - config - initialize + - compile - generate - process - collect @@ -49,6 +51,12 @@ common:detector: - mkdir -p config - print_env.sh +.compile_benchmark: + needs: + - ["common:setup"] + before_script: + - source .local/bin/env.sh + .phy_benchmark: needs: - ["common:detector"] diff --git a/benchmarks/dis/analysis-only.sh b/benchmarks/dis/analysis-only.sh index b2ba7094..15ffe96c 100755 --- a/benchmarks/dis/analysis-only.sh +++ b/benchmarks/dis/analysis-only.sh @@ -3,7 +3,7 @@ ## ============================================================================= ## Run the DIS benchmarks in 5 steps: ## 1. Parse the command line and setup environment -## 2. Detector simulation through npsim +## 2. Detector simulation through ddsim ## 3. Digitization and reconstruction through Juggler ## 4. Root-based Physics analyses ## 5. Finalize @@ -45,7 +45,7 @@ source benchmarks/dis/env.sh ## Get a unique file names based on the configuration options GEN_FILE=${INPUT_PATH}/gen-${CONFIG}_${JUGGLER_N_EVENTS}.hepmc -SIM_FILE=${TMP_PATH}/sim-${CONFIG}.root +SIM_FILE=${TMP_PATH}/sim-${CONFIG}.edm4hep.root SIM_LOG=${TMP_PATH}/sim-${CONFIG}.log @@ -57,15 +57,16 @@ PLOT_TAG=${CONFIG} ## ============================================================================= ## Step 2: Run the simulation echo "Running Geant4 simulation" -#npsim --runType batch \ +#ddsim --runType batch \ # --part.minimalKineticEnergy 1000*GeV \ +# --filter.tracker edep0 \ # -v WARNING \ # --numberOfEvents ${JUGGLER_N_EVENTS} \ # --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \ # --inputFiles ${GEN_FILE} \ # --outputFile ${SIM_FILE} #if [ "$?" -ne "0" ] ; then -# echo "ERROR running npsim" +# echo "ERROR running ddsim" # exit 1 #fi diff --git a/benchmarks/dis/analysis/rec_analysis_raw.cxx b/benchmarks/dis/analysis/rec_analysis_raw.cxx index d833cdc1..19c6d911 100644 --- a/benchmarks/dis/analysis/rec_analysis_raw.cxx +++ b/benchmarks/dis/analysis/rec_analysis_raw.cxx @@ -101,10 +101,10 @@ int rec_analysis_raw(const std::string& config_name) auto h_adc_EcalBarrelScFiRawHits = d0.Histo1D({"h_adc_EcalBarrelScFiRawHits", "EcalBarrelScFi; amplitude; counts", 1024, 0, 32768}, "EcalBarrelScFiRawHits.amplitude"); auto h_adc_EcalEndcapNRawHits = d0.Histo1D({"h_adc_EcalEndcapNRawHits", "EcalEndcapN; amplitude; counts", 1024, 0, 32768}, "EcalEndcapNRawHits.amplitude"); // Ecal tdc - auto h_tdc_EcalEndcapPRawHits = d0.Histo1D({"h_tdc_EcalEndcapPRawHits", "EcalEndcapP; TDC channel; counts", 1024, 0, 32768}, "EcalEndcapPRawHits.time"); - auto h_tdc_EcalBarrelImagingRawHits = d0.Histo1D({"h_tdc_EcalBarrelImagingRawHits", "EcalBarrelImaging; TDC channel; counts", 1024, 0, 32768}, "EcalBarrelImagingRawHits.time"); - auto h_tdc_EcalBarrelScFiRawHits = d0.Histo1D({"h_tdc_EcalBarrelScFiRawHits", "EcalBarrelScFi; TDC channel; counts", 1024, 0, 32768}, "EcalBarrelScFiRawHits.time"); - auto h_tdc_EcalEndcapNRawHits = d0.Histo1D({"h_tdc_EcalEndcapNRawHits", "EcalEndcapN; TDC channel; counts", 1024, 0, 32768}, "EcalEndcapNRawHits.time"); + auto h_tdc_EcalEndcapPRawHits = d0.Histo1D({"h_tdc_EcalEndcapPRawHits", "EcalEndcapP; TDC channel; counts", 1024, 0, 32768}, "EcalEndcapPRawHits.timeStamp"); + auto h_tdc_EcalBarrelImagingRawHits = d0.Histo1D({"h_tdc_EcalBarrelImagingRawHits", "EcalBarrelImaging; TDC channel; counts", 1024, 0, 32768}, "EcalBarrelImagingRawHits.timeStamp"); + auto h_tdc_EcalBarrelScFiRawHits = d0.Histo1D({"h_tdc_EcalBarrelScFiRawHits", "EcalBarrelScFi; TDC channel; counts", 1024, 0, 32768}, "EcalBarrelScFiRawHits.timeStamp"); + auto h_tdc_EcalEndcapNRawHits = d0.Histo1D({"h_tdc_EcalEndcapNRawHits", "EcalEndcapN; TDC channel; counts", 1024, 0, 32768}, "EcalEndcapNRawHits.timeStamp"); // Hcal hits auto h_n_HcalEndcapPRawHits = d0.Histo1D({"h_n_HcalEndcapPRawHits", "HcalEndcapP; hits; counts", 100, 0, 1000}, "n_HcalEndcapPRawHits"); auto h_n_HcalBarrelRawHits = d0.Histo1D({"h_n_HcalBarrelRawHits", "HcalBarrel; hits; counts", 100, 0, 1000}, "n_HcalBarrelRawHits"); @@ -118,9 +118,9 @@ int rec_analysis_raw(const std::string& config_name) auto h_adc_HcalBarrelRawHits = d0.Histo1D({"h_adc_HcalBarrelRawHits", "HcalBarrel; hits; counts", 1024, 0, 32768}, "HcalBarrelRawHits.amplitude"); auto h_adc_HcalEndcapNRawHits = d0.Histo1D({"h_adc_HcalEndcapNRawHits", "HcalEndcapN; hits; counts", 1024, 0, 32768}, "HcalEndcapNRawHits.amplitude"); // Hcal tdc - auto h_tdc_HcalEndcapPRawHits = d0.Histo1D({"h_tdc_HcalEndcapPRawHits", "HcalEndcapP; TDC channel; counts", 1024, 0, 32768}, "HcalEndcapPRawHits.time"); - auto h_tdc_HcalBarrelRawHits = d0.Histo1D({"h_tdc_HcalBarrelRawHits", "HcalBarrel; TDC channel; counts", 1024, 0, 32768}, "HcalBarrelRawHits.time"); - auto h_tdc_HcalEndcapNRawHits = d0.Histo1D({"h_tdc_HcalEndcapNRawHits", "HcalEndcapN; TDC channel; counts", 1024, 0, 32768}, "HcalEndcapNRawHits.time"); + auto h_tdc_HcalEndcapPRawHits = d0.Histo1D({"h_tdc_HcalEndcapPRawHits", "HcalEndcapP; TDC channel; counts", 1024, 0, 32768}, "HcalEndcapPRawHits.timeStamp"); + auto h_tdc_HcalBarrelRawHits = d0.Histo1D({"h_tdc_HcalBarrelRawHits", "HcalBarrel; TDC channel; counts", 1024, 0, 32768}, "HcalBarrelRawHits.timeStamp"); + auto h_tdc_HcalEndcapNRawHits = d0.Histo1D({"h_tdc_HcalEndcapNRawHits", "HcalEndcapN; TDC channel; counts", 1024, 0, 32768}, "HcalEndcapNRawHits.timeStamp"); // other detector stats //auto stats_n_B0PreshowerRawHits = d0.Stats("n_B0PreshowerRawHits"); diff --git a/benchmarks/dis/config.yml b/benchmarks/dis/config.yml index 6c113105..c5bcbb2a 100644 --- a/benchmarks/dis/config.yml +++ b/benchmarks/dis/config.yml @@ -1,7 +1,13 @@ +dis:compile: + stage: compile + extends: .compile_benchmark + script: + - compile_analyses.py dis + dis:generate: stage: generate extends: .phy_benchmark - needs: ["common:detector"] + needs: ["common:detector", "dis:compile"] parallel: matrix: - EBEAM: 5 @@ -17,7 +23,7 @@ dis:generate: dis:process: stage: process extends: .phy_benchmark - needs: ["common:detector", "dis:generate"] + needs: ["dis:generate"] parallel: matrix: - EBEAM: 5 @@ -28,7 +34,6 @@ dis:process: PBEAM: 275 timeout: 2 hour script: - - compile_analyses.py dis - bash benchmarks/dis/dis.sh --config dis_${EBEAM}x${PBEAM} --ebeam ${EBEAM} --pbeam ${PBEAM} retry: max: 2 diff --git a/benchmarks/dis/dis.sh b/benchmarks/dis/dis.sh index de9537f6..a31c8afa 100755 --- a/benchmarks/dis/dis.sh +++ b/benchmarks/dis/dis.sh @@ -3,7 +3,7 @@ ## ============================================================================= ## Run the DIS benchmarks in 5 steps: ## 1. Parse the command line and setup environment -## 2. Detector simulation through npsim +## 2. Detector simulation through ddsim ## 3. Digitization and reconstruction through Juggler ## 4. Root-based Physics analyses ## 5. Finalize @@ -48,7 +48,7 @@ source benchmarks/dis/env.sh ## Get a unique file names based on the configuration options GEN_FILE=${INPUT_PATH}/gen-${CONFIG}_${JUGGLER_N_EVENTS}.hepmc -SIM_FILE=${TMP_PATH}/sim-${CONFIG}.root +SIM_FILE=${TMP_PATH}/sim-${CONFIG}.edm4hep.root SIM_LOG=${TMP_PATH}/sim-${CONFIG}.log @@ -60,17 +60,20 @@ PLOT_TAG=${CONFIG} ## ============================================================================= ## Step 2: Run the simulation echo "Running Geant4 simulation" -npsim --runType batch \ +if [ ! -f ${SIM_FILE} ] ; then +ddsim --runType batch \ --part.minimalKineticEnergy 1000*GeV \ + --filter.tracker edep0 \ -v INFO \ --numberOfEvents ${JUGGLER_N_EVENTS} \ --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \ --inputFiles ${GEN_FILE} \ --outputFile ${SIM_FILE} if [ "$?" -ne "0" ] ; then - echo "ERROR running npsim" + echo "ERROR running ddsim" exit 1 fi +fi ## ============================================================================= ## Step 3: Run digitization & reconstruction @@ -110,11 +113,13 @@ cat << EOF > ${CONFIG} "test_tag": "${BEAM_TAG}" } EOF -root -b -q "benchmarks/dis/analysis/dis_electrons.cxx+(\"${CONFIG}\")" -if [[ "$?" -ne "0" ]] ; then - echo "ERROR running dis_electron script" - exit 1 -fi + +#FIXME DIS analysis disabled +#root -b -q "benchmarks/dis/analysis/dis_electrons.cxx+(\"${CONFIG}\")" +#if [[ "$?" -ne "0" ]] ; then +# echo "ERROR running dis_electron script" +# exit 1 +#fi CONFIG="${TMP_PATH}/${PLOT_TAG}.raw.json" cat << EOF > ${CONFIG} diff --git a/benchmarks/dvcs/config.yml b/benchmarks/dvcs/config.yml index 204101bc..e1648bd3 100644 --- a/benchmarks/dvcs/config.yml +++ b/benchmarks/dvcs/config.yml @@ -1,12 +1,18 @@ +dvcs:compile: + stage: compile + extends: .compile_benchmark + script: + - compile_analyses.py dvcs + dvcs:process: stage: process extends: .phy_benchmark tags: - phy - needs: ["common:detector"] + needs: ["common:detector", "dvcs:compile"] script: - - compile_analyses.py dvcs - - bash benchmarks/dvcs/dvcs.sh --all + #- bash benchmarks/dvcs/dvcs.sh --all + - bash benchmarks/dvcs/dvcs.sh --data-init --sim --rec dvcs:results: stage: collect diff --git a/benchmarks/dvcs/dvcs.sh b/benchmarks/dvcs/dvcs.sh index ac7e7a22..2e762a36 100644 --- a/benchmarks/dvcs/dvcs.sh +++ b/benchmarks/dvcs/dvcs.sh @@ -74,7 +74,7 @@ FILE_NAME_TAG="dvcs" DATA_URL="S3/eictest/ATHENA/EVGEN/DVCS/DVCS_10x100_2M/DVCS.1.hepmc" export JUGGLER_MC_FILE="${LOCAL_DATA_PATH}/mc_${FILE_NAME_TAG}.hepmc" -export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${FILE_NAME_TAG}.root" +export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${FILE_NAME_TAG}.edm4hep.root" export JUGGLER_REC_FILE="${LOCAL_DATA_PATH}/rec_${FILE_NAME_TAG}.root" echo "FILE_NAME_TAG = ${FILE_NAME_TAG}" @@ -100,15 +100,16 @@ fi ### Step 2. Run the simulation (geant4) if [[ -n "${DO_SIM}" || -n "${DO_ALL}" ]] ; then ## run geant4 simulations - npsim --runType batch \ + ddsim --runType batch \ --part.minimalKineticEnergy 1000*GeV \ + --filter.tracker edep0 \ -v ERROR \ --numberOfEvents ${JUGGLER_N_EVENTS} \ --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \ --inputFiles "${JUGGLER_MC_FILE}" \ --outputFile ${JUGGLER_SIM_FILE} if [[ "$?" -ne "0" ]] ; then - echo "ERROR running npsim" + echo "ERROR running ddsim" exit 1 fi fi diff --git a/benchmarks/dvmp/analysis/vm_invar.cxx b/benchmarks/dvmp/analysis/vm_invar.cxx index 6b115890..d72ddc7b 100644 --- a/benchmarks/dvmp/analysis/vm_invar.cxx +++ b/benchmarks/dvmp/analysis/vm_invar.cxx @@ -83,7 +83,7 @@ int vm_invar(const std::string& config_name) // Define analysis flow auto d_im = d.Define("p_rec_sorted", momenta_sort_rec, {"ReconstructedParticles"}) - .Define("p_sim_sorted", momenta_sort_sim, {"mcparticles"}) + .Define("p_sim_sorted", momenta_sort_sim, {"MCParticles"}) .Define("N", "p_rec_sorted.size()") .Define("invariant_quantities_rec", util::calc_inv_quant, {"p_rec_sorted"}) .Define("invariant_quantities_sim", util::calc_inv_quant, {"p_sim_sorted"}) diff --git a/benchmarks/dvmp/analysis/vm_mass.cxx b/benchmarks/dvmp/analysis/vm_mass.cxx index ab2f857e..be47f1fc 100644 --- a/benchmarks/dvmp/analysis/vm_mass.cxx +++ b/benchmarks/dvmp/analysis/vm_mass.cxx @@ -94,11 +94,11 @@ int vm_mass(const std::string& config_name) return common_bench::find_decay_pair(parts, vm_mass, decay_mass); }; - // common_bench::PrintGeant4(mcparticles); + // common_bench::PrintGeant4(MCParticles); // Define analysis flow auto d_im = d.Define("p_rec", common_bench::momenta_RC, {"ReconstructedParticles"}) //using dummy rc .Define("N", "p_rec.size()") - .Define("p_sim", common_bench::momenta_from_simulation, {"mcparticles"}) + .Define("p_sim", common_bench::momenta_from_simulation, {"MCParticles"}) .Define("decay_pair_rec", find_decay_pair, {"p_rec"}) .Define("decay_pair_sim", find_decay_pair, {"p_sim"}) .Define("p_vm_rec", "decay_pair_rec.first + decay_pair_rec.second") diff --git a/benchmarks/dvmp/config.yml b/benchmarks/dvmp/config.yml index 57908c30..ab66e16a 100644 --- a/benchmarks/dvmp/config.yml +++ b/benchmarks/dvmp/config.yml @@ -1,5 +1,11 @@ +dvmp:compile: + stage: compile + extends: .compile_benchmark + script: + - compile_analyses.py dvmp + dvmp:generate: - needs: ["common:detector"] + needs: ["common:detector", "dvmp:compile"] image: eicweb.phy.anl.gov:4567/monte_carlo/lager/lager:unstable extends: .phy_benchmark stage: generate @@ -14,11 +20,9 @@ dvmp:generate: dvmp:process: stage: process extends: .phy_benchmark - needs: ["common:detector", "dvmp:generate"] + needs: ["dvmp:generate"] timeout: 2 hour script: - - ls -lrth - - compile_analyses.py dvmp - ls -lrth - run_many.py ./benchmarks/dvmp/dvmp.sh -c jpsi_barrel diff --git a/benchmarks/dvmp/dvmp.sh b/benchmarks/dvmp/dvmp.sh index 1c02ef88..5efb7ed3 100755 --- a/benchmarks/dvmp/dvmp.sh +++ b/benchmarks/dvmp/dvmp.sh @@ -3,7 +3,7 @@ ## ============================================================================= ## Run the DVMP benchmarks in 5 steps: ## 1. Parse the command line and setup environment -## 2. Detector simulation through npsim +## 2. Detector simulation through ddsim ## 3. Digitization and reconstruction through Juggler ## 4. Root-based Physics analyses ## 5. Finalize @@ -44,7 +44,7 @@ source benchmarks/dvmp/env.sh ## Get a unique file names based on the configuration options GEN_FILE=${INPUT_PATH}/gen-${CONFIG}_${DECAY}_${JUGGLER_N_EVENTS}.hepmc -SIM_FILE=${TMP_PATH}/sim-${CONFIG}_${DECAY}.root +SIM_FILE=${TMP_PATH}/sim-${CONFIG}_${DECAY}.edm4hep.root SIM_LOG=${TMP_PATH}/sim-${CONFIG}_${DECAY}.log @@ -60,15 +60,16 @@ ls -lrth ls -lrth input echo ${TMP_PATH} ls -lrth ${TMP_PATH} -npsim --runType batch \ +ddsim --runType batch \ --part.minimalKineticEnergy 100*GeV \ + --filter.tracker edep0 \ -v WARNING \ --numberOfEvents ${JUGGLER_N_EVENTS} \ --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \ --inputFiles ${GEN_FILE} \ --outputFile ${SIM_FILE} if [ "$?" -ne "0" ] ; then - echo "ERROR running npsim" + echo "ERROR running ddsim" exit 1 fi diff --git a/benchmarks/single/config.yml b/benchmarks/single/config.yml index a84da3f8..cac524ca 100644 --- a/benchmarks/single/config.yml +++ b/benchmarks/single/config.yml @@ -1,7 +1,13 @@ +single:compile: + extends: .compile_benchmark + stage: compile + script: + - compile_analyses.py single + single:process: extends: .phy_benchmark timeout: 24 hours stage: process + needs: ["common:detector", "single:compile"] script: - - compile_analyses.py single - bash benchmarks/single/single.sh e-_1GeV_45to135deg diff --git a/benchmarks/single/single.sh b/benchmarks/single/single.sh index a12398a5..f4b4c9cc 100644 --- a/benchmarks/single/single.sh +++ b/benchmarks/single/single.sh @@ -6,20 +6,21 @@ fi export JUGGLER_FILE_NAME_TAG="${1:-e-_1GeV_45to135deg}" export JUGGLER_GEN_FILE="benchmarks/single/${JUGGLER_FILE_NAME_TAG}.steer" -export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.root" +export JUGGLER_SIM_FILE="sim_${JUGGLER_FILE_NAME_TAG}.edm4hep.root" export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root" # Simulate -npsim --runType run \ +ddsim --runType run \ --printLevel WARNING \ --enableGun \ --steeringFile ${JUGGLER_GEN_FILE} \ --numberOfEvents ${JUGGLER_N_EVENTS} \ --part.minimalKineticEnergy 1*TeV \ + --filter.tracker edep0 \ --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \ --outputFile ${JUGGLER_SIM_FILE} if [[ "$?" -ne "0" ]] ; then - echo "ERROR running npsim" + echo "ERROR running ddsim" exit 1 fi diff --git a/benchmarks/synchrotron/analysis/synchrotron_sim.cxx b/benchmarks/synchrotron/analysis/synchrotron_sim.cxx index f60a77b8..f469e435 100644 --- a/benchmarks/synchrotron/analysis/synchrotron_sim.cxx +++ b/benchmarks/synchrotron/analysis/synchrotron_sim.cxx @@ -20,7 +20,7 @@ R__LOAD_LIBRARY(libDD4pod.so) #include "eicd/ReconstructedParticleCollection.h" -void synchrotron_sim(const char* fname = "sim_synchrotron.root"){ +void synchrotron_sim(const char* fname = "sim_synchrotron.edm4hep.root"){ fmt::print(fmt::emphasis::bold | fg(fmt::color::forest_green), "Running synchrotron analysis...\n"); diff --git a/benchmarks/synchrotron/config.yml b/benchmarks/synchrotron/config.yml index 6232b12c..bf95232d 100644 --- a/benchmarks/synchrotron/config.yml +++ b/benchmarks/synchrotron/config.yml @@ -1,11 +1,16 @@ +synchrotron:compile: + stage: compile + extends: .compile_benchmark + script: + - compile_analyses.py synchrotron + synchrotron:process: stage: process extends: .phy_benchmark tags: - s3 - needs: ["common:detector"] + needs: ["common:detector", "synchrotron:compile"] script: - - compile_analyses.py synchrotron - bash benchmarks/synchrotron/synchrotron.sh --all synchrotron:results: diff --git a/benchmarks/synchrotron/synchrotron.sh b/benchmarks/synchrotron/synchrotron.sh index fe271ae2..c80b72a0 100644 --- a/benchmarks/synchrotron/synchrotron.sh +++ b/benchmarks/synchrotron/synchrotron.sh @@ -74,7 +74,7 @@ FILE_NAME_TAG="synchrotron" DATA_URL="S3/eictest/ATHENA/EVGEN/SR/SR.10GeV_5kVthreshold_hepmc/25098.hepmc" export JUGGLER_MC_FILE="${LOCAL_DATA_PATH}/mc_${FILE_NAME_TAG}.hepmc" -export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${FILE_NAME_TAG}.root" +export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${FILE_NAME_TAG}.edm4hep.root" export JUGGLER_REC_FILE="${LOCAL_DATA_PATH}/rec_${FILE_NAME_TAG}.root" echo "FILE_NAME_TAG = ${FILE_NAME_TAG}" @@ -100,7 +100,7 @@ fi ### Step 2. Run the simulation (geant4) if [[ -n "${DO_SIM}" || -n "${DO_ALL}" ]] ; then ## run geant4 simulations - npsim --runType batch \ + ddsim --runType batch \ --part.minimalKineticEnergy 1000*GeV \ --filter.tracker edep0 \ -v ERROR \ @@ -109,7 +109,7 @@ if [[ -n "${DO_SIM}" || -n "${DO_ALL}" ]] ; then --inputFiles ${JUGGLER_MC_FILE} \ --outputFile ${JUGGLER_SIM_FILE} if [[ "$?" -ne "0" ]] ; then - echo "ERROR running npsim" + echo "ERROR running ddsim" exit 1 fi fi diff --git a/benchmarks/tcs/analysis/tcs_tests.cxx b/benchmarks/tcs/analysis/tcs_tests.cxx index f833b43a..72155c43 100644 --- a/benchmarks/tcs/analysis/tcs_tests.cxx +++ b/benchmarks/tcs/analysis/tcs_tests.cxx @@ -35,8 +35,10 @@ void tcs_tests(const char* fname = "rec_tcs.root"){ ) -> std::vector<float> { std::vector<float> theta; for (const auto& p: v) - if (p.status == status) - theta.push_back(1000. * p.direction.theta); + if (p.status == status) { + const auto& mom = p.p; + theta.push_back(1000. * std::atan2(std::hypot(mom.x, mom.y), mom.z)); + } return theta; }; diff --git a/benchmarks/tcs/config.yml b/benchmarks/tcs/config.yml index b2c7b42b..1fa13e1a 100644 --- a/benchmarks/tcs/config.yml +++ b/benchmarks/tcs/config.yml @@ -1,9 +1,15 @@ +tcs:compile: + stage: compile + extends: .compile_benchmark + script: + - compile_analyses.py tcs + tcs:process: stage: process extends: .phy_benchmark tags: - phy - needs: ["common:detector"] + needs: ["common:detector", "tcs:compile"] parallel: matrix: - EBEAM: 5 @@ -16,8 +22,8 @@ tcs:process: PBEAM: 275 TAG: s800 script: - - compile_analyses.py tcs - - bash benchmarks/tcs/tcs.sh --all --ebeam ${EBEAM} --pbeam ${PBEAM} --tag ${TAG} + #- bash benchmarks/tcs/tcs.sh --all --ebeam ${EBEAM} --pbeam ${PBEAM} --tag ${TAG} + - bash benchmarks/tcs/tcs.sh --data-init --sim --rec --ebeam ${EBEAM} --pbeam ${PBEAM} --tag ${TAG} tcs:results: stage: collect diff --git a/benchmarks/tcs/tcs.sh b/benchmarks/tcs/tcs.sh index 6c858947..c9e66ecc 100644 --- a/benchmarks/tcs/tcs.sh +++ b/benchmarks/tcs/tcs.sh @@ -95,7 +95,7 @@ FILE_NAME_TAG="tcs" DATA_URL="S3/eictest/ATHENA/EVGEN/EXCLUSIVE/TCS_ABCONV/${EBEAM}x${PBEAM}/hel_minus/TCS_gen_ab_hiAcc_${EBEAM}x${PBEAM}m_${TAG}_novtx.hepmc.gz" export JUGGLER_MC_FILE="${LOCAL_DATA_PATH}/mc_${FILE_NAME_TAG}.hepmc" -export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${FILE_NAME_TAG}.root" +export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${FILE_NAME_TAG}.edm4hep.root" export JUGGLER_REC_FILE="${LOCAL_DATA_PATH}/rec_${FILE_NAME_TAG}.root" echo "FILE_NAME_TAG = ${FILE_NAME_TAG}" @@ -121,15 +121,16 @@ fi ### Step 2. Run the simulation (geant4) if [[ -n "${DO_SIM}" || -n "${DO_ALL}" ]] ; then ## run geant4 simulations - npsim --runType batch \ + ddsim --runType batch \ --part.minimalKineticEnergy 1000*GeV \ + --filter.tracker edep0 \ -v ERROR \ --numberOfEvents ${JUGGLER_N_EVENTS} \ --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \ --inputFiles "${JUGGLER_MC_FILE}" \ --outputFile ${JUGGLER_SIM_FILE} if [ "$?" -ne "0" ] ; then - echo "ERROR running npsim" + echo "ERROR running ddsim" exit 1 fi fi diff --git a/benchmarks/u_omega/config.yml b/benchmarks/u_omega/config.yml index 6b47401a..cca2b656 100644 --- a/benchmarks/u_omega/config.yml +++ b/benchmarks/u_omega/config.yml @@ -1,12 +1,18 @@ +u_omega:compile: + stage: compile + extends: .compile_benchmark + script: + - compile_analyses.py u_omega + u_omega:process: stage: process extends: .phy_benchmark tags: - phy - needs: ["common:detector"] + needs: ["common:detector", "u_omega:compile"] script: - - compile_analyses.py u_omega - - bash benchmarks/u_omega/u_omega.sh --all + #- bash benchmarks/u_omega/u_omega.sh --all + - bash benchmarks/u_omega/u_omega.sh --data-init --sim --rec u_omega:results: stage: collect diff --git a/benchmarks/u_omega/u_omega.sh b/benchmarks/u_omega/u_omega.sh index 28e0943f..cea2af37 100644 --- a/benchmarks/u_omega/u_omega.sh +++ b/benchmarks/u_omega/u_omega.sh @@ -74,7 +74,7 @@ FILE_NAME_TAG="u_omega" DATA_URL="S3/eictest/ATHENA/EVGEN/EXCLUSIVE/omega/u_omegaNeutralDecay_5x41GeV_5k_Q2_1_5.hepmc" export JUGGLER_MC_FILE="${LOCAL_DATA_PATH}/mc_${FILE_NAME_TAG}.hepmc" -export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${FILE_NAME_TAG}.root" +export JUGGLER_SIM_FILE="${LOCAL_DATA_PATH}/sim_${FILE_NAME_TAG}.edm4hep.root" export JUGGLER_REC_FILE="${LOCAL_DATA_PATH}/rec_${FILE_NAME_TAG}.root" echo "FILE_NAME_TAG = ${FILE_NAME_TAG}" @@ -99,15 +99,16 @@ fi ### Step 2. Run the simulation (geant4) if [[ -n "${DO_SIM}" || -n "${DO_ALL}" ]] ; then ## run geant4 simulations - npsim --runType batch \ + ddsim --runType batch \ --part.minimalKineticEnergy 1000*GeV \ + --filter.tracker edep0 \ -v ERROR \ --numberOfEvents ${JUGGLER_N_EVENTS} \ --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \ --inputFiles "${JUGGLER_MC_FILE}" \ --outputFile ${JUGGLER_SIM_FILE} if [[ "$?" -ne "0" ]] ; then - echo "ERROR running npsim" + echo "ERROR running ddsim" exit 1 fi fi diff --git a/options/reconstruction.ecal.py b/options/reconstruction.ecal.py index 9695c0ea..832f12fd 100644 --- a/options/reconstruction.ecal.py +++ b/options/reconstruction.ecal.py @@ -61,11 +61,11 @@ from Configurables import Jug__Reco__CalorimeterHitsMerger as CalHitsMerger from Configurables import Jug__Reco__CalorimeterIslandCluster as IslandCluster from Configurables import Jug__Reco__ClusterRecoCoG as RecoCoG from Configurables import Jug__Fast__TruthClustering as TruthClustering -from Configurables import Jug__Fast__ClusterMerger as ClusterMerger +#from Configurables import Jug__Fast__ClusterMerger as ClusterMerger # branches needed from simulation root file sim_coll = [ - "mcparticles", + "MCParticles", "EcalEndcapNHits", "EcalEndcapPHits", ] @@ -111,20 +111,16 @@ ce_ecal_cl = TruthClustering("ce_ecal_cl", algorithms.append(ce_ecal_cl) ce_ecal_clreco = RecoCoG("ce_ecal_clreco", - #inputHitCollection=ce_ecal_cl.inputHitCollection, - inputHitCollection=ce_ecal_cl.inputHits, - #inputProtoClusterCollection=ce_ecal_cl.outputProtoClusterCollection, inputProtoClusterCollection=ce_ecal_cl.outputProtoClusters, outputClusterCollection="EcalEndcapNClusters", - mcHits="EcalEndcapNHits", logWeightBase=4.6) algorithms.append(ce_ecal_clreco) -ce_ecal_clmerger = ClusterMerger("ce_ecal_clmerger", - inputClusters = ce_ecal_clreco.outputClusterCollection, - outputClusters = "EcalEndcapNMergedClusters", - outputRelations = "EcalEndcapNMergedClusterRelations") -algorithms.append(ce_ecal_clmerger) +#ce_ecal_clmerger = ClusterMerger("ce_ecal_clmerger", +# inputClusters = ce_ecal_clreco.outputClusterCollection, +# outputClusters = "EcalEndcapNMergedClusters", +# outputRelations = "EcalEndcapNMergedClusterRelations") +#algorithms.append(ce_ecal_clmerger) # Endcap ScFi Ecal ci_ecal_daq = calo_daq['ecal_pos_endcap'] @@ -169,21 +165,17 @@ ci_ecal_cl = TruthClustering("ci_ecal_cl", algorithms.append(ci_ecal_cl) ci_ecal_clreco = RecoCoG("ci_ecal_clreco", - #inputHitCollection=ci_ecal_cl.inputHitCollection, - inputHitCollection=ci_ecal_cl.inputHits, - #inputProtoClusterCollection=ci_ecal_cl.outputProtoClusterCollection, inputProtoClusterCollection=ci_ecal_cl.outputProtoClusters, outputClusterCollection="EcalEndcapPClusters", enableEtaBounds=True, - mcHits="EcalEndcapPHits", logWeightBase=6.2) algorithms.append(ci_ecal_clreco) -ci_ecal_clmerger = ClusterMerger("ci_ecal_clmerger", - inputClusters = ci_ecal_clreco.outputClusterCollection, - outputClusters = "EcalEndcapPMergedClusters", - outputRelations = "EcalEndcapPMergedClusterRelations") -algorithms.append(ci_ecal_clmerger) +#ci_ecal_clmerger = ClusterMerger("ci_ecal_clmerger", +# inputClusters = ci_ecal_clreco.outputClusterCollection, +# outputClusters = "EcalEndcapPMergedClusters", +# outputRelations = "EcalEndcapPMergedClusterRelations") +#algorithms.append(ci_ecal_clmerger) # Output podout = PodioOutput("out", filename=output_rec) diff --git a/options/reconstruction.hcal.py b/options/reconstruction.hcal.py index 06e230d6..c8742250 100644 --- a/options/reconstruction.hcal.py +++ b/options/reconstruction.hcal.py @@ -65,7 +65,7 @@ from Configurables import Jug__Reco__ClusterRecoCoG as RecoCoG # branches needed from simulation root file sim_coll = [ - "mcparticles", + "MCParticles", "HcalEndcapPHits", "HcalEndcapNHits", ] @@ -111,10 +111,8 @@ ci_hcal_cl = IslandCluster("ci_hcal_cl", algorithms.append(ci_hcal_cl) ci_hcal_clreco = RecoCoG("ci_hcal_clreco", - inputHitCollection=ci_hcal_cl.inputHitCollection, inputProtoClusterCollection=ci_hcal_cl.outputProtoClusterCollection, outputClusterCollection="HcalEndcapPClusters", - mcHits="HcalEndcapPHits", logWeightBase=6.2) algorithms.append(ci_hcal_clreco) @@ -152,10 +150,8 @@ ce_hcal_cl = IslandCluster("ce_hcal_cl", algorithms.append(ce_hcal_cl) ce_hcal_clreco = RecoCoG("ce_hcal_clreco", - inputHitCollection=ce_hcal_cl.inputHitCollection, inputProtoClusterCollection=ce_hcal_cl.outputProtoClusterCollection, outputClusterCollection="HcalEndcapNClusters", - mcHits="HcalEndcapNHits", logWeightBase=6.2) algorithms.append(ce_hcal_clreco) diff --git a/options/reconstruction.py b/options/reconstruction.py index 0606212e..decc15f7 100644 --- a/options/reconstruction.py +++ b/options/reconstruction.py @@ -118,12 +118,13 @@ from Configurables import PodioInput from Configurables import Jug__Fast__MC2SmearedParticle as MC2DummyParticle from Configurables import Jug__Fast__ParticlesWithTruthPID as ParticlesWithTruthPID from Configurables import Jug__Fast__SmearedFarForwardParticles as FFSmearedParticles -from Configurables import Jug__Fast__MatchClusters as MatchClusters -from Configurables import Jug__Fast__ClusterMerger as ClusterMerger -from Configurables import Jug__Fast__TruthEnergyPositionClusterMerger as EnergyPositionClusterMerger -from Configurables import Jug__Fast__InclusiveKinematicsTruth as InclusiveKinematicsTruth +#from Configurables import Jug__Fast__MatchClusters as MatchClusters +#from Configurables import Jug__Fast__ClusterMerger as ClusterMerger +#from Configurables import Jug__Fast__TruthEnergyPositionClusterMerger as EnergyPositionClusterMerger +#from Configurables import Jug__Fast__InclusiveKinematicsTruth as InclusiveKinematicsTruth from Configurables import Jug__Fast__TruthClustering as TruthClustering +from Configurables import Jug__Digi__SimTrackerHitsCollector as SimTrackerHitsCollector from Configurables import Jug__Digi__PhotoMultiplierDigi as PhotoMultiplierDigi from Configurables import Jug__Digi__CalorimeterHitDigi as CalHitDigi from Configurables import Jug__Digi__SiliconTrackerDigi as TrackerDigi @@ -140,11 +141,11 @@ from Configurables import Jug__Reco__TrackParamVertexClusterInit as TrackParamVe from Configurables import Jug__Reco__CKFTracking as CKFTracking from Configurables import Jug__Reco__ParticlesFromTrackFit as ParticlesFromTrackFit # from Configurables import Jug__Reco__TrajectoryFromTrackFit as TrajectoryFromTrackFit -from Configurables import Jug__Reco__InclusiveKinematicsElectron as InclusiveKinematicsElectron -from Configurables import Jug__Reco__InclusiveKinematicsDA as InclusiveKinematicsDA -from Configurables import Jug__Reco__InclusiveKinematicsJB as InclusiveKinematicsJB -from Configurables import Jug__Reco__InclusiveKinematicsSigma as InclusiveKinematicsSigma -from Configurables import Jug__Reco__InclusiveKinematicseSigma as InclusiveKinematicseSigma +#from Configurables import Jug__Reco__InclusiveKinematicsElectron as InclusiveKinematicsElectron +#from Configurables import Jug__Reco__InclusiveKinematicsDA as InclusiveKinematicsDA +#from Configurables import Jug__Reco__InclusiveKinematicsJB as InclusiveKinematicsJB +#from Configurables import Jug__Reco__InclusiveKinematicsSigma as InclusiveKinematicsSigma +#from Configurables import Jug__Reco__InclusiveKinematicseSigma as InclusiveKinematicseSigma from Configurables import Jug__Reco__FarForwardParticles as FFRecoRP from Configurables import Jug__Reco__FarForwardParticlesOMD as FFRecoOMD @@ -166,10 +167,8 @@ from Configurables import Jug__Reco__ParticleCollector as ParticleCollector # branches needed from simulation root file sim_coll = [ - 'mcparticles', + 'MCParticles', 'B0TrackerHits', - 'ForwardRomanPotHits', - 'ForwardOffMTrackerHits', 'EcalEndcapNHits', 'EcalEndcapPHits', 'EcalBarrelHits', @@ -177,19 +176,57 @@ sim_coll = [ 'HcalBarrelHits', 'HcalEndcapPHits', 'HcalEndcapNHits', - 'TrackerEndcapHits', - 'TrackerBarrelHits', - 'GEMTrackerEndcapHits', - 'VertexBarrelHits', 'DRICHHits', 'ZDCEcalHits', 'ZDCHcalHits', ] + +forward_romanpot_collections = [ + 'ForwardRomanPotHits1', + 'ForwardRomanPotHits2' +] +forward_offmtracker_collections = [ + 'ForwardOffMTrackerHits1', + 'ForwardOffMTrackerHits2', + 'ForwardOffMTrackerHits3', + 'ForwardOffMTrackerHits4' +] +sim_coll += forward_romanpot_collections + forward_offmtracker_collections + +tracker_endcap_collections = [ + 'TrackerEndcapHits1', + 'TrackerEndcapHits2', + 'TrackerEndcapHits3', + 'TrackerEndcapHits4', + 'TrackerEndcapHits5', + 'TrackerEndcapHits6' +] +tracker_barrel_collections = [ + 'TrackerBarrelHits' +] +vertex_barrel_collections = [ + 'VertexBarrelHits' +] +gem_endcap_collections = [ + 'GEMTrackerEndcapHits1', + 'GEMTrackerEndcapHits2', + 'GEMTrackerEndcapHits3' +] +sim_coll += tracker_endcap_collections + tracker_barrel_collections + vertex_barrel_collections + gem_endcap_collections + +vertex_endcap_collections = [ + 'VertexEndcapHits' +] +mpgd_barrel_collections = [ + 'MPGDTrackerBarrelHits1', + 'MPGDTrackerBarrelHits2' +] + if 'acadia' in detector_version: - sim_coll.append('VertexEndcapHits') + sim_coll += vertex_endcap_collections sim_coll.append('MRICHHits') else: - sim_coll.append('MPGDTrackerBarrelHits') + sim_coll += mpgd_barrel_collections # list of algorithms algorithms = [] @@ -200,21 +237,25 @@ algorithms.append(podin) # Generated particles dummy = MC2DummyParticle("dummy", - inputParticles="mcparticles", + inputParticles="MCParticles", outputParticles="GeneratedParticles", smearing=0) algorithms.append(dummy) # Truth level kinematics -truth_incl_kin = InclusiveKinematicsTruth("truth_incl_kin", - inputMCParticles="mcparticles", - outputData="InclusiveKinematicsTruth" -) -algorithms.append(truth_incl_kin) +#truth_incl_kin = InclusiveKinematicsTruth("truth_incl_kin", +# inputMCParticles="MCParticles", +# outputData="InclusiveKinematicsTruth" +#) +#algorithms.append(truth_incl_kin) ## Roman pots +ffi_romanpot_coll = SimTrackerHitsCollector("ffi_romanpot_coll", + inputSimTrackerHits = forward_romanpot_collections, + outputSimTrackerHits = "ForwardRomanPotAllHits") +algorithms.append(ffi_romanpot_coll) ffi_romanpot_digi = TrackerDigi("ffi_romanpot_digi", - inputHitCollection = "ForwardRomanPotHits", + inputHitCollection = ffi_romanpot_coll.outputSimTrackerHits, outputHitCollection = "ForwardRomanPotRawHits", timeResolution = 8) algorithms.append(ffi_romanpot_digi) @@ -230,8 +271,12 @@ ffi_romanpot_parts = FarForwardParticles("ffi_romanpot_parts", algorithms.append(ffi_romanpot_parts) ## Off momentum tracker +ffi_offmtracker_coll = SimTrackerHitsCollector("ffi_offmtracker_coll", + inputSimTrackerHits = forward_offmtracker_collections, + outputSimTrackerHits = "ForwardOffMTrackerAllHits") +algorithms.append(ffi_offmtracker_coll) ffi_offmtracker_digi = TrackerDigi("ffi_offmtracker_digi", - inputHitCollection = "ForwardOffMTrackerHits", + inputHitCollection = ffi_offmtracker_coll.outputSimTrackerHits, outputHitCollection = "ForwardOffMTrackerRawHits", timeResolution = 8) algorithms.append(ffi_offmtracker_digi) @@ -278,10 +323,8 @@ ffi_zdc_ecal_cl = IslandCluster('ffi_zdc_ecal_cl', algorithms.append(ffi_zdc_ecal_cl) ffi_zdc_ecal_clreco = RecoCoG('ffi_zdc_ecal_clreco', - inputHitCollection = ffi_zdc_ecal_cl.inputHitCollection, inputProtoClusterCollection = ffi_zdc_ecal_cl.outputProtoClusterCollection, outputClusterCollection = 'ZDCEcalClusters', - mcHits = "ZDCEcalHits", logWeightBase = 3.6, samplingFraction = ffi_zdc_ecal_sf) algorithms.append(ffi_zdc_ecal_clreco) @@ -306,10 +349,8 @@ ffi_zdc_hcal_cl = IslandCluster('ffi_zdc_hcal_cl', algorithms.append(ffi_zdc_hcal_cl) ffi_zdc_hcal_clreco = RecoCoG('ffi_zdc_hcal_clreco', - inputHitCollection = ffi_zdc_hcal_cl.inputHitCollection, inputProtoClusterCollection = ffi_zdc_hcal_cl.outputProtoClusterCollection, outputClusterCollection = 'ZDCHcalClusters', - mcHits = "ZDCHcalHits", logWeightBase = 3.6, samplingFraction = ffi_zdc_hcal_sf) algorithms.append(ffi_zdc_hcal_clreco) @@ -348,20 +389,16 @@ ce_ecal_cl = TruthClustering("ce_ecal_cl", algorithms.append(ce_ecal_cl) ce_ecal_clreco = RecoCoG("ce_ecal_clreco", - #inputHitCollection=ce_ecal_cl.inputHitCollection, - inputHitCollection=ce_ecal_cl.inputHits, - #inputProtoClusterCollection=ce_ecal_cl.outputProtoClusterCollection, inputProtoClusterCollection=ce_ecal_cl.outputProtoClusters, outputClusterCollection="EcalEndcapNClusters", - mcHits="EcalEndcapNHits", logWeightBase=4.6) algorithms.append(ce_ecal_clreco) -ce_ecal_clmerger = ClusterMerger("ce_ecal_clmerger", - inputClusters = ce_ecal_clreco.outputClusterCollection, - outputClusters = "EcalEndcapNMergedClusters", - outputRelations = "EcalEndcapNMergedClusterRelations") -algorithms.append(ce_ecal_clmerger) +#ce_ecal_clmerger = ClusterMerger("ce_ecal_clmerger", +# inputClusters = ce_ecal_clreco.outputClusterCollection, +# outputClusters = "EcalEndcapNMergedClusters", +# outputRelations = "EcalEndcapNMergedClusterRelations") +#algorithms.append(ce_ecal_clmerger) # Endcap ScFi Ecal ci_ecal_daq = calo_daq['ecal_pos_endcap'] @@ -406,21 +443,17 @@ ci_ecal_cl = TruthClustering("ci_ecal_cl", algorithms.append(ci_ecal_cl) ci_ecal_clreco = RecoCoG("ci_ecal_clreco", - #inputHitCollection=ci_ecal_cl.inputHitCollection, - inputHitCollection=ci_ecal_cl.inputHits, - #inputProtoClusterCollection=ci_ecal_cl.outputProtoClusterCollection, inputProtoClusterCollection=ci_ecal_cl.outputProtoClusters, outputClusterCollection="EcalEndcapPClusters", enableEtaBounds=True, - mcHits="EcalEndcapPHits", logWeightBase=6.2) algorithms.append(ci_ecal_clreco) -ci_ecal_clmerger = ClusterMerger("ci_ecal_clmerger", - inputClusters = ci_ecal_clreco.outputClusterCollection, - outputClusters = "EcalEndcapPMergedClusters", - outputRelations = "EcalEndcapPMergedClusterRelations") -algorithms.append(ci_ecal_clmerger) +#ci_ecal_clmerger = ClusterMerger("ci_ecal_clmerger", +# inputClusters = ci_ecal_clreco.outputClusterCollection, +# outputClusters = "EcalEndcapPMergedClusters", +# outputRelations = "EcalEndcapPMergedClusterRelations") +#algorithms.append(ci_ecal_clmerger) # Central Barrel Ecal (Imaging Cal.) img_barrel_daq = calo_daq['ecal_barrel_imaging'] @@ -453,11 +486,10 @@ img_barrel_cl = ImagingCluster("img_barrel_cl", algorithms.append(img_barrel_cl) img_barrel_clreco = ImagingClusterReco("img_barrel_clreco", - inputHitCollection=img_barrel_cl.inputHitCollection, - inputProtoClusterCollection=img_barrel_cl.outputProtoClusterCollection, - outputClusterCollection="EcalBarrelImagingClusters", + inputProtoClusters=img_barrel_cl.outputProtoClusterCollection, + outputClusters="EcalBarrelImagingClusters", mcHits="EcalBarrelHits", - outputLayerCollection="EcalBarrelImagingLayers") + outputLayers="EcalBarrelImagingLayers") algorithms.append(img_barrel_clreco) # Central ECAL SciFi @@ -499,21 +531,19 @@ scfi_barrel_cl = IslandCluster("scfi_barrel_cl", algorithms.append(scfi_barrel_cl) scfi_barrel_clreco = RecoCoG("scfi_barrel_clreco", - inputHitCollection=scfi_barrel_cl.inputHitCollection, inputProtoClusterCollection=scfi_barrel_cl.outputProtoClusterCollection, outputClusterCollection="EcalBarrelScFiClusters", - mcHits="EcalBarrelScFiHits", logWeightBase=6.2) algorithms.append(scfi_barrel_clreco) ## barrel cluster merger -barrel_clus_merger = EnergyPositionClusterMerger("barrel_clus_merger", - inputMCParticles = "mcparticles", - inputEnergyClusters = scfi_barrel_clreco.outputClusterCollection, - inputPositionClusters = img_barrel_clreco.outputClusterCollection, - outputClusters = "EcalBarrelMergedClusters", - outputRelations = "EcalBarrelMergedClusterRelations") -algorithms.append(barrel_clus_merger) +#barrel_clus_merger = EnergyPositionClusterMerger("barrel_clus_merger", +# inputMCParticles = "MCParticles", +# inputEnergyClusters = scfi_barrel_clreco.outputClusterCollection, +# inputPositionClusters = img_barrel_clreco.outputClusterCollection, +# outputClusters = "EcalBarrelMergedClusters", +# outputRelations = "EcalBarrelMergedClusterRelations") +#algorithms.append(barrel_clus_merger) # Central Barrel Hcal @@ -553,10 +583,8 @@ cb_hcal_cl = IslandCluster("cb_hcal_cl", algorithms.append(cb_hcal_cl) cb_hcal_clreco = RecoCoG("cb_hcal_clreco", - inputHitCollection=cb_hcal_cl.inputHitCollection, inputProtoClusterCollection=cb_hcal_cl.outputProtoClusterCollection, outputClusterCollection="HcalBarrelClusters", - mcHits="HcalBarrelHits", logWeightBase=6.2) algorithms.append(cb_hcal_clreco) @@ -594,10 +622,8 @@ ci_hcal_cl = IslandCluster("ci_hcal_cl", algorithms.append(ci_hcal_cl) ci_hcal_clreco = RecoCoG("ci_hcal_clreco", - inputHitCollection=ci_hcal_cl.inputHitCollection, inputProtoClusterCollection=ci_hcal_cl.outputProtoClusterCollection, outputClusterCollection="HcalEndcapPClusters", - mcHits="HcalEndcapPHits", logWeightBase=6.2) algorithms.append(ci_hcal_clreco) @@ -635,48 +661,76 @@ ce_hcal_cl = IslandCluster("ce_hcal_cl", algorithms.append(ce_hcal_cl) ce_hcal_clreco = RecoCoG("ce_hcal_clreco", - inputHitCollection=ce_hcal_cl.inputHitCollection, inputProtoClusterCollection=ce_hcal_cl.outputProtoClusterCollection, outputClusterCollection="HcalEndcapNClusters", - mcHits="HcalEndcapNHits", logWeightBase=6.2) algorithms.append(ce_hcal_clreco) # Tracking +trk_b_coll = SimTrackerHitsCollector("trk_b_coll", + inputSimTrackerHits = tracker_barrel_collections, + outputSimTrackerHits = "TrackerBarrelAllHits") +algorithms.append( trk_b_coll ) + trk_b_digi = TrackerDigi("trk_b_digi", - inputHitCollection="TrackerBarrelHits", - outputHitCollection="TrackerBarrelRawHits", + inputHitCollection = trk_b_coll.outputSimTrackerHits, + outputHitCollection = "TrackerBarrelRawHits", timeResolution=8) algorithms.append(trk_b_digi) +trk_ec_coll = SimTrackerHitsCollector("trk_ec_coll", + inputSimTrackerHits = tracker_endcap_collections, + outputSimTrackerHits = "TrackerEndcapAllHits") +algorithms.append( trk_ec_coll ) + trk_ec_digi = TrackerDigi("trk_ec_digi", - inputHitCollection="TrackerEndcapHits", - outputHitCollection="TrackerEndcapRawHits", + inputHitCollection = trk_ec_coll.outputSimTrackerHits, + outputHitCollection = "TrackerEndcapRawHits", timeResolution=8) algorithms.append(trk_ec_digi) +vtx_b_coll = SimTrackerHitsCollector("vtx_b_coll", + inputSimTrackerHits = vertex_barrel_collections, + outputSimTrackerHits = "VertexBarrelAllHits") +algorithms.append( vtx_b_coll ) + vtx_b_digi = TrackerDigi("vtx_b_digi", - inputHitCollection="VertexBarrelHits", - outputHitCollection="VertexBarrelRawHits", + inputHitCollection = vtx_b_coll.outputSimTrackerHits, + outputHitCollection = "VertexBarrelRawHits", timeResolution=8) algorithms.append(vtx_b_digi) if 'acadia' in detector_version: + vtx_ec_coll = SimTrackerHitsCollector("vtx_ec_coll", + inputSimTrackerHits = vertex_endcap_collections, + outputSimTrackerHits = "VertexEndcapAllHits") + algorithms.append( vtx_ec_coll ) + vtx_ec_digi = TrackerDigi("vtx_ec_digi", - inputHitCollection="VertexEndcapHits", - outputHitCollection="VertexEndcapRawHits", + inputHitCollection = vtx_ec_coll.outputSimTrackerHits, + outputHitCollection = "VertexEndcapRawHits", timeResolution=8) algorithms.append( vtx_ec_digi ) else: + mm_b_coll = SimTrackerHitsCollector("mm_b_coll", + inputSimTrackerHits = mpgd_barrel_collections, + outputSimTrackerHits = "MPGDTrackerBarrelAllHits") + algorithms.append( mm_b_coll ) + mm_b_digi = TrackerDigi("mm_b_digi", - inputHitCollection="MPGDTrackerBarrelHits", - outputHitCollection="MPGDTrackerBarrelRawHits", + inputHitCollection = mm_b_coll.outputSimTrackerHits, + outputHitCollection = "MPGDTrackerBarrelRawHits", timeResolution=8) algorithms.append( mm_b_digi ) +gem_ec_coll = SimTrackerHitsCollector("gem_ec_coll", + inputSimTrackerHits = gem_endcap_collections, + outputSimTrackerHits = "GEMTrackerEndcapAllHits") +algorithms.append( gem_ec_coll ) + gem_ec_digi = TrackerDigi("gem_ec_digi", - inputHitCollection="GEMTrackerEndcapHits", - outputHitCollection="GEMTrackerEndcapRawHits", + inputHitCollection = gem_ec_coll.outputSimTrackerHits, + outputHitCollection = "GEMTrackerEndcapRawHits", timeResolution=10) algorithms.append(gem_ec_digi) @@ -736,7 +790,7 @@ algorithms.append(sourcelinker) ## Track param init truth_trk_init = TrackParamTruthInit("truth_trk_init", - inputMCParticles="mcparticles", + inputMCParticles="MCParticles", outputInitialTrackParameters="InitTrackParams") algorithms.append(truth_trk_init) @@ -762,30 +816,31 @@ algorithms.append(parts_from_fit) # Event building parts_with_truth_pid = ParticlesWithTruthPID("parts_with_truth_pid", - inputMCParticles = "mcparticles", + inputMCParticles = "MCParticles", inputTrackParameters = parts_from_fit.outputTrackParameters, - outputParticles = "ReconstructedChargedParticles") + outputParticles = "ReconstructedParticles") +# outputParticles = "ReconstructedChargedParticles") algorithms.append(parts_with_truth_pid) -match_clusters = MatchClusters("match_clusters", - inputMCParticles = "mcparticles", - inputParticles = parts_with_truth_pid.outputParticles, - inputEcalClusters = [ - str(ce_ecal_clmerger.outputClusters), - str(barrel_clus_merger.outputClusters), - str(ci_ecal_clmerger.outputClusters) - ], - inputHcalClusters = [ - str(ce_hcal_clreco.outputClusterCollection), - str(cb_hcal_clreco.outputClusterCollection), - str(ci_hcal_clreco.outputClusterCollection) - ], - outputParticles = "ReconstructedParticles") -algorithms.append(match_clusters) +#match_clusters = MatchClusters("match_clusters", +# inputMCParticles = "MCParticles", +# inputParticles = parts_with_truth_pid.outputParticles, +# inputEcalClusters = [ +# str(ce_ecal_clmerger.outputClusters), +# str(barrel_clus_merger.outputClusters), +# str(ci_ecal_clmerger.outputClusters) +# ], +# inputHcalClusters = [ +# str(ce_hcal_clreco.outputClusterCollection), +# str(cb_hcal_clreco.outputClusterCollection), +# str(ci_hcal_clreco.outputClusterCollection) +# ], +# outputParticles = "ReconstructedParticles") +#algorithms.append(match_clusters) ## Far Forward for now stored separately fast_ff = FFSmearedParticles("fast_ff", - inputMCParticles = "mcparticles", + inputMCParticles = "MCParticles", outputParticles = "ReconstructedFFParticles", enableZDC = True, enableB0 = True, @@ -826,36 +881,36 @@ if 'acadia' in detector_version: algorithms.append(mrich_reco) # Inclusive kinematics -incl_kin_electron = InclusiveKinematicsElectron("incl_kin_electron", - inputMCParticles="mcparticles", - inputParticles="ReconstructedParticles", - outputData="InclusiveKinematicsElectron" -) -algorithms.append(incl_kin_electron) -incl_kin_jb = InclusiveKinematicsJB("incl_kin_jb", - inputMCParticles="mcparticles", - inputParticles="ReconstructedParticles", - outputData="InclusiveKinematicsJB" -) -algorithms.append(incl_kin_jb) -incl_kin_da = InclusiveKinematicsDA("incl_kin_da", - inputMCParticles="mcparticles", - inputParticles="ReconstructedParticles", - outputData="InclusiveKinematicsDA" -) -algorithms.append(incl_kin_da) -incl_kin_sigma = InclusiveKinematicsSigma("incl_kin_sigma", - inputMCParticles="mcparticles", - inputParticles="ReconstructedParticles", - outputData="InclusiveKinematicsSigma" -) -algorithms.append(incl_kin_sigma) -incl_kin_esigma = InclusiveKinematicseSigma("incl_kin_esigma", - inputMCParticles="mcparticles", - inputParticles="ReconstructedParticles", - outputData="InclusiveKinematicseSigma" -) -algorithms.append(incl_kin_esigma) +#incl_kin_electron = InclusiveKinematicsElectron("incl_kin_electron", +# inputMCParticles="MCParticles", +# inputParticles="ReconstructedParticles", +# outputData="InclusiveKinematicsElectron" +#) +#algorithms.append(incl_kin_electron) +#incl_kin_jb = InclusiveKinematicsJB("incl_kin_jb", +# inputMCParticles="MCParticles", +# inputParticles="ReconstructedParticles", +# outputData="InclusiveKinematicsJB" +#) +#algorithms.append(incl_kin_jb) +#incl_kin_da = InclusiveKinematicsDA("incl_kin_da", +# inputMCParticles="MCParticles", +# inputParticles="ReconstructedParticles", +# outputData="InclusiveKinematicsDA" +#) +#algorithms.append(incl_kin_da) +#incl_kin_sigma = InclusiveKinematicsSigma("incl_kin_sigma", +# inputMCParticles="MCParticles", +# inputParticles="ReconstructedParticles", +# outputData="InclusiveKinematicsSigma" +#) +#algorithms.append(incl_kin_sigma) +#incl_kin_esigma = InclusiveKinematicseSigma("incl_kin_esigma", +# inputMCParticles="MCParticles", +# inputParticles="ReconstructedParticles", +# outputData="InclusiveKinematicseSigma" +#) +#algorithms.append(incl_kin_esigma) # Output podout = PodioOutput("out", filename=output_rec) @@ -870,7 +925,7 @@ podout.outputCommands = [ ] + [ "drop " + c for c in sim_coll ] + [ - "keep mcparticles" + "keep MCParticles" ] algorithms.append(podout) diff --git a/options/reconstruction.raw.py b/options/reconstruction.raw.py index 62665bcd..92e32574 100644 --- a/options/reconstruction.raw.py +++ b/options/reconstruction.raw.py @@ -57,16 +57,15 @@ services.append(EICDataSvc("EventDataSvc", inputs=input_sims, OutputLevel=WARNIN # juggler components from Configurables import PodioInput +from Configurables import Jug__Digi__SimTrackerHitsCollector as SimTrackerHitsCollector from Configurables import Jug__Digi__PhotoMultiplierDigi as PhotoMultiplierDigi from Configurables import Jug__Digi__CalorimeterHitDigi as CalHitDigi from Configurables import Jug__Digi__SiliconTrackerDigi as TrackerDigi # branches needed from simulation root file sim_coll = [ - 'mcparticles', + 'MCParticles', 'B0TrackerHits', - 'ForwardRomanPotHits', - 'ForwardOffMTrackerHits', 'EcalEndcapNHits', 'EcalEndcapPHits', 'EcalBarrelHits', @@ -74,17 +73,56 @@ sim_coll = [ 'HcalBarrelHits', 'HcalEndcapPHits', 'HcalEndcapNHits', - 'TrackerEndcapHits', - 'TrackerBarrelHits', - 'GEMTrackerEndcapHits', - 'VertexBarrelHits', 'DRICHHits', ] + +forward_romanpot_collections = [ + 'ForwardRomanPotHits1', + 'ForwardRomanPotHits2' +] +forward_offmtracker_collections = [ + 'ForwardOffMTrackerHits1', + 'ForwardOffMTrackerHits2', + 'ForwardOffMTrackerHits3', + 'ForwardOffMTrackerHits4' +] +sim_coll += forward_romanpot_collections + forward_offmtracker_collections + +tracker_endcap_collections = [ + 'TrackerEndcapHits1', + 'TrackerEndcapHits2', + 'TrackerEndcapHits3', + 'TrackerEndcapHits4', + 'TrackerEndcapHits5', + 'TrackerEndcapHits6' +] +tracker_barrel_collections = [ + 'TrackerBarrelHits' +] +vertex_barrel_collections = [ + 'VertexBarrelHits' +] +gem_endcap_collections = [ + 'GEMTrackerEndcapHits1', + 'GEMTrackerEndcapHits2', + 'GEMTrackerEndcapHits3' +] +sim_coll += tracker_endcap_collections + tracker_barrel_collections + vertex_barrel_collections + gem_endcap_collections + + +vertex_endcap_collections = [ + 'VertexEndcapHits' +] +mpgd_barrel_collections = [ + 'MPGDTrackerBarrelHits1', + 'MPGDTrackerBarrelHits2' +] + if 'acadia' in detector_version: - sim_coll.append('VertexEndcapHits') + sim_coll += vertex_endcap_collections sim_coll.append('MRICHHits') else: - sim_coll.append('MPGDTrackerBarrelHits') + sim_coll += mpgd_barrel_collections # list of algorithms algorithms = [] @@ -94,15 +132,23 @@ podin = PodioInput("PodioReader", collections=sim_coll) algorithms.append(podin) ## Roman pots +ffi_romanpot_coll = SimTrackerHitsCollector("ffi_romanpot_coll", + inputSimTrackerHits = forward_romanpot_collections, + outputSimTrackerHits = "ForwardRomanPotAllHits") +algorithms.append(ffi_romanpot_coll) ffi_romanpot_digi = TrackerDigi("ffi_romanpot_digi", - inputHitCollection = "ForwardRomanPotHits", + inputHitCollection = ffi_romanpot_coll.outputSimTrackerHits, outputHitCollection = "ForwardRomanPotRawHits", timeResolution = 8) algorithms.append(ffi_romanpot_digi) ## Off momentum tracker +ffi_offmtracker_coll = SimTrackerHitsCollector("ffi_offmtracker_coll", + inputSimTrackerHits = forward_offmtracker_collections, + outputSimTrackerHits = "ForwardOffMTrackerAllHits") +algorithms.append(ffi_offmtracker_coll) ffi_offmtracker_digi = TrackerDigi("ffi_offmtracker_digi", - inputHitCollection = "ForwardOffMTrackerHits", + inputHitCollection = ffi_offmtracker_coll.outputSimTrackerHits, outputHitCollection = "ForwardOffMTrackerRawHits", timeResolution = 8) algorithms.append(ffi_offmtracker_digi) @@ -180,42 +226,72 @@ ce_hcal_digi = CalHitDigi("ce_hcal_digi", algorithms.append(ce_hcal_digi) # Tracking +trk_b_coll = SimTrackerHitsCollector("trk_b_coll", + inputSimTrackerHits = tracker_barrel_collections, + outputSimTrackerHits = "TrackerBarrelAllHits") +algorithms.append( trk_b_coll ) + trk_b_digi = TrackerDigi("trk_b_digi", - inputHitCollection="TrackerBarrelHits", - outputHitCollection="TrackerBarrelRawHits", + inputHitCollection = trk_b_coll.outputSimTrackerHits, + outputHitCollection = "TrackerBarrelRawHits", timeResolution=8) algorithms.append(trk_b_digi) +trk_ec_coll = SimTrackerHitsCollector("trk_ec_coll", + inputSimTrackerHits = tracker_endcap_collections, + outputSimTrackerHits = "TrackerEndcapAllHits") +algorithms.append( trk_ec_coll ) + trk_ec_digi = TrackerDigi("trk_ec_digi", - inputHitCollection="TrackerEndcapHits", - outputHitCollection="TrackerEndcapRawHits", + inputHitCollection = trk_ec_coll.outputSimTrackerHits, + outputHitCollection = "TrackerEndcapRawHits", timeResolution=8) algorithms.append(trk_ec_digi) +vtx_b_coll = SimTrackerHitsCollector("vtx_b_coll", + inputSimTrackerHits = vertex_barrel_collections, + outputSimTrackerHits = "VertexBarrelAllHits") +algorithms.append( vtx_b_coll ) + vtx_b_digi = TrackerDigi("vtx_b_digi", - inputHitCollection="VertexBarrelHits", - outputHitCollection="VertexBarrelRawHits", + inputHitCollection = vtx_b_coll.outputSimTrackerHits, + outputHitCollection = "VertexBarrelRawHits", timeResolution=8) algorithms.append(vtx_b_digi) if 'acadia' in detector_version: + vtx_ec_coll = SimTrackerHitsCollector("vtx_ec_coll", + inputSimTrackerHits = vertex_endcap_collections, + outputSimTrackerHits = "VertexEndcapAllHits") + algorithms.append( vtx_ec_coll ) + vtx_ec_digi = TrackerDigi("vtx_ec_digi", - inputHitCollection="VertexEndcapHits", - outputHitCollection="VertexEndcapRawHits", + inputHitCollection = vtx_ec_coll.outputSimTrackerHits, + outputHitCollection = "VertexEndcapRawHits", timeResolution=8) algorithms.append( vtx_ec_digi ) else: + mm_b_coll = SimTrackerHitsCollector("mm_b_coll", + inputSimTrackerHits = mpgd_barrel_collections, + outputSimTrackerHits = "MPGDTrackerBarrelAllHits") + algorithms.append( mm_b_coll ) + mm_b_digi = TrackerDigi("mm_b_digi", - inputHitCollection="MPGDTrackerBarrelHits", - outputHitCollection="MPGDTrackerBarrelRawHits", + inputHitCollection = mm_b_coll.outputSimTrackerHits, + outputHitCollection = "MPGDTrackerBarrelRawHits", timeResolution=8) algorithms.append( mm_b_digi ) +gem_ec_coll = SimTrackerHitsCollector("gem_ec_coll", + inputSimTrackerHits = gem_endcap_collections, + outputSimTrackerHits = "GEMTrackerEndcapAllHits") +algorithms.append( gem_ec_coll ) + gem_ec_digi = TrackerDigi("gem_ec_digi", - inputHitCollection="GEMTrackerEndcapHits", - outputHitCollection="GEMTrackerEndcapRawHits", + inputHitCollection = gem_ec_coll.outputSimTrackerHits, + outputHitCollection = "GEMTrackerEndcapRawHits", timeResolution=10) -algorithms.append(gem_ec_digi) +algorithms.append( gem_ec_digi ) # DRICH drich_digi = PhotoMultiplierDigi("drich_digi", -- GitLab