Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:35

0001 ##########################################################################
0002 ##
0003 # Check if there is the trackerTree.root file.
0004 ##
0005 
0006 import logging
0007 import os
0008 
0009 from Alignment.MillePedeAlignmentAlgorithm.alignmentsetup.helper \
0010     import checked_out_MPS
0011 import Alignment.MillePedeAlignmentAlgorithm.mpslib.tools as mps_tools
0012 
0013 
0014 def check(config):
0015     logger = logging.getLogger("mpsvalidate")
0016     logger.info("Check if TrackerTree.root file exists")
0017     
0018     outputpath = os.path.join(config.jobDataPath, ".TrackerTree.root")
0019 
0020     # check if file exists
0021     if not os.path.isfile(outputpath):
0022         logger.info("TrackerTree.root file does not exist. It will be created now.")
0023         
0024         configpath = os.path.join(config.mpspath, "test", "trackerTree_cfg.py")
0025         logger.info("Path to the config file: {0}".format(configpath))
0026         
0027         cmd = ["cmsRun", configpath, "outputFile="+outputpath]
0028         if config.globalTag != None: cmd.append("globalTag="+config.globalTag)
0029         if config.firstRun != None: cmd.append("firstRun="+config.firstRun)
0030         mps_tools.run_checked(cmd, suppress_stderr = True)
0031 
0032     return os.path.abspath(outputpath)