How to Use the Monte Carlo Production System

Changes Have been Made Please Read

Iain Bertram December 13, 2002

Introduction:

Before making a request you should be familiar with mc_runjob. In particular the options available and how it handles cardfile parameters. The Request system assumes that mc_runjob will be used.

To create a request you need to follow a series of steps:

  1. Create a python script that describes all of the variables to be used in your request.
  2. Submit the request
  3. Record the Request Number returned
  4. Get the request authorised by your group representitive
  5. The requests will appear on the webpage: http://www-d0.fnal.gov/computing/mcprod/request_details/Request.html

What is an appropriate farm request?

Before sending your request to the farm, please consider if it is appropriate. In general remote farm production should be for large scale projects with standard executables. If you only want a few thousand events, or you want to run d0reco with non-standard parameters this is not really appropriate.

Writing the Python Script

Start by writing down all of the variables you require to be set in your job. Note, each time you change a variable you must submit a new request, this includes masses.

All scripts start with a standard header:
from import_classes import * 

datatier='reconstructed'
appfamily=AppFamily('reconstruction', 'p13.05.00', 'd0reco')

Note, this version of the software has nothing to do wityh the version of the software run on the mc request. We will run the latest version of software available.

Note, please only put in the parameters necessary for your request. Putting in additional Parameters is unwise as it may lead to problems running your jobs.

Then you must give the parameters for your request, here is a qcd request:

For a request to be acceptable please ensure all floating point numbers are quoted to at least one decimal place with no extraneous zeroes, I.e. 4.0 instead of 4.


dict={                                              # A python dictionary
   'Global':{ 	                                   # Keywords applying to the whole job
		'Stream': 'notstreamed', 						# Must be included
		'Description': 'Test of QCD Request', 	# Description of your request, make it reasonably detailed
												# DO NOT USE SPECIAL CHARACTERS PLEASE
		'ProducedForName': 'bertram', 			# your user name
		'GroupName': 'dzero', 							# the physics group that is making the request.
		'RunType': 'Monte Carlo'},					# Must be included 
   'Generated':{									# generator Keywords
		'PDFLibFunc': 'CTEQ4L', 						# PDF
		'CardfileDir': 'np', 									# Cardfile directory
		'CardfileVersion': 'v00-03-43', 					
		'EtaGt': '-4.2', 
		'Production': 'qcd', 
		'PtGt': '20.0', 
		'CollisionEnergy': '1960.0', 
		'EtaLt': '4.2', 
		'Decay': 'incl', 
		'Generator': 'pythia'}, 								# You must include a generator
    'Simulated':{									# D0gstar Keywords (these are default, note changing from plate is not reccomended)
		 'KeepParticleCalEnergy': 'off', 
		 'Geometry': 'plate'}, 
    'Digitized':{'CalorimeterNoise': 'on',   # d0sim keywords
		 'NumMinBi': '0.0', 				# If having zero overlay events pleasse set to fixed.
		 'MinBiOpt': 'Fixed'}, 
    'Reconstructed':{							# d0reco keywords
		     #'RecoRcpFile': 'standard'			# please no longer specified standard as this is no longer supported (you get it by default)
	},  
    }

In general the only thing you need to change in the above request is the production process. I.e. you need to set the following keywords:
CardfileVersion, CardfileDir, Production, Decay

Lets examine an example, we want to generate using the cards: cardfiles/v00-04-06/wz/pythia_w_wmunu.cards then we would set these to:

		'CardfileVersion': 'v00-04-06', 					
		'CardfileDir': 'wz', 
		'Production': 'w', 
		'Decay': 'wmunu',

Another example: v00-04-06/np/pythia_w1z2_3lmET_mSUGRA2_pt1_0_m.cards

		'CardfileVersion': 'v00-04-06', 					
		'CardfileDir': 'np', 
		'Production': 'w1z2', 
		'Decay': '3lmET_mSUGRA2_pt1_0_m',

Submitting the Request

