<jupyter_start><jupyter_text>Adding tag variables to NanoAODstuff<jupyter_code>import FWCore.ParameterSet.Config as cms
from Configuration.StandardSequences.Eras import eras
process = cms.Process("USER",eras.Run2_2017)

## Load services
process.load("Configuration.Geometry.GeometryRecoDB_cff")
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
process.load("Configuration.StandardSequences.MagneticField_cff")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 10
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc')

##Inputs
#Source
process.source = cms.Source(
    "PoolSource",
    fileNames = cms.untracked.vstring(
        'root://xrootd-cms.infn.it//store/relval/CMSSW_9_2_7/RelValTTbarLepton_13/'
        'MINIAODSIM/PU25ns_92X_upgrade2017_realistic_v7-v1/00000/'
        '4E285340-6471-E711-AF0C-0025905B85F6.root'
    )
)

#Events to run
process.maxEvents = cms.untracked.PSet( 
    input = cms.untracked.int32(100) 
)

#Long summary
process.options = cms.untracked.PSet( 
    wantSummary = cms.untracked.bool(True) 
)<jupyter_output><empty_output><jupyter_text>Re-making jets<jupyter_code>#################################################
## Remake jets
#################################################

## Filter out neutrinos from packed GenParticles
process.packedGenParticlesForJetsNoNu = cms.EDFilter(
    "CandPtrSelector", 
    src = cms.InputTag("packedGenParticles"), 
    cut = cms.string("abs(pdgId) != 12 && abs(pdgId) != 14 && abs(pdgId) != 16")
)

## Define GenJets
from RecoJets.JetProducers.ak4GenJets_cfi import ak4GenJets
process.ak4GenJetsNoNu = ak4GenJets.clone(
    src = 'packedGenParticlesForJetsNoNu'
)

## Select charged hadron subtracted packed PF candidates
process.pfCHS = cms.EDFilter(
    "CandPtrSelector", 
    src = cms.InputTag("packedPFCandidates"), 
    cut = cms.string("fromPV")
)

from RecoJets.JetProducers.ak4PFJets_cfi import ak4PFJets
## Define PFJetsCHS
process.ak4PFJetsCHS = ak4PFJets.clone(
    src = 'pfCHS', 
    doAreaFastjet = True
)<jupyter_output><empty_output><jupyter_text>Making PAT jetsThe following part produces the `pat::Jet` collection out of the newly created `reco::Jet` collection. As for the previous exercise, we will use a PAT tool modifier: `switchJetCollection`. You can view all its options as usual.<jupyter_code>from PhysicsTools.PatAlgos.tools.jetTools import switchJetCollection
print switchJetCollection.__doc__
for par_name, par in switchJetCollection._parameters.iteritems():
    print '   - %s:  %s' % (par_name, par.description)<jupyter_output><empty_output><jupyter_text>We want to make a new pat jet collection from the jet collection we just created, and add the following discriminators: CSVv2, cMVAv2, and DeepCSV. Please fill the following code<jupyter_code>## b-tag discriminators
bTagDiscriminators = [
    #
    # PUT THE DISCRIMINATORS HERE
    #
]

## Switch the default PAT jet collection to the above-defined ak4PFJetsCHS
#
# REPLACE THE FIXME!
# 
FIXME = 'FIXME' #this is just here to avoid python to raise an exception
switchJetCollection(
    process,
    jetSource = FIXME,
    pvSource = FIXME,
    pfCandidates = FIXME,
    svSource = FIXME,
    muSource = FIXME,
    elSource = FIXME,
    btagDiscriminators = bTagDiscriminators,
    jetCorrections = ('AK4PFchs', ['L1FastJet', 'L2Relative', 'L3Absolute'], 'None'),
    genJetCollection = FIXME,
    genParticles = FIXME
)
getattr(process,'selectedPatJets').cut = cms.string('pt > 10')   # to match the selection for slimmedJets in MiniAOD<jupyter_output><empty_output><jupyter_text>What is this needed for?<jupyter_code>from PhysicsTools.PatAlgos.tools.pfTools import adaptPVs
## Adapt primary vertex collection
adaptPVs(
    process, 
    pvCollection=cms.InputTag('offlineSlimmedPrimaryVertices')
)<jupyter_output><empty_output><jupyter_text>Now, set the output. Please note the use of the `Task`, which allows the configuration file to run smoothly in the unscheduled mode<jupyter_code>#output
process.out = cms.OutputModule(
    "PoolOutputModule",
    fileName = cms.untracked.string('recluster_jets.root'),
    ## save only events passing the full path
    #SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('p') ),
    outputCommands = cms.untracked.vstring(
        'drop *', ## Do not keep anything
        'keep *_slimmedJets_*_*', 
        'keep *_selectedPatJets_*_*', 
    )
)

#
# ADD YOUR CODE HERE!
#
process.outpath = cms.EndPath(process.out, patAlgosToolsTask)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12216706237858839, 'fraction_numerical': 0.01748327217785452, 'mean_word_length': 5.186915887850467, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '61211', 'license': 'Apache-2.0', 'n_tokens_mistral': 1628, 'n_tokens_neox': 1538, 'n_words': 332, 'path': 'test/tagVarAdd.ipynb', 'repo_name': 'NJManganelli/FourTopNAOD', 'size': '4633'}