CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
pfMETCorrectionType0_cfi.py
Go to the documentation of this file.
2 
3 #--------------------------------------------------------------------------------
4 # select collection of "good" collision vertices
5 
6 selectedVerticesForPFMEtCorrType0 = cms.EDFilter("VertexSelector",
7  src = cms.InputTag('offlinePrimaryVertices'),
8  cut = cms.string("isValid & ndof >= 4 & chi2 > 0 & tracksSize > 0 & abs(z) < 24 & abs(position.Rho) < 2."),
9  filter = cms.bool(False)
10 )
11 
12 selectedPrimaryVertexHighestPtTrackSumForPFMEtCorrType0 = cms.EDFilter("PATSingleVertexSelector",
13  mode = cms.string('firstVertex'),
14  vertices = cms.InputTag('selectedVerticesForPFMEtCorrType0'),
15  filter = cms.bool(False)
16 )
17 #--------------------------------------------------------------------------------
18 
19 #--------------------------------------------------------------------------------
20 # association of PFCandidates to vertices
21 
22 from RecoParticleFlow.PFTracking.particleFlowDisplacedVertex_cfi import particleFlowDisplacedVertex
24 
25 from CommonTools.RecoUtils.pf_pu_assomap_cfi import Tracks2Vertex
26 trackToVertexAssociation = Tracks2Vertex.clone()
27 
28 from CommonTools.RecoUtils.pfcand_assomap_cfi import PFCandAssoMap
29 pfCandidateToVertexAssociation = PFCandAssoMap.clone(
30  VertexTrackAssociationMap = cms.InputTag('trackToVertexAssociation')
31 )
32 #--------------------------------------------------------------------------------
33 
34 #--------------------------------------------------------------------------------
35 # produce Type 0 MET corrections
36 
37 pfMETcorrType0 = cms.EDProducer("Type0PFMETcorrInputProducer",
38  srcPFCandidateToVertexAssociations = cms.InputTag('pfCandidateToVertexAssociation'),
39  srcHardScatterVertex = cms.InputTag('selectedPrimaryVertexHighestPtTrackSumForPFMEtCorrType0'),
40  correction = cms.PSet(
41  formula = cms.string("-([0] + [1]*x)*(1.0 + TMath::Erf(-[2]*TMath::Power(x, [3])))"),
42  par0 = cms.double(0.),
43  par1 = cms.double(-0.703151),
44  par2 = cms.double(0.0303531),
45  par3 = cms.double(0.909209)
46  ),
47  minDz = cms.double(0.2) # [cm], minimum distance required between pile-up vertices and "hard scatter" vertex
48 )
49 #--------------------------------------------------------------------------------
50 
51 type0PFMEtCorrectionPFCandToVertexAssociation = cms.Sequence(
52  selectedVerticesForPFMEtCorrType0
53  * selectedPrimaryVertexHighestPtTrackSumForPFMEtCorrType0
54  * particleFlowDisplacedVertex
55  * trackToVertexAssociation
56  * pfCandidateToVertexAssociation
57 )
58 
59 type0PFMEtCorrection = cms.Sequence(
60  type0PFMEtCorrectionPFCandToVertexAssociation
61  * pfMETcorrType0
62 )