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
|
import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
from Configuration.AlCa.GlobalTag import GlobalTag
options = VarParsing.VarParsing("analysis")
MODE_ANALYZE, MODE_REMAP = 0, 1
RECHITS, DIGIS, CLUSTERS = 1, 2, 3
dataSourceDic = { RECHITS : "ALCARECOTkAlMinBias", #"generalTracks",
DIGIS : "siStripDigis",
CLUSTERS: "siStripClusters" }
defaultAnylyzeMode = RECHITS #DIGIS # RECHITS
###################### OPTIONS HANDLER
options.register ("opMode",
MODE_ANALYZE,
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.int,
"Operation Mode")
options.register ("analyzeMode",
defaultAnylyzeMode,
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.int,
"Analyze Mode")
options.register ("eventLimit",
-1,
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.int,
"Limits Events Processed in Analyze Mode")
options.register ("inputRootFile",
"/store/express/Run2018D/StreamExpressAlignment/ALCARECO/TkAlMinBias-Express-v1/000/324/980/00000/00E8FB8F-D3AB-C442-BCC2-FEEAE63EA711.root",
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.string,
"Source Data File - either for analyze or remap")
options.register ("stripHistogram",
"TkHMap_NumberValidHits",
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.string,
"Strip Detector Histogram to Remap")
options.register ("src",
dataSourceDic[defaultAnylyzeMode],
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.string,
"Collection Source") #??
options.register ("globalTag", # option name
"auto:run2_data", # default value
VarParsing.VarParsing.multiplicity.singleton, # singleton or list
VarParsing.VarParsing.varType.string, # string, bool, int, or float
"Global Tag") # ? help ?
options.parseArguments()
######################
process = cms.Process("Demo")
if options.opMode == MODE_ANALYZE:
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.eventLimit) )
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
options.inputRootFile
)
)
runNumber = "Analyze"
elif options.opMode == MODE_REMAP:
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) )
process.source = cms.Source("EmptySource")
#run number deduction
runNumber = str(int(options.inputRootFile.split("_")[-1].split(".")[0][1:]))
process.demo = cms.EDAnalyzer('TrackerRemapper',
opMode = cms.int32(options.opMode),
analyzeMode = cms.int32(options.analyzeMode),
#stripRemapFile = cms.string(options.inputRootFile),
#stripHistogram = cms.string(options.stripHistogram),
#runString = cms.string(runNumber),
src = cms.InputTag(options.src),
)
process.p = cms.Path(process.demo)
process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag, "")
process.load("CalibTracker.SiStripCommon.TkDetMapESProducer_cfi")
#process.load("DQM.SiStripCommon.TkHistoMap_cff")
#process.TkDetMap = cms.Service("TkDetMap")
#process.SiStripDetInfoFileReader = cms.Service("SiStripDetInfoFileReader")
#### Add these lines to produce a tracker map
process.load("DQMServices.Core.DQMStore_cfg")
# Output root file name:
process.TFileService = cms.Service("TFileService", fileName = cms.string('outputStrip.root') )
|