Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Changes and Additions #34

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Bench Mark Scripts/script_EVNT.sh

This file was deleted.

3 changes: 0 additions & 3 deletions Bench Mark Scripts/script_TRUTH.sh

This file was deleted.

16 changes: 0 additions & 16 deletions Bench Mark Scripts/script_rucio.sh

This file was deleted.

Binary file added Benchmark Scripts/EVNT/EVNT.root
Binary file not shown.
218 changes: 218 additions & 0 deletions Benchmark Scripts/EVNT/SUSY_Radiative_Decays_JO.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
include ( 'MadGraphControl/SUSY_SimplifiedModel_PreInclude.py' )
from GeneratorFilters.GeneratorFiltersConf import xAODMETFilter
#from GeneratorFilters.GeneratorFiltersConf import xAODPhotonFilter
#from GeneratorFilters.GeneratorFiltersConf import xAODMultiElecMuTauFilter
from MadGraphControl.MadGraphUtilsHelpers import *



include("GeneratorFilters//xAODPhotonFilter_Common.py")
include("GeneratorFilters//xAODMultiElecMuTauFilter_Common.py")
include("GeneratorFilters//xAODMETFilter_Common.py")

JOName = get_physics_short()

#get the file name and split it on _ to extract relavent information
jobConfigParts = JOName.split("_")
print("jobConfigParts: ", jobConfigParts)

METCut = jobConfigParts[3]

mN2 = float(jobConfigParts[5])
mN1 = float(jobConfigParts[7])


jobOptProcess = jobConfigParts[8]


print("mN2: ",mN2, "\nmN1: ", mN1, "\nProcess: ", jobOptProcess, "\nMETCut: ", METCut)



higgsino = False
winobino = False
if(jobOptProcess == "HH"):
higgsino = True
jobOptProcess_evt_desc = "Higgsino"

process = '''
generate p p > n2 n1 @1
add process p p > n2 n1 j @2
add process p p > n2 n1 j j @3
add process p p > n2 x1+ @4
add process p p > n2 x1+ j @5
add process p p > n2 x1+ j j @6
add process p p > n2 x1- @7
add process p p > n2 x1- j @8
add process p p > n2 x1- j j @9
'''

elif(jobOptProcess == "WB"):
winobino = True
jobOptProcess_evt_desc = "Wino-Bino"
process = '''
generate p p > n2 x1+ @1
'''

else:
raise RuntimeError("Only Higgsino or WinoBino supported.")


decays['1000023'] = """DECAY 1000023 9.37327589E-04 # neutralino2 decays
1.00000000E+00 2 1000022 22 # BR(~chi_20 -> ~chi_10 gamma )"""

decays['1000024'] = """DECAY 1000024 7.00367294E-03 # chargino1+ decays

# BR NDA ID1 ID2 ID3
0.33333333E+00 3 1000022 -1 2 # BR(chi^+_1 -> chi^0_1 d_bar u)
0.33333333E+00 3 1000022 -3 4 # BR(chi^+_1 -> chi^0_1 s_bar c)
0.11111111E+00 3 1000022 -11 12 # BR(chi^+_1 -> chi^0_1 e^+ nu_e)
0.11111111E+00 3 1000022 -13 14 # BR(chi^+_1 -> chi^0_1 mu^+ nu_mu)
0.11111111E+00 3 1000022 -15 16 # BR(chi^+_1 -> chi^0_1 tau^+ nu_tau)"""



#Photon Filter
#filtSeq += xAODPhotonFilter("PhotonFilter")
filtSeq.xAODPhotonFilter.PtMin = 5000.
filtSeq.xAODPhotonFilter.NPhotons = 1

#MET Filter
#filtSeq += xAODMETFilter("METFilter")
filtSeq.xAODMissingEtFilter.METCut = float(METCut)*GeV
evt_multiplier = 10


#Lepton Filter
#filtSeq += xAODMultiElecMuTauFilter("MultiElecMuTauFilter")
#ElecMuTauFilter = filtSeq.xAODMultiElecMuTauFilter
filtSeq.xAODMultiElecMuTauFilter.MinPt = 20.0 * GeV
#ElecMuTauFilter.MaxEta = 2.8
filtSeq.xAODMultiElecMuTauFilter.NLeptons = 1
filtSeq.xAODMultiElecMuTauFilter.IncludeHadTaus = 0 # don't include hadronic taus




filtSeq.Expression = "xAODPhotonFilter and (xAODMissingEtFilter or xAODMultiElecMuTauFilter)"



