Skip to content
Austin Belknap edited this page Jun 1, 2014 · 39 revisions

PAT Tuple Production

To request central production of a PAT tuple, please post a request on the Github issue tracker.

Finding PAT tuples

The PAT tuple production is tracked on the PAT Tuple Publications wiki page. Sometimes this page is out of date. You can search Tapas' HDFS directory with the following command:

find /hdfs/store/user/tapas -mindepth 2 -maxdepth 2 -type d | grep SEARCH_TERM

PAT Tuple Content

Skim

Before tuplization, the events are skimmed at the AOD level. The OR of the following requirements is applied:

  • One global muon with pt > 20 and eta < 2.4
  • One electron with pt > 20 and eta < 2.5
  • One global muon with pt > 14, eta < 2.4 and one tau pt > 18, eta < 2.3
  • One electron with pt > 17, eta < 2.5 and one tau pt > 18, eta < 2.3
  • One electron with pt > 17, eta < 2.5 and one tau pt > 18, eta < 2.3

PF Isolation

The PF isolation values (0.4) are available for electrons and muons via:

  • chargedHadronIso()
  • neutralHadronIso()
  • photonIso()
  • userIso(2) - pfPUChargedHadrons for applying the Delta Beta correction

The H2Tau analysis uses custom veto cones, defined at the H2Tau working twiki. You can get the H2Tau isolations by:

