-
Notifications
You must be signed in to change notification settings - Fork 4
/
windowNTuple_cfg.py
96 lines (72 loc) · 3.5 KB
/
windowNTuple_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
# coding: utf-8
"""
Test config to run the WindowInference plugin.
"""
import os
import subprocess
import FWCore.ParameterSet.Config as cms
from FWCore.ParameterSet.VarParsing import VarParsing
# # determine the location of _this_ file
# if "__file__" in globals():
# this_dir = os.path.dirname(os.path.abspath(__file__))
# else:
# this_dir = os.path.expandvars("$CMSSW_BASE/src/RecoHGCal/GraphReco/test")
# # ensure that the graph exists
# # if not, call the create_dummy_graph.py script in a subprocess since tensorflow complains
# # when its loaded twice (once here in python, once in c++)
# graph_path = os.path.join(this_dir, "graph.pb")
# if not os.path.exists(graph_path):
# script_path = os.path.join(this_dir, "create_dummy_graph.py")
# code = subprocess.call(["python", script_path, graph_path])
# if code != 0:
# raise Exception("create_dummy_graph.py failed")
# setup minimal options
options = VarParsing("python")
options.setDefault("inputFiles", "file://partGun_PDGid22_x96_Pt1.0To100.0_RECO_1.root")
options.setDefault('outputFile', 'file:windowntup.root')
options.parseArguments()
#this one has some tracks
# define the process to run for the Phase2 era
from Configuration.Eras.Era_Phase2C8_cff import Phase2C8
process = cms.Process("HGR", Phase2C8)
# standard sequences and modules
process.load("Configuration.StandardSequences.Services_cff")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.load("Configuration.Geometry.GeometryExtended2026D41Reco_cff")
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
process.load('Configuration.StandardSequences.MagneticField_cff')
process.load('Configuration.StandardSequences.RawToDigi_cff')
process.load('Configuration.StandardSequences.L1Reco_cff')
process.load('Configuration.StandardSequences.Reconstruction_cff')
process.load('Configuration.StandardSequences.RecoSim_cff')
process.load('Configuration.StandardSequences.EndOfProcess_cff')
process.load('Configuration.StandardSequences.Validation_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
#process.load("SimTracker.TrackAssociatorProducers.trackAssociatorByHits_cfi") #or this one? unclear!
# minimal configuration
process.MessageLogger.cerr.FwkReport.reportEvery = 1
process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(100))
process.source = cms.Source("PoolSource", fileNames=cms.untracked.vstring(options.inputFiles))
# global tag
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, "auto:phase2_realistic", "")
# process options
process.options = cms.untracked.PSet(
allowUnscheduled=cms.untracked.bool(True),
wantSummary=cms.untracked.bool(True),
)
process.TFileService = cms.Service("TFileService", fileName = cms.string(
options.__getattr__("outputFile", noTags=True)))
# load and configure the windowInference module
from RecoHGCal.GraphReco.windowNTupler_cfi import WindowNTupler
process.WindowNTupler = WindowNTupler.clone()
process.WindowNTuplerDefaultTruth = WindowNTupler.clone()
process.hgcSimTruth = cms.EDProducer("HGCTruthProducer",
)
process.WindowNTupler.simClusters = "hgcSimTruth"
process.WindowNTupler.nEtaSegments=cms.uint32(2)
process.WindowNTupler.nPhiSegments=cms.uint32(4)
process.hgcSimTruthSequence = cms.Sequence(process.hgcSimTruth)
process.dump=cms.EDAnalyzer('EventContentAnalyzer')
# define the path to run
process.p = cms.Path(process.hgcSimTruthSequence * process.WindowNTupler) # * process.WindowNTuplerDefaultTruth)