Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-02 00:53:35

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from PhysicsTools.NanoAOD.common_cff import *
0004 from DPGAnalysis.MuonTools.common_cff import *
0005 
0006 from DPGAnalysis.MuonTools.dtSegmentFlatTableProducer_cfi import dtSegmentFlatTableProducer
0007 
0008 dtSegmentFlatTable = dtSegmentFlatTableProducer.clone(
0009     name = "dtSegment",
0010     src =  "dt4DSegments",
0011     doc =  "DT segment information",
0012 
0013     variables = cms.PSet(
0014         seg4D_hasPhi = Var("hasPhi()", bool, doc = "has segment phi view - bool"),
0015         seg4D_hasZed = Var("hasZed()", bool, doc = "has segment zed view - bool"),
0016         seg4D_posLoc_x = Var("localPosition().x()", float, doc = "position x in local coordinates - cm"),
0017         seg4D_posLoc_y = Var("localPosition().y()", float, doc = "position y in local coordinates - cm"),
0018         seg4D_posLoc_z = Var("localPosition().z()", float, doc = "position z in local coordinates - cm"),
0019         seg4D_dirLoc_x = Var("localDirection().x()", float, doc = "direction x in local coordinates"),
0020         seg4D_dirLoc_y = Var("localDirection().y()", float, doc = "direction y in local coordinates"),
0021         seg4D_dirLoc_z = Var("localDirection().z()", float, doc = "direction z in local coordinates"),
0022 
0023         seg2D_phi_t0 = Var(f"? hasPhi() ? phiSegment().t0() : {defaults.FLOAT}", float, doc = "t0 from segments with phi view - ns"),
0024         seg2D_phi_nHits = Var(f"? hasPhi() ? phiSegment().specificRecHits().size() : 0", "int16", doc = "# hits in phi view - [0:8] range"),
0025         seg2D_phi_vDrift = Var(f"? hasPhi() ? phiSegment().vDrift() : {defaults.FLOAT_POS}", float, doc = "v_drift from segments with phi view"),
0026         seg2D_phi_normChi2 = Var(f"? hasPhi() ? (phiSegment().chi2() / phiSegment().degreesOfFreedom()) : {defaults.FLOAT_POS}", float, doc = "chi2/n.d.o.f. from segments with phi view"),
0027         
0028         seg2D_z_t0 = Var(f"? hasZed() ? zSegment().t0() : {defaults.FLOAT}", float, doc = "t0 from segments with z view - ns"),
0029         seg2D_z_nHits = Var(f"? hasZed() ? zSegment().specificRecHits().size() : 0", "int16", doc = "# hits in z view - [0:4] range"),
0030         seg2D_z_normChi2 = Var(f"? hasZed() ? (zSegment().chi2() / zSegment().degreesOfFreedom()) : {defaults.FLOAT_POS}", float, doc = "chi2/n.d.o.f. from segments with z view"),
0031     ),
0032 
0033     detIdVariables = cms.PSet(
0034         wheel = DetIdVar("wheel()", "int16", doc = "wheel  -  [-2:2] range"),
0035         sector = DetIdVar("sector()", "int16", doc = "sector - [1:14] range"
0036                                             "<br />sector 13 used for the second MB4 of sector 4"
0037                                             "<br />sector 14 used for the second MB4 of sector 10"),
0038         station = DetIdVar("station()", "int16", doc = "station - [1:4] range")
0039     ),
0040 
0041     globalPosVariables = cms.PSet(
0042         seg4D_posGlb_phi = GlobGeomVar("phi().value()", doc = "position phi in global coordinates - radians [-pi:pi]"),
0043         seg4D_posGlb_eta = GlobGeomVar("eta()", doc = "position eta in global coordinates"),
0044     ),
0045 
0046     globalDirVariables = cms.PSet(
0047         seg4D_dirGlb_phi = GlobGeomVar("phi().value()", doc = "direction phi in global coordinates - radians [-pi:pi]"),
0048         seg4D_dirGlb_eta = GlobGeomVar("eta()", doc = "direction eta in global coordinates"),
0049     )
0050 )
0051 
0052 from DPGAnalysis.MuonTools.muDTSegmentExtTableProducer_cfi import muDTSegmentExtTableProducer
0053 
0054 muDTSegmentExtTable = muDTSegmentExtTableProducer.clone()
0055 
0056 from DPGAnalysis.MuonTools.rpcRecHitFlatTableProducer_cfi import rpcRecHitFlatTableProducer
0057 
0058 rpcRecHitFlatTable = rpcRecHitFlatTableProducer.clone(
0059     name = "rpcRecHit",
0060     src = "rpcRecHits",
0061     doc =  "RPC rec-hit information",
0062 
0063     variables = cms.PSet(
0064         bx = Var("BunchX()", int, doc="bunch crossing number"),
0065         time = Var("time()", float, doc = "time information in ns"),
0066         firstClusterStrip = Var("firstClusterStrip()", "int16", doc = "lowest-numbered strip in the cluster"),
0067         clusterSize = Var("clusterSize()", "int16", doc = "number of strips in the cluster"),
0068         coordX = Var("localPosition().x()", float, doc = "position x in local coordinates - cm"),
0069         coordY = Var("localPosition().y()", float, doc = "position y in local coordinates - cm"),
0070         coordZ = Var("localPosition().z()", float, doc = "position z in local coordinates - cm"),
0071     ),
0072 
0073     detIdVariables = cms.PSet(
0074         region = DetIdVar("region()", "int16", doc = "0: barrel, +-1: endcap"),
0075         ring = DetIdVar("ring()", "int16", doc = "ring id:"
0076                                         "<br />wheel number in barrel (from -2 to +2)"
0077                                         "<br />ring number in endcap (from 1 to 3)"),
0078         station = DetIdVar("station()", "int16", doc = "chambers at same R in barrel, chambers at same Z ion endcap"),
0079         layer = DetIdVar("layer()", "int16", doc = "layer id:"
0080                                           "<br />in station 1 and 2 for barrel, we have two layers of chambers:"
0081                                           "<br />layer 1 is the inner chamber and layer 2 is the outer chamber"),
0082         sector = DetIdVar("sector()", "int16", doc = "group of chambers at same phi"),
0083         subsector = DetIdVar("subsector()", "int16", doc = "Some sectors are divided along the phi direction in subsectors "
0084                                                   "(from 1 to 4 in Barrel, from 1 to 6 in Endcap)"),
0085         roll = DetIdVar("roll()", "int16", doc = "roll id (also known as eta partition):"
0086                                         "<br />each chamber is divided along the strip direction"),
0087         rawId = DetIdVar("rawId()", "uint", doc = "unique detector unit ID")
0088     )
0089 )
0090 
0091 dtrpcPointFlatTable = rpcRecHitFlatTableProducer.clone(
0092     name = 'dtToRpc',
0093     src = cms.InputTag('rpcPointProducer','RPCDTExtrapolatedPoints'),
0094     doc = "DT extrapolated point on RPC",
0095 
0096     variables = cms.PSet(
0097         coordX = Var("localPosition().x()", float, doc = "position x in local coordinates - cm"),
0098         coordY = Var("localPosition().y()", float, doc = "position y in local coordinates - cm"),
0099         coordZ = Var("localPosition().z()", float, doc = "position z in local coordinates - cm"),
0100     ),
0101 
0102     detIdVariables = cms.PSet(
0103         region = DetIdVar("region()", "int16", doc = "0: barrel, +-1: endcap"),
0104         ring = DetIdVar("ring()", "int16", doc = "ring id:"
0105                                         "<br />wheel number in barrel (from -2 to +2)"
0106                                         "<br />ring number in endcap (from 1 to 3)"),
0107         station = DetIdVar("station()", "int16", doc = "chambers at same R in barrel, chambers at same Z ion endcap"),
0108         layer = DetIdVar("layer()", "int16", doc = "layer id:"
0109                                           "<br />in station 1 and 2 for barrel, we have two layers of chambers:"
0110                                           "<br />layer 1 is the inner chamber and layer 2 is the outer chamber"),
0111         sector = DetIdVar("sector()", "int16", doc = "group of chambers at same phi"),
0112         subsector = DetIdVar("subsector()", "int16", doc = "Some sectors are divided along the phi direction in subsectors "
0113                                                   "(from 1 to 4 in Barrel, from 1 to 6 in Endcap)"),
0114         roll = DetIdVar("roll()", "int16", doc = "roll id (also known as eta partition):"
0115                                         "<br />each chamber is divided along the strip direction"),
0116         rawId = DetIdVar("rawId()", "uint", doc = "unique detector unit ID")
0117     )
0118 )
0119 
0120 cscrpcPointFlatTable = rpcRecHitFlatTableProducer.clone(
0121     name = 'cscToRpc',
0122     src = cms.InputTag('rpcPointProducer','RPCCSCExtrapolatedPoints'),
0123     doc = "CSC segment extrapolated on RPC",
0124 
0125     variables = cms.PSet(
0126         coordX = Var("localPosition().x()", float, doc = "position x in local coordinates - cm"),
0127         coordY = Var("localPosition().y()", float, doc = "position y in local coordinates - cm"),
0128         coordZ = Var("localPosition().z()", float, doc = "position z in local coordinates - cm"),
0129     ),
0130 
0131     detIdVariables = cms.PSet(
0132         region = DetIdVar("region()", "int16", doc = "0: barrel, +-1: endcap"),
0133         ring = DetIdVar("ring()", "int16", doc = "ring id:"
0134                                         "<br />wheel number in barrel (from -2 to +2)"
0135                                         "<br />ring number in endcap (from 1 to 3)"),
0136         station = DetIdVar("station()", "int16", doc = "chambers at same R in barrel, chambers at same Z ion endcap"),
0137         layer = DetIdVar("layer()", "int16", doc = "layer id:"
0138                                           "<br />in station 1 and 2 for barrel, we have two layers of chambers:"
0139                                           "<br />layer 1 is the inner chamber and layer 2 is the outer chamber"),
0140         sector = DetIdVar("sector()", "int16", doc = "group of chambers at same phi"),
0141         subsector = DetIdVar("subsector()", "int16", doc = "Some sectors are divided along the phi direction in subsectors "
0142                                                   "(from 1 to 4 in Barrel, from 1 to 6 in Endcap)"),
0143         roll = DetIdVar("roll()", "int16", doc = "roll id (also known as eta partition):"
0144                                         "<br />each chamber is divided along the strip direction"),
0145         rawId = DetIdVar("rawId()", "uint", doc = "unique detector unit ID")
0146     )
0147 )
0148 
0149 from DPGAnalysis.MuonTools.gemRecHitFlatTableProducer_cfi import gemRecHitFlatTableProducer
0150 
0151 gemRecHitFlatTable = gemRecHitFlatTableProducer.clone(
0152     name = "gemRecHit",
0153     src = "gemRecHits",
0154     doc =  "GEM rec-hit information",
0155 
0156     variables = cms.PSet(
0157         bx = Var("BunchX()", int, doc="bunch crossing number"),
0158         clusterSize = Var("clusterSize()", "int16", doc = "number of strips in the cluster"),        loc_x = Var("localPosition().x()", float, doc = "hit position x in local coordinates - cm"),
0159         firstClusterStrip = Var("firstClusterStrip()", "int16", doc = "lowest-numbered strip in the cluster"),
0160         loc_phi = Var("localPosition().phi().value()", float, doc = "hit position phi in local coordinates - rad"),
0161         loc_y = Var("localPosition().y()", float, doc = "hit position y in local coordinates - cm"),
0162         loc_z = Var("localPosition().z()", float, doc = "hit position z in local coordinates - cm"),
0163     ),
0164 
0165     detIdVariables = cms.PSet(
0166         roll = DetIdVar("roll()", "int16", doc = "roll id, also known as eta partition:"
0167                                         "<br />(partitions numbered from 1 to 8)"),
0168         region = DetIdVar("region()", "int16", doc = "GE11 region where the hit is reconstructed"
0169                                             "<br />(int, positive endcap: +1, negative endcap: -1)"),
0170         chamber = DetIdVar("chamber()", "int16", doc = "GE11 superchamber where the hit is reconstructed"
0171                                               "<br />(chambers numbered from 0 to 35)"),
0172         layer = DetIdVar("layer()", "int16", doc = "GE11 layer where the hit is reconstructed"
0173                                           "<br />(layer1: 1, layer2: 2)")        
0174     ),
0175 
0176     globalPosVariables = cms.PSet(
0177         g_r = GlobGeomVar("perp()", doc = "hit position r in global coordinates - cm"),
0178         g_phi = GlobGeomVar("phi().value()", doc = "hit position phi in global coordinates -  radians [-pi:pi]"),
0179         g_x = GlobGeomVar("x()", doc = "hit position x in global coordinates - cm"),
0180         g_y = GlobGeomVar("y()", doc = "hit position y in global coordinates - cm"),
0181         g_z = GlobGeomVar("z()", doc = "hit position z in global coordinates - cm")
0182     )
0183 )
0184 
0185 from DPGAnalysis.MuonTools.gemSegmentFlatTableProducer_cfi import gemSegmentFlatTableProducer
0186 
0187 gemSegmentFlatTable = gemSegmentFlatTableProducer.clone(
0188     name = "gemSegment",
0189     src = "gemSegments",
0190     doc =  "GEM segment information",
0191 
0192     variables = cms.PSet(
0193         chi2 = Var("chi2()", int, doc = "chi2 from segment fit"),
0194         bx = Var("bunchX()", int, doc="bunch crossing number"),
0195         posLoc_x = Var("localPosition().x()", float, doc = "position x in local coordinates - cm"),
0196         posLoc_y = Var("localPosition().y()", float, doc = "position y in local coordinates - cm"),
0197         posLoc_z = Var("localPosition().z()", float, doc = "position z in local coordinates - cm"),
0198         dirLoc_x = Var("localDirection().x()", float, doc = "direction x in local coordinates"),
0199         dirLoc_y = Var("localDirection().y()", float, doc = "direction y in local coordinates"),
0200         dirLoc_z = Var("localDirection().z()", float, doc = "direction z in local coordinates"),
0201     ),
0202 
0203     detIdVariables = cms.PSet(
0204         region = DetIdVar("region()", "int16", doc = "GE11 region where the hit is reconstructed"
0205                                             "<br />(int, positive endcap: +1, negative endcap: -1)"),
0206         ring = DetIdVar("ring()", "int16", doc = ""),
0207         station = DetIdVar("station()", "int16", doc = "GEM station <br />(always 1 for GE1/1)"),
0208         chamber = DetIdVar("chamber()", "int16", doc = "GE11 superchamber where the hit is reconstructed"
0209                                               "<br />(chambers numbered from 0 to 35)")
0210     ),
0211     
0212     globalPosVariables = cms.PSet(
0213         posGlb_x = GlobGeomVar("x()", doc = "position x in global coordinates - cm"),
0214         posGlb_y = GlobGeomVar("y()", doc = "position y in global coordinates - cm"),
0215         posGlb_z = GlobGeomVar("z()", doc = "position z in global coordinates - cm"),
0216         posGlb_phi = GlobGeomVar("phi().value()", doc = "position phi in global coordinates - radians [-pi:pi]"),
0217         posGlb_eta = GlobGeomVar("eta()", doc = "position eta in global coordinates"),
0218     ),
0219 
0220     globalDirVariables = cms.PSet(
0221         dirGlb_phi = GlobGeomVar("phi().value()", doc = "direction phi in global coordinates - radians [-pi:pi]"),
0222         dirGlb_eta = GlobGeomVar("eta()", doc = "direction eta in global coordinates"),
0223     )
0224 )
0225 
0226 muLocalRecoTables = cms.Sequence(rpcRecHitFlatTable
0227                                  + dtrpcPointFlatTable
0228                                  + cscrpcPointFlatTable
0229                                  + gemRecHitFlatTable
0230                                  + dtSegmentFlatTable
0231                                  + muDTSegmentExtTable
0232                                  + gemSegmentFlatTable
0233                                 )