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

Draft: Update cmssw 13 #40

Open
wants to merge 91 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
d865421
Porting DisappTrks repo to CMSSW_13_0_13
borzari Mar 7, 2024
e7aa701
Porting DisappTrks repo to CMSSW_13_0_13
borzari Mar 7, 2024
6c19eb3
Avoiding copies
borzari May 20, 2024
e94e178
cleanup and working TensorflowProducer
carriganm95 May 21, 2024
af5f969
Using 2022 muon/electron SFs in Run3
borzari Jun 3, 2024
13d4b15
updates for producing the L1ETM seeds
carriganm95 Jun 3, 2024
328fb93
Merge branch 'update_CMSSW_13' of github.com:OSU-CMS/DisappTrks into …
carriganm95 Jun 3, 2024
4737b84
Merge tag 'cmssw_13_0_13' into update_CMSSW_13
carriganm95 Jun 3, 2024
4705670
Merge branch 'master' into update
carriganm95 Jun 3, 2024
c69348f
Merge pull request #42 from OSU-CMS/update
carriganm95 Jun 3, 2024
b7d153a
updated background script for 2022, updates to create electron fiduci…
carriganm95 Jun 5, 2024
2b7046d
final fixes to background estimate
carriganm95 Jun 5, 2024
d2bdd6b
Merge pull request #43 from OSU-CMS/update_local
carriganm95 Jun 18, 2024
22fcfe9
working point for tensorflow update
carriganm95 Jun 18, 2024
662cdfe
Merge branch 'update_CMSSW_13' into updateTensorflowProducer
carriganm95 Jun 18, 2024
8743ced
Applying scale factors over MC histograms
borzari Jun 19, 2024
ea6c674
Updating METFilters for Run3
borzari Jul 4, 2024
cfd8a0d
Fix cutMetFilters and changing tau selections
borzari Jul 4, 2024
36544d7
update cuts for deep sets
carriganm95 Aug 15, 2024
86a6c5b
updates to run deep sets cuts
carriganm95 Aug 15, 2024
a7103ce
fix 2022 scale factors for leptons
carriganm95 Aug 15, 2024
39bbdf0
Merge pull request #45 from OSU-CMS/finalTensorflowMerge
carriganm95 Aug 15, 2024
285b801
Merge branch 'updateTensorflowProducer' of github.com:OSU-CMS/DisappT…
carriganm95 Aug 15, 2024
950208f
Adding tau iso cut to the tau selection
borzari Aug 19, 2024
e96350d
Update config_cfg.py
carriganm95 Aug 21, 2024
10a6751
Update miniAOD_124X_Samples.py
carriganm95 Aug 21, 2024
2e2ea3a
Delete StandardAnalysis/test/test_tensorflow_2022.py
carriganm95 Aug 21, 2024
18c897e
Delete StandardAnalysis/test/test_tensorflow_MC2022_cfg.py
carriganm95 Aug 21, 2024
fc4b457
Delete StandardAnalysis/plugins/TensorflowProducer.cc
carriganm95 Aug 21, 2024
c4a0138
Merge pull request #44 from OSU-CMS/updateTensorflowProducer
carriganm95 Aug 21, 2024
342c59d
updates to run limits in python3
carriganm95 Aug 22, 2024
c7e9d17
Adding trigger SFs
borzari Aug 23, 2024
2c2cfe8
Merge pull request #47 from OSU-CMS/limitPlots
carriganm95 Aug 23, 2024
e1bef13
updates to add fiducial maps
carriganm95 Aug 23, 2024
70d1f9e
add 2022 etm file
carriganm95 Aug 23, 2024
a34da89
Adding PU SFs
borzari Aug 24, 2024
d6fe30e
Merge pull request #48 from OSU-CMS/triggerSFs
borzari Aug 26, 2024
9509396
Merge pull request #49 from OSU-CMS/limitPlots
carriganm95 Aug 26, 2024
ac43a54
Updates for 2022 limit plots
borzari Aug 28, 2024
bcb0757
Updating scripts for run2 + run3 estimation
borzari Sep 2, 2024
aab6d5f
Fixing era arguments for run 3
borzari Sep 2, 2024
be74e18
Fix memory leak in EventJetVarProducer, fix fiducial maps in 2022
carriganm95 Sep 10, 2024
c2b7904
Merge pull request #50 from OSU-CMS/fixMemoryLeak
carriganm95 Sep 10, 2024
2f38bf9
Adding CRAB cfg file for signal yields
borzari Sep 12, 2024
e9c8fb9
Merge branch 'update_CMSSW_13' into signalLimits
borzari Sep 12, 2024
7436012
Changes for running limit setting with CRAB
borzari Sep 12, 2024
58bfdd3
Merge branch 'signalLimits' of https://github.com/OSU-CMS/DisappTrks …
borzari Sep 12, 2024
793627e
Adding if statement for 1200 mass
borzari Sep 16, 2024
effe94d
Merge pull request #51 from OSU-CMS/signalLimits
borzari Sep 16, 2024
e1f72ed
Adding files to plot ZToMuMuISR scale factor
borzari Sep 18, 2024
589eda5
Merge pull request #52 from OSU-CMS/ZToMuMuISRPlot
borzari Sep 18, 2024
c3a2c8a
add pt cut to ZtoEE selection
carriganm95 Sep 23, 2024
538dead
Merge pull request #54 from OSU-CMS/updateZtoEE
carriganm95 Sep 23, 2024
cf62f9a
Adding ZToMuMu ISR ratio plot
borzari Sep 26, 2024
ce9e1f1
Merge pull request #55 from OSU-CMS/ZToMuMuRatio
borzari Sep 27, 2024
1618063
updates to fix d0 plotting, also updates on 2022 fake track estimate,…
carriganm95 Oct 3, 2024
6b170b8
change sidebands back to default
carriganm95 Oct 3, 2024
946e7ab
Fixing track isolation cut
borzari Oct 4, 2024
9330623
Merge pull request #57 from OSU-CMS/trkIsoCutUpdate
borzari Oct 4, 2024
b55a618
Merge branch 'update_CMSSW_13' into fixD0Plots
carriganm95 Oct 9, 2024
8673755
Merge pull request #56 from OSU-CMS/fixD0Plots
carriganm95 Oct 9, 2024
92f2d48
Adding FileInPath to input files
borzari Oct 12, 2024
05fc4de
Merge pull request #58 from OSU-CMS/FileInPath
borzari Oct 15, 2024
afa167b
updates for 2022 backgrounds
carriganm95 Oct 16, 2024
ac169db
Merge branch 'update_CMSSW_13' into backgroundUpdates2022
carriganm95 Oct 16, 2024
962b0b5
Adding changes to MiniAOD only processing
borzari Oct 17, 2024
85c7add
Merge pull request #60 from OSU-CMS/MiniAODOnly
borzari Oct 18, 2024
df71030
Adding correct GTs for all early Run 3 data
borzari Oct 30, 2024
9479f51
Merge pull request #61 from OSU-CMS/addGTs
borzari Nov 1, 2024
51fb9ed
Adding macros for Run 3 AN plots
borzari Nov 12, 2024
eb5a8b7
add updates to run with preEE veto maps
carriganm95 Nov 14, 2024
45d00e8
Merge pull request #62 from OSU-CMS/includeANPlotMacros
borzari Nov 15, 2024
277eede
updates to move all configuration of year/era to customize
carriganm95 Nov 15, 2024
54ea741
Merge pull request #63 from OSU-CMS/updatePreEE
carriganm95 Nov 15, 2024
9686058
Merge pull request #59 from OSU-CMS/backgroundUpdates2022
carriganm95 Nov 15, 2024
4a5fe53
Changing jet ID selections to use common utils and selection changes
borzari Nov 19, 2024
2a0f000
Merge pull request #64 from OSU-CMS/jetID
borzari Nov 19, 2024
e950f62
adding ntuples file for run 3 datasets
carriganm95 Nov 22, 2024
4c740dc
updates to add jetVetoMap to cuts and change fiducial maps for 2022G era
carriganm95 Nov 25, 2024
54ef141
updated jetVetoMap cut
carriganm95 Nov 25, 2024
e86ceaa
remove jet veto map from jets since already in isoTrksCuts
carriganm95 Nov 25, 2024
33de87e
Changing muon trigger filter depending on era
borzari Nov 28, 2024
2587b69
Changing muon HLT filter to work with many channels
borzari Nov 29, 2024
85292ab
Fixing muon HLT filter
borzari Nov 29, 2024
63ccc75
Merge pull request #66 from OSU-CMS/chngRun3
borzari Nov 30, 2024
ed91db8
Merge branch 'update_CMSSW_13' into run3NTuples
carriganm95 Nov 30, 2024
676c109
merge with master, update 2022E fiducial maps
carriganm95 Nov 30, 2024
47771d9
Merge pull request #65 from OSU-CMS/run3NTuples
carriganm95 Dec 9, 2024
6d8a353
update l1ETM files
carriganm95 Dec 13, 2024
03a4f5a
update producer file
carriganm95 Dec 13, 2024
284ffcc
Merge pull request #69 from OSU-CMS/updateL1ETM
ryansantos1174 Dec 15, 2024
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
69,468 changes: 69,468 additions & 0 deletions BackgroundEstimation/data/2022F/l1ETM_2022.txt