Save the python script in a file: for example, Request_Dict.py

  1. setup sam
  2. # setup sam_user v_4_5_0_0 Do not do this
  3. Carry out the following command:
    sam create request --dict=Request_Dict.py --job-name='MC' --group=groupname --num-events=10 --comment='A Good Monte Carlo Description'
    YOU MUST have jobname='MC' and use your groups name in groupname.
    You will be returned a request ID, record this number, it will be designated ID from now on.
    1. If you have made a mistake in the request you have to cancle the request by contacting Iain Bertram or getting your MC representitive to run the command
      sam modify request status
      --request-id=ID --status=terminated

  4. Once you are satisfied with the request get your MC representitive to do the following:
    1. setup sam_user -t
      setup sam_common -t
    2. If you wnt this request to be processed with a higher priority withion your own group do the following
      sam modify request --request-id=1155 --priority=5 (The maximum priority is 9, the lowest 0, all are assumed 0 unless this is set, the higher the number the higher the priority)
    3. Approve the request (the request is now fixed, it can be changed only if processing has not started):
      sam modify request --request-id=1155 --status=approved
    4. The request ID is now in the queue for processing

Running your own Generated Events

 

Examples

To Specify Exact Versions of Code

from import_classes import *
datatier='reconstructed'
appfamily=AppFamily('reconstruction', 'p11.12.01', 'd0reco')

# setup D0RunII 
# setup mc_runjob
# Default parameters are in $MC_RUNJOB_DIST/py_script/MCRunjobDefaults.py

dict={      
    'Global':{
        'Stream': 'notstreamed', 
        'Description': 'Higgs Hpp 150 GeV',
        'ProducedForName': 'qzli', 
        'GroupName': 'higgs', 
        'RunType': 'Monte Carlo'},
    'Generated':{
        'D0Release':'p11.12.01',     # Specifying a required version of the software
        'PDFLibFunc': 'CTEQ4L', 
        'CardfileVersion': 'v00-04-02',
        'CardfileDir': 'higgs', 
        'Production': 'hppl',
        'Decay': 'eeee',
        'HppMass' : '150.0', 
        'EtaLt': '5.0',
        'EtaGt': '-5.0',
        'CollisionEnergy': '1960.0',
        'Generator': 'pythia'}, # 
    'Simulated':{
		'D0Release':'p11.12.01',     # Specifying a required version of the software
        'KeepParticleCalEnergy': 'off',
        'Geometry': 'plate'},
    'Digitized':{
		'CalorimeterNoise': 'on',
		'D0Release':'p11.12.01',     # Specifying a required version of the software
        'NumMinBi': '0.5',
        'MinBiOpt': 'Poisson'},
    'Reconstructed':{
		'D0Release':'p11.12.01',     # Specifying a required version of the software
        'RecoRcpFile': 'standard'},
    'root-tuple':{
       'CalAnalyzeMinEnergyToPlot': '0.01',
       'RecoanalyzeRcpFile': 'standard',
		'D0Release':'p11.12.01',     # Specifying a required version of the software

                      }
        }

 

Higgs Examples:

This is a request for H++ production, using cardfiles/v00-04-02/higgs/pythia_hppl_eeee.cards

from import_classes import *
datatier='reconstructed'
appfamily=AppFamily('reconstruction', 'p11.12.01', 'd0reco')

# setup D0RunII 
# setup mc_runjob
# Default parameters are in $MC_RUNJOB_DIST/py_script/MCRunjobDefaults.py

dict={      
    'Global':{
        'Stream': 'notstreamed', 
        'Description': 'Higgs Hpp 150 GeV',
        'ProducedForName': 'qzli', 
        'GroupName': 'higgs', 
        'RunType': 'Monte Carlo'},
    'Generated':{
        'PDFLibFunc': 'CTEQ4L', 
        'CardfileVersion': 'v00-04-02',
        'CardfileDir': 'higgs', 
        'Production': 'hppl',
        'Decay': 'eeee',
        'HppMass' : '150.0', 
        'EtaLt': '5.0',
        'EtaGt': '-5.0',
        'CollisionEnergy': '1960.0',
        'Generator': 'pythia'}, # 
    'Simulated':{
        'KeepParticleCalEnergy': 'off',
        'Geometry': 'plate'},
    'Digitized':{'CalorimeterNoise': 'on',
                 'NumMinBi': '0.5',
                 'MinBiOpt': 'Poisson'},
    'Reconstructed':{
        'RecoRcpFile': 'standard'},
#    'root-tuple':{
#       'CalAnalyzeMinEnergyToPlot': '0.01',
#       'RecoanalyzeRcpFile': 'standard',
#                      }
        }

