00001 import FWCore.ParameterSet.Config as cms
00002
00003
00004 L1GtPatternGenerator = cms.EDAnalyzer("L1GtPatternGenerator",
00005
00006 GtInputTag = cms.InputTag("gtDigis"),
00007 GmtInputTag = cms.InputTag("gmtDigis"),
00008 GctInputTag = cms.InputTag("gctDigis"),
00009 CscInputTag = cms.InputTag("gtDigis", "CSC"),
00010 DtInputTag = cms.InputTag("gtDigis", "DT"),
00011 RpcbInputTag = cms.InputTag("gtDigis", "RPCb"),
00012 RpcfInputTag = cms.InputTag("gtDigis", "RPCf"),
00013
00014
00015 PatternFileName = cms.string("GT_GMT_patterns.txt"),
00016
00017
00018 bx = cms.vint32(0),
00019
00020
00021 PatternFileHeader = cms.string(
00022 """#GT_GMT_patterns_VD
00023 #
00024 # editors - HB 220606
00025 #
00026 # remarks:
00027 # values in this template are for version VD (same as VB) for the cond-chips of GTL9U (from IVAN)
00028 #
00029 # syntax:
00030 # character "#" indicates a comment line
00031 # header line 1 => hardware of sim- and spy-memories
00032 # header line 2 => hardware location (FPGA-chip) of sim-memories
00033 # header line 3 => channel number of sim-memories (PSB)
00034 # header line 4 => hardware location (FPGA-chip) of spy-memories
00035 # header line 5 => name of patterns
00036 # header line 6 => number of objects (calos, muons) or other declarations
00037 # (header line 7 => only graphics)
00038 # (header line 8 => only text and graphics)
00039 # header line 9 => number of columns, starting with 0
00040 #
00041 # patterns:
00042 # values in column 0 are event numbers (decimal), starting with 0 (synchronisation data)
00043 # patterns for 1024 events (memories of cond-chips on GTL9U can contain only 1024 events) are in this file
00044 # values in columns 1-119 are the hexadecimal patterns, the rightmost digit in a string is LSB
00045 #
00046 # header:
00047 # e |<--------------------------------------------------------------------------PSB/GTL9U(REC)------------------------------------------------------------------------------------------------------------->|<--------------------------------------------------------------------------PSB/GMT(AUF,AUB)--------------------------------------------------------------------------------------------------------------------------------------------------->|<----------------------------------------------------------------GMT REGIONAL MUONs----------------------------------------------------------->|<----GMT(SORT)/GTL9U(REC)----->|<--------------GTL9U(COND)/FDL(ALGO)---------------->|<-----------FDL----------->|
00048 # v |PSB slot13/ch6+7 |PSB slot13/ch4+5 |PSB slot13/ch2+3 |PSB slot13/ch0+1 |PSB slot14/ch6+7 |PSB slot14/ch4+5 |PSB slot14/ch2+3 |PSB slot14/ch0+1 |PSB slot15/ch2+3 |PSB slot15/ch0+1 |PSB slot19/ch6+7 |PSB slot19/ch4+5 |PSB slot19/ch2+3 |PSB slot19/ch0+1 |PSB slot20/ch6+7 |PSB slot20/ch4+5 |PSB slot20/ch2+3 |PSB slot20/ch0+1 |PSB slot21/ch6+7 |PSB slot21/ch4+5 |PSB slot21/ch2+3 |PSB slot21/ch0+1 |GMT INF |GMT INC |GMT IND |GMT INB |GMT SORT |COND1 |COND2 |PSB slot9/ch0+1 |FINOR |
00049 # e |ch6 ch7 ch6 ch7 |ch4 ch5 ch4 ch5 |ch2 ch3 ch2 ch3 |ch0 ch1 ch0 ch1 |ch6 ch7 ch6 ch7 |ch4 ch5 ch4 ch5 |ch2 ch3 ch2 ch3 |ch0 ch1 ch0 ch1 |ch2 ch3 ch2 ch3 |ch0 ch1 ch0 ch1 |ch6 ch7 ch6 ch7 |ch4 ch5 ch4 ch5 |ch2 ch3 ch2 ch3 |ch0 ch1 ch0 ch1 |ch6 ch7 ch6 ch7 |ch4 ch5 ch4 ch5 |ch2 ch3 ch2 ch3 |ch0 ch1 ch0 ch1 |ch6 ch7 ch6 ch7 |ch4 ch5 ch4 ch5 |ch2 ch3 ch2 ch3 |ch0 ch1 ch0 ch1 | | | | | | | |ch0 ch1 ch0 ch1 | |
00050 # n |GTL9U REC1 |GTL9U REC1 |GTL9U REC2 |GTL9U REC2 |GTL9U REC2 |GTL9U REC2 |GTL9U REC3 |GTL9U REC3 |GTL9U REC3 |GTL9U REC3 |GMT AUF |GMT AUF |GMT AUB |GMT AUB |GMT AUF |GMT AUF |GMT AUB |GMT AUB |GMT AUF |GMT AUF |GMT AUB |GMT AUB | | | | |GTL9U REC1 |FDL ALGO |FDL ALGO |FDL ALGO | |
00051 # t |calo1 (ieg) |calo2 (eg) |calo3 (jet) |calo4 (fwdjet) |calo5 (tau) |calo6 (esums) |calo7 (hfbc/etsums)|calo8 (free) |calo9 (totem) |calo10 (free) |MQF4 |MQF3 |MQB2 |MQB1 |MQF8 |MQF7 |MQB6 |MQB5 |MQF12 |MQF11 |MQB10 |MQB9 |RPC forward |CSC |DT |RPC barrel |muon (sorted four) |algo |algo |techtrigger | |
00052 # | 1 2 3 4 | 1 2 3 4 | 1 2 3 4 | 1 2 3 4 | 1 2 3 4 | 1 2 3 4 | 1 2 3 4 | 1 2 3 4 | 1 2 3 4 | 1 2 3 4 |45M 45Q 6M 6Q |45M 45Q 6M 6Q |01M 01Q 23M 23Q |01M 01Q 23M 23Q |45M 45Q 6M 6Q |45M 45Q 6M 6Q |01M 01Q 23M 23Q |01M 01Q 23M 23Q |45M 45Q 6M 6Q |45M 45Q 6M 6Q |01M 01Q 23M 23Q |01M 01Q 23M 23Q | 1 2 3 4 | 1 2 3 4 | 1 2 3 4 | 1 2 3 4 | 1 2 3 4 |191--160 159--128 127---96|95----64 63----32 31-----0|15-0 47-32 31-16 63-48| |
00053 # | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
00054 # columns: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
00055 # 0 | 1 2 3 4 | 5 6 7 8 | 9 10 11 12 | 13 14 15 16 | 17 18 19 20 | 21 22 23 24 | 25 26 27 28 | 29 30 31 32 | 33 34 35 36 | 37 38 39 40 | 41 42 43 44 | 45 46 47 48 | 49 50 51 52 | 53 54 55 56 | 57 58 59 60 | 61 62 63 64 | 65 66 67 68 | 69 70 71 72 | 73 74 75 76 | 77 78 79 80 | 81 82 83 84 | 85 86 87 88 | 89 90 91 92 | 93 94 95 96 | 97 98 99 100 | 101 102 103 104 | 105 106 107 108 | 109 110 111 | 112 113 114 | 115 116 117 118|119 |
00056 """),
00057
00058
00059 PatternFileFooter = cms.string(""),
00060
00061
00062 PatternFileColumns = cms.vstring(),
00063
00064 PatternFileLengths = cms.vuint32(),
00065
00066 PatternFileDefaultValues = cms.vuint32(),
00067
00068
00069 DebugOutput = cms.bool(False)
00070 )
00071
00072 def addBlock(analyzer, name, count, length, default):
00073 for i in range(1,count+1):
00074 analyzer.PatternFileColumns.append("%s%d" % (name, i))
00075 analyzer.PatternFileLengths.append(length)
00076 analyzer.PatternFileDefaultValues.append(default)
00077
00078 def addPSB(analyzer, name):
00079 addBlock(analyzer, name, 4, 16, 0)
00080
00081
00082 def addRegionalMuons(analyzer, name):
00083
00084
00085 addBlock(analyzer, name, 4, 32, 0x0000ff00)
00086
00087 def addGMTMuons(analyzer, name):
00088 addBlock(analyzer, name, 4, 26, 0)
00089
00090
00091 fields = L1GtPatternGenerator.PatternFileColumns
00092 lengths = L1GtPatternGenerator.PatternFileLengths
00093 defaults = L1GtPatternGenerator.PatternFileDefaultValues
00094
00095
00096 for name in [ "gctIsoEm", "gctEm", "cenJet", "forJet", "tauJet" ]:
00097 addPSB(L1GtPatternGenerator, name)
00098
00099
00100
00101 fields += ["etTotal1", "etMiss1", "etHad1", "etMissPhi1"]
00102 lengths += [ 16, 16, 16, 16]
00103 defaults += [ 0, 0, 0, 0]
00104
00105
00106
00107 fields += [ "hfPsbValue1_l", "htMiss1", "hfPsbValue1_h", "unknown"]
00108 lengths += [ 16, 16, 16, 16]
00109 defaults += [ 0, 0, 0, 0]
00110
00111
00112 addPSB(L1GtPatternGenerator, "unknown")
00113
00114
00115 addPSB(L1GtPatternGenerator, "unknown")
00116
00117
00118
00119 addBlock(L1GtPatternGenerator, "unknown", 4, 16, 0xffff)
00120
00121
00122 for i in range(12):
00123 addPSB(L1GtPatternGenerator, "unknown")
00124
00125
00126 addRegionalMuons(L1GtPatternGenerator, "fwdMuon")
00127 addRegionalMuons(L1GtPatternGenerator, "cscMuon")
00128 addRegionalMuons(L1GtPatternGenerator, "dtMuon")
00129 addRegionalMuons(L1GtPatternGenerator, "brlMuon")
00130
00131
00132 addGMTMuons(L1GtPatternGenerator, "gmtMuon")
00133
00134
00135 addBlock(L1GtPatternGenerator, "gtDecisionExt", 2, 32, 0)
00136 addBlock(L1GtPatternGenerator, "gtDecision", 4, 32, 0)
00137
00138
00139
00140 fields += ["gtTechTrigger1_l", "gtTechTrigger2_l", "gtTechTrigger1_h", "gtTechTrigger2_h"]
00141 lengths += [ 16, 16, 16, 16]
00142 defaults += [ 0, 0, 0, 0]
00143
00144 fields += ["gtFinalOr"]
00145 lengths += [ 9]
00146 defaults += [ 0]
00147
00148
00149 if len(fields) != 119:
00150 raise ValueError("Expecting 119 data fields (120 - event number) in pattern file format, got %d!" % len(fields) )
00151
00152
00153
00154
00155