Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-04 02:55:17

0001 from __future__ import print_function
0002 import os
0003 import shlex, shutil, getpass
0004 #import subprocess
0005 
0006 import FWCore.ParameterSet.Config as cms
0007 
0008 process = cms.Process("SiPixelInclusiveBuilder")
0009 
0010 process.load("FWCore.MessageService.MessageLogger_cfi")
0011 process.MessageLogger.cerr.enable = False
0012 process.MessageLogger.cout = dict(enable = True, threshold = "WARNING")
0013 
0014 process.load("Configuration.StandardSequences.MagneticField_cff")
0015 
0016 #hptopo
0017 
0018 #process.load("Configuration.StandardSequences.GeometryIdeal_cff")
0019 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0020 from Configuration.AlCa.autoCond import autoCond
0021 process.GlobalTag.globaltag = autoCond['run2_design']
0022 print(process.GlobalTag.globaltag)
0023 process.load("Configuration.StandardSequences.GeometryDB_cff")
0024 
0025 #process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
0026 #process.load("CalibTracker.Configuration.TrackerAlignment.TrackerAlignment_Fake_cff")
0027 #process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi")
0028 #process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi")
0029 
0030 process.load("CondTools.SiPixel.SiPixelGainCalibrationService_cfi")
0031 process.load("CondCore.CondDB.CondDB_cfi")
0032 
0033 process.source = cms.Source("EmptyIOVSource",
0034     firstValue = cms.uint64(1),
0035     lastValue = cms.uint64(1),
0036     timetype = cms.string('runnumber'),
0037     interval = cms.uint64(1)
0038 )
0039 
0040 process.maxEvents = cms.untracked.PSet(
0041     input = cms.untracked.int32(1)
0042 )
0043 
0044 #to get the user running the process
0045 user = getpass.getuser()
0046 
0047 #try:
0048 #    user = os.environ["USER"]
0049 #except KeyError:
0050 #    user = subprocess.call('whoami')
0051 #    # user = commands.getoutput('whoami')
0052  
0053 #file = "/tmp/" + user + "/SiPixelLorentzAngle.db"
0054 file = "siPixelLorentzAngle.db"
0055 sqlfile = "sqlite_file:" + file
0056 print('\n-> Uploading as user %s into file %s, i.e. %s\n' % (user, file, sqlfile))
0057 
0058 #standard python libraries instead of spawn processes
0059 if(os.path.isfile('./'+file)):
0060     shutil.move("siPixelLorentzAngle.db", "siPixelLorentzAngle_old.db")
0061 #subprocess.call(["/bin/cp", "siPixelLorentzAngle.db", file])
0062 #subprocess.call(["/bin/mv", "siPixelLorentzAngle.db", "siPixelLorentzAngle.db"])
0063 
0064 ##### DATABASE CONNNECTION AND INPUT TAGS ######
0065 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0066     BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService'),
0067     DBParameters = cms.PSet(
0068         authenticationPath = cms.untracked.string('.'),
0069         connectionRetrialPeriod = cms.untracked.int32(10),
0070         idleConnectionCleanupPeriod = cms.untracked.int32(10),
0071         messageLevel = cms.untracked.int32(1),
0072         enablePoolAutomaticCleanUp = cms.untracked.bool(False),
0073         enableConnectionSharing = cms.untracked.bool(True),
0074         connectionRetrialTimeOut = cms.untracked.int32(60),
0075         connectionTimeOut = cms.untracked.int32(0),
0076         enableReadOnlySessionOnUpdateConnection = cms.untracked.bool(False)
0077     ),
0078     timetype = cms.untracked.string('runnumber'),
0079     connect = cms.string(sqlfile),
0080     toPut = cms.VPSet(
0081         cms.PSet(
0082             record = cms.string('SiPixelLorentzAngleRcd'),
0083             tag = cms.string('SiPixelLorentzAngle_2015_v2')
0084             #tag = cms.string('SiPixelLorentzAngle_v1')
0085         ),
0086         ###        cms.PSet(
0087         ###            record = cms.string('SiPixelLorentzAngleSimRcd'),
0088         ###            tag = cms.string('SiPixelLorentzAngleSim_v1')
0089         ###        ),
0090     )
0091 )
0092 
0093 ###### LORENTZ ANGLE OBJECT ######
0094 process.SiPixelLorentzAngle = cms.EDAnalyzer("SiPixelLorentzAngleDB",
0095     magneticField = cms.double(3.8),
0096     #in case of PSet
0097     BPixParameters = cms.untracked.VPSet(
0098         cms.PSet(
0099             layer = cms.uint32(1),
0100             module = cms.uint32(1),
0101             angle = cms.double(0.0862)
0102         ),
0103         cms.PSet(
0104             layer = cms.uint32(1),
0105             module = cms.uint32(2),
0106             angle = cms.double(0.0862)
0107         ),
0108         cms.PSet(
0109             layer = cms.uint32(1),
0110             module = cms.uint32(3),
0111             angle = cms.double(0.0862)
0112         ),
0113         cms.PSet(
0114             layer = cms.uint32(1),
0115             module = cms.uint32(4),
0116             angle = cms.double(0.0862)
0117         ),
0118         cms.PSet(
0119             layer = cms.uint32(1),
0120             module = cms.uint32(5),
0121             angle = cms.double(0.0883)
0122         ),
0123         cms.PSet(
0124             layer = cms.uint32(1),
0125             module = cms.uint32(6),
0126             angle = cms.double(0.0883)
0127         ),
0128         cms.PSet(
0129             layer = cms.uint32(1),
0130             module = cms.uint32(7),
0131             angle = cms.double(0.0883)
0132         ),
0133         cms.PSet(
0134             layer = cms.uint32(1),
0135             module = cms.uint32(8),
0136             angle = cms.double(0.0883)
0137         ),
0138         cms.PSet(
0139             layer = cms.uint32(2),
0140             module = cms.uint32(1),
0141             angle = cms.double(0.0848)
0142         ),
0143         cms.PSet(
0144             layer = cms.uint32(2),
0145             module = cms.uint32(2),
0146             angle = cms.double(0.0848)
0147         ),
0148         cms.PSet(
0149             layer = cms.uint32(2),
0150             module = cms.uint32(3),
0151             angle = cms.double(0.0848)
0152         ),
0153         cms.PSet(
0154             layer = cms.uint32(2),
0155             module = cms.uint32(4),
0156             angle = cms.double(0.0848)
0157         ),
0158         cms.PSet(
0159             layer = cms.uint32(2),
0160             module = cms.uint32(5),
0161             angle = cms.double(0.0892)
0162         ),
0163         cms.PSet(
0164             layer = cms.uint32(2),
0165             module = cms.uint32(6),
0166             angle = cms.double(0.0892)
0167         ),
0168         cms.PSet(
0169             layer = cms.uint32(2),
0170             module = cms.uint32(7),
0171             angle = cms.double(0.0892)
0172         ),
0173         cms.PSet(
0174             layer = cms.uint32(2),
0175             module = cms.uint32(8),
0176             angle = cms.double(0.0892)
0177         ),
0178         cms.PSet(
0179             layer = cms.uint32(3),
0180             module = cms.uint32(1),
0181             angle = cms.double(0.0851)
0182         ),
0183         cms.PSet(
0184             layer = cms.uint32(3),
0185             module = cms.uint32(2),
0186             angle = cms.double(0.0851)
0187         ),
0188         cms.PSet(
0189             layer = cms.uint32(3),
0190             module = cms.uint32(3),
0191             angle = cms.double(0.0851)
0192         ),
0193         cms.PSet(
0194             layer = cms.uint32(3),
0195             module = cms.uint32(4),
0196             angle = cms.double(0.0851)
0197         ),
0198         cms.PSet(
0199             layer = cms.uint32(3),
0200             module = cms.uint32(5),
0201             angle = cms.double(0.0877)
0202         ),
0203         cms.PSet(
0204             layer = cms.uint32(3),
0205             module = cms.uint32(6),
0206             angle = cms.double(0.0877)
0207         ),
0208         cms.PSet(
0209             layer = cms.uint32(3),
0210             module = cms.uint32(7),
0211             angle = cms.double(0.0877)
0212         ),
0213         cms.PSet(
0214             layer = cms.uint32(3),
0215             module = cms.uint32(8),
0216             angle = cms.double(0.0877)
0217         ),
0218     ),
0219     FPixParameters = cms.untracked.VPSet(
0220         cms.PSet(
0221             side = cms.uint32(1),
0222             disk = cms.uint32(1),
0223             HVgroup = cms.uint32(1),
0224             angle = cms.double(0.0714)
0225         ),
0226         cms.PSet(
0227             side = cms.uint32(1),
0228             disk = cms.uint32(2),
0229             HVgroup = cms.uint32(1),
0230             angle = cms.double(0.0714)
0231         ),
0232         cms.PSet(
0233             side = cms.uint32(2),
0234             disk = cms.uint32(1),
0235             HVgroup = cms.uint32(1),
0236             angle = cms.double(0.0713)
0237         ),
0238         cms.PSet(
0239             side = cms.uint32(2),
0240             disk = cms.uint32(2),
0241             HVgroup = cms.uint32(1),
0242             angle = cms.double(0.0713)
0243         ),
0244         cms.PSet(
0245             side = cms.uint32(1),
0246             disk = cms.uint32(1),
0247             HVgroup = cms.uint32(2),
0248             angle = cms.double(0.0643)
0249         ),
0250         cms.PSet(
0251             side = cms.uint32(1),
0252             disk = cms.uint32(2),
0253             HVgroup = cms.uint32(2),
0254             angle = cms.double(0.0643)
0255         ),
0256         cms.PSet(
0257             side = cms.uint32(2),
0258             disk = cms.uint32(1),
0259             HVgroup = cms.uint32(2),
0260             angle = cms.double(0.0643)
0261         ),
0262         cms.PSet(
0263             side = cms.uint32(2),
0264             disk = cms.uint32(2),
0265             HVgroup = cms.uint32(2),
0266             angle = cms.double(0.0643)
0267         ),
0268     ),
0269     ModuleParameters = cms.untracked.VPSet(
0270         cms.PSet(
0271             rawid = cms.uint32(302056472),
0272             angle = cms.double(0.0955)
0273         ),
0274         cms.PSet(
0275             rawid = cms.uint32(302056476),
0276             angle = cms.double(0.0955)
0277         ),
0278         cms.PSet(
0279             rawid = cms.uint32(302056212),
0280             angle = cms.double(0.0955)
0281         ),
0282         cms.PSet(
0283             rawid = cms.uint32(302055700),
0284             angle = cms.double(0.0955)
0285         ),
0286         cms.PSet(
0287             rawid = cms.uint32(302055708),
0288             angle = cms.double(0.0955)
0289         ),
0290         cms.PSet(
0291             rawid = cms.uint32(302060308),
0292             angle = cms.double(0.0955)
0293         ),
0294         cms.PSet(
0295             rawid = cms.uint32(302060312),
0296             angle = cms.double(0.0955)
0297         ),
0298         cms.PSet(
0299             rawid = cms.uint32(302059800),
0300             angle = cms.double(0.0955)
0301         ),
0302         cms.PSet(
0303             rawid = cms.uint32(302059548),
0304             angle = cms.double(0.0955)
0305         ),
0306         cms.PSet(
0307             rawid = cms.uint32(302123040),
0308             angle = cms.double(0.0955)
0309         ),
0310         cms.PSet(
0311             rawid = cms.uint32(302122772),
0312             angle = cms.double(0.0955)
0313         ),
0314         cms.PSet(
0315             rawid = cms.uint32(302122776),
0316             angle = cms.double(0.0955)
0317         ),
0318         cms.PSet(
0319             rawid = cms.uint32(302122516),
0320             angle = cms.double(0.0955)
0321         ),
0322         cms.PSet(
0323             rawid = cms.uint32(302122264),
0324             angle = cms.double(0.0955)
0325         ),
0326         cms.PSet(
0327             rawid = cms.uint32(302122272),
0328             angle = cms.double(0.0955)
0329         ),
0330         cms.PSet(
0331             rawid = cms.uint32(302122008),
0332             angle = cms.double(0.0955)
0333         ),
0334         cms.PSet(
0335             rawid = cms.uint32(302121752),
0336             angle = cms.double(0.0955)
0337         ),
0338         cms.PSet(
0339             rawid = cms.uint32(302121496),
0340             angle = cms.double(0.0955)
0341         ),
0342         cms.PSet(
0343             rawid = cms.uint32(302121240),
0344             angle = cms.double(0.0955)
0345         ),
0346         cms.PSet(
0347             rawid = cms.uint32(302121244),
0348             angle = cms.double(0.0955)
0349         ),
0350         cms.PSet(
0351             rawid = cms.uint32(302128920),
0352             angle = cms.double(0.0955)
0353         ),
0354         cms.PSet(
0355             rawid = cms.uint32(302128924),
0356             angle = cms.double(0.0955)
0357         ),
0358         cms.PSet(
0359             rawid = cms.uint32(302129176),
0360             angle = cms.double(0.0955)
0361         ),
0362         cms.PSet(
0363             rawid = cms.uint32(302129180),
0364             angle = cms.double(0.0955)
0365         ),
0366         cms.PSet(
0367             rawid = cms.uint32(302129184),
0368             angle = cms.double(0.0955)
0369         ),
0370         cms.PSet(
0371             rawid = cms.uint32(302128404),
0372             angle = cms.double(0.0955)
0373         ),
0374         cms.PSet(
0375             rawid = cms.uint32(302128408),
0376             angle = cms.double(0.0955)
0377         ),
0378         cms.PSet(
0379             rawid = cms.uint32(302189088),
0380             angle = cms.double(0.0955)
0381         ),
0382         cms.PSet(
0383             rawid = cms.uint32(302188820),
0384             angle = cms.double(0.0955)
0385         ),
0386         cms.PSet(
0387             rawid = cms.uint32(302188832),
0388             angle = cms.double(0.0955)
0389         ),
0390         cms.PSet(
0391             rawid = cms.uint32(302188052),
0392             angle = cms.double(0.0955)
0393         ),
0394         cms.PSet(
0395             rawid = cms.uint32(302187552),
0396             angle = cms.double(0.0955)
0397         ),
0398         cms.PSet(
0399             rawid = cms.uint32(302197784),
0400             angle = cms.double(0.0955)
0401         ),
0402         cms.PSet(
0403             rawid = cms.uint32(302197532),
0404             angle = cms.double(0.0955)
0405         ),
0406         cms.PSet(
0407             rawid = cms.uint32(302197536),
0408             angle = cms.double(0.0955)
0409         ),
0410         cms.PSet(
0411             rawid = cms.uint32(302197016),
0412             angle = cms.double(0.0955)
0413         ),
0414         cms.PSet(
0415             rawid = cms.uint32(302196244),
0416             angle = cms.double(0.0955)
0417         ),
0418         cms.PSet(
0419             rawid = cms.uint32(302195232),
0420             angle = cms.double(0.0955)
0421         ),
0422         cms.PSet(
0423             rawid = cms.uint32(302188824),
0424             angle = cms.double(0.0955)
0425         ),
0426         cms.PSet(
0427             rawid = cms.uint32(302186772),
0428             angle = cms.double(0.0955)
0429         ),
0430         cms.PSet(
0431             rawid = cms.uint32(302186784),
0432             angle = cms.double(0.0955)
0433         ),
0434         cms.PSet(
0435             rawid = cms.uint32(302121992),
0436             angle = cms.double(0.0955)
0437         ),
0438         cms.PSet(
0439             rawid = cms.uint32(302188552),
0440             angle = cms.double(0.0955)
0441         ),
0442         cms.PSet(
0443             rawid = cms.uint32(302187280),
0444             angle = cms.double(0.0955)
0445         ),
0446         cms.PSet(
0447             rawid = cms.uint32(302186768),
0448             angle = cms.double(0.0955)
0449         ),
0450         cms.PSet(
0451             rawid = cms.uint32(302186764),
0452             angle = cms.double(0.0955)
0453         ),
0454         cms.PSet(
0455             rawid = cms.uint32(302186756),
0456             angle = cms.double(0.0955)
0457         ),
0458         cms.PSet(
0459             rawid = cms.uint32(302197516),
0460             angle = cms.double(0.0955)
0461         ),
0462     ),
0463     #in case lorentz angle values for bpix should be read from file -> not implemented yet
0464     useFile = cms.bool(False),
0465     record = cms.untracked.string('SiPixelLorentzAngleRcd'),  
0466     fileName = cms.string('lorentzFit.txt') 
0467 )
0468 
0469 process.SiPixelLorentzAngleSim = cms.EDAnalyzer("SiPixelLorentzAngleDB",
0470     magneticField = cms.double(3.8),
0471     #in case lorentz angle values for bpix should be read from file -> not implemented yet
0472     useFile = cms.bool(False),
0473     record = cms.untracked.string('SiPixelLorentzAngleSimRcd'),
0474     fileName = cms.string('lorentzFit.txt') 
0475 )
0476 
0477 
0478 
0479 
0480 process.p = cms.Path(
0481 #    process.SiPixelLorentzAngleSim*
0482     process.SiPixelLorentzAngle
0483     )
0484