Skip to content

Latest commit

 

History

History
229 lines (165 loc) · 10.9 KB

README.md

File metadata and controls

229 lines (165 loc) · 10.9 KB

Pythia8-Dark Photon Supersymmetry Preliminary Event Production

This packages is designed to perform GEN-only private MC productions using the CMSSW Pythia8 release that is included in the working CMSSW release. It also includes basic TTree-making files and simplistic histogramming that is intended primarly as a starting point to springboard to do whatever specific plotting is desired. However, this basic structure has been edited to generate and analyze supersymmetry events.

Update Instructions to Run Lepton Jets

I (Ming Huang) have tried to update these instructions as best as I can so people are less confused, since this information IS outdated.

First create a clean CMSSW_11_0_2 release area:

cmsrel CMSSW_11_0_2
cd CMSSW_11_0_2/src
cmsenv

Next clone the LeptonJetGeneration repository here

git clone https://github.com/IMSA-CMS/LeptonJetGeneration GenStudy
cd GenStudy

Next use scram to build and compile the project

scram b -j 8

If there are compiler errors, rsolve these (should be minor, if any). Upon successful build change to test directory and try running the genrator executable using cmsRun. This creates a lot screen output and can be time consuming to run so we redirect the output into a .txt file using '>' and run both functions in the background using '&' It does take command line input. Every option has a default value except for maxEvents...which defaults to infinity! YOU MUST ASSIGN A VALUE TO THIS VARIABLE EVERY TIME!!! If you forget, simply kill the process with "Ctrl+C"

cd Dimuon/test

cmsRun ciCrossSecCalc_edm_cfg.py maxEvents=50000 minMass=300 maxMass=800 Lambda=10000 helicityLL=-1 ciGen=1 ULE=off pdgId=11 &> outFile.txt &

If you just want to see if you can get it to run with default settings the following is a better option. Do note that this doesn't save the output, and this doesn't run in the background.

cmsRun ciCrossSecCalc_edm_cfg.py maxEvents=5000

This creates an output ROOT file that's confusing for the amateur. Using Dimuon_cfg.py to make sense of it is the best option. Within the Dimuon_cfg.py file is a section where you can set the file to analyze. This file should be the same as the one ciCrossSecCalc_edm_cfg.py generated. Dimuon_cfg.py takes that file and creates useful histograms of it.

cmsRun Dimuon_cfg.py &> dimuonOutFile.txt &

You can use the following if you want to see the debug output and don't want it to run in the background.

cmsRun Dimuon_cfg.py

The outfile should be called "Pythia6_Sep21_CI_L13000_8TeV_Sep21.root" unless you changed it. To open file in root:

root Pythia6_Sep21_CI_L13000_8TeV_Sep21.root

This has histograms which you can quickly check to see if it makes sense.

Dimuon_cfg.py runs Dimuon.cc, which is a file in the plugins directoy. To access the plugins directory from the Dimoun directory:

cd plugins

You should see Dimuon.cc, which is a C++ file which contains the directions for analyzing the file generated by ciCrossSecCalc_edm_cfg.py and you can make edits to this file to obtain different information. You should also see oldDimuon.cc.old which contains Shawn's orginal code if you want to see what he used.

The follwing sections are outdated, but you might find some useful information in them if you care to look.

This creates an output ROOT file that is labeled by most of the input parameters. This file has all of the RAW event MC info. It is meant to be analysed using Dilepton_cfg.py which is our TTree maker (or EDAnalyzer in CMS language). It takes an input .root file from GEN production with the .root extension and also takes in a user created output file name WITHOUT the .root extension. This also displays alot of screen output so we redirect and run in the background again.

cmsRun Dilepton_cfg.py inFile=<name of file created by generator> filename=<some output filename> &> AnalyzerOut.txt &

The output file has branches and histograms that can be used to quickly check to see if the values make sense.

These can be opened in a TBrowser in ROOT by doing the following:

root -l <some output filename>.root
[0]TBrowser b

If everything looks OK, it is likely that you would like to plot these histograms. We offer a basic histogramming and plotting script, makeHistograms.cc that provides simple access to the TTree variables and some basic ROOT plotting functionality. It takes three input variables, inputfile name, particle type, and output file name. To run this do

#for BASH shell
root -x -b -q makeHistograms.cc++(\"outputFile.root\",\"muon\",\"histogramOut\")

#for tcsh shell
root -x -b -q makeHistograms.cc++\(\"outputFile.root\",\"electron\",\"histogramOut\"\)

Once this has run, it will have made an output ROOT file that has stored the histograms that can be either: a) modified in the TBrowser b) saved as a .C ROOT macro that can be modified that way

The .root file will also have all TCanvas objects saved inside it. The TCanvas objects also get written out to .png file...if a different format is desired, this can easily be modified inside makeHistogram.cc in the SaveAs() function by changing .png to .pdf, or some other desired extension.

CRAB submission steps for Workflow

When running local simulations do the following:

GENSIM:

in test/genSimCrabConfig folder:

One can run locally doing the mc16GenSim_cfg.py, using the same command line input as with ciCrossSecCalc_edm_cfg.py. E.g.

cmsRun mc16GenSim_cfg.py maxEvents=10000 ciGen=1 helicityLL=-1 minMass=300 Lambda=10000 >& outputFile.log &

To submit via CRAB, the crabConfig file needs to be modied. It is highly recomended that the CRAB configuration file name has it's own unique name that clearly identifies the sample that you want to submit. It is also strongly recommended that all naming information used within the configuration file is unique to the sample, especially the request name.

Make the following changes: config.General.requestName = '' config.JopType.psetName = 'mc16GenSim_cfg.py' config.JobType.pyCfgParams =[]

config.outputPrimaryDataSet = '<PrimaryDataset name for DAS that will identify the lepton flavor and Lambda value (N.B. all daughter samples e.g. RECO, AOD, miniAOD will inherit from this name)>' config.Data.outputDatasetTag = ''

For first time setup only you will need to create the crab_projects folder:

mkdir crab_projects

This is the directory that CRAB will store local CRAB output into.

To submit to CRAB do the following (once only per cd):

cmsenv
voms-proxy-init -voms cms --valid 168:00
source cvmfs/cms.cern.ch/crab3/crab.sh

Then for each CRAB job that you would like to submit do the following:

crab submit -c <crabConfigFile>

You can check the status of the jobs using:

crab status --dir crab_projects/<CRAB task request name>

If any jobs need to be resubmitted, do the following (N.B. only jobs in FAILED state can be resubmitted):

crab resubmit --dir crab_projects/<CRAB task request name>  --jobids=<comma separated list of jobs e.g. 1,6,10-70>

Jobs can also be followed using the task monitoring dashboard.

Once jobs are completed, the RECO process can be started.

RECO: To start change to the RECO CRAB directory, test/recoCrabConfig. To run Locally, make sure that the input file path in the file matches the location of the GENSIM output ROOT file. Then simply do:

cmsRun mc16RECO_cfg.py

To submit to CRAB, the process is similar to submitting the GENSIM step. The primary difference comes from modifying the CRAB config file. To do this, open the CRAB config file in a text editor. The following will need changes: config.General.requestName = '' config.Data.inputDatset =' ' To find the ouput dataset name you will need to query DAS using the following:

"dataset = //--*/USER" using the prod/phys03 Database (DBS). Simply copy and paste the appropriate sample name from the DAS page and paste it into the inputDataset variable in the RECO CRAB config file.

Lastly: config.Data.outputDatasetTag = '<output Tag that uniquely identifies the RECO (DIGIRAW) sample>'

Once these changes are made, CRAB submission is the same as GENSIM, simply use the RECO crabconfig file instead of the GENSIM in the command.

AOD:

For AOD, change to the test/aodCrabConfig directory and make the changes to the same fields specified in the RECO step in the crab config file, but update to use RECO as input dataset and change the request name and output tag to reflect the AOD.

miniAOD:

For miniAOD, change to the test/miniAODCrabConfig directory and make the changes to the same fields specified in the RECO step in the crab config file, but update to use the AOD as input dataset and change the request name and output tag to reflect miniAOD.

Outdated CMSSW_7_4_4 Instructions (Valid for 2015 running)

In order to check this out you should have checked out a CMSSW release. It has been tested on CMSSW_7_4_4. To checkout package, please do the following in the src directory:

git clone https://github.com/szaleski/Pythia8-dilepton.git GenStudy

or

git clone [email protected]:szaleski/Pythia8-dilepton.git GenStudy

After the package has been checked out you can run the Generator dimuon_Pythia8_gen.py that resides in the test directory. Running this generator creates a .root output file. Also, it is possible to specify optional parameters at the command line, specifically, the number of events to produce (maxEvents), minimum mass cut (minMass), maximum mass cut (maxMass), model type (model), and output file name (outName). Any of the specified parameters may be omitted from the command, and will revert to their default values found in the mcCommandLineOptions_cfi.py file in the python dirctory. These can be hardcoded into the generator file though if one wishes.

To run please do the following:

  1. change to test directory
cmsRun dimuon_Pythia8_gen.py maxEvents=<number of events> minMass=<low mass cut> maxMass=<high mass cut> model=<model name> outName="<file name>"

This creates a .root output file that can be analyzed using Dimuon_cfg.py. This cfg file analyzes the TTree generated by dimuon_Pythia8_gen.py.

To run this file please do the following:

cmsRun Dimuon_cfg.py

It creates histograms for the following quantities of Boson, and dimuon pairs: pT, mass, energy, pseudorapidity, phi, theta, and charge. It also compares values of theta and phi for the muon pairs.

Do not use Plots.cc, this was an earlier attempt of Plots2.cc Plots2.cc can be used to generate different canvases to be analyzed in the .root output file created by Dimuon_cfg.py