Large diffs are not rendered by default.

25,640 changes: 25,640 additions & 0 deletions BackgroundEstimation/data/2022F/l1ETM_2022E.txt

Large diffs are not rendered by default.

33,628 changes: 33,628 additions & 0 deletions BackgroundEstimation/data/2022F/l1ETM_2022F.txt

Large diffs are not rendered by default.

10,200 changes: 10,200 additions & 0 deletions BackgroundEstimation/data/2022F/l1ETM_2022G.txt

Large diffs are not rendered by default.

33,628 changes: 33,628 additions & 0 deletions BackgroundEstimation/data/l1ETM_2022F.txt

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions BackgroundEstimation/plugins/EventL1ETMProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ EventL1ETMProducer<T>::beginRun (const edm::Run &run, const edm::EventSetup &set
template<class T> void
EventL1ETMProducer<T>::AddVariables (const edm::Event &event, const edm::EventSetup &setup)
{

edm::Handle<edm::TriggerResults> triggers;
event.getByToken (tokenTriggers_, triggers);

Expand Down Expand Up @@ -155,6 +156,8 @@ EventL1ETMProducer<T>::AddVariables (const edm::Event &event, const edm::EventSe
(*eventvariables)["passes_" + additionalFilters_.at (i)] = anatools::triggerObjectExists (event, *triggers, *triggerObjects, additionalCollections_.at (i), additionalFilters_.at (i));
}



template<class T> const string
EventL1ETMProducer<T>::tagCollectionParameter () const
{
Expand Down
40 changes: 29 additions & 11 deletions BackgroundEstimation/plugins/EventTPProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,12 @@ EventTPProducer<osu::Electron>::passesVeto (const osu::Track &probe) const
bool passes = probe.deltaRToClosestPFElectron () > 0.15
&& (probe.matchedCaloJetEmEnergy() + probe.matchedCaloJetHadEnergy()) < 10.0
&& probe.hitAndTOBDrop_bestTrackMissingOuterHits () >= 3.0;
#elif DATA_FORMAT == MINI_AOD_2022_CUSTOM // Verification Needed !
bool passes = probe.deltaRToClosestPFElectron () > 0.15
#elif DATA_FORMAT == MINI_AOD_2022_CUSTOM
bool passes = probe.deltaRToClosestElectron () > 0.15
&& probe.caloNewNoPUDRp5CentralCalo () < 10.0
&& probe.hitAndTOBDrop_bestTrackMissingOuterHits () >= 3.0;
#elif DATA_FORMAT == MINI_AOD_ONLY_2022_CUSTOM
bool passes = probe.deltaRToClosestElectron () > 0.15
&& (probe.matchedCaloJetEmEnergy() + probe.matchedCaloJetHadEnergy()) < 10.0
&& probe.hitAndTOBDrop_bestTrackMissingOuterHits () >= 3.0;
#else
Expand All @@ -392,7 +396,9 @@ EventTPProducer<osu::Electron>::passesLooseVeto (const osu::Track &probe) const
bool passes = probe.deltaRToClosestVetoElectron () > 0.15
#if DATA_FORMAT == MINI_AOD_2017
&& (probe.matchedCaloJetEmEnergy() + probe.matchedCaloJetHadEnergy()) < 10.0
#elif DATA_FORMAT == MINI_AOD_2022_CUSTOM // Verification Needed !
#elif DATA_FORMAT == MINI_AOD_2022_CUSTOM
&& probe.caloNewNoPUDRp5CentralCalo () < 10.0
#elif DATA_FORMAT == MINI_AOD_ONLY_2022_CUSTOM
&& (probe.matchedCaloJetEmEnergy() + probe.matchedCaloJetHadEnergy()) < 10.0
#else
&& probe.caloNewNoPUDRp5CentralCalo () < 10.0
Expand All @@ -404,7 +410,7 @@ EventTPProducer<osu::Electron>::passesLooseVeto (const osu::Track &probe) const
template<class T, class... Args> template<class T0> bool
EventTPProducer<T, Args...>::matchedToTag (const osu::Track &probe, const vector<T0> &tags) const
{
for (const auto tag : tags) {
for (const auto &tag : tags) {
if (deltaR (probe, tag) < probeTagMatchingDR_) return true;
}
return false;
Expand All @@ -416,8 +422,8 @@ EventTPProducer<osu::Muon>::passesVeto (const osu::Track &probe) const
#if DATA_FORMAT == MINI_AOD_2017
bool passes = probe.deltaRToClosestPFMuon () > 0.15
&& probe.hitAndTOBDrop_bestTrackMissingOuterHits () >= 3.0;
#elif DATA_FORMAT == MINI_AOD_2022 // Verification Needed !
bool passes = probe.deltaRToClosestPFMuon () > 0.15
#elif DATA_FORMAT == MINI_AOD_2022_CUSTOM || DATA_FORMAT == MINI_AOD_ONLY_2022_CUSTOM
bool passes = probe.deltaRToClosestMuon () > 0.15
&& probe.hitAndTOBDrop_bestTrackMissingOuterHits () >= 3.0;
#else
bool passes = probe.deltaRToClosestMuon () > 0.15
Expand All @@ -443,8 +449,13 @@ EventTPProducer<osu::Electron, osu::Tau>::passesVeto (const osu::Track &probe) c
&& probe.dRMinJet () > 0.5
&& (probe.matchedCaloJetEmEnergy() + probe.matchedCaloJetHadEnergy()) < 10.0
&& probe.hitAndTOBDrop_bestTrackMissingOuterHits () >= 3.0;
#elif DATA_FORMAT == MINI_AOD_2022_CUSTOM // Verification needed !
bool passes = probe.deltaRToClosestPFChHad () > 0.15
#elif DATA_FORMAT == MINI_AOD_2022_CUSTOM
bool passes = probe.deltaRToClosestTauHad () > 0.15
&& probe.dRMinJet () > 0.5
&& probe.caloNewNoPUDRp5CentralCalo () < 10.0
&& probe.hitAndTOBDrop_bestTrackMissingOuterHits () >= 3.0;
#elif DATA_FORMAT == MINI_AOD_ONLY_2022_CUSTOM
bool passes = probe.deltaRToClosestTauHad () > 0.15
&& probe.dRMinJet () > 0.5
&& (probe.matchedCaloJetEmEnergy() + probe.matchedCaloJetHadEnergy()) < 10.0
&& probe.hitAndTOBDrop_bestTrackMissingOuterHits () >= 3.0;
Expand All @@ -464,7 +475,9 @@ EventTPProducer<osu::Electron, osu::Tau>::passesLooseVeto (const osu::Track &pro
bool passes = probe.deltaRToClosestVetoElectron () > 0.15
#if DATA_FORMAT == MINI_AOD_2017
&& (probe.matchedCaloJetEmEnergy() + probe.matchedCaloJetHadEnergy()) < 10.0
#elif DATA_FORMAT == MINI_AOD_2022_CUSTOM //Verification needed
#elif DATA_FORMAT == MINI_AOD_2022_CUSTOM
&& probe.caloNewNoPUDRp5CentralCalo () < 10.0
#elif DATA_FORMAT == MINI_AOD_ONLY_2022_CUSTOM
&& (probe.matchedCaloJetEmEnergy() + probe.matchedCaloJetHadEnergy()) < 10.0
#else
&& probe.caloNewNoPUDRp5CentralCalo () < 10.0
Expand All @@ -481,8 +494,13 @@ EventTPProducer<osu::Muon, osu::Tau>::passesVeto (const osu::Track &probe) const
&& probe.dRMinJet () > 0.5
&& (probe.matchedCaloJetEmEnergy() + probe.matchedCaloJetHadEnergy()) < 10.0
&& probe.hitAndTOBDrop_bestTrackMissingOuterHits () >= 3.0;
#elif DATA_FORMAT == MINI_AOD_2022_CUSTOM //Verification needed
bool passes = probe.deltaRToClosestPFChHad () > 0.15
#elif DATA_FORMAT == MINI_AOD_2022_CUSTOM
bool passes = probe.deltaRToClosestTauHad () > 0.15
&& probe.dRMinJet () > 0.5
&& probe.caloNewNoPUDRp5CentralCalo () < 10.0
&& probe.hitAndTOBDrop_bestTrackMissingOuterHits () >= 3.0;
#elif DATA_FORMAT == MINI_AOD_ONLY_2022_CUSTOM
bool passes = probe.deltaRToClosestTauHad () > 0.15
&& probe.dRMinJet () > 0.5
&& (probe.matchedCaloJetEmEnergy() + probe.matchedCaloJetHadEnergy()) < 10.0
&& probe.hitAndTOBDrop_bestTrackMissingOuterHits () >= 3.0;
Expand Down
14 changes: 12 additions & 2 deletions BackgroundEstimation/python/ElectronTagProbeSelections.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
def createHitsVariations (ch, chName):
globals ().update (createChannelVariations (ch, chName, None, cutTrkNLayersVariations))
globals ().update (createChannelVariations (ch, chName, cutTrkNValidHitsSignal, cutTrkNValidHitsVariations))
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_"):
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_13_0_"):
replaceSingleCut (globals ()[chName + 'NHits3'].cuts, cutTrkNValidPixelHits[3], cutTrkNValidPixelHitsSignal)
replaceSingleCut (globals ()[chName + 'NLayers3'].cuts, cutTrkNValidPixelHits[3], cutTrkNValidPixelHitsSignal)

Expand All @@ -26,7 +26,7 @@ def createHitsVariations (ch, chName):
cutElectronTightID,
cutElectronTightPFIso,
]
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_"):
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_13_0_"):
tagElectronCuts = [
cutMetFilters,
cutElectronPt,
Expand Down Expand Up @@ -203,6 +203,10 @@ def createHitsVariations (ch, chName):
ElectronFiducialCalcBeforeInvestigate2018Ineff.name = cms.string("ElectronFiducialCalcBeforeInvestigate2018Ineff")
addCuts(ElectronFiducialCalcBeforeInvestigate2018Ineff.cuts, [cutTrkInvestigate2018Ineff])

ElectronDeepSetsBeforeOldCuts = copy.deepcopy(ElectronFiducialCalcBeforeOldCuts)
ElectronDeepSetsBeforeOldCuts.name = cms.string("ElectronDeepSetsBeforeOldCuts")
addCuts(ElectronDeepSetsBeforeOldCuts.cuts, [cutDeepSets])

ElectronFiducialCalcAfter = copy.deepcopy(ZtoEleProbeTrkWithZCuts)
ElectronFiducialCalcAfter.name = cms.string("ElectronFiducialCalcAfter")
addSingleCut(ElectronFiducialCalcAfter.cuts, cutTrkVetoElecVeto, cutEleTrkOS)
Expand All @@ -216,6 +220,10 @@ def createHitsVariations (ch, chName):
replaceSingleCut(ElectronFiducialCalcAfterOldCuts.cuts, cutTrkNValidPixelHits[3], cutTrkNValidPixelHitsSignal)
replaceSingleCut(ElectronFiducialCalcAfterOldCuts.cuts, cutTrkNValidHits[7], cutTrkNValidHitsSignal)

ElectronDeepSetsAfter = copy.deepcopy(ElectronFiducialCalcBeforeOldCuts)
ElectronDeepSetsAfter.name = cms.string("ElectronDeepSetsAfter")
addCuts(ElectronDeepSetsAfter.cuts, [cutTrkDeepSets])

ZtoEleDisTrk = copy.deepcopy(ZtoEleProbeTrkWithZCuts)
ZtoEleDisTrk.name = cms.string("ZtoEleDisTrk")
addSingleCut(ZtoEleDisTrk.cuts, cutTrkNMissOut, cutEleTrkOS)
Expand Down Expand Up @@ -256,6 +264,8 @@ def createHitsVariations (ch, chName):
createHitsVariations (ZtoEleProbeTrkWithSSFilter, "ZtoEleProbeTrkWithSSFilter")
createHitsVariations (ZtoEleProbeTrkWithLooseFilter, "ZtoEleProbeTrkWithLooseFilter")
createHitsVariations (ZtoEleProbeTrkWithLooseSSFilter, "ZtoEleProbeTrkWithLooseSSFilter")
createHitsVariations (ElectronTagPt35NoJetCuts, "ElectronTagPt35NoJetCuts")
createHitsVariations (ElectronTagPt35NoJetCutsMetTrig, "ElectronTagPt35NoJetCutsMetTrig")

# create copies of all above selections with the fiducial electron/muon cuts removed
for selection in list (locals ()):
Expand Down
4 changes: 2 additions & 2 deletions BackgroundEstimation/python/EventL1ETMProducer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def customizeForL1ETMProducer (producer):
print("# Unknown producer type! Cannot set collection for tag lepton.")
exit (1)

elif os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_"):
elif os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_13_0_"):
print("# Using 2022 MET trigger filters in EventL1ETMProducer_cfg.py...")

# The items in each vector correspond to the following triggers, in this order:
Expand All @@ -121,7 +121,7 @@ def customizeForL1ETMProducer (producer):
producer.additionalCollections = cms.vstring ()
producer.additionalFilters = cms.vstring ()

producer.l1Prescales = cms.FileInPath ("DisappTrks/BackgroundEstimation/data/l1ETM_2017.txt") #Should be fixed later
producer.l1Prescales = cms.FileInPath ("DisappTrks/BackgroundEstimation/data/l1ETM_2022.txt") #Should be fixed later

if producer.type_ () == "EventElectronL1ETMProducer":
producer.tagCollection = cms.string ("hltGtStage2Digis:EGamma:HLT")
Expand Down
2 changes: 1 addition & 1 deletion BackgroundEstimation/python/EventMETTriggerProducer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def customizeForMETTriggerProducer (producer):
producer.additionalCollections = cms.vstring(["hltTrk50Filter::HLT"] + [""] * 8)
producer.additionalFilters = cms.vstring(["hltTrk50Filter"] + [""] * 8)

elif os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_"):
elif os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_13_0_"):
print("# Using 2022 MET trigger filters in EventMETTriggerProducer_cfi.py...") #Should be fixed later

# Copied from AllTriggers.py, all triggers in the Grand Or selection
Expand Down
4 changes: 4 additions & 0 deletions BackgroundEstimation/python/FiducialMapCalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def FindHotSpots(self, beforeVeto, afterVeto):
self._meanInefficiency = meanInefficiency
self._stdDevInefficiency = stdDevInefficiency

print(f"Standard Dev of Inefficiency: {stdDevInefficiency}, nRegions: {nRegionsWithTag}")

# now find hot spots where the inefficiency is larger than the meanInefficiency by at least threshold * stdDevInefficiency

for xbin in range(1, efficiency.GetXaxis().GetNbins()):
Expand Down Expand Up @@ -265,6 +267,8 @@ def CompareFiducialMap(self):
existingMapName += '2017_data.root'
elif '2018' in self.Numerator["sample"]:
existingMapName += '2017_data.root' # doesn't exist yet, compare to 2017
elif '2022' in self.Numerator['sample']:
existingMapName += '2017_data.root' #doesn't exist yet, compare to 2017
existingMapFile = TFile(existingMapName, 'read')
existingMapDenominator = existingMapFile.Get('beforeVeto')
existingMapNumerator = existingMapFile.Get('afterVeto')
Expand Down
12 changes: 7 additions & 5 deletions BackgroundEstimation/python/MuonTagProbeSelections.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
def createHitsVariations (ch, chName):
globals ().update (createChannelVariations (ch, chName, None, cutTrkNLayersVariations))
globals ().update (createChannelVariations (ch, chName, cutTrkNValidHitsSignal, cutTrkNValidHitsVariations))
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_"):
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_13_0_"):
replaceSingleCut (globals ()[chName + 'NHits3'].cuts, cutTrkNValidPixelHits[3], cutTrkNValidPixelHitsSignal)
replaceSingleCut (globals ()[chName + 'NLayers3'].cuts, cutTrkNValidPixelHits[3], cutTrkNValidPixelHitsSignal)

Expand Down Expand Up @@ -190,7 +190,7 @@ def createHitsVariations (ch, chName):
removeCuts(MuonFiducialCalcBefore.cuts, [cutTrk2017LowEfficiencyRegion])
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_"):
removeCuts(MuonFiducialCalcBefore.cuts, [cutTrk2018LowEfficiencyRegion])
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_"):
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_13_0_"):
removeCuts(MuonFiducialCalcBefore.cuts, [cutTrkEcalo, cutMuonMatchToTrigObj, cutTrkIso]) #FIXME: Make sure this removal is okay


Expand All @@ -200,7 +200,7 @@ def createHitsVariations (ch, chName):

MuonFiducialCalcBeforeOldCuts = copy.deepcopy(MuonFiducialCalcBefore)
MuonFiducialCalcBeforeOldCuts.name = cms.string("MuonFiducialCalcBeforeOldCuts")
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_"):
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_13_0_"):
replaceSingleCut(MuonFiducialCalcBeforeOldCuts.cuts, cutTrkNValidPixelHits[3], cutTrkNValidPixelHitsSignal)
replaceSingleCut(MuonFiducialCalcBeforeOldCuts.cuts, cutTrkNValidHits[7], cutTrkNValidHitsSignal)

Expand All @@ -212,12 +212,12 @@ def createHitsVariations (ch, chName):
removeCuts(MuonFiducialCalcAfter.cuts, [cutTrk2017LowEfficiencyRegion])
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_"):
removeCuts(MuonFiducialCalcAfter.cuts, [cutTrk2018LowEfficiencyRegion])
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_"):
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_13_0_"):
removeCuts(MuonFiducialCalcAfter.cuts, [cutTrkEcalo, cutMuonMatchToTrigObj, cutTrkIso]) #FIXME: Make sure this removal is okay

MuonFiducialCalcAfterOldCuts = copy.deepcopy(MuonFiducialCalcAfter)
MuonFiducialCalcAfterOldCuts.name = cms.string("MuonFiducialCalcAfterOldCuts")
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_"):
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_13_0_"):
replaceSingleCut(MuonFiducialCalcAfterOldCuts.cuts, cutTrkNValidPixelHits[3], cutTrkNValidPixelHitsSignal)
replaceSingleCut(MuonFiducialCalcAfterOldCuts.cuts, cutTrkNValidHits[7], cutTrkNValidHitsSignal)

Expand Down Expand Up @@ -260,6 +260,8 @@ def createHitsVariations (ch, chName):
createHitsVariations (ZtoMuProbeTrkWithSSFilter, "ZtoMuProbeTrkWithSSFilter")
createHitsVariations (ZtoMuProbeTrkWithLooseFilter, "ZtoMuProbeTrkWithLooseFilter")
createHitsVariations (ZtoMuProbeTrkWithLooseSSFilter, "ZtoMuProbeTrkWithLooseSSFilter")
createHitsVariations (MuonTagPt35NoJetCuts, "MuonTagPt35NoJetCuts")
createHitsVariations (MuonTagPt35NoJetCutsMetTrig, "MuonTagPt35NoJetCutsMetTrig")

# create copies of all above selections with the fiducial electron/muon cuts removed
for selection in list (locals ()):
Expand Down
4 changes: 3 additions & 1 deletion BackgroundEstimation/python/TauTagProbeSelections.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def createHitsVariations (ch, chName):
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_"):
tagTauCuts.append(cutTauTightMVAIso)
else:
tagTauCuts.append(cutTauTightID)
tagTauCuts.append(cutTauTightPFIso)
addCuts(TauTagSkim.cuts, tagTauCuts)

################################################################################
Expand Down Expand Up @@ -325,6 +325,8 @@ def createHitsVariations (ch, chName):
createHitsVariations (ZtoTauToEleProbeTrkWithZCuts, "ZtoTauToEleProbeTrkWithZCuts")
createHitsVariations (ZtoTauToMuDisTrk, "ZtoTauToMuDisTrk")
createHitsVariations (ZtoTauToEleDisTrk, "ZtoTauToEleDisTrk")
createHitsVariations (TauTagPt55NoJetCuts, "TauTagPt55NoJetCuts")
createHitsVariations (TauTagPt55NoJetCutsMetTrig, "TauTagPt55NoJetCutsMetTrig")

# create copies of all above selections with the fiducial electron/muon cuts removed
for selection in list (locals ()):
Expand Down
5 changes: 3 additions & 2 deletions BackgroundEstimation/python/ZtoEESelections.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
def createHitsVariations (ch, chName):
globals ().update (createChannelVariations (ch, chName, None, cutTrkNLayersVariations))
globals ().update (createChannelVariations (ch, chName, cutTrkNValidHitsSignal, cutTrkNValidHitsVariations))
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_"):
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_13_0_"):
replaceSingleCut (globals ()[chName + 'NHits3'].cuts, cutTrkNValidPixelHits[3], cutTrkNValidPixelHitsSignal)
replaceSingleCut (globals ()[chName + 'NLayers3'].cuts, cutTrkNValidPixelHits[3], cutTrkNValidPixelHitsSignal)

Expand All @@ -30,7 +30,7 @@ def createHitsVariations (ch, chName):
cutEEInvMassZLo,
cutEEInvMassZHi,
]
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_"):
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_13_0_"):
zToEEElectronCuts = [
cutMetFilters,
cutElectronPairPt,
Expand All @@ -41,6 +41,7 @@ def createHitsVariations (ch, chName):
cutEEChargeProduct,
cutEEInvMassZLo,
cutEEInvMassZHi,
cutElectronPt,
]
addCuts(ZtoEE.cuts, zToEEElectronCuts)

Expand Down
2 changes: 1 addition & 1 deletion BackgroundEstimation/python/ZtoMuMuSelections.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
def createHitsVariations (ch, chName):
globals ().update (createChannelVariations (ch, chName, None, cutTrkNLayersVariations))
globals ().update (createChannelVariations (ch, chName, cutTrkNValidHitsSignal, cutTrkNValidHitsVariations))
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_"):
if os.environ["CMSSW_VERSION"].startswith ("CMSSW_9_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_10_2_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_12_4_") or os.environ["CMSSW_VERSION"].startswith ("CMSSW_13_0_"):
replaceSingleCut (globals ()[chName + 'NHits3'].cuts, cutTrkNValidPixelHits[3], cutTrkNValidPixelHitsSignal)
replaceSingleCut (globals ()[chName + 'NLayers3'].cuts, cutTrkNValidPixelHits[3], cutTrkNValidPixelHitsSignal)

Expand Down
Loading