Electrons:

  • userIso(0) - all PF charged particles vetos: EB 0.01, EE 0.01
  • userIso(1) - PF photon isolation vetos: EE + EB 0.08
  • userIso(2) - PF PU isolation vetos: none (maybe this isn't right??)

Muons:

  • userIso(0) - all PF charged particles vetos: EB 0.001, EE 0.001

Note that you probably need to update your PAT tags in 42X to get the required version of DataFormats/PatCandidates.

For convenience, the fastjet energy is embedded in electrons and muons:

  • userFloat('rho') - uses determinstic Voronoi rho produced during tau ID
  • userFloat('zzRho') - uses ZZ recipe

Muons

Collection: cleanPatMuons

The following cut-based muon IDs are embedded:

  • userInt('WWID')
  • userInt('WWID2011')
  • userInt('VBTF')
  • userInt('tightID') - 2012 Muon POG recommendation

The WWID2011 is the same as defined in the UWAnalysis packages.

You can get a ref to to the associated PFMuon via:

  • pfCandidateRef(),

if this ref isNull(), there is no muon ID'd by PF.

The following IP information is embedded as userFloats:

  • ipDXY
  • dz
  • vz
  • ip3D
  • ip3DS - significance
  • tip
  • tipS - significance

The following systematics candidates are embedded (as userCands). The energy scale uncertainty is taken from the muon MuscleFit.

  • uncorr (no muon energy scale, same as pat::Muon p4)
  • corr (nominal ES correction)
  • mes- (down 1 sigma)
  • mes+ (up 1 sigma)

The closest PF patJet is available via the userCand('patJet') function. This ref may be null if the closest jet is farther than DR=0.5! The jet pt is stored as userFloat('jetPt'). If the jet doesn't exist, the "jet pt" is equal to the muon Pt. The distance to the jet is userFloat('jetDR').

Rochester Corrections

The following Rochester corrections for the pT are available:

  • userFloat("RochCor2012")
  • userFloat("RochCor2012_errUp")
  • userFloat("RochCor2012_errDown")

Roch2011A and Roch2011B are also available.

Electrons

Collection: cleanPatElectrons

The following electron IDs are embedded as userFloats:

  • wp80
  • wp90
  • wp95
  • WWID
  • MITID - the 2011 MVA ID by the MIT people

The loose MVA WP for the H2Tau analysis (e-mu) channel is available as:

  • userInt("mvaidwp")
The following 2012 electron MVA IDs (see EGamma ID Recipe.) and RECO IDs
are embedded as as eIDs:
  • cicTight --> eidTight
  • cicLoose --> eidLoose
  • cicMedium --> eidMedium
  • electronID('mvaNonTrigV0')
  • electronID('mvaTrigV0')

The following 2011 electron MVA ID related information is embedded:

  • userFloat("hasConversion") UPDATE: this has a bug, use userInt("HasMatchedConversion") instead.
  • userInt("missingHits") - number of missing hits
  • userFloat("idDZ") - dz used for MVA id
  • userFloat("MVA") - raw MVA value
  • userFloat("MVApreID") - pre-ID cuts used for the MVA
  • userFloat("MITID") - MIT MVA ID working point binary value

An MVA working point for the electron ID is embedded, again from the H2Tau 2012 twiki. The ID working point is based on the "NonTrig" MVA.

  • userInt('mvaidwp')

The following IP information is embedded as userFloats:

  • ipDXY
  • dz
  • vz
  • ip3D
  • ip3DS - significance
  • tip
  • tipS - significance

The following systematics candidates are embedded (as userCands). The electron energy scale uncertainty is currently configured to be 6% (I think this is a fixme)

  • uncorr (no muon energy scale)
  • ees- (down 1 sigma)
  • ees+ (up 1 sigma)

returns a reco::CandidatePtr pointing to a reco::GsfElectron.

Electron Regression and Calibration

In HZZ4L, the electrons include energy regression and calibration defined here: HZZ4L Electrons

To run them in the PAT-tuples, run the PAT-tuplization with eleReg=1. The relevant code that runs the regression and calibration is located here: PatTools/python/patTupleProduction

Photons for ɣ + X

The following ID's are implemented in the cleanPatPhotons, based on: https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedPhotonID2012

  • userInt('ConvSafeElectronVeto')
  • userFloat('SingleTowerHoE')
  • userFloat('SingleTowerHoEDepth1')
  • userFloat('SingleTowerHoEDepth2')
  • userInt('CBID_XXX')

Where XXX is one of "LOOSE","MEDIUM","TIGHT".

Photons for FSR recovery

A collection of pat::PFParticles appropriate for ZZ FSR recovery are stored as boostedFsrPhotons. The following isolations are implemented as userFloats.

  • fsrPhotonPFIsoChHad04
  • fsrPhotonPFIsoChHad04pt02
  • fsrPhotonPFIsoNHad04
  • fsrPhotonPFIsoPhoton04
  • fsrPhotonPFIsoChHadPU04
  • fsrPhotonPFIsoChHadPU04pt02
  • fsrPhotonPFIsoChHad03
  • fsrPhotonPFIsoChHad03pt02
  • fsrPhotonPFIsoNHad03
  • fsrPhotonPFIsoPhoton03
  • fsrPhotonPFIsoChHadPU03
  • fsrPhotonPFIsoChHadPU03pt02

Jets

Collection: selectedPatJets

The following jet IDs are embedded into the PFJets as userFloats. They correspond to the official PFJet IDs listed on the JetMET twiki.

  • idLoose
  • idMedium
  • idTight

The raw MVA-based PU jet IDs (see MVAMet) are embedded as:

  • userFloat('fullDiscriminant')
  • userFloat('philv1Discriminant')
  • userFloat('simpleDiscriminant')

and the integer working points as:

  • userInt('fullIdXXX')
  • userInt('philv1IdXXX')
  • userInt('simpleIdXXX')

where XXX is Loose, Medium or Tight.

Available b-tag discriminators:

  • jetBProbabilityBJetTagsAOD
  • jetProbabilityBJetTagsAOD
  • trackCountingHighPurBJetTagsAOD
  • trackCountingHighEffBJetTagsAOD
  • simpleSecondaryVertexNegativeBJetTagsAOD
  • simpleSecondaryVertexHighEffBJetTagsAOD
  • simpleSecondaryVertexHighPurBJetTagsAOD
  • combinedSecondaryVertexBJetTagsAOD
  • combinedSecondaryVertexMVABJetTagsAOD
  • softMuonBJetTagsAOD
  • softMuonByPtBJetTagsAOD
  • softMuonByIP3dBJetTagsAOD

Jet Corrections

The L1FastJet, L2Relative, L3Absolute corrections are applied to MC & Data. The L2L3Residual corrections are additionally applied to Data. Reference: IntroToJEC twiki.

In simulation, a smearing correction (see PAS JME-10-014) is additionally computed (but not applied by default) to correct the simulated jet energy resolution. The energy corrections are applied after the smearing is done.

The uncorrected, and 1 sigma uncertainties on the JEC are available from the pat::Jets via;

  • userCand("uncorr") - no corrections or smearing applied
  • userCand("smeared") - applying GEN-DATA resolution correction
  • userCand("smear+") - smear error up
  • userCand("smear-") - smear error down
  • userCand("jes+") - using the JES uncertainty from the CondDB
  • userCand("jes-") - using the JES uncertainty from the CondDB
  • userCand("ues+") - using the UES uncertainty of 10%
  • userCand("ues-") - using the UES uncertainty of 10%

Taus

Collection: cleanPatTaus

The taus are HPS PFTaus.

Discriminators

The standard complement of discriminators are available.

  • decayModeFinding
  • byVLooseIsolation
  • byLooseIsolation
  • byMediumIsolation
  • byTightIsolation
  • byVLooseIsolationDeltaBetaCorr
  • byLooseIsolationDeltaBetaCorr
  • byMediumIsolationDeltaBetaCorr
  • byTightIsolationDeltaBetaCorr
  • byVLooseCombinedIsolationDeltaBetaCorr
  • byLooseCombinedIsolationDeltaBetaCorr
  • byMediumCombinedIsolationDeltaBetaCorr
  • byTightCombinedIsolationDeltaBetaCorr
  • byCombinedIsolationDeltaBetaCorrRaw
  • againstElectronLoose
  • againstElectronMedium
  • againstElectronTight
  • againstElectronMVA
  • againstMuonLoose
  • againstMuonMedium
  • againstMuonTight
  • byIsolationMVAraw
  • byLooseIsolationMVA
  • byMediumIsolationMVA
  • byTightIsolationMVA
  • byIsolationMVA2raw
  • byLooseIsolationMVA2
  • byMediumIsolationMVA2
  • byTightIsolationMVA2
  • againstElectronMVA2raw
  • againstElectronMVA2category
  • againstElectronVLooseMVA2
  • againstElectronLooseMVA2
  • againstElectronMediumMVA2
  • againstElectronTightMVA2
  • byLooseCombinedIsolationDeltaBetaCorr3Hits
  • byMediumCombinedIsolationDeltaBetaCorr3Hits
  • byTightCombinedIsolationDeltaBetaCorr3Hits
  • byCombinedIsolationDeltaBetaCorrRaw3Hits
  • againstElectronMVA3raw
  • againstElectronMVA3category
  • againstElectronLooseMVA3
  • againstElectronMediumMVA3
  • againstElectronTightMVA3
  • againstElectronVTightMVA3
  • againstElectronDeadECAL
  • againstMuonLoose2
  • againstMuonMedium2
  • againstMuonTight2

The seed jets are available via the userCand('patJet') function. The corrected jet pt is stored as userFloat('jetPt'). This always exists, as taus are seeded by jets.

The following IP information is embedded as userFloats:

  • ipDXY
  • dz
  • vz
  • ip3D
  • ip3DS - significance
  • tip
  • tipS - significance

The following systematics candidates are embedded (as userCands). The tau energy scale uncertainty is currently configured to be 3%

  • uncorr (no tau energy scale)
  • tes- (down 1 sigma)
  • tes+ (up 1 sigma)

MET

Collection: systematicsMET

The following four-vector systematics are embedded as userCands:

  • userCand("type1") - Type 1 correct MET (jets only)
  • userCand("mes+") - Muon scale uncertainty
  • userCand("tes+") - Tau scale uncertainty
  • userCand("jes+") - Jet scale uncertainty
  • userCand("ues+") - Unclustered energy scale uncertainty

Charge conjugation is implied.

Generating PAT Tuples

Testing locally

You can run on a local file by doing:

 cd FinalStateAnalysis/PatTools/test
 ./patTuple_cfg.py isMC=0 globalTag=$datagt inputFiles=file:$dataAODFile maxEvents=1000 outputFile=myTestFile.root

Critical options:

globalTag
What global tag to use. For convenience, the environment variables $datagt and $mcgt are defined in environment.sh
isMC
Should be either 0 or 1 to specify data or simulation, respectively.

For quick test convenience, working AOD files for data and MC are set in the $dataAODFile and $mcAODFile variables.

CRAB submission

Build the crab submitters:

cd PatTools/test
python submit_tuplization_crab.py JOB_ID  

You can pass wildcards to --samples to submit only some samples. The wildcard matches the key name in MetaData/python/data{7,8}TeV.py

Example:

python submit_tuplization_crab.py JOB_ID  --samples "Zjets*" "WplusJets*"

Will create submissions for Zjets and WplusJets only.

The submit_tuplization_crab.py script will create a directory JOB_ID with a multicrab.cfg in it.

Now setup your grid stuff, submit the jobs, and say goodbye to your quota:

source /cms/sw/glite3_2_5/etc/profile.d/grid_env.sh
source /cms/sw/CRAB_2_8_1/crab.sh
multicrab -create 
multicrab -submit 

Helpful Tips

Resubmit Failed Jobs

ls /scratch/$USER/_DIRECTORY_/*/dags/dag.dag.status | xargs grep -lir ERR | sed -e "s|status|rescue001|" | xargs -I{} -n 1 farmoutAnalysisJobs --rescue-dag-file={}

Make a directory (and nested directories) readable/writable by CONDOR.

find . -type d  -exec fs setacl -dir '{}' -acl condor-hosts rlidkw \;