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

Muon POG NanoAOD v2 #43642

Merged
merged 19 commits into from
Feb 21, 2024
Merged
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
10 changes: 10 additions & 0 deletions Configuration/PyReleaseValidation/python/relval_nano.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def subnext(self):
steps['NANO_data13.0_prompt']=merge([{'--customise' : 'PhysicsTools/NanoAOD/nano_cff.nanoL1TrigObjCustomize', '-n' : '1000'},
steps['NANO_data13.0']])


steps['muDPGNANO_data13.0']=merge([{'-s' : 'RAW2DIGI,NANO:@MUDPG',
'--conditions':'auto:run3_data',
'-n' : '100',
Expand All @@ -166,6 +167,10 @@ def subnext(self):
'--datatier':'NANOAOD',
'--eventcontent':'NANOAOD'}])

steps['muPOGNANO_data13.0']=merge([{'-s' : 'NANO:@PHYS+@MUPOG',
'-n' : '1000'},
steps['NANO_data13.0']])

###current release cycle workflows : 13.2
steps['TTBarMINIAOD13.2'] = {'INPUT':InputInfo(location='STD',
## dataset below to be replaced with a 13.2 relval sample when available
Expand All @@ -175,6 +180,9 @@ def subnext(self):
'--conditions':'auto:phase1_2022_realistic'},
_NANO_mc])

steps['muPOGNANO_mc13.2']=merge([{'-s' : 'NANO:@PHYS+@MUPOG ', '-n' : '1000'},
steps['NANO_mc13.2']])

##13.X INPUT
steps['RunScoutingPFRun32022D13.X']={'INPUT':InputInfo(dataSet='/ScoutingPFRun3/Run2022D-v1/RAW',label='2022D',events=100000,location='STD', ls=Run2022D)}

Expand Down Expand Up @@ -230,11 +238,13 @@ def subnext(self):
workflows[_wfn()] = ['NANOdata130Xrun3', ['MuonEG2023MINIAOD13.0', 'NANO_data13.0_prompt', 'HRV_NANO_data']]
workflows[_wfn()] = ['muDPGNANO130Xrun3', ['ZMuSkim2023DRAWRECO13.0', 'muDPGNANO_data13.0']]
workflows[_wfn()] = ['muDPGNANOBkg130Xrun3', ['ZeroBias2023DRAW13.0', 'muDPGNANOBkg_data13.0']]
workflows[_wfn()] = ['muPOGNANO_data13.0', ['MuonEG2023MINIAOD13.0', 'muPOGNANO_data13.0']]

_wfn.next()
################
#13.2 workflows
workflows[_wfn()] = ['NANOmc132X', ['TTBarMINIAOD13.2', 'NANO_mc13.2', 'HRV_NANO_mc']]
workflows[_wfn()] = ['muPOGNANO_mc13.2', ['TTBarMINIAOD13.2', 'muPOGNANO_mc13.2']]

_wfn.next()
################
Expand Down
20 changes: 17 additions & 3 deletions PhysicsTools/NanoAOD/plugins/MuonSpecialVariables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class MuonSpecialVariables : public edm::stream::EDProducer<> {
void setArbitratedTracker(pat::Muon &mu) const;
void setInnerTrackDxyz(pat::Muon &mu, const reco::Vertex &vtx) const;
void setTrkiso04(pat::Muon &mu, const std::vector<reco::Track> tracks) const;
void setTrkiso03(pat::Muon &mu, const std::vector<reco::Track> tracks) const;
void setNSegements(pat::Muon &mu) const;

private:
Expand Down Expand Up @@ -63,9 +64,21 @@ void MuonSpecialVariables::setTrkiso04(pat::Muon &mu, const std::vector<reco::Tr
continue;
energy += trk.pt();
}
float Trkiso04 = (energy - mu.pt()) / mu.pt();
float relTrkiso4 = (Trkiso04 > 0) ? Trkiso04 : 0;
mu.addUserFloat("relTrkiso4", relTrkiso4);
float Trkiso04 = (energy - mu.pt());
float absTrkiso04 = (Trkiso04 > 0) ? Trkiso04 : 0;
mu.addUserFloat("absTrkiso04", absTrkiso04);
}

void MuonSpecialVariables::setTrkiso03(pat::Muon &mu, const std::vector<reco::Track> tracks) const {
float energy = 0;
for (const auto &trk : tracks) {
if (deltaR(mu.eta(), mu.phi(), trk.eta(), trk.phi()) > 0.3)
continue;
energy += trk.pt();
}
float Trkiso03 = (energy - mu.pt());
float absTrkiso03 = (Trkiso03 > 0) ? Trkiso03 : 0;
mu.addUserFloat("absTrkiso03", absTrkiso03);
}

void MuonSpecialVariables::setNSegements(pat::Muon &mu) const {
Expand Down Expand Up @@ -109,6 +122,7 @@ void MuonSpecialVariables::produce(edm::Event &iEvent, const edm::EventSetup &iS
}
mu.addUserInt("isGoodVertex", good_vertex);
setTrkiso04(mu, *trkCollection);
setTrkiso03(mu, *trkCollection);
setNSegements(mu);
out->push_back(mu);
}
Expand Down
2 changes: 2 additions & 0 deletions PhysicsTools/NanoAOD/python/autoNANO.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def expandNanoMapping(seqList, mapping, key):
# L1 flavours: add tables through customize, supposed to be combined with PHYS
'L1' : {'customize': 'nanoL1TrigObjCustomize'},
'L1FULL' : {'customize': 'nanoL1TrigObjCustomizeFull'},
# Muon POG flavours : add tables through customize, supposed to be combined with PHYS
'MUPOG' : {'customize' : 'PhysicsTools/NanoAOD/custom_muon_cff.PrepMuonCustomNanoAOD'},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I think it would have been wiser for me to spot that @PHYS should be added by default here, if you are never going to ask --step NANO:@MUPOG alone (i.e not including the @PHYS part. we might need a quick PR for this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vlimant we were using always --step @phys+@MUPOG even in the relval_nano.py. I can make a quick PR to change this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in #44425

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please have a look at #44428 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @vlimant , I have posted a comment in #44428. The changes look fine to me. but please wait a little bit for other muon pog colleagues to confirm.

# MUDPG flavours: use their own sequence
'MUDPG' : {'sequence': 'DPGAnalysis/MuonTools/muNtupleProducer_cff.muDPGNanoProducer',
'customize': 'DPGAnalysis/MuonTools/muNtupleProducer_cff.muDPGNanoCustomize'},
Expand Down
Loading