evgenLog.info("evt_multiplier == " + str(evt_multiplier))


# exact mass spectrum and mixing matrices depend on scenario
if higgsino:
print("Choosing Higgsino...")
# see also: https://twiki.cern.ch/twiki/bin/view/LHCPhysics/SUSYCrossSections13TeVhinosplit
#masses['1000023'] = -1.0 * MassToFloat(splitConfig[3]) # N2, make LSP higgsino like (positive for wino)
#masses['1000024'] = 0.5 * (MassToFloat(splitConfig[3])+MassToFloat(splitConfig[4])) # Chargino is between N1 and N2
masses['1000022'] = mN1
masses['1000023'] = -1.0 * mN2
masses['1000024'] = str((float(mN2) + float(mN1))/2.)

# Off-diagonal chargino mixing matrix V
param_blocks['VMIX']={}
param_blocks['VMIX']['1 1']='0.00E+00'
param_blocks['VMIX']['1 2']='1.00E+00'
param_blocks['VMIX']['2 1']='1.00E+00'
param_blocks['VMIX']['2 2']='0.00E+00'
# Off-diagonal chargino mixing matrix U
param_blocks['UMIX']={}
param_blocks['UMIX']['1 1']='0.00E+00'
param_blocks['UMIX']['1 2']='1.00E+00'
param_blocks['UMIX']['2 1']='1.00E+00'
param_blocks['UMIX']['2 2']='0.00E+00'
# Neutralino mixing matrix chi_i0 = N_ij (B,W,H_d,H_u)_j
param_blocks['NMIX']={}
param_blocks['NMIX']['1 1']=' 0.00E+00' # N_11 bino
param_blocks['NMIX']['1 2']=' 0.00E+00' # N_12
param_blocks['NMIX']['1 3']=' 7.07E-01' # N_13
param_blocks['NMIX']['1 4']='-7.07E-01' # N_14
param_blocks['NMIX']['2 1']=' 0.00E+00' # N_21
param_blocks['NMIX']['2 2']=' 0.00E+00' # N_22
param_blocks['NMIX']['2 3']='-7.07E-01' # N_23 higgsino
param_blocks['NMIX']['2 4']='-7.07E-01' # N_24 higgsino
param_blocks['NMIX']['3 1']=' 1.00E+00' # N_31
param_blocks['NMIX']['3 2']=' 0.00E+00' # N_32
param_blocks['NMIX']['3 3']=' 0.00E+00' # N_33 higgsino
param_blocks['NMIX']['3 4']=' 0.00E+00' # N_34 higgsino
param_blocks['NMIX']['4 1']=' 0.00E+00' # N_41
param_blocks['NMIX']['4 2']='-1.00E+00' # N_42 wino
param_blocks['NMIX']['4 3']=' 0.00E+00' # N_43
param_blocks['NMIX']['4 4']=' 0.00E+00' # N_44
elif winobino:
print("Choosing Wino-Bino...")
#masses['1000023'] = 1.0 * MassToFloat(splitConfig[3]) # N2, make LSP wino like (negative for higgsino)
masses['1000022'] = mN1
masses['1000023'] = mN2
masses['1000024'] = masses['1000023'] # C1 = N2

# mixing used in R19 samples: https://gitlab.cern.ch/atlas-physics/pmg/infrastructure/mc15joboptions/-/blob/master/common/MadGraph/param_card.SM.C1N2.WZ.dat
# the off-diagonal entries lead to small but non-zero cross sections for e.g. N2N1 and N1C1 (these vanish for pure Winos/Binos)
# Chargino mixing matrix V
param_blocks['VMIX']={}
param_blocks['VMIX']['1 1']='9.72557835E-01' # V_11
param_blocks['VMIX']['1 2']='-2.32661249E-01' # V_12
param_blocks['VMIX']['2 1']='2.32661249E-01' # V_21
param_blocks['VMIX']['2 2']='9.72557835E-01' # V_22
# Chargino mixing matrix U
param_blocks['UMIX']={}
param_blocks['UMIX']['1 1']='9.16834859E-01' # U_11
param_blocks['UMIX']['1 2']='-3.99266629E-01' # U_12
param_blocks['UMIX']['2 1']='3.99266629E-01' # U_21
param_blocks['UMIX']['2 2']='9.16834859E-01' # U_22
# Neutralino mixing matrix
param_blocks['NMIX']={}
param_blocks['NMIX']['1 1']='9.86364430E-01' # N_11
param_blocks['NMIX']['1 2']='-5.31103553E-02' # N_12
param_blocks['NMIX']['1 3']='1.46433995E-01' # N_13
param_blocks['NMIX']['1 4']='-5.31186117E-02' # N_14
param_blocks['NMIX']['2 1']='9.93505358E-02' # N_21
param_blocks['NMIX']['2 2']='9.44949299E-01' # N_22
param_blocks['NMIX']['2 3']='-2.69846720E-01' # N_23
param_blocks['NMIX']['2 4']='1.56150698E-01' # N_24
param_blocks['NMIX']['3 1']='-6.03388002E-02' # N_31
param_blocks['NMIX']['3 2']='8.77004854E-02' # N_32
param_blocks['NMIX']['3 3']='6.95877493E-01' # N_33
param_blocks['NMIX']['3 4']='7.10226984E-01' # N_34
param_blocks['NMIX']['4 1']='-1.16507132E-01' # N_41
param_blocks['NMIX']['4 2']='3.10739017E-01' # N_42
param_blocks['NMIX']['4 3']='6.49225960E-01' # N_43
param_blocks['NMIX']['4 4']='-6.84377823E-01' # N_44








