Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 23:31:27

0001 #! /usr/bin/env cmsRun
0002 
0003 import FWCore.ParameterSet.Config as cms
0004 
0005 process = cms.Process("MaterialAnalyser")
0006 
0007 readGeometryFromDB = False
0008 
0009 # Configuration and Conditions
0010 # We cannot read the geometry from the DB, since we have to inject out custom-made
0011 # material-budget grouping into the DDD of the detector. So we need to read the
0012 # geometry using the XMLIdealGeometryRecord.
0013 if readGeometryFromDB:
0014 # Global Tag and geometry via it
0015   process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0016   from Configuration.AlCa.GlobalTag import GlobalTag
0017   process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
0018 else:
0019   process.load('Configuration.Geometry.GeometryExtended2026D44Reco_cff')
0020 
0021 process.load('FWCore.MessageService.MessageLogger_cfi')
0022 
0023 # Add our custom detector grouping to DDD
0024 process.XMLIdealGeometryESSource.geomXMLFiles.extend(['SimTracker/TrackerMaterialAnalysis/data/trackingMaterialGroups_ForPhaseII.xml'])
0025 
0026 # Analyze and plot the tracking material
0027 process.load("SimTracker.TrackerMaterialAnalysis.trackingMaterialAnalyser_ForHGCalPhaseII_cff")
0028 process.trackingMaterialAnalyser.SplitMode         = "NearestLayer"
0029 process.trackingMaterialAnalyser.SaveParameters    = True
0030 process.trackingMaterialAnalyser.SaveXML           = True
0031 process.trackingMaterialAnalyser.SaveDetailedPlots = False
0032 
0033 process.source = cms.Source("PoolSource",
0034     fileNames = cms.untracked.vstring('file:material.root')
0035 )
0036 process.maxEvents = cms.untracked.PSet(
0037     input = cms.untracked.int32(-1)
0038 )
0039 
0040 process.path = cms.Path(process.trackingMaterialAnalyser)
0041 
0042 
0043 def customizeMessageLogger(process):
0044     ### Easy customisation of MessageLogger ###
0045     # 1. Extend MessageLogger to monitor all modules: the * means any
0046     #    label for all defined python modules
0047     process.MessageLogger.debugModules.extend(['*'])
0048     # 2. Define destination and its default logging properties
0049     how_to_debug = cms.untracked.PSet(threshold = cms.untracked.string("DEBUG"),
0050                                       DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)),
0051                                       default = cms.untracked.PSet(limit = cms.untracked.int32(0)),
0052                                       )
0053     # 3. Attach destination and its logging properties to the main process
0054     process.MessageLogger.files.debugTrackingMaterialAnalyzer = how_to_debug
0055     # 4. Define and extend the categories we would like to monitor
0056     log_debug_categories = ['TrackingMaterialAnalyser', 'MaterialAccountingGroup']
0057     
0058 
0059     # 5. Extend the configuration of the configured destination so that it
0060     #    will trace all messages coming from the list of specified
0061     #    categories.
0062     unlimit_debug = cms.untracked.PSet(limit = cms.untracked.int32(-1))
0063     for val in log_debug_categories:
0064         setattr(process.MessageLogger.files.debugTrackingMaterialAnalyzer, val, unlimit_debug)
0065 
0066     return process
0067 
0068 
0069 #process = customizeMessageLogger(process)
0070 
0071