Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:38

0001 
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 process = cms.Process("CastorProducts")
0005 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0006 
0007 # specify the correct database tags which contain the updated gains and channelquality flags
0008 process.load("CondCore.DBCommon.CondDBSetup_cfi")
0009 process.CastorDbProducer = cms.ESProducer("CastorDbProducer")
0010 process.es_pool = cms.ESSource(
0011    "PoolDBESSource",
0012    process.CondDBSetup,
0013    timetype = cms.string('runnumber'),
0014    connect = cms.string('frontier://cmsfrontier.cern.ch:8000/FrontierProd/CMS_COND_31X_HCAL'),
0015    authenticationMethod = cms.untracked.uint32(0),
0016    toGet = cms.VPSet(
0017        cms.PSet(
0018            record = cms.string('CastorPedestalsRcd'),
0019            tag = cms.string('CastorPedestals_v2.0_offline')
0020            ),
0021        cms.PSet(
0022            record = cms.string('CastorPedestalWidthsRcd'),
0023            tag = cms.string('CastorPedestalWidths_v2.0_offline')
0024            ),
0025        cms.PSet(
0026            record = cms.string('CastorGainsRcd'),
0027            tag = cms.string('CastorGains_v2.0_offline')
0028            ),
0029        cms.PSet(
0030            record = cms.string('CastorGainWidthsRcd'),
0031        tag = cms.string('CastorGainWidths_v2.0_offline')
0032            ),
0033        cms.PSet(
0034            record = cms.string('CastorQIEDataRcd'),
0035        tag = cms.string('CastorQIEData_v2.0_offline')
0036            ),
0037        cms.PSet(
0038            record = cms.string('CastorChannelQualityRcd'),
0039            tag = cms.string('CastorChannelQuality_v2.0_offline')
0040            ),
0041        cms.PSet(
0042            record = cms.string('CastorElectronicsMapRcd'),
0043            tag = cms.string('CastorElectronicsMap_v2.0_offline')
0044            )
0045    )
0046 )
0047 # end of Db configuration
0048 
0049 process.maxEvents = cms.untracked.PSet(
0050     input = cms.untracked.int32(-1)
0051 )
0052 
0053 process.source = cms.Source("PoolSource",
0054 duplicateCheckMode = cms.untracked.string("noDuplicateCheck"),
0055     fileNames = cms.untracked.vstring(
0056         'file:data_RAW2DIGI_L1Reco_RECO.root' # choose your input file here
0057     )
0058 )
0059 
0060 # load CASTOR default reco chain (from towers on)
0061 process.load('RecoLocalCalo.Castor.Castor_cff')
0062 
0063 # construct the module which executes the RechitCorrector for data reconstructed in releases < 4.2.X
0064 process.rechitcorrector = cms.EDProducer("RecHitCorrector",
0065     rechitLabel = cms.InputTag("castorreco","","RECO"), # choose the original RecHit collection
0066     revertFactor = cms.double(62.5), # this is the factor to go back to the original fC: 1/0.016
0067     doInterCalib = cms.bool(True) # do intercalibration
0068 )
0069 
0070 # construct the module which executes the RechitCorrector for data reconstructed in releases >= 4.2.X
0071 process.rechitcorrector42 = cms.EDProducer("RecHitCorrector",
0072         rechitLabel = cms.InputTag("castorreco","","RECO"), # choose the original RecHit collection
0073         revertFactor = cms.double(1), # this is the factor to go back to the original fC - not needed when data is already intercalibrated
0074         doInterCalib = cms.bool(False) # don't do intercalibration, RecHitCorrector will only correct the EM response and remove BAD channels
0075 )
0076 
0077 
0078 # tell to the CastorCell reconstruction that he should use the new corrected rechits for releases < 4.2.X
0079 #process.CastorCellReco.inputprocess = "rechitcorrector"
0080 
0081 # tell to the CastorTower reconstruction that he should use the new corrected rechits for releases >= 4.2.X
0082 process.CastorTowerReco.inputprocess = "rechitcorrector"
0083 
0084 
0085 process.MyOutputModule = cms.OutputModule("PoolOutputModule",
0086     fileName = cms.untracked.string('rechitcorrector_output.root') # choose your output file
0087 )
0088 
0089 # execute the rechitcorrector and afterwards do the reco chain again (towers -> jets)
0090 process.producer = cms.Path(process.rechitcorrector*process.CastorFullReco)
0091 process.end = cms.EndPath(process.MyOutputModule)
0092