CMS 3D CMS Logo

testHGCalCellHitSum_cfg.py
Go to the documentation of this file.
1 
10 import FWCore.ParameterSet.Config as cms
11 import os, sys, imp, re
12 import FWCore.ParameterSet.VarParsing as VarParsing
13 
14 
16 options = VarParsing.VarParsing('standard')
17 options.register('geometry',
18  "D110",
19  VarParsing.VarParsing.multiplicity.singleton,
20  VarParsing.VarParsing.varType.string,
21  "geometry of operations: D105, D110, D114")
22 
23 options.register('layers',
24  "1",
25  VarParsing.VarParsing.multiplicity.singleton,
26  VarParsing.VarParsing.varType.string,
27  "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 in memory usage and ~50 times in file volume if 'all layers' option is applied.")
28 
29 options.register('type',
30  "mu",
31  VarParsing.VarParsing.multiplicity.singleton,
32  VarParsing.VarParsing.varType.string,
33  "type of operations: mu, tt")
34 
35 
36 options.parseArguments()
37 
38 import FWCore.ParameterSet.Config as cms
39 from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
40 process = cms.Process('HGCalCellHit',Phase2C17I13M9)
41 
42 print(options)
43 
44 
46 
47 loadFile = "Configuration.Geometry.GeometryExtendedRun4" + options.geometry + "Reco_cff"
48 inputFile = "file:step1" + options.geometry + options.type + ".root"
49 outputFile = "file:geantoutput" + options.geometry + options.type + ".root"
50 
51 if (options.geometry == "D105"):
52  geomFile = 'Validation/HGCalValidation/data/wafer_v16.csv'
53 elif (options.geometry == "D114"):
54  geomFile = 'Validation/HGCalValidation/data/wafer_v17.csv'
55 else:
56  geomFile = 'Validation/HGCalValidation/data/wafer_v17.csv'
57 
58 print("Geometry file: ", loadFile)
59 print("Wafer file: ", geomFile)
60 print("Input file: ", inputFile)
61 print("Output file: ", outputFile)
62 
63 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
64 process.load(loadFile)
65 process.load('FWCore.MessageService.MessageLogger_cfi')
66 process.MessageLogger.cerr.FwkReport.reportEvery = 100
67 if hasattr(process,'MessageLogger'):
68  process.MessageLogger.ValidHGCal=dict()
69 
70 process.load("IOMC.RandomEngine.IOMC_cff")
71 process.RandomNumberGeneratorService.generator.initialSeed = 456789
72 
73 process.source = cms.Source("PoolSource",
74  fileNames = cms.untracked.vstring(inputFile)
75 )
76 
77 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1))
78 
79 process.load('Validation.HGCalValidation.hgcalCellHitSum_cff')
80 
81 process.hgcalCellHitSumEE.geometryFileName = geomFile
82 process.hgcalCellHitSumHEF.geometryFileName = geomFile
83 process.hgcalCellHitSumHEB.geometryFileName = geomFile
84 
85 process.TFileService = cms.Service("TFileService",
86  fileName = cms.string(outputFile) )
87 
88 process.p = cms.Path(process.hgcalCellHitSumEE*process.hgcalCellHitSumHEF*process.hgcalCellHitSumHEB)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47