This repository has been archived by the owner on Jun 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
/
rechitanalysis2017_cfg.py
117 lines (98 loc) · 6.01 KB
/
rechitanalysis2017_cfg.py
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
import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
import os,sys
options = VarParsing.VarParsing('standard') # avoid the options: maxEvents, files, secondaryFiles, output, secondaryOutput because they are already defined in 'standard'
#Change the data folder appropriately to where you wish to access the files from:
options.register('dataFolder',
'./',
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.string,
'folder containing raw input')
options.register('runNumber',
106,
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.int,
'Input run to process')
options.register('outputFolder',
'./',
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.string,
'Output folder where analysis output are stored')
options.register('electronicMap',
'HGCal/CondObjects/data/map_CERN_Hexaboard_September_17Sensors_7EELayers_10FHLayers_V1.txt',
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.string,
'path to the electronic map')
# Available options:
# "HGCal/CondObjects/data/map_CERN_Hexaboard_July_6Layers.txt"
# "HGCal/CondObjects/data/map_CERN_Hexaboard_September_17Sensors_7EELayers_10FHLayers_V1.txt" # end of september
# "HGCal/CondObjects/data/map_CERN_Hexaboard_October_17Sensors_5EELayers_6FHLayers_V1.txt" # october 18-22, 1st conf
# "HGCal/CondObjects/data/map_CERN_Hexaboard_October_20Sensors_5EELayers_7FHLayers_V1.txt" # october 18-22, 2nd conf
options.register('hgcalLayout',
'HGCal/CondObjects/data/layerGeom_oct2017_h2_17layers.txt',
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.string,
'path to hgcal layout file')
# Available options:
# "HGCal/CondObjects/data/layerGeom_oct2017_h2_17layers.txt"
# "HGCal/CondObjects/data/layerGeom_oct2017_h6_17layers.txt"
# "HGCal/CondObjects/data/layerGeom_oct2017_h6_20layers.txt"
options.maxEvents = -1
options.output = "cmsswEvents_Cluster.root"
options.parseArguments()
print options
if not os.path.isdir(options.dataFolder):
sys.exit("Error: Data folder not found or inaccessible!")
################################
process = cms.Process("rechitanalysis")
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(options.maxEvents)
)
####################################
process.source = cms.Source("PoolSource",
fileNames=cms.untracked.vstring("file:%s/cmsswEvents_Run%d_RecHit.root"%(options.dataFolder,options.runNumber))
)
filename = options.outputFolder+"/HexaOutput_"+str(options.runNumber)+".root"
process.TFileService = cms.Service("TFileService",
fileName = cms.string(filename)
)
process.output = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string(options.output),
outputCommands = cms.untracked.vstring('drop *',
'keep *_*_HGCALTBRECHITS_*',
'keep *_*_HGCALTBCLUSTERS_*',
'keep *_*_HGCALTBCLUSTERS7_*',
'keep *_*_HGCALTBCLUSTERS19_*',
)
)
process.clusterproducer = cms.EDProducer("HGCalTBClusterProducer",
OutputCollectionName = cms.string('HGCALTBCLUSTERS'),
InputCollection = cms.InputTag('rechitproducer','HGCALTBRECHITS'),
ElectronicsMap = cms.untracked.string(options.electronicMap),
DetectorLayout=cms.untracked.string(options.hgcalLayout),
SensorSize=cms.untracked.int32(128),
runDynamicCluster = cms.untracked.bool(True),
runCluster7 = cms.untracked.bool(True),
runCluster19 = cms.untracked.bool(True),
minEnergy = cms.untracked.double(2.0),
)
process.rechitplotter = cms.EDAnalyzer("RecHitPlotter",
InputCollection=cms.InputTag("rechitproducer","HGCALTBRECHITS"),
ElectronicMap=cms.untracked.string(options.electronicMap),
DetectorLayout=cms.untracked.string(options.hgcalLayout),
SensorSize=cms.untracked.int32(128),
EventPlotter=cms.untracked.bool(True),
MipThreshold=cms.untracked.double(5.0),
NoiseThreshold=cms.untracked.double(2.0)
)
process.showeranalyzer = cms.EDAnalyzer("ShowerAnalyzer",
InputCollection=cms.InputTag("rechitproducer","HGCALTBRECHITS"),
InputClusterCollection=cms.InputTag("clusterproducer","HGCALTBCLUSTERS"),
InputCluster7Collection=cms.InputTag("clusterproducer","HGCALTBCLUSTERS7"),
InputCluster19Collection=cms.InputTag("clusterproducer","HGCALTBCLUSTERS19"),
DetectorLayout=cms.untracked.string(options.hgcalLayout),
SensorSize=cms.untracked.int32(128),
NoiseThreshold=cms.untracked.double(2.0)
)
process.p = cms.Path( process.clusterproducer*process.showeranalyzer )
process.end = cms.EndPath(process.output)