# Getting started on Jpsi analysis # *** 1. Convert CMS AOD file (Data/MC) into plain root in lxplus *** 1-1) Set up CMS environment (see details in CMS workbook chapter 1.3) in lxplus work area (the exactly same CMSSW package as that in official real data production should be used) a) source /cvmfs/cms.cern.ch/cmsset_default.sh b) export SCRAM_ARCH=slc7_amd64_gcc700 (set the same slc-gcc version as the needed CMSSW release, check slc-gcc version by using 'scram list -a | grep CMSSW_10_3_3_patch1') c) cmsrel CMSSW_10_3_3_patch1 # only needs to be done once d) cd CMSSW_10_3_3_patch1/src e) cmsenv 1-2) Install Rice VertexCompositeAnalysis package a) in 'CMSSW_10_3_3_patch1/src', git clone -b 10_3_X https://github.com/davidlw/VertexCompositeAnalysis b) cd VertexCompositeAnalysis c) scram b -j8 d) cd VertexCompositeProducer/test e) cmsRun PbPbSkimAndTree2018_DiMuContBothGammaGamma_mc_cfg.py 1-3) Submit crab jobs (See details in https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookCRAB3Tutorial) The crab job configuration files used for jpsi analysis can be found in 'jpsiAnaCode/crabJobConfig' directory Caveat: There is NO maximum HF tower energy filter in PbPbSkimAndTree2018_DiMuContBothGammaGamma_mc_cfg.py, please pay attention to the efficiency correction of leading HF energy veto # The root files of DATA&MC, generated by VertexCompositeAnalysis package, can be found . # The analysis codes in following steps are based on the plain root gerenated by VertexCompositeAnalysis package. Therefore, copy the rootfiles under '/storage1/users/sy54/PbPb2018_DiMuTrees' in bonner lab cluster to the 'jpsiAnaCode/rootfiles' directory. !!! Please DO NOT change the relative directory paths in following steps !!! # *** 2. DATA analysis *** 2-1) cd jpsiAnaCode/anaData 2-2) execute 'root -l -b -q anaEvt.C+' to produce various histograms, e.g., ZDC distributions, pair mass vs. pair pt vs. pair rapidity distributions... (One valid root file generated by VertexCompositeAnalysis package is needed) 2-3) execute 'root -l -b -q plotJpsiQA.C+' to produces QA plots, including the pair mass (pt) vs. rapitiy (neutron multiplicity)... 2-4) execute 'root -l -b -q plotAcc.C+' to check the daughter muon kinematics and give one an idea how the acceptance boundaries of soft muon and triggered muon are determined # *** 3. neutron decouple *** 3-1) cd jpsiAnaCode/neuDecouple 3-2) execute 'root -l -b -q plotZDC.C+' to decouple neutron numbers. In UPC Jpsi analysis, 0n0n, 0nXn, XnXn with X>=1 will be used. In this case both the efficiency and purity of 0n and Xn are ~100% according to the fit results NOTE, 'plotZDC.C' analyzes the output root file of step 2-2) # *** 4. Single muon pt smearing (One can use different method to do the pt smearing) *** The single muon pt resolution in simulation is better than that in real data. To better model the mass and pt distributions of muon pairs from various processes (e.g., coherent Jpsi, two-photon interaction), the single muon pt resolution in simulation needs to be tuned to match real data 4-1) Evaluate single muon pt bias and resolution in simulation a) cd jpsiAnaCode/simulation b) root -l -b -q 'anaMcEvt.C+("LowMassGammaGamma")' c) cd jpsiAnaCode/ptSmear/rawPtRes d) root -l -b -q plotPtRes.C+ to generate single muon pt bias and resolution (this step generates the rawPtRes.root file used in jpsiAnaCode/common/funUtil.h) 4-2) Do single muon pt smearing and generate smeared pair mass templates for each pt-smearing setting a) cd jpsiAnaCode/ptSmear/makeSmear b) execute './smearMcEvt.sh' to generate smeared histograms (hMvsPtvsRap_ScanIdx) for coherent Jpsi, coherent psi2S, and QED background 4-3) Determine the best pt-smearing setting (par[0] of sqrt([0]*[0]/pt/pt + [1]*[1])) by matching smeared mass templates to data a) cd jpsiAnaCode/ptSmear/determineParA b) root -l -b -q genSmearedTemp.C+ to generate mass templates c) root -l -b -q determineParA.C+ to determine the best par[0], which is the mPar0 in 'jpsiAnaCode/common/constant.h' # *** 5. Generate acceptance*efficiency correction factors and templates of various processes *** Two requests have been submitted for the interested processes in official MC production: 1) The first request does full CMS simulation chain (GENSIM->DIGI->RECO). In this request, a loose single muon kinematic filter (LHE-MuonCUT-fragment.py in 'https://twiki.cern.ch/twiki/bin/viewauth/CMS/MCFor2018PbPb5TeV') is applied in GENSIM step to increase simulation efficiency (or reduce computing time). Therefore, one CANNOT correctly evaluate the acceptance factor (caused by daughter muon kinematic selections in data analysis) in this request. 2) The second request, without single muon kinematic filter, only does CMS GENSIM step to evaluate the loose single muon kinematic filter efficiency used in the first request. 5-1) Generate the single muon kinematic filter efficiency, used in GENSIM step. In private production, one can calculate this filter efficiency by analyzing STARlight output, while this correction factor can be evaluated by analyzing the output of the second request only having GENSIM production. a) cd jpsiAnaCode/simulation b) root -l -b -q anaSTARlight.C+ (excute './anaSTARlight.sh' to analyze all particle species) to generate the histograms for calculating the single muon filter efficiency vs. rapidity -- NOTE, one needs to feed required STARlight output file (from step 1-3 in https://github.com/mumuustc/starlightLHE) to this macro. One can grab some STARlight output files in lxplus /afs/cern.ch/user/s/shuaiy/eos_hin/STARlight/officalMCRequest -- hMvsPtvsRap_muFilter (numerator) and hMvsPtvsRap_STARlight (denominator) are used to calculate the loose single muon kinematic filter efficiency vs. rapidity 5-2) Generate pt/mass templates and acceptance*efficiency correction factors, which includes further muon kinematic selection, tracking, muon ID, trigger efficiencies, as a function of rapidity for various processes. *** NOTE, the efficiency of loose single muon kinematic filter, applied in GENSIM step, is not included in this step *** a) cd jpsiAnaCode/simulation b) root -l -b -q anaMcEvt.C+ (excute './anaSTARlight.sh' to analyze all particle species) to generate the histograms for efficiency and template estimation c) root -l -b -q genEffAndTemp.C+ to generate pt/mass templates and efficiency correction factors for various processes, based on the output of step b) -- The following two steps are just for one's own interests d) root -l -b -q genMuEff.C+ to generate the tracking&identification and trigger efficiencies for single muon e) root -l -b -q checkEffAndTemp_NueMult.C+ to check the template and efficiency difference for coherent Jpsi with different nuclear breakup scenarios # *** 6. Signal extraction *** 6-1) cd jpsiAnaCode/signalExt 6-2) root -l -b -q decoupleJpsi.C+ to decouple different contributions by fitting mass and pt distributions