Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-25 02:29:11

0001 
0002 ## adapted from produceCalibrationTree_template_cfg.py
0003 
0004 import FWCore.ParameterSet.Config as cms
0005 ##from CalibTracker.SiStripCommon.shallowTree_test_template import * ## TODO get rid of this one
0006 
0007 process = cms.Process('CALIB')
0008 process.load('Configuration/StandardSequences/MagneticField_cff')
0009 process.load('Configuration.Geometry.GeometryRecoDB_cff')
0010 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0011 
0012 from Configuration.AlCa.GlobalTag import GlobalTag
0013 process.GlobalTag = GlobalTag(process.GlobalTag, "auto:run3_data_PromptAnalysis")
0014 
0015 process.load('FWCore.MessageService.MessageLogger_cfi')
0016 process.load('Configuration.StandardSequences.Services_cff')
0017 
0018 process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(-1))
0019 
0020 process.source = cms.Source("PoolSource",
0021                             fileNames = cms.untracked.vstring("/store/express/Run2023F/StreamExpress/ALCARECO/SiStripCalMinBias-Express-v1/000/373/710/00000/e2df2f78-b95a-4f33-ae22-add59aa2903f.root"))
0022 
0023 process.options   = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0024 process.MessageLogger.cerr.FwkReport.reportEvery = 10000
0025 
0026 inTracks = cms.InputTag("ALCARECOSiStripCalMinBias")
0027 
0028 process.load('CalibTracker.SiStripCommon.prescaleEvent_cfi')
0029 process.load('CalibTracker.Configuration.Filter_Refit_cff')
0030 ## use CalibrationTracks (for clusters) and CalibrationTracksRefit (for tracks)
0031 process.CalibrationTracks.src = inTracks
0032 
0033 tracksForCalib = cms.InputTag("CalibrationTracksRefit")
0034 
0035 process.prescaleEvent.prescale = 1
0036 
0037 process.TkCalSeq = cms.Sequence(process.prescaleEvent*process.MeasurementTrackerEvent*process.trackFilterRefit)
0038 
0039 process.load("PhysicsTools.NanoAOD.nano_cff")
0040 process.load("PhysicsTools.NanoAOD.NanoAODEDMEventContent_cff")
0041 
0042 ## as a test: it should be possible to add tracks fully at configuration level (+ declaring the plugin)
0043 from PhysicsTools.NanoAOD.common_cff import *
0044 ## this is equivalent to ShallowTrackProducer as configured for the gain calibration
0045 process.tracksTable = cms.EDProducer("SimpleTrackFlatTableProducer",
0046         src=tracksForCalib,
0047         cut=cms.string(""),
0048         name=cms.string("track"),
0049         doc=cms.string("SiStripCalMinBias ALCARECO tracks"),
0050         singleton=cms.bool(False),
0051         extension=cms.bool(False),
0052         variables=cms.PSet(
0053             #chi2=Var("chi2()", float),
0054             #ndof=Var("ndof()", int),
0055             chi2ndof=Var("chi2()/ndof", float),
0056             #charge=Var("charge()", float),
0057             momentum=Var("p()", float),
0058             pt=Var("pt()", float),
0059             #pterr=Var("ptError()", float),
0060             hitsvalid=Var("numberOfValidHits()", int), ## unsigned?
0061             #hitslost=Var("numberOfLostHits()", int), ## unsigned?
0062             #theta=Var("theta()", float),
0063             #thetaerr=Var("thetaError()", float),
0064             phi=Var("phi()", float),
0065             #phierr=Var("phiError()", float),
0066             eta=Var("eta()", float),
0067             #etaerr=Var("etaError()", float),
0068             #dxy=Var("dxy()", float),
0069             #dxyerr=Var("dxyError()", float),
0070             #dsz=Var("dsz()", float),
0071             #dszerr=Var("dszError()", float),
0072             #qoverp=Var("qoverp()", float),
0073             #qoverperr=Var("qoverpError()", float),
0074             #vx=Var("vx()", float),
0075             #vy=Var("vy()", float),
0076             #vz=Var("vz()", float),
0077             algo=Var("algo()", int)
0078             )
0079         )
0080 process.load("CalibTracker.SiStripCommon.tkInstLumiTable_cfi")
0081 process.tkInstLumiTable.extension = True
0082 process.load("CalibTracker.SiStripCommon.siStripPositionCorrectionsTable_cfi")
0083 process.load("CalibTracker.SiStripCommon.siStripGainCalibTable_cfi")
0084 process.siStripPositionCorrectionsTable.Tracks = tracksForCalib
0085 process.siStripGainCalibTable.Tracks = tracksForCalib
0086 
0087 process.nanoCTPath = cms.Path(process.TkCalSeq *
0088                               process.nanoMetadata *
0089                               process.tkInstLumiTable *
0090                               process.tracksTable *
0091                               process.siStripPositionCorrectionsTable) #*
0092                               #process.siStripGainCalibTable)
0093 
0094 process.out = cms.OutputModule("NanoAODOutputModule",
0095                                fileName=cms.untracked.string("CalibTreeMC_nano.root"),
0096                                outputCommands=process.NANOAODEventContent.outputCommands)
0097 
0098 process.end = cms.EndPath(process.out)