Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:59:27

0001 import glob
0002 import FWCore.ParameterSet.Config as cms
0003 import FWCore.ParameterSet.VarParsing as VarParsing
0004 options = VarParsing.VarParsing()
0005 
0006 ###################################################################
0007 # Setup 'standard' options
0008 ###################################################################
0009 
0010 options.register('OutFileName',
0011                  "test.root", # default value
0012                  VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0013                  VarParsing.VarParsing.varType.string, # string, int, or float
0014                  "name of the output file (test.root is default)")
0015 
0016 options.register('myGT',
0017                  "auto:run2_data", # default value
0018                  VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0019                  VarParsing.VarParsing.varType.string, # string, int, or float
0020                  "name of the input Global Tag")
0021 
0022 options.register('maxEvents',
0023                  -1,
0024                  VarParsing.VarParsing.multiplicity.singleton, # singleton or list                 
0025                  VarParsing.VarParsing.varType.int, # string, int, or float
0026                  "num. events to run")
0027 
0028 options.parseArguments()
0029 
0030 process = cms.Process("AlCaRECOAnalysis")
0031 
0032 ###################################################################
0033 # Message logger service
0034 ###################################################################
0035 process.load("FWCore.MessageService.MessageLogger_cfi")
0036 process.MessageLogger.cerr.FwkReport.reportEvery = 1
0037 
0038 ###################################################################
0039 # Geometry producer and standard includes
0040 ###################################################################
0041 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
0042 process.load("Configuration.StandardSequences.Services_cff")
0043 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0044 process.load('Configuration.StandardSequences.MagneticField_cff')
0045 #process.load("Configuration.StandardSequences.MagneticField_0T_cff")
0046 process.load("CondCore.CondDB.CondDB_cfi")
0047 
0048 ####################################################################
0049 # Get the GlogalTag
0050 ####################################################################
0051 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0052 from Configuration.AlCa.GlobalTag import GlobalTag
0053 process.GlobalTag = GlobalTag(process.GlobalTag,options.myGT, '')
0054 
0055 ###################################################################
0056 # Source
0057 ###################################################################
0058 readFiles = cms.untracked.vstring()
0059 readFiles.extend(['file:SiPixelCalSingleMuonTight.root'])
0060 #readFiles.extend(['file:SiPixelCalSingleMuonTight_fullDetId.root'])
0061 process.source = cms.Source("PoolSource",fileNames = readFiles)
0062 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(options.maxEvents))
0063 
0064 ###################################################################
0065 # The TrackRefitter
0066 ###################################################################
0067 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
0068 import RecoTracker.TrackProducer.TrackRefitters_cff
0069 process.TrackRefitter = process.TrackRefitterP5.clone(src = 'ALCARECOSiPixelCalSingleMuonTight',
0070                                                       TrajectoryInEvent = True,
0071                                                       TTRHBuilder = "WithAngleAndTemplate",
0072                                                       NavigationSchool = "",
0073                                                       )
0074 
0075 ###################################################################
0076 # The analysis module
0077 ###################################################################
0078 process.myanalysis = cms.EDAnalyzer("NearbyPixelClustersAnalyzer",
0079                                     trajectoryInput = cms.InputTag("TrackRefitter"),
0080                                     #skimmedGeometryPath = cms.string("CalibTracker/SiPixelESProducers/data/PixelSkimmedGeometry.txt")  # phase-0
0081                                     skimmedGeometryPath = cms.string("SLHCUpgradeSimulations/Geometry/data/PhaseI/PixelSkimmedGeometry_phase1.txt") #phase-1
0082                                     )
0083 
0084 ###################################################################
0085 # Output name
0086 ###################################################################
0087 process.TFileService = cms.Service("TFileService",
0088                                    fileName = cms.string(options.OutFileName))
0089 
0090 ###################################################################
0091 # Path
0092 ###################################################################
0093 process.p1 = cms.Path(process.offlineBeamSpot*
0094                       process.TrackRefitter*
0095                       process.myanalysis)