Skip to content

Commit e8b0d90

Browse files
authored
Merge pull request #477 from brownd1978/mixfix
Fixes for MDC2025 mixing
2 parents 5b9a35a + 8f17022 commit e8b0d90

File tree

4 files changed

+88
-69
lines changed

4 files changed

+88
-69
lines changed

JobConfig/mixing/Mix.fcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ outputs.TriggeredOutput.SelectEvents : @local::Digitize.SignalTriggers
4040
outputs.TriggerableOutput.SelectEvents : [ @sequence::physics.TriggerablePaths ]
4141
# Final configuration
4242
#include "Production/JobConfig/common/epilog.fcl"
43+
#include "Production/JobConfig/digitize/epilog.fcl"
4344
#include "Production/JobConfig/digitize/OnSpill_epilog.fcl"
4445
#include "mu2e-trig-config/core/trigDigiInputsEpilog.fcl"
4546
#include "Production/JobConfig/mixing/epilog.fcl"

JobConfig/mixing/prolog.fcl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,11 @@ Mixing : {
3737
MaxEventsToSkip: @nil
3838
}
3939
}
40-
4140
DetStepFilter: {
4241
module_type: MixingFilter
4342
}
44-
4543
}
4644

47-
4845
Mixing : {
4946
@table::Mixing
5047
producers : {
@@ -84,7 +81,7 @@ Mixing : {
8481
ReturnValue : true
8582
}
8683

87-
}
84+
}
8885
StepMixSequence : [ MuStopPileupMixer, EleBeamFlashMixer, MuBeamFlashMixer, NeutralsFlashMixer ]
8986
StepFilterSequence : [ MuStopPileupFilter, EleBeamFlashFilter, MuBeamFlashFilter, NeutralsFlashFilter ]
9087
# when mixing early events the intensity must be scaled down

Scripts/CreateSimEfficiency.sh

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
#!/usr/bin/bash
22
#
3-
# Script to create the SimEfficiency proditions content from a beam campaign. The campaign 'configuration' field must be provided
4-
# stopped muon/mubeam campaign is first argument
5-
# IPA campaign is second
6-
# stopped pion/pibeam campaign is third
7-
# filtered pions campaign is fourth
83
# setup mu2efiletools before executing this script
94
#
10-
rm $1_SimEff.txt
11-
mu2eGenFilterEff --out=$1_SimEff.txt --chunksize=100 sim.mu2e.MuBeamCat.$1.art sim.mu2e.EleBeamCat.$1.art sim.mu2e.NeutralsCat.$1.art \
12-
sim.mu2e.MuminusStopsCat.$1.art sim.mu2e.MuplusStopsCat.$1.art sim.mu2e.IPAMuminusStopsCat.$2.art \
13-
dts.mu2e.MuBeamFlashCat.$1.art dts.mu2e.EleBeamFlashCat.$1.art dts.mu2e.NeutralsFlashCat.$1.art \
14-
dts.mu2e.MuStopPileupCat.$1.art \
15-
dts.mu2e.EarlyMuBeamFlashCat.$1.art dts.mu2e.EarlyEleBeamFlashCat.$1.art dts.mu2e.EarlyNeutralsFlashCat.$1.art \
16-
sim.mu2e.PiBeam.$3.art sim.mu2e.PiminusStopsCat.$3.art sim.mu2e.PiMinusFilter.$4.art
17-
sed -i -e 's/dts\.mu2e\.//' -e 's/sim\.mu2e\.//' -e 's/\..*\.art//' -e 's/ IOV//' $1_SimEff.txt
5+
SIMEFF=MDC2025_SimEff.txt
6+
if [ -f "$SIMEFF" ]; then
7+
rm -f $SIMEFF
8+
fi
9+
mu2eGenFilterEff --out=MDC2025_SimEff.txt --chunksize=100 \
10+
sim.mu2e.MuBeamCat.MDC2025ab.art sim.mu2e.EleBeamCat.MDC2025ab.art sim.mu2e.NeutralsCat.MDC2025ab.art \
11+
sim.mu2e.MuminusStopsCat.MDC2025ac.art sim.mu2e.MuplusStopsCat.MDC2025ac.art \
12+
dts.mu2e.MuBeamFlashCat.MDC2025ac.art dts.mu2e.EleBeamFlashCat.MDC2025ac.art dts.mu2e.NeutralsFlashCat.MDC2025ac.art \
13+
dts.mu2e.MuStopPileupCat.MDC2025ac.art \
14+
dts.mu2e.EarlyMuBeamFlashCat.MDC2025ac.art dts.mu2e.EarlyEleBeamFlashCat.MDC2025ac.art dts.mu2e.EarlyNeutralsFlashCat.MDC2025ac.art \
15+
sim.mu2e.PiBeamCat.MDC2025ac.art \
16+
sim.mu2e.PiMinusFilter.MDC2025ac.art \
17+
sim.mu2e.PiTargetStops.MDC2025ac.art \
18+
sim.mu2e.PhysicalPionStops.MDC2025ac.art
19+
sed -i -e 's/dts\.mu2e\.//' -e 's/sim\.mu2e\.//' -e 's/\..*\.art//' -e 's/ IOV//' $SIMEFF
20+
#sim.mu2e.IPAMuminusStopsCat.MDC2025ac.art
21+
#sim.mu2e.PiminusStopsCat.MDC2025ac.art

