Zprime Simulation Steps
This Twiki page, shows the 6 necesary steps to perform a Z prime analysis.
- The code to perform the first four steps was written by Alfredo Gurrola (Vanderbilt University) and Anirban Saha (INFN).
- The powerfull tool to create the Ntuples and to perform the analysis was done by Alfredo Gurrola (Vanderbilt), Andres Florez (Los Andes), Amandeep Kalsi (Panjab)
There are 6 steps in an analysis.
- Generation: Produce the proccess of interes, it means that the physics process coming from the collision is generated. Just the creation of particles is simulated without the interaction with the subdetectors.
- RAW & Sim: The interaction of the particles (produced in the first step) with the material of the detectors is simulated
- AODSIM: All the CMS algorithms are used to identify/reconstruct all the particles (taking the information of the step 2)
- miniAOD: It is just like the step 3 but keeping just the most relevant information from the CMS algorithms to reconstruct the collision (electron objects, jet objects, etc)
- BSM3G Ntuples: It is just a like the step 4 but now keeping the most important variables for each object (energy, momentum, angles, )
- Analyzer: Use the output from the step 5 and you can perfomr the analysis, produce histograms, efficiencies, etc.
Getting Started for steps 1-4
This instructions allow you to reproduce the first four steps in the simulation.The
script.csh produces the python files in order to generate the root file in each step. You can modify the values to generate the sample of your interest (See 1. generate)
script.csh
The number of events can be changed
-no_exec -n 10 change to --no_exec -n 1
1. Generate
-Generate the physics process of interest. Produce particles of a particlar Feynmman diagram
cmsRun STEP1_GEN-SIM.py >
GenOutput.log
This step produces the GENSIM.root with all the particles simulated in
MonteCarlo coming form the process you want to study. You can modify the center-of-mass energy, the number of events, among others:
The step 1 takes the following file. There you can modify the Z' mass.
Let's look at: Configuration/GenProduction/python/ThirteenTeV/ZprimeToTauTau_M_4500_TuneCUETP8M1_tauola_13TeV_pythia8_cfi.py
1. specifies the "generator":
generator = cms.EDFilter("Pythia8GeneratorFilter",
2. specifies the center-of-mass energy:
comEnergy = cms.double(13000.0),
3. dumps information for only 1 event:
maxEventsToPrint = cms.untracked.int32(1),
4. tau decays are handled by another package (tauola):
ExternalDecays = cms.PSet(Tauola = cms.untracked.PSet(
TauolaPolar,
TauolaDefaultInputCards ),
5. specifies the type of process (i.e. feynman diagram. In this case it's fermion+antifermion production a new boson)
'NewGaugeBoson:ffbar2gmZZprime = on',
6. the new gauge boson is a Z':
'Zprime:gmZmode = 3',
7. specifies the mass of the Z' (4500
GeV in this case):
'32:m0 = 4500',
8. force the Z' to decay to a pair of tau leptons
'32:onIfAny = 15',
Let's look at the cmsDriver commands for step #1:
1. uses the file "ZprimeToTauTau_M_4500_TuneCUETP8M1_tauola_13TeV_pythia8_cfi.py" as a template:
cmsDriver.py Configuration/GenProduction/python/ThirteenTeV/ZprimeToTauTau_M_4500_TuneCUETP8M1_tauola_13TeV_pythia8_cfi.py
2. name of the output file from step #1 (generation step):
--fileout GENSIM.root
3. specifies the detector conditions that will be used for the RAW+SIM step ... need to specify this is Monte Carlo:
--customise
SLHCUpgradeSimulations /Configuration/postLS1Customs.customisePostLS1
--conditions auto:run2_mc
4. specify the magnetic field strength:
--magField 38T_PostLS1
5. produces a python file with all the above information that is ready for the user to run:
--python_filename STEP1_GEN-SIM.py
6. how many events to generate?:
--no_exec -n 10
2. RAW & SIM
Perform the simulation of the interaction of the particles in the detector (GEANT4). Takes the particles generated in the first step
cmsRun STEP2.py
It takes the file from the step 1 (GENSIM.root) and produces the file RAWSIM.root
3. AODSIM
Apply CMS algorithms to identify/reconstruct the particles e, &mu, &tau, p, etc... Takes the information from the particles of the RAW & SIM step
cmsRun STEP3.py
It takes the file from the step 2 (RAWSIM.root) and produces the file AODSIM.root
4. miniAOD
miniAOD is a "lighter" version of the step 3 output file. Only important information is kept in each object.
cmsRun STEP4.py
It takes the file from the step 3 (AODSIM.root) and produces the file mini_AODSIM.root
Getting Started for steps 5-6
1. You need to work at the SLC6 area. First, setup your enviroment
- source /cvmfs/cms.cern.ch/cmsset_default.csh
- setenv SCRAM_ARCH slc6_amd64_gcc491
- cmsrel CMSSW_7_4_0
- cd CMSSW_7_4_0/src
- cmsenv
2. Install all packages
Install and compile the code to use the PAT-electron ID:
- git cms-merge-topic ikrav:egm_id_74X_v0
- scram b -j 10
Get the
NTupleMaker code and compile it:
Get the Analyzer code and compile it (code that performs the analysis and produces histograms):
Get the Plotter code and compile it (scripts to create plots and calculate efficiencies). To avoid root version problems install it on your CMSSW_7_1_14/src area
5. BSM 3G Ntuples
The output file from the step 4 is reduced to kept just important information about the objects: energy, &phi, pT, etc of each particle
cd into the appropriate
NtupleMaker directory to start running the code:
cd
NtupleMaker /BSM3G_TNT_Maker/python
Copy a test input miniAOD root file from gurrola's area (or your own):
- // FROM VANDERBILT:
- cp /home/gurrola/mini_AODSIM.root .
- // FROM LPC:
- cp /uscms/home/florez/mini_AODSIM.root .
- To use your own root file you must do two changes into the miniAOD.py file: - put the path of your 'path/mini_AODSIM.root' - change the number of events
Run the
NtupleMaker code:
- cmsRun miniAOD.py (it produces the file OutTree.root)
cd into the appropriate Analyzer directory to start running the code:
- cd Analyzer/BSM3G_TNT_MainAnalyzer/
Analysis
Use the outputfile from step 5 (events with just important variables information) to apply cuts and produce histograms.
Copy a the Ntuple root file
OutTree.root and compile the code:
- cp $CMSSW_BASE/src/NtupleMaker/BSM3G_TNT_Maker/python/OutTree.root .
- make clean
- make BSM3GAnalyzer
Run the analyzer code and inspect the output root file:
- ./BSM3GAnalyzer OutTree.root analysis.root
- root -l analysis.root
To run multiple files at LPC using CONDOR, please go to this link and follow the instructions:
https://github.com/florez/CONDOR
Please make sure to read carefully the scripts to understand how to configure the code.
if you have questions, please contact Andres Florez.
Use the Plotter code (CMSSW_7_1_14) and output from running the analyzer to produce plots and a cut flow eff table:
- cd CMSSW_7_1_14/src/Plotter/TNTCode/
Copy the analysis.root on the folders Data and
DYMuMu
- cp CMSSW_7_1_14/src/Analyzer/BSM3G_TNT_MainAnalyzer/analysis.root CMSSW_7_1_14/src/Plotter/TNTCode/Data
- cp CMSSW_7_1_14/src/Analyzer/BSM3G_TNT_MainAnalyzer/analysis.root CMSSW_7_1_14/src/Plotter/TNTCode/ DYMuMu
Make sure that you are working on SCRAM_ARCH slc6_amd64_gcc491 or you are going to get some root version problems
Inspect the output root file:
root -l Plots_Rebin1.root
Macro to Tau id efficiency
It was written by Francesco. the macro is /afs/
cern.ch/user/f/fromeo/public/EXO/Efficiency