WZ Example

This is a request for H++ production, using cardfiles/v00-04-06/wz/pythia_w_wenu.cards

from import_classes import *

datatier='reconstructed'
appfamily=AppFamily('reconstruction', 'p11.12.01', 'd0reco')

dict={
    'Global':{
        'Stream': 'notstreamed',                # Must be included
        'Description': 'WZ Request for W to enu',         #
        'ProducedForName': 'steinbru',                  # your user
        'GroupName': 'wz',    # the physics group that is making
        'RunType': 'Monte Carlo'},    # Must be included
    'Generated':{
        'PDFLibFunc': 'CTEQ4L',
        'CardfileDir': 'wz',
        'CardfileVersion': 'v00-04-06',
        'EtaGt': '-4.2',
        'Production': 'w',
        'CollisionEnergy': '1960.0',
        'EtaLt': '4.2',
        'Decay': 'wenu',
        'Generator': 'pythia'},
    'Simulated':{
        # D0gstar Keywords (these are defa ult, note changing from plate is not reccomended)
        'KeepParticleCalEnergy': 'off',
        'Geometry': 'plate'},
    'Digitized':{
        'CalorimeterNoise': 'on',   # d0sim keywords
        'NumMinBi': '0.5',
        'MinBiOpt': 'Poisson'},
    'Reconstructed':{                                                   #
        'RecoRcpFile': 'standard'},
    }

Generator Parameters (se mc_runjob for full details) Needs updating


# Default values for Pythia Parameters
pythia_Defaults={'CollisionEnergy':               1960.0,
                 'PtGt':                          5.0,
                 'PtLt':                          99999.0,    
                 'EtaGt':                         -4.2,
                 'EtaLt':                         4.2,
                 'CustomExecutable' :             TypeDefaults['string'],
                 'HiggsMass':                     120.0,
                 'TopMass':                       174.3,
                 'UseQQUserDec':                  'off',
                 'QQDecayProcess':                TypeDefaults['string'],
		 'UseQQ':                         'off',
                 'UseOnetop':                     'off',
                 'UseEvtGen':                     'off', # DEE 25/9/02
                 'UseEvtGenUserDec':             TypeDefaults['string'],
                 'EvtGenDecayProcess':           TypeDefaults['string'],
                 'KinMassGt':                     2.0, 
                 'KinMassLt':                     -1.0,
                 'WPrimeMass':                    750.0,
                 'LeptoQuarkMass':                250.0,
                 'MultiplePartonInteractions':    'on',
                 'OnetopProcess':                 '13',
                 'OnetopOnlyTop':                 '0',
                 'CustomPTable':                  TypeDefaults['string'],
                 'ZPrimeMass':                    700.0,
                 'HppMass':                       200.0, #DEE 16/7/02
                 'Generator':                     'pythia',
                 'NumRecords':                    '0',
                 'UseComphep':                    'off',
                 'CHProcessName':                 TypeDefaults['string'],
                 'CHInputFile':                   TypeDefaults['string'],
                 'D0MessRCP':                     TypeDefaults['string'],
                 
                 'TechniPi0Mass':      85.0,  #\ 
                 'ChTechniPiMass':    85.0,   #|
                 'TechniPi0PrimeMass': 85.0,  # > DEE 25/11/02
                 'TechniRho0Mass':     175.0, #|
                 'ChTechniRhoMass':   175.0,  #|
                 'TechniOmega0Mass':   175.0, #/
                 

                 }