CMS 3D CMS Logo

protons_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
3 from PhysicsTools.NanoAOD.genProtonTable_cfi import genProtonTable as _genproton
4 from PhysicsTools.NanoAOD.simpleProtonTrackFlatTableProducer_cfi import simpleProtonTrackFlatTableProducer
5 
6 singleRPProtons = True
7 
8 protonTable = cms.EDProducer("ProtonProducer",
9  tagRecoProtonsSingle = cms.InputTag("ctppsProtons", "singleRP"),
10  tagRecoProtonsMulti = cms.InputTag("ctppsProtons", "multiRP"),
11  tagTrackLite = cms.InputTag("ctppsLocalTrackLiteProducer"),
12  storeSingleRPProtons = cms.bool(singleRPProtons)
13 )
14 
15 multiRPTable = simpleProtonTrackFlatTableProducer.clone(
16  src = cms.InputTag("ctppsProtons","multiRP"),
17  name = cms.string("Proton_multiRP"),
18  doc = cms.string("bon"),
19  skipNonExistingSrc = cms.bool(True),#is this safe?
20  variables = cms.PSet(
21  xi = Var("xi",float,doc="xi or dp/p",precision=12),
22  thetaX = Var("thetaX",float,doc="theta x",precision=13),
23  thetaY = Var("thetaY",float,doc="theta y",precision=13),
24  t = Var("t",float,doc="Mandelstam variable t",precision=13),
25  time = Var("time()",float,doc="time",precision=16),
26  timeUnc = Var("timeError",float,doc="time uncertainty",precision=13),
27  ),
28  externalVariables = cms.PSet(
29  arm = ExtVar("protonTable:arm",int,doc="0 = sector45, 1 = sector56"),
30  ),
31 )
32 
33 singleRPTable = simpleProtonTrackFlatTableProducer.clone(
34  src = cms.InputTag("ctppsProtons","singleRP"),
35  name = cms.string("Proton_singleRP"),
36  doc = cms.string("bon"),
37  skipNonExistingSrc = cms.bool(True),#is this safe?
38  variables = cms.PSet(
39  xi = Var("xi",float,doc="xi or dp/p",precision=12),
40  thetaY = Var("thetaY",float,doc="th y",precision=10),
41  ),
42  externalVariables = cms.PSet(
43  decRPId = ExtVar("protonTable:protonRPId",int,doc="Detector ID",precision=8),
44  ),
45 )
46 
47 protonTablesTask = cms.Task(protonTable,multiRPTable)
48 if singleRPProtons: protonTablesTask.add(singleRPTable)
49 
50 # GEN-level signal/PU protons collection
51 genProtonTable = _genproton.clone(
52  cut = cms.string('(pdgId == 2212) && (abs(pz) > 5200) && (abs(pz) < 6467.5)') # xi in [0.015, 0.2]
53 )
54 
55 genProtonTablesTask = cms.Task(genProtonTable)
def ExtVar(tag, valtype, doc=None, precision=-1)
Definition: common_cff.py:27
def Var(expr, valtype, doc=None, precision=-1)
Definition: common_cff.py:16