Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-07 22:32:56

0001 #!/usr/bin/env python3
0002 """
0003 _pp_
0004 
0005 Test for Collision Scenario implementation
0006 
0007 """
0008 
0009 
0010 import unittest
0011 import FWCore.ParameterSet.Config as cms
0012 from Configuration.DataProcessing.GetScenario import getScenario
0013 
0014 
0015 
0016 def writePSetFile(name, process):
0017     """
0018     _writePSetFile_
0019 
0020     Util to dump the process to a file
0021 
0022     """
0023     handle = open(name, 'w')
0024     handle.write(process.dumpPython())
0025     handle.close()
0026 
0027 
0028 class ppScenarioTest(unittest.TestCase):
0029     """
0030     unittest for pp collisions scenario
0031 
0032     """
0033 
0034     def testA(self):
0035         """get the scenario"""
0036         try:
0037             scenario = getScenario("pp")
0038         except Exception as ex:
0039             msg = "Failed to get pp scenario\n"
0040             msg += str(ex)
0041             self.fail(msg)
0042 
0043 
0044     def testPromptReco(self):
0045         """test promptReco method"""
0046         scenario = getScenario("pp")
0047         try:
0048             process = scenario.promptReco("FT_R_42_V10A::All",writeTiers = ['RECO', 'AOD', 'ALCARECO', 'DQM'])
0049             writePSetFile("testPromptReco.py", process)
0050         except Exception as ex:
0051             msg = "Failed to create Prompt Reco configuration\n"
0052             msg += "for pp Scenario\n"
0053             msg += str(ex)
0054             self.fail(msg)
0055 
0056 
0057 
0058 
0059 if __name__ == '__main__':
0060     unittest.main()