CMS 3D CMS Logo

testHGCalMTRecoStudy_cfg.py
Go to the documentation of this file.
1 
8 import FWCore.ParameterSet.Config as cms
9 import os, sys, imp, re
10 import FWCore.ParameterSet.VarParsing as VarParsing
11 
12 
15 
16 
17 options = VarParsing.VarParsing('standard')
18 options.register('geometry',
19  "D92",
20  VarParsing.VarParsing.multiplicity.singleton,
21  VarParsing.VarParsing.varType.string,
22  "geometry of operations: D88, D92, D93")
23 
24 options.register('layers',
25  "1",
26  VarParsing.VarParsing.multiplicity.singleton,
27  VarParsing.VarParsing.varType.string,
28  "For single layer use 'layers=3' (default is 'layers=1'); or for multiple layers use 'layers=1,27,41,46'; or for all layers use 'layers=1-47'. Note that the size may increase by ~10 times or more in RAM and filesize if 'all layers' option is used.")
29 
30 
31 options.parseArguments()
32 
33 import FWCore.ParameterSet.Config as cms
34 
35 print(options)
36 
37 
39 
40 fileInput = "file:step3.root"
41 
42 if (options.geometry == "D88"):
43  from Configuration.Eras.Era_Phase2C11I13M9_cff import Phase2C11I13M9
44  process = cms.Process('HGCalMTReco',Phase2C11I13M9)
45  process.load('Configuration.Geometry.GeometryExtended2026D88Reco_cff')
46  outputFile = 'file:recoutputD88.root'
47 elif (options.geometry == "D93"):
48  from Configuration.Eras.Era_Phase2C11I13M9_cff import Phase2C11I13M9
49  process = cms.Process('HGCalMTReco',Phase2C11I13M9)
50  process.load('Configuration.Geometry.GeometryExtended2026D93Reco_cff')
51  outputFile = 'file:recoutputD93.root'
52 elif (options.geometry == "D92"):
53  from Configuration.Eras.Era_Phase2C11I13M9_cff import Phase2C11I13M9
54  process = cms.Process('HGCalMTReco',Phase2C11I13M9)
55  process.load('Configuration.Geometry.GeometryExtended2026D92Reco_cff')
56  outputFile = 'file:recoutputD92.root'
57 else:
58  print("Please select a valid geometry version e.g. D88, D92, D93....")
59 
60 print("Input file: ", fileInput)
61 print("Output file: ", outputFile)
62 
63 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
64 process.load('Configuration.StandardSequences.MagneticField_cff')
65 process.load('Configuration.StandardSequences.Services_cff')
66 process.load('FWCore.MessageService.MessageLogger_cfi')
67 process.load('Configuration.EventContent.EventContent_cff')
68 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
69 from Configuration.AlCa.GlobalTag import GlobalTag
70 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T21', '')
71 
72 process.MessageLogger.cerr.FwkReport.reportEvery = 100
73 
74 process.source = cms.Source("PoolSource",
75  dropDescendantsOfDroppedBranches = cms.untracked.bool(False),
76  fileNames = cms.untracked.vstring(fileInput),
77  inputCommands = cms.untracked.vstring(
78  'keep *',
79  'drop l1tTkPrimaryVertexs_L1TkPrimaryVertex__*' # This is to skip this branch causing issue in D88 reco files with older CMSSW <= 12_4_0-pre4
80  ),
81  secondaryFileNames = cms.untracked.vstring()
82 )
83 
84 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) )
85 
86 process.load('Validation.HGCalValidation.hgcalMTRecoStudy_cfi')
87 
88 process.hgcalMTRecoStudyEE = process.hgcalMTRecoStudy.clone(detectorName = 'HGCalEESensitive',
89  source = 'HGCalRecHit:HGCEERecHits',
90  layerList = options.layers
91  )
92 
93 process.hgcalMTRecoStudyFH = process.hgcalMTRecoStudy.clone(detectorName = 'HGCalHESiliconSensitive',
94  source = 'HGCalRecHit:HGCHEFRecHits',
95  layerList = options.layers
96  )
97 
98 process.hgcalMTRecoStudyBH = process.hgcalMTRecoStudy.clone( detectorName = 'HGCalHEScintillatorSensitive',
99  source = 'HGCalRecHit:HGCHEBRecHits',
100  layerList = options.layers
101  )
102 
103 process.TFileService = cms.Service("TFileService",
104  fileName = cms.string(outputFile),
105  closeFileFast = cms.untracked.bool(True))
106 
107 process.p = cms.Path(process.hgcalMTRecoStudyEE+process.hgcalMTRecoStudyFH+process.hgcalMTRecoStudyBH)
108 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47