3 ### What are my baseline values?
5 BaseField="[ 0.5, 0.782, 1.734 ]"
9 ### Declare the electron lifetime arrays
10 declare -a Lifetimes=("1000" "2000" "3000" "5000" "8000")
11 declare -a LifeNames=("1ms" "2ms" "3ms" "5ms" "8ms")
13 ### Declare the electric field arrays
14 declare -a FieldValue=("[ 0.25, 0.782, 1.734 ]" "[ 0.375, 0.782, 1.734 ]" "[ 0.5, 0.782, 1.734 ]")
15 declare -a FieldNames=("250V" "375V" "500V")
17 ### Delcare the diffusion const arrays
18 declare -a Diffusion=("0" "3.1e-9" "6.2e-9" "12.4e-9")
19 declare -a DiffNames=("0Diff" "50Diff" "100Diff" "200Diff")
21 ### Delcare the noise normalisation arrays
22 declare -a NoiseLevel=("3.16" "6.32" "9.48" "12.64" "31.6")
23 declare -a HitThresh=("[ 6, 6, 6 ]" "[ 10, 10, 10 ]" "[ 15, 15, 15 ]" "[ 20, 20, 20 ]" "[ 40, 40, 40 ]")
24 declare -a NoiseNames=("100N" "200N" "300N" "400N" "1000N")
26 ### Check that the length of the two electron lifetime arrays are equal
27 LifeLen=${#Lifetimes[@]}
28 LNamLen=${#LifeNames[@]}
29 if [ $LifeLen -ne $LNamLen ]; then
30 echo "The size of Lifetimes is ${LifeLen} and the size of LifeNames is ${LNamLen}.....Fix it"
33 ### Check that the length of the two electron field arrays are equal
34 FieldLen=${#FieldValue[@]}
35 FiNamLen=${#FieldNames[@]}
36 if [ $FieldLen -ne $FiNamLen ]; then
37 echo "The size of FieldValue is ${FieldLen} and the size of FieldNames is ${FiNamLen}.....Fix it"
40 ### Check that the length of the two electron field arrays are equal
41 DiffLen=${#Diffusion[@]}
42 DNamLen=${#DiffNames[@]}
43 if [ $DiffLen -ne $DNamLen ]; then
44 echo "The size of Diffusion is ${DiffLen} and the size of DiffNames is ${DNamLen}.....Fix it"
47 ### Check that the length of the two electron field arrays are equal
48 NoiseLen=${#NoiseLevel[@]}
49 HitThLen=${#HitThresh[@]}
50 NoNamLen=${#NoiseNames[@]}
51 if [[ $NoiseLen -ne $NoNamLen || $NoiseLen -ne $HitThLen || $HitThLen -ne $NoNamLen ]]; then
52 echo "The size of NoiseLevel is ${NoiseLen} the size of HitThresh is ${HitThLen} and the size of NoiseNames is ${NoNamLen}.....Fix it"
56 ### Define where I am going to put the fcl files
57 MCTestFclDir=$MRB_SOURCE/dunetpc/fcl/dune35t/MCTests/
58 echo "Putting fcl files in this directory -> ${MCTestFclDir}"
60 ### Define a function to make all of the fcl files ###
61 function MakeTheFcls(){
62 ThisLife=$BaseLifetime
64 ThisDiff=$BaseDiffusion
73 ThisLife=${Lifetimes[$2-1]}
74 LifeName=${LifeNames[$2-1]}
75 elif [ $1 -eq 2 ]; then
76 ThisField=${FieldValue[$2-1]}
77 FieldName=${FieldNames[$2-1]}
78 elif [ $1 -eq 3 ]; then
79 ThisDiff=${Diffusion[$2-1]}
80 DiffName=${DiffNames[$2-1]}
81 elif [ $1 -eq 4 ]; then
82 ThisNoise=${NoiseLevel[$2-1]}
83 ThisHitTh=${HitThresh[$2-1]}
84 NoiseName=${NoiseNames[$2-1]}
86 echo "Something is wrong, you're asking for parameter "$2
89 echo "Making files for ${ThisLife} ${LifeName}, ${ThisField} ${FieldName}, ${ThisDiff} ${DiffName}, ${ThisNoise} ${NoiseName}"
92 ### Note that this is using the counter muon GEANT4 fcl file!!!
93 cat <<EOF > ${MCTestFclDir}MCTest_g4_${LifeName}_${FieldName}_${DiffName}_${NoiseName}.fcl
94 #include "standard_g4_dune35t_countermu.fcl"
96 services.DetectorPropertiesService.Electronlifetime: ${ThisLife}
97 services.DetectorPropertiesService.Efield: ${ThisField}
98 services.LArG4Parameters.LongitudinalDiffusion: ${ThisDiff}
102 ### Make the detsim file
103 ### Note that this is using the millblock detsim module!!!
104 cat <<EOF > ${MCTestFclDir}MCTest_detsim_${LifeName}_${FieldName}_${DiffName}_${NoiseName}.fcl
105 #include "standard_detsim_dune35t_milliblock.fcl"
107 services.DetectorPropertiesService.Electronlifetime: ${ThisLife}
108 services.DetectorPropertiesService.Efield: ${ThisField}
109 services.LArG4Parameters.LongitudinalDiffusion: ${ThisDiff}
111 services.ChannelNoiseService: @local::chnoiseold
114 if [ $1 -eq 4 ]; then
115 cat<<EOF >> ${MCTestFclDir}MCTest_detsim_${LifeName}_${FieldName}_${DiffName}_${NoiseName}.fcl
116 services.ChannelNoiseService.NoiseNormU: ${ThisNoise} # 3.16
117 services.ChannelNoiseService.NoiseNormV: ${ThisNoise} # 3.16
118 services.ChannelNoiseService.NoiseNormZ: ${ThisNoise} # 3.16
124 ### Note that this is using the counter muon GEANT4 fcl file!!!
125 cat <<EOF > ${MCTestFclDir}MCTest_reco_${LifeName}_${FieldName}_${DiffName}_${NoiseName}.fcl
126 #include "standard_reco_dune35tsim_milliblock.fcl"
128 services.DetectorPropertiesService.Electronlifetime: ${ThisLife}
129 services.DetectorPropertiesService.Efield: ${ThisField}
132 if [ $1 -eq 4 ]; then
133 cat <<EOF >> ${MCTestFclDir}MCTest_reco_${LifeName}_${FieldName}_${DiffName}_${NoiseName}.fcl
134 physics.producers.gaushit.MinSig: ${ThisHitTh} # [ 5, 5, 10 ]
135 physics.producers.fasthit.MinSigCol: 50
136 physics.producers.fasthit.MinSigInd: 50
141 ### Make the fcl files for the different electron lifetimes.
142 for (( life=1; life<${LifeLen}+1; life++ ));
144 MakeTheFcls 1 ${life}
147 ### Now make the fcl files for the different electric fields.
148 for (( field=1; field<${FieldLen}+1; field++ ));
150 MakeTheFcls 2 ${field}
153 ### Now make the fcl files for the different diffusion constants.
154 for (( diff=1; diff<${DiffLen}+1; diff++ ));
156 MakeTheFcls 3 ${diff}
159 ### Now make the fcl files for the different noise levels.
160 for (( noise=1; noise<${NoiseLen}+1; noise++ ));
162 MakeTheFcls 4 ${noise}