Skip to content

Commit

Permalink
Lep ID and FSR fixes (#10)
Browse files Browse the repository at this point in the history
* H4L updates

* “Fsr Recovery & Rochester correction”

* Jet Selection Updated

* Mela loaded

* Delete helloworld.h

* Delete NJettiness.h

* Delete NJettiness.cc

* Delete helloworld.cc

* Delete proxy.sh

* Delete condor_setup_lpc.py

* Delete JetSFMaker.py

* Delete HZZAnalysisModule.py

* Delete condor_setup_lxplus.py

* Add files via upload

* Remove redundancy

* Update README.md

* Add files via upload

* Update README.md

* Update README.md

* Update README.md

* RoccoR Added

* Path fixed

* Add files via upload

* Add files via upload

* Delete __init__.pyc

* Delete RoccoR.cc

* Delete RoccoR.h

* Update README.md

* Update H4LCppModule.py

* Update keep_and_drop.txt

* Update README.md

Following updates:

- Updated to `CMSSW_10_6_30` from `CMSSW_10_6_20`
- Updated to the latest version of official nanoAOD-tools
- Added back the instruction of batch job.

* Update README.md

* MELA updates

* Delete KalmanMuonCalibrationsProducer/interface directory

* Delete KalmanMuonCalibrationsProducer/plugins directory

* Delete KalmanMuonCalibrationsProducer/python directory

* Delete KalmanMuonCalibrationsProducer/src directory

* Delete BuildFile.xml

* Trigger selection added

* Trigger Updated

* Update keep_and_drop.txt with Mela branches

* Update keep_and_drop.txt

* Update keep_and_drop.txt

* Sync for Lepton

* Add Z selection

* Lepton Module Changed

* hard code removed

* Reading branch modified

* Jet Selection fixed

* tight Electron corrected

* Add files via upload

* Gen issue fixed

* RoccoR module updated

* Add files via upload

* Update post_proc.py

* FSR bug fixed

* - Updated input file reading method, while running locally
   - Added two example.txt file for local running
- Updated condor script

---------

Co-authored-by: Ramkrishna Sharma <[email protected]>
Co-authored-by: Ram Krishna Sharma <[email protected]>
  • Loading branch information
3 people authored Sep 25, 2023
1 parent 1e394c6 commit d0a6de6
Show file tree
Hide file tree
Showing 8 changed files with 318 additions and 250 deletions.
1 change: 1 addition & 0 deletions ExampleInputFileList.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/store/mc/RunIISummer20UL18NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_upgrade2018_realistic_v16_L1v1-v1/120000/3ED05633-EBB7-4A44-8F9D-CD956490BCFD.root
1 change: 1 addition & 0 deletions ExampleInputFileList_data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/store/data/Run2018B/SingleMuon/NANOAOD/UL2018_MiniAODv2_NanoAODv9_GT36-v1/2430000/333071A2-4043-B340-BBDC-395EBF78EA33.root
20 changes: 19 additions & 1 deletion H4LCppModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class HZZAnalysisCppProducer(Module):
def __init__(self,year,cfgFile,isMC):
def __init__(self,year,cfgFile,isMC,isFSR):
base = "$CMSSW_BASE/src/PhysicsTools/NanoAODTools/python/postprocessing/analysis/nanoAOD_skim"
ROOT.gSystem.Load("%s/JHUGenMELA/MELA/data/slc7_amd64_gcc700/libJHUGenMELAMELA.so" % base)
ROOT.gSystem.Load("%s/JHUGenMELA/MELA/data/slc7_amd64_gcc700/libjhugenmela.so" % base)
Expand Down Expand Up @@ -53,6 +53,7 @@ def __init__(self,year,cfgFile,isMC):
self.passZZEvts = 0
self.cfgFile = cfgFile
self.isMC = isMC
self.worker.isFSR = isFSR
pass
def beginJob(self):
pass
Expand Down Expand Up @@ -275,10 +276,27 @@ def analyze(self, event):
phij2 = self.worker.phij2
mj2 = self.worker.mj2

if pTL2>pTL1:
pTL1, pTl2 = pTL2, pTL1
etaL1, etaL2 = etaL2, etaL1
phiL1, phiL2 = phiL2, phiL1
massL1,massL2 = massL2, massL1
if pTL4>pTL3:
pTL3, pTL4 = pTL4, pTL3
etaL3, etaL4 = etaL4, etaL3
phiL3, phiL4 = phiL4, phiL3
massL3, massL4 = massL4, massL3


pT4l = self.worker.ZZsystem.Pt()
eta4l = self.worker.ZZsystem.Eta()
phi4l = self.worker.ZZsystem.Phi()
mass4l = self.worker.ZZsystem.M()
if self.worker.isFSR==False:
pT4l = self.worker.ZZsystemnofsr.Pt()
eta4l = self.worker.ZZsystemnofsr.Eta()
phi4l = self.worker.ZZsystemnofsr.Phi()
mass4l = self.worker.ZZsystemnofsr.M()
self.out.fillBranch("mass4l",mass4l)
self.out.fillBranch("pT4l",pT4l)
self.out.fillBranch("eta4l",eta4l)
Expand Down
2 changes: 1 addition & 1 deletion Utils
391 changes: 211 additions & 180 deletions condor_setup_lxplus.py

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion interface/H4LTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ class H4LTools {
FsrPhoton_dROverEt2.clear();FsrPhoton_phi.clear();FsrPhoton_eta.clear();FsrPhoton_pt.clear();FsrPhoton_relIso03.clear();
GenPart_pt.clear();
Zlist.clear();
Zlistnofsr.clear();
Zflavor.clear();
Zlep1index.clear();
Zlep2index.clear();
Expand All @@ -279,7 +280,8 @@ class H4LTools {

flag4e=false; flag4mu=false; flag2e2mu=false;
}

bool isFSR=true;
unsigned int Zsize=0;
TSpline *spline_g4;
TSpline *spline_g2;
TSpline *spline_L1;
Expand Down
82 changes: 40 additions & 42 deletions post_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,54 @@
from PhysicsTools.NanoAODTools.postprocessing.modules.jme.jetmetHelperRun2 import *
from PhysicsTools.NanoAODTools.postprocessing.modules.btv.btagSFProducer import *

testfile = "root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL18NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_upgrade2018_realistic_v16_L1v1-v1/120000/3ED05633-EBB7-4A44-8F9D-CD956490BCFD.root"
#testfile1 = "root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL18NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_upgrade2018_realistic_v16_L1v1-v1/270000/1B1D7372-F369-7C40-A85F-841308D42D2C.root"
#testfile2 = "root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL18NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_upgrade2018_realistic_v16_L1v1-v1/270000/2BA7CCC9-BA73-3C45-9844-474A92E58A28.root"
#testfile = "root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL18NanoAODv9/GluGluHToZZTo4L_M120_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_upgrade2018_realistic_v16_L1v1-v1/270000/1D8ACDF9-FCA6-7649-95A4-487A132F318D.root"
#testfile1 = "root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL18NanoAODv9/GluGluHToZZTo4L_M120_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_upgrade2018_realistic_v16_L1v1-v1/130000/6EA35A9B-C42E-0447-ACED-E3AC70A7AD7E.root"
#testfile = "root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL18NanoAODv9/GluGluHToZZTo4L_M124_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_upgrade2018_realistic_v16_L1v1-v1/70000/1AAFFFBE-330D-EF42-B39E-BA70A7E90669.root"
#testfile = "root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL18NanoAODv9/GluGluHToZZTo4L_M126_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_upgrade2018_realistic_v16_L1v1-v1/280000/8198816C-2B6D-CB41-9B96-6B02BD81CAAE.root"
#testfile = "root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/VBF_HToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/2430000/13F76A9B-76DD-144B-B328-A8C207376C08.root"
#testfile1 = "root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL18NanoAODv9/GluGluHToZZTo4L_M130_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_upgrade2018_realistic_v16_L1v1-v1/70000/00305042-7CD7-2C46-8FD6-D1089E4C4163.root"
#testfile = "root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/260000/FD91C4F0-7DE3-4947-817D-3EA957A0BC50.root"
#testfile = "root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL18NanoAODv9/VBF_HToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_upgrade2018_realistic_v16_L1v1-v1/80000/3F65CE54-8477-C64E-B0BB-BD77E870AB54.root"
#testfile = "root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL18NanoAODv9/GluGluHToZZTo2L2Q_M1000_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_upgrade2018_realistic_v16_L1v1-v1/280000/7F817CD1-84C1-5347-AEEA-F069CAE84799.root"
ifRunningOnCondor = False

testfilelist = []
testfilelist.append("root://cms-xrd-global.cern.ch//store/data/Run2018B/SingleMuon/NANOAOD/UL2018_MiniAODv2_NanoAODv9_GT36-v1/2430000/87FA9714-D8D3-1345-BFF5-3B417B1ADC64.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/130000/4743B911-1EA3-7E46-959B-93F466ED622F.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/130000/DE3F93DE-DAF6-DD4A-AC3B-13ACE92EAD68.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/2430000/336F0076-347C-AC40-B1B4-E31E14323B81.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/260000/100D0E96-C700-5244-874F-38DB4B410228.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/260000/28512C40-9C25-864A-98E9-4746C0471E63.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/260000/2BAB6B06-FFE2-DC4F-A57F-3A33B3326A30.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/260000/453FC70D-8164-1B4B-A756-81E7432C1D61.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/260000/5C1E0BC2-F153-E946-9B61-470E8AF85C58.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/260000/9DB74D60-0434-A04C-B430-173D6D6538C3.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/260000/DB3B1648-246F-314E-9DD8-FACEA0AE62F6.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/260000/FD91C4F0-7DE3-4947-817D-3EA957A0BC50.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/270000/6021CDF7-AE6F-464D-81E2-AB75ABC4809D.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/270000/77B90DAA-35B9-004E-9C49-52E516FB15D6.root")
testfilelist.append("root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL17NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_mc2017_realistic_v9-v2/270000/C01084F4-328D-0146-B71E-B167AB6A7E86.root")

entriesToRun = 0 # 0 if need to run over all entries else put number of entries to run
isMCTrueFalse = False

if ifRunningOnCondor:
testfile = "root://cms-xrd-global.cern.ch//store/mc/RunIISummer20UL18NanoAODv9/GluGluHToZZTo4L_M125_TuneCP5_13TeV_powheg2_JHUGenV7011_pythia8/NANOAODSIM/106X_upgrade2018_realistic_v16_L1v1-v1/120000/3ED05633-EBB7-4A44-8F9D-CD956490BCFD.root"
testfilelist.append(testfile)

else:
if len(sys.argv) > 1:
InputFileList = sys.argv[1]
else:
InputFileList = "ExampleInputFileList.txt"
with open(InputFileList, 'r') as file:
for line in file:
# Remove newline characters
line = line.strip()
# Append the line to the list with the "root://cms-xrd-global.cern.ch//" prefix
testfilelist.append("root://cms-xrd-global.cern.ch/" + line)

# Set entriesToRun = 0 if need to run over all entries else put number of entries to run
entriesToRun = 0 if ifRunningOnCondor else 100

isMC = True
isFSR = False

outputbranchsel = "keep_and_drop.txt"
# Keep DownloadFileToLocalThenRun=True this should reduce the file read error from eos.
DownloadFileToLocalThenRun=True
if testfilelist[0].find("2018") != -1:
year = 2018
cfgFile = 'Input_2018.yml'
if testfilelist[0].find("2017") != -1:
year = 2017
cfgFile = 'Input_2017.yml'
if testfilelist[0].find("UL18") != -1:

if testfilelist[0].find("/data/") != -1:
isMC = False
outputbranchsel = "keep_and_drop_data.txt"

if testfilelist[0].find("UL18") != -1 or testfilelist[0].find("UL2018") != -1: # UL2018 for identification of 2018 UL data and UL18 for identification of 2018 UL MC
year = 2018
cfgFile = 'Input_2018.yml'
if testfilelist[0].find("UL17") != -1:

if testfilelist[0].find("UL17") != -1 or testfilelist[0].find("UL2017") != -1:
year = 2017
cfgFile = 'Input_2017.yml'
if testfilelist[0].find("pythia") != -1:
isMCTrueFalse = True
H4LCppModule = lambda: HZZAnalysisCppProducer(year,cfgFile,isMCTrueFalse)

H4LCppModule = lambda: HZZAnalysisCppProducer(year,cfgFile, isMC, isFSR)
print("outputbranchsel = ",outputbranchsel)
print("isMC = ",isMC)
print("isFSR = ",isFSR)
#p=PostProcessor(".",[testfile],"",None,[H4LCppModule()],provenance=True,fwkJobReport=False,haddFileName="nano_M125.root",maxEntries=entriesToRun,prefetch=DownloadFileToLocalThenRun,outputbranchsel="keep_and_drop.txt")
p=PostProcessor(".",testfilelist,"",None,[H4LCppModule()],provenance=True,fwkJobReport=False,haddFileName="nano_M125_cpp.root",maxEntries=entriesToRun,prefetch=DownloadFileToLocalThenRun,outputbranchsel="keep_and_drop.txt")
p=PostProcessor(".",testfilelist,"",None,[H4LCppModule()],provenance=True,fwkJobReport=False,haddFileName="nano_M125_cpp.root",maxEntries=entriesToRun,prefetch=DownloadFileToLocalThenRun,outputbranchsel=outputbranchsel)

p.run()
print "DONE"
67 changes: 42 additions & 25 deletions src/H4LTools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,10 @@ unsigned H4LTools::doFsrRecovery(TLorentzVector Lep){
fsrcand.SetPtEtaPhiM(FsrPhoton_pt[BestFsrPhotons[i]],FsrPhoton_eta[BestFsrPhotons[i]],FsrPhoton_phi[BestFsrPhotons[i]],0);
float dRlC,dRlOverPtC;
dRlC = fsrcand.DeltaR(Lep);
dRlOverPtC = dRl/(fsrcand.Pt()*fsrcand.Pt());
if ((dRlC<fsrphotondRlcut)&&(dRlOverPtC<fsrphotondRlOverPtcut)){
if(dRlOverPtC<dRlOverPt){
if ((dRlC<fsrphotondRlcut)&&(FsrPhoton_dROverEt2[BestFsrPhotons[i]]<fsrphotondRlOverPtcut)){
if(FsrPhoton_dROverEt2[BestFsrPhotons[i]]<dRlOverPt){
dRl = dRlC;
dRlOverPt = dRlOverPtC;
dRlOverPt = FsrPhoton_dROverEt2[BestFsrPhotons[i]];
FsrIdx = BestFsrPhotons[i];
}
}
Expand Down Expand Up @@ -282,6 +281,7 @@ float H4LTools::ApplyRoccoR(bool isMC, int charge, float pt, float eta, float ph

double u1;
u1 = rand.Uniform(1.);
//u1 = 0.5; //Sync
scale_factor = calibrator->kSmearMC(charge, pt, eta, phi, nLayers, u1);
}
}
Expand Down Expand Up @@ -354,37 +354,44 @@ void H4LTools::LeptonSelection(){

ElelistFsr = BatchFsrRecovery(Elelist);
MulistFsr = BatchFsrRecovery(Mulist);

for(unsigned int ae=0; ae<Eid.size();ae++){
float RelEleIsoNoFsr;
RelEleIsoNoFsr = Eiso[ae];
unsigned int FsrEleidx;
FsrEleidx = doFsrRecovery(Elelist[ae]);
if(FsrEleidx<900){
TLorentzVector fsrele;
fsrele.SetPtEtaPhiM(FsrPhoton_pt[FsrEleidx],FsrPhoton_eta[FsrEleidx],FsrPhoton_phi[FsrEleidx],0);
if(Elelist[ae].DeltaR(fsrele)>0.01){
RelEleIsoNoFsr = RelEleIsoNoFsr - FsrPhoton_pt[FsrEleidx]/Elelist[ae].Pt();
}
if (isFSR){
unsigned int FsrEleidx;
FsrEleidx = doFsrRecovery(Elelist[ae]);
if(FsrEleidx<900){
TLorentzVector fsrele;
fsrele.SetPtEtaPhiM(FsrPhoton_pt[FsrEleidx],FsrPhoton_eta[FsrEleidx],FsrPhoton_phi[FsrEleidx],0);
std::cout<<"Ele correction: "<< std::endl;
if(Elelist[ae].DeltaR(fsrele)>0.01){
RelEleIsoNoFsr = RelEleIsoNoFsr - FsrPhoton_pt[FsrEleidx]/Elelist[ae].Pt();
}
}
}
if((Eid[ae]==true)&&(RelEleIsoNoFsr<0.35)){
nTightEle++;
TightEleindex.push_back(ae);
nTightEleChgSum += Elechg[ae];
}

}

for(unsigned int amu=0; amu<muid.size();amu++){
float RelIsoNoFsr;
RelIsoNoFsr = Muiso[amu];
unsigned int FsrMuonidx;
FsrMuonidx = doFsrRecovery(Mulist[amu]);
if(FsrMuonidx<900){
TLorentzVector fsrmuon;
fsrmuon.SetPtEtaPhiM(FsrPhoton_pt[FsrMuonidx],FsrPhoton_eta[FsrMuonidx],FsrPhoton_phi[FsrMuonidx],0);
if(Mulist[amu].DeltaR(fsrmuon)>0.01){
RelIsoNoFsr = RelIsoNoFsr - FsrPhoton_pt[FsrMuonidx]/Mulist[amu].Pt();
}
if (isFSR){
unsigned int FsrMuonidx;
FsrMuonidx = doFsrRecovery(Mulist[amu]);
if(FsrMuonidx<900){
TLorentzVector fsrmuon;
fsrmuon.SetPtEtaPhiM(FsrPhoton_pt[FsrMuonidx],FsrPhoton_eta[FsrMuonidx],FsrPhoton_phi[FsrMuonidx],0);
std::cout<<"muon FSR recovered"<<endl;
if(Mulist[amu].DeltaR(fsrmuon)>0.01){
RelIsoNoFsr = RelIsoNoFsr - FsrPhoton_pt[FsrMuonidx]/Mulist[amu].Pt();
}
}
}
if((muid[amu]==true)&&(RelIsoNoFsr<0.35)){
nTightMu++;
Expand Down Expand Up @@ -490,7 +497,9 @@ bool H4LTools::findZCandidate(){
Zlistnofsr.push_back(Zcannofsr);
}

if (Zlist.size()>0){

Zsize = Zlist.size();
if (Zsize>0){
return true;
}
else{
Expand All @@ -514,7 +523,7 @@ bool H4LTools::ZZSelection(){
if((abs(nTightEleChgSum)+abs(nTightMuChgSum))>(nTightMu+nTightEle-4)){
return foundZZCandidate;
}
if(Zlist.size()<2){
if(Zsize<2){
return foundZZCandidate;
}

Expand Down Expand Up @@ -676,11 +685,17 @@ bool H4LTools::ZZSelection(){

Z1nofsr = Zlistnofsr[Z1index];
Z2nofsr = Zlistnofsr[Z2index];

ZZsystem = Z1+Z2;
ZZsystemnofsr = Z1nofsr+Z2nofsr;

/*if(abs(ZZsystemnofsr.M()-ZZsystem.M())>0.000001){
std::cout<<"FSR works "<<abs(ZZsystemnofsr.M()-ZZsystem.M())<<std::endl;
std::cout<<"FSR: "<<ZZsystem.M()<<" noFSR:"<<ZZsystemnofsr.M()<<std::endl;
}*/

float massZZ;
massZZ = ZZsystem.M();
if (isFSR) massZZ = ZZsystem.M();
else massZZ = ZZsystemnofsr.M();
if ((massZZ>HiggscutDown)&&(massZZ<HiggscutUp)){
if (flag2e2mu) cutm4l2e2mu++;
if (flag4e) cutm4l4e++;
Expand Down Expand Up @@ -748,10 +763,12 @@ bool H4LTools::ZZSelection(){

SimpleParticleCollection_t daughters;
TLorentzVector Lep1,Lep2,Lep3,Lep4;

Lep1.SetPtEtaPhiM(Zlep1pt[Z1index],Zlep1eta[Z1index],Zlep1phi[Z1index],Zlep1mass[Z1index]);
Lep2.SetPtEtaPhiM(Zlep2pt[Z1index],Zlep2eta[Z1index],Zlep2phi[Z1index],Zlep2mass[Z1index]);
Lep3.SetPtEtaPhiM(Zlep1pt[Z2index],Zlep1eta[Z2index],Zlep1phi[Z2index],Zlep1mass[Z2index]);
Lep4.SetPtEtaPhiM(Zlep2pt[Z2index],Zlep2eta[Z2index],Zlep2phi[Z2index],Zlep2mass[Z2index]);


pTL1 = Lep1.Pt();
etaL1 = Lep1.Eta();
Expand Down

0 comments on commit d0a6de6

Please sign in to comment.