Scripts/gen_Mix.sh

Lines changed: 69 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,22 @@
55

66
# Function: Print a help message.
77
usage() {
8-
echo "Usage: $0 [ --primary primary physics process name ]
9-
[ --campaign campaign name e.g. MDC2020 ]
10-
[ --mver mixin (input) campaign version e.g. 'p' ]
11-
[ --over output campaign version e.g. 'v' ]
12-
[ --pbeam proton beam intensity e.g. Mix1BB (one Booster Batch), Mix2BB, MixLow, or MixSeq (sequential)]
13-
[ --dbpurpose purpose of db e.g. perfect, startup, best ]
14-
[ --dbversion db version ]
15-
[ --early (opt) for early digitization. Intensity will be set to 'Low' ]
16-
[ --merge-events (opt) merge events, default 5000 ]
17-
[ --owner (opt) default mu2e ]
18-
[ --field (opt) default = DS +TSD, override for special runs ]
19-
[ --neutmix (opt) # of neutral pileup files ]
20-
[ --elemix (opt) # of electron pileup files ]
21-
[ --mustopmix (opt) # of mustop daughter pileup files ] [ --mubeammix (opt) # of mubeam pileup files ]
8+
echo "Usage: $0 [ --primary primary physics process name ]
9+
[ --campaign campaign name e.g. MDC2020 ]
10+
[ --mver mixin (input) campaign version e.g. 'p' ]
11+
[ --over output campaign version e.g. 'v' ]
12+
[ --pbeam proton beam intensity e.g. Mix1BB (one Booster Batch), Mix2BB, MixLow, or MixSeq (sequential)]
13+
[ --dbpurpose purpose of db e.g. perfect, startup, best ]
14+
[ --dbversion db version ]
15+
[ --early (opt) for early digitization. Intensity will be set to 'Low' ]
16+
[ --merge-events (opt) merge events, default 5000 ]
17+
[ --owner (opt) default mu2e ]
18+
[ --field (opt) default = DS +TSD, override for special runs ]
19+
[ --neutmix (opt) # of neutral pileup files ]
20+
[ --elemix (opt) # of electron pileup files ]
21+
[ --mustopmix (opt) # of mustop daughter pileup files ] [ --mubeammix (opt) # of mubeam pileup files ]
2222
[ --primary_dataset dts.mu2e.desc.dsconf.art ]
23+
[ --tarball (opt) location of tarball ]
2324
[ --ensemble 0 or 1 ]"
2425
}
2526

@@ -39,14 +40,16 @@ PBEAM=""
3940
EARLY=""
4041
MERGE_EVENTS=5000 #source events in mixing
4142
OWNER=mu2e
42-
NEUTNMIXIN=50
43-
ELENMIXIN=25
43+
NEUTNMIXIN=40
44+
ELENMIXIN=50
4445
MUSTOPNMIXIN=2
4546
MUBEAMNMIXIN=1
4647
FIELD="Offline/Mu2eG4/geom/bfgeom_no_tsu_ps_v01.txt"
4748
PRIMARY_DATASET=""
4849
ENSEMBLE=0
4950
PUSHOUT=false
51+
DBSIM="Sim"
52+
TB=""
5053

5154
# Loop: Get the next option;
5255
while getopts ":-:" options; do
@@ -110,30 +113,33 @@ while getopts ":-:" options; do
110113
OPTIND=$(( $OPTIND + 1 ))
111114
;;
112115
primary_dataset)
113-
PRIMARY_DATASET=${!OPTIND}
114-
OPTIND=$(( $OPTIND + 1 ))
115-
;;
116+
PRIMARY_DATASET=${!OPTIND}
117+
OPTIND=$(( $OPTIND + 1 ))
118+
;;
116119
ensemble)
117-
ENSEMBLE=${!OPTIND}
118-
OPTIND=$(( $OPTIND + 1 ))
119-
;;
120-
pushout)
121-
PUSHOUT=${!OPTIND}
122-
OPTIND=$(( $OPTIND + 1 ))
123-
;;
124-
125-
esac
126-
;;
127-
:)
128-
echo "Error: -${OPTARG} requires an argument."
129-
exit_abnormal
130-
;;
131-
*)
132-
echo "Unknown option ${OPTARG}"
133-
exit_abnormal
134-
;;
135-
esac
136-
done
120+
ENSEMBLE=${!OPTIND}
121+
OPTIND=$(( $OPTIND + 1 ))
122+
;;
123+
pushout)
124+
PUSHOUT=${!OPTIND}
125+
OPTIND=$(( $OPTIND + 1 ))
126+
;;
127+
tarball)
128+
TB=${!OPTIND}
129+
OPTIND=$(( $OPTIND + 1 ))
130+
;;
131+
esac
132+
;;
133+
:)
134+
echo "Error: -${OPTARG} requires an argument."
135+
exit_abnormal
136+
;;
137+
*)
138+
echo "Unknown option ${OPTARG}"
139+
exit_abnormal
140+
;;
141+
esac
142+
done
137143

138144

139145
# basic tests
@@ -228,11 +234,11 @@ echo $MERGE_FACTOR
228234

229235
# Setup the beam intensity model
230236
case "$PBEAM" in
231-
Mix1BB) pbeam_fcl=OneBB.fcl ;;
232-
Mix2BB) pbeam_fcl=TwoBB.fcl ;;
233-
MixLow) pbeam_fcl=LowIntensity.fcl ;;
234-
MixSeq) pbeam_fcl=NoPrimaryPBISequence.fcl ;;
235-
*) echo "Unknown PBEAM $PBEAM"; exit_abnormal ;;
237+
Mix1BB) pbeam_fcl=OneBB.fcl ;;
238+
Mix2BB) pbeam_fcl=TwoBB.fcl ;;
239+
MixLow) pbeam_fcl=LowIntensity.fcl ;;
240+
MixSeq) pbeam_fcl=NoPrimaryPBISequence.fcl ;;
241+
*) echo "Unknown PBEAM $PBEAM"; exit_abnormal ;;
236242
esac
237243
echo "#include \"Production/JobConfig/mixing/${pbeam_fcl}\"" >> mix.fcl
238244

@@ -276,21 +282,27 @@ echo physics.filters.NeutralsFlashMixer.mu2e.MaxEventsToSkip: ${nskip_NeutralsFl
276282
echo physics.filters.MuStopPileupMixer.mu2e.MaxEventsToSkip: ${nskip_MuStopPileup} >> mix.fcl
277283

278284
# setup database access, for SimEfficiences and digi parameters
279-
echo services.DbService.purpose: ${CAMPAIGN}_${DBPURPOSE} >> mix.fcl
285+
echo services.DbService.purpose: ${DBSIM}_${DBPURPOSE} >> mix.fcl
280286
echo services.DbService.version: ${DBVERSION} >> mix.fcl
281287
echo services.DbService.verbose : 2 >> mix.fcl
282288
echo "services.GeometryService.bFieldFile : \"${FIELD}\"" >> mix.fcl
283289
# overwrite the outputs
284290
echo outputs.TriggeredOutput.fileName: \"dig.owner.${DESC}Triggered.version.sequencer.art\" >> mix.fcl
285291
echo outputs.TriggerableOutput.fileName: \"dig.owner.${DESC}Triggerable.version.sequencer.art\" >> mix.fcl
286292

293+
294+
JDSETUP=" --setup ${SETUP} "
295+
if [ "${TB}" != "" ]; then
296+
JDSETUP=" --code ${TB} "
297+
fi
298+
287299
cmd=(
288-
mu2ejobdef --dsconf=${DSCONF} --dsowner=${OWNER} --description=${DESC} --embed mix.fcl --setup ${SETUP}
289-
--inputs=${PRIMARY_DESC}.txt --merge-factor=${MERGE_FACTOR}
290-
--auxinput=${MUSTOPNMIXIN}:physics.filters.MuStopPileupMixer.fileNames:${MUSTOPPILEUP}
291-
--auxinput=${ELENMIXIN}:physics.filters.EleBeamFlashMixer.fileNames:${EBEAMPILEUP}
292-
--auxinput=${MUBEAMNMIXIN}:physics.filters.MuBeamFlashMixer.fileNames:${MUBEAMPILEUP}
293-
--auxinput=${NEUTNMIXIN}:physics.filters.NeutralsFlashMixer.fileNames:${NPILEUP}
300+
mu2ejobdef --dsconf=${DSCONF} --dsowner=${OWNER} --description=${DESC} --embed mix.fcl ${JDSETUP}
301+
--inputs=${PRIMARY_DESC}.txt --merge-factor=${MERGE_FACTOR}
302+
--auxinput=${MUSTOPNMIXIN}:physics.filters.MuStopPileupMixer.fileNames:${MUSTOPPILEUP}
303+
--auxinput=${ELENMIXIN}:physics.filters.EleBeamFlashMixer.fileNames:${EBEAMPILEUP}
304+
--auxinput=${MUBEAMNMIXIN}:physics.filters.MuBeamFlashMixer.fileNames:${MUBEAMPILEUP}
305+
--auxinput=${NEUTNMIXIN}:physics.filters.NeutralsFlashMixer.fileNames:${NPILEUP}
294306
)
295307

296308
echo "Running: ${cmd[*]}"
@@ -301,7 +313,12 @@ parfile="cnf.${OWNER}.${DESC}.${DSCONF}.0.tar"
301313
echo "parfile: $parfile"
302314

303315
test_fcl=${parfile}.fcl
304-
mu2ejobfcl --jobdef $parfile --index 0 --default-proto root --default-loc tape > ${test_fcl}
316+
mu2ejobfcl --jobdef $parfile --index 0 --default-proto root --default-loc tape \
317+
--location "dts.mu2e.MuBeamFlashCat.${MIXINCONF}.art:tape" \
318+
--location "dts.mu2e.NeutralsFlashCat.${MIXINCONF}.art:disk" \
319+
--location "dts.mu2e.EleBeamFlashCat.${MIXINCONF}.art:disk" \
320+
--location "dts.mu2e.MuStopPileupCat.${MIXINCONF}.art:disk" \
321+
> ${test_fcl}
305322
cat ${test_fcl}
306323

307324

0 commit comments

Comments
 (0)