njets = 2

#if 'MET' in JOName.split('_')[-1]:
# include ( 'GeneratorFilters/MissingEtFilter.py' )
#
# metFilter = JOName.split('_')[-1]
# metFilter = int(metFilter.split("MET")[1].split(".")[0])

# print "Using MET Filter: " + str(metFilter)
# filtSeq.MissingEtFilter.METCut = metFilter*GeV
# evt_multiplier = metFilter / 10

#else:
# print "No MET Filter applied"


#evgenLog.info('Registered generation of stop pair production, stop to c+LSP and t+LSP; grid point '+str(runArgs.jobConfig[0])+' decoded into mass point mstop=' + str(masses['1000006']) + ', mlsp='+str(masses['1000022']))

#evgenConfig.contact = [ "[email protected]","[email protected]","[email protected]" ]
#evgenConfig.keywords += ['simplifiedModel','charm']
evgenConfig.description = jobOptProcess_evt_desc + ' N2->N1 + gam'

if njets>0:
#genSeq.Pythia8.Commands += ["Merging:Process = pp>{t1,1000006}{t1~,-1000006}"]
genSeq.Pythia8.Commands += ["Merging:Process = guess"]
genSeq.Pythia8.UserHooks += ["JetMergingaMCatNLO"]

include ( 'MadGraphControl/SUSY_SimplifiedModel_PostInclude.py' )
13 changes: 13 additions & 0 deletions Benchmark Scripts/EVNT/benchmark_EVNT.sub
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Universe = vanilla

Output = /data/selbor/Out_Files/EVNT/$(Cluster).$(Process).out
Error = /data/selbor/Err_Files/EVNT/$(Cluster).$(Process).err
Log = /data/selbor/LogFiles/EVNT/$(Cluster).$(Process).log

Executable = /home/selbor/benchmarks/EVNT/run_EVNT.sh


request_memory = 3GB
request_cpus = 1

Queue 1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include("SUSY_Radiative_Decays_JO.py")
34 changes: 34 additions & 0 deletions Benchmark Scripts/EVNT/run_EVNT.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#/bin/bash


# Copies the necessary files into the directory:
# /data/selbor/ReqFiles/
cp ~data/selbor/ReqFiles/mc* .
cp ~data/selbor/ReqFiles/SUSY_*.py .

# Since we aren't working in lxplus we need the following two lines:
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh

# Sets up our ATLAS Release and version
asetup AthGeneration,23.6.34,here

# Defining out output directory
outputdir="/home/selbor/benchmarks/benchmark_EVNT/100xxx/100001/"
# Defining our seed
seed=1001

# Removes the output directory in case it's still there
rm -rf ${outputdir}

# Makes the directory to store files
mkdir -p ${outputdir}

# Copies the necessary script to the output directory
cp mc* SUSY_*.py ${outputdir}

# Changes directory into the output directory
cd ${outputdir}

# Runs the job using all the necessary parameters we defined above
Gen_tf.py --ecmEnergy=13000.0 --jobConfig=${outputdir} --outputEVNTFile=EVNT.root --maxEvents=10000 --randomSeed=${seed}
4 changes: 4 additions & 0 deletions Benchmark Scripts/EVNT/script_EVNT.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# Condor command, ran in the console, needed to submit our job into the queue
condor_submit benchmark_EVNT.sub
72 changes: 72 additions & 0 deletions Benchmark Scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Benchmark Scripts:
Contains information about four example jobs that are being run at the UChicago AF. The jobs run periodically, every six hours, with the aid of crontab.
## Workflow
When a crontab file access one of the scripts in this directory is works in the following way:
1. Reads the script the user specifies in their script:
- Suppose the crontab is set to run a batch job, then it will read /home/selbor/benchmarks/TRUTH3/script_TRUTH.sh
```bash
#!/bin/bash

condor_submit /home/selbor/benchmarks/TRUTH3/benchmark_TRUTH.sub
```
2. The contents of /home/selbor/benchmarks/TRUTH3/script_TRUTH.sh file will submit the submission file; /home/selbor/benchmarks/TRUTH3/benchmark_TRUTH.sub
3. The contents of the submission file will be read and the executable file will be used for the job; /home/selbor/LogFiles/benchmarks/TRUTH/run_truth3.sh

If the user wants to run this job interactively then, within the directory the executable file is located, the user should run:
```console
./run_truth3.sh
```
For interactive jobs, like for the Rucio Downloads, the script that the crontab reads just contains all of the commands one would enter in the console.

## Type of Jobs
Each of the jobs listed below have their respective directories with everything needed to run them, either interactively or in the batch:
- EVNT:
- Batch
- TRUTH3:
- Batch
- Rucio:
- Interactive
- TRUTH3_centos7:
- Batch
- Interactive

## Interactive Jobs
The following scripts are used to run interactive jobs:
- script_rucio.sh
- to_run_centos_interactive.sh

## Batch Jobs
As outlined in the documentation, to run batch jobs we need an executable file and a submission file. For benchmarking purposes a third script was written. Information about these can be found in the following subsections.
### Executable Files
The following scripts are used as the executable files for batch job submissions:
- run_EVNT.sh
- run_truth3.sh
- to_run_centos.sh

### Submission Files
The submission files all follow the format that was outlined in the documentation. The following is a list of the submission files used:
- benchmark_EVNT.sub
- benchmark_TRUTH.sub
- benchmark_TRUTH_centos7.sub

### Crontab Scripts:
To run the batch jobs periodically the following scripts are accessed by a crontab file:
- script_TRUTH.sh
- script_EVNT.sh
- script_TRUTH3_centos.sh
- to_run_centos_interactive.sh

## Cron-Jobs
The scripts are ran every six hours, this is done using a crontab. Below you'll find the crontab file used:

```bash
0 */6 * * * /home/selbor/benchmarks/Rucio/script_rucio.sh

0 */6 * * * /home/selbor/benchmarks/TRUTH3/script_TRUTH.sh

0 */6 * * * /home/selbor/benchmarks/EVNT/script_EVNT.sh

0 */6 * * * /home/selbor/benchmarks/TRUTH3_centos7/script_TRUTH3_centos.sh

0 */6 * * * /home/selbor/benchmarks/TRUTH3_centos7/to_run_centos_interactive.sh
```
24 changes: 24 additions & 0 deletions Benchmark Scripts/Rucio/script_rucio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#! /bin/bash

# Removes the existing directory in preparation for another download
rm -r mc23_13p6TeV.700866.Sh_2214_WWW_3l3v_EW6.deriv.DAOD_PHYSLITE.e8532_e8528_s4162_s4114_r14622_r14663_p6026_tid37222410_00/

# The following lines are needed since we aren't in xlplus
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
export ALRB_localConfigDir=$HOME/localConfig

# Section makes use of our certificate
source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh
lsetup emi
echo "Wookiee13" | voms-proxy-init -voms atlas

# Sets up our data management system client
lsetup "rucio -w"

# Makes note of the current date and time; to be used in naming log files
curr_time=$(date +"%Y.%m.%dT%H.%M.%S")

# Begins the rucio download process
# Its outputs are saved in the /data/selbor/LogFiles/Rucio/ directory.
# The file's name is the date and time the process began
rucio download --rses AGLT2_LOCALGROUPDISK mc23_13p6TeV:mc23_13p6TeV.700866.Sh_2214_WWW_3l3v_EW6.deriv.DAOD_PHYSLITE.e8532_e8528_s4162_s4114_r14622_r14663_p6026_tid37222410_00 2>&1 | tee /data/selbor/LogFiles/Rucio/$curr_time.log
Binary file added Benchmark Scripts/TRUTH3/EVNT.root
Binary file not shown.
Loading