Difference: SWGuideHeavyIonEvtMixing (1 vs. 6)

Revision 62009-10-30 - PhilipAllfrey

Line: 1 to 1
 
META TOPICPARENT name="SWGuideHeavyIon"

Mixing Signal Events into Heavy Ion Background

Complete: 5
Changed:
<
<
>
>
 
Changed:
<
<

Instructions for generating, simulating and mixing signal event

>
>

Goal of this page

The aim of this page is to provide instructions for generating, simulating and mixing a signal event into a heavy ion background event
 
Changed:
<
<

Quick Instructions

>
>

Code and tags

The code which does the mixing has been incorporated into the standard MixingModule, which lives in SimGeneral/MixingModule, since release CMSSW_3_3_0. There is no need for additional CVS tags.
 
Changed:
<
<
Heavy Ion mixing job can be created in two ways, by either using cmsDriver.py command, or writing a cfg yourself.
>
>

Quick Instructions

The configuration file (cfg) for a heavy-ion mixing job can be created in two ways, by either using the cmsDriver.py command, or writing the cfg yourself.
 

Using cmsDriver.py

Changed:
<
<
You can create a configuration with the following command:
>
>
You can create a configuration file with the following command:
 
cmsDriver.py Pyquen_DiJet_pt80to120_4TeV_cfi.py \
--himix --scenario HeavyIons \

Line: 27 to 28
 --no_exec
Changed:
<
<
This configuration mixes dijets into heavy ion background, and runs up to RECO. The particularities are:
  • The input generator cfi has to be defined with label "hiSignal", rather than "generator".
>
>
This configuration mixes dijets into heavy ion background, and runs up to RECO. The signal event is specified in the input cfi file (here Pyquen_DiJet_pt80to120_4TeV_cfi.py). The background event into which it should be mixed is specified by the --filein parameter. Further details to nore are:
  • In the input generator cfi, (Pyquen_DiJet_pt80to120_4TeV_cfi.py in the example above ), the generator module has to be defined with label "hiSignal", rather than "generator".
 
  • The GEN sequence must be run with the option "hiSignal", by typing it as "GEN:hiSignal" among sequences.
  • The option "--himix" must be used.
  • Scenario "HeavyIons" must be specified.
  • A process name (of your choice) has to be specified in order not to clash with previous processes that ran on the events.
Changed:
<
<
You can modify all other parameters as you like. You can look at SWGuidePyReleaseValidationOptions for cmsDriver.py details.

Writing a custom configuration

  • Create a PoolSource that opens an input (heavy ion background) file. Make sure you drop the previously produced DIGI, RAW etc. of the background event. You need only the GEN and SIM info from this file:
>
>
You can modify all other parameters as you like. See SWGuidePyReleaseValidationOptions for cmsDriver.py details.
 
Added:
>
>

Writing a custom configuration file

  • Create a PoolSource that opens an input (heavy ion background) file. Make sure you drop the previously produced DIGI, RAW etc. of the background event. You need only the GEN and SIM info from this file:
 
process.source = cms.Source("PoolSource",
    fileNames = cms.untracked.vstring('inputfile.root'),

Line: 52 to 49
 )
Changed:
<
<

  • Load a generator particularly configured for mixing:
>
>
  • Load a generator particularly configured for mixing, for example:
 
process.load('Configuration.Generator.Pyquen_GammaJet_pt20_4TeV_cfi')
Line: 95 to 89
 

Other possibilities you may need

Mixing in Gen-Level only

Changed:
<
<
>
>
For some studies it may be sufficient to mix the signal and background events at the generator level, rather than the SIM level as for the cases above. To do this
 
  • Load only standard GEN sequences.
Changed:
<
<
  • For mixing, use mixGenNoPU from HiEventMixing, by not loading; but importing.
>
>
process.load('Configuration/StandardSequences/Services_cff')
process.load('Configuration/StandardSequences/Generator_cff')
 
Added:
>
>
  • For mixing, use mixGenNoPU from HiEventMixing, not by loading; but importing.
 
from SimGeneral.MixingModule.HiEventMixing_cff import *
process.mix = mixGenHI

Line: 106 to 104
 process.pmix = cms.Path(process.mix)
Changed:
<
<

Running NoPileUp on hiSignal

>
>

Running NoPileUp on hiSignal

 
Changed:
<
<
You may want to take the already simulated signal events, which are mixed into HI background reconstructed, and run RECO on them without the heavy ion background. It is possible to save the RECO output of both mixed and signal-only event in the same file. Heere are the instructions to do it:
>
>
You may want to take the already simulated signal events, which have been mixed into HI background and reconstructed, and run RECO on them without the heavy ion background. It is possible to save the RECO output of both mixed and signal-only event in the same file. Here are the instructions to do it:
 
Changed:
<
<
  • For now, you need to check out the HEAD of SimGeneral/MixingModule from the CVS.
  • Create a PoolSource that drops the DIGI, RAW, and local RECO of the input file.
  • Load only standard GEN, SIM, DIGI sequences.
  • For mixing, load HiEventMixing and change parameters to use only the signal:
>
>
  • For now (CMSSW_3_3_X or 3_4_0_preX) , you need to check out the HEAD of SimGeneral/MixingModule from the CVS.
cvs co SimGeneral/MixingModule
scramv1 b

  • In your configuration file, create a PoolSource that drops the DIGI, RAW, and local RECO of the input file.
process.source = cms.Source("PoolSource",
    fileNames = cms.untracked.vstring('inputfile.root'),
    inputCommands = cms.untracked.vstring(
        'drop *_*_*_DIGI',
        'drop *_*_*_RAW',
        'drop *_*_*_RECO'),
    dropDescendantsOfDroppedBranches = cms.untracked.bool(False)
)
 
Added:
>
>
  • Load only standard GEN, SIM, DIGI sequences.
 

Added:
>
>
process.load('Configuration/StandardSequences/Services_cff') process.load('Configuration/StandardSequences/Generator_cff') process.load('Configuration/StandardSequences/Sim_cff') process.load('Configuration/StandardSequences/Digi_cff')
 
Added:
>
>
  • For mixing, load HiEventMixing and change parameters to use only the signal:

 process.load("SimGeneral.MixingModule.HiEventMixing_cff") process.mix.srcGEN = ["hiSignal"]
Changed:
<
<
process.mix.srcSIM = ["hSignalG4SimHits"]
>
>
process.mix.srcSIM = ["hiSignalG4SimHits"]
 

  • Run standard DIGI, L1, RAW, RawToDigi sequences.
Added:
>
>
process.p = cms.Path(process.mix*process.doAllDigi*process.L1Emulator*process.DigiToRaw*process.RawToDigi)
 
Deleted:
<
<
If you want to keep both Mixed ans Signal-only reconstruction objects, then you need new names for the Signal-only RECO objects. This is also easy:
 
Changed:
<
<
  • Load standard RECO for heavy ions, but AFTER that, load the extra reco for hiSignal.
>
>
If you want to keep both Mixed and Signal-only reconstruction objects, then you need new names for the Signal-only RECO objects. This is also easy:
 
Added:
>
>
  • Load standard RECO for heavy ions, but AFTER that, load the extra reco for hiSignal.
 
process.load('Configuration/StandardSequences/ReconstructionHeavyIons_cff')
process.load('RecoHI.Configuration.Reconstruction_hiSignal_cff')

Line: 143 to 163
 

Configuration Examples

Changed:
<
<
http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/UserCode/CmsHi/Utilities/scripts/mixDiJet_reco.sh?view=markup
>
>
The directory UserCode/CmsHi/Utilities/scripts contains some scripts with correctly-formed cmsDriver.py commands for mixing, e.g.
 

Related Links

Deleted:
<
<
  \ No newline at end of file
Added:
>
>

Contact

Review status

Reviewer/Editor and Date Comments
YetkinYilmaz - 29 Oct 2009 updated contents as part of documentation review

Responsible: YetkinYilmaz

 \ No newline at end of file

Revision 52009-10-30 - PhilipAllfrey

Line: 1 to 1
Changed:
<
<
META TOPICPARENT name="SWGuideHIDocReview09"
>
>
META TOPICPARENT name="SWGuideHeavyIon"
 

Mixing Signal Events into Heavy Ion Background

Complete: 5

Revision 42009-10-28 - YetkinYilmaz

Line: 1 to 1
 
META TOPICPARENT name="SWGuideHIDocReview09"

Mixing Signal Events into Heavy Ion Background

Added:
>
>
Complete: 5
 
Line: 12 to 13
 

Using cmsDriver.py

Changed:
<
<
cmsDriver.py [Generator cfi - with label = hiSignal ] --himix --no_exec --scenario HeavyIons -s [Sequences, at least GEN,SIM] -n [Number of events] --conditions [Conditions with Tag] --datatier [Data Tier] --eventcontent [Event Content] --filein=[Input file LFN, or PFL with prefix] --fileout=[Output file]

Example (Mixing GammaJets):

>
>
You can create a configuration with the following command:
 

Changed:
<
<
cmsDriver.py Pyquen_GammaJet_pt20_4TeV.cfi --himix --no_exec --scenario HeavyIons -s GEN,SIM,DIGI,L1,DIGI2RAW,RAW2DIGI,RECO -n 1 --conditions FrontierConditions_GlobalTag,MC_31X_V8::All --datatier 'GEN-SIM-RAW-RECO' --eventcontent FEVTDEBUG --filein=/store/relval/CMSSW_3_3_0_pre3/RelValHydjetQ_MinBias_4TeV/GEN-SIM-RAW/MC_31X_V8-v1/0015/DC571B73-43A1-DE11-BD0C-000423D98804.root --fileout=gammajet20_MIX_RECO.root
>
>
cmsDriver.py Pyquen_DiJet_pt80to120_4TeV_cfi.py --himix --scenario HeavyIons -s GEN:hiSignal,SIM,DIGI,L1,DIGI2RAW,RAW2DIGI,RECO --conditions FrontierConditions_GlobalTag,MC_31X_V9::All --datatier 'GEN-SIM-RAW-RECO' --eventcontent=FEVTDEBUG --processName 'HISIGNAL' --filein=inputfile.root --fileout=outputfile.root -n 1 --no_exec

This configuration mixes dijets into heavy ion background, and runs up to RECO. The particularities are:

  • The input generator cfi has to be defined with label "hiSignal", rather than "generator".
  • The GEN sequence must be run with the option "hiSignal", by typing it as "GEN:hiSignal" among sequences.
  • The option "--himix" must be used.
  • Scenario "HeavyIons" must be specified.
  • A process name (of your choice) has to be specified in order not to clash with previous processes that ran on the events.

You can modify all other parameters as you like. You can look at SWGuidePyReleaseValidationOptions for cmsDriver.py details.

 

Writing a custom configuration

Changed:
<
<
  • Create a PoolSource that opens an input (heavy ion background) file.
>
>
  • Create a PoolSource that opens an input (heavy ion background) file. Make sure you drop the previously produced DIGI, RAW etc. of the background event. You need only the GEN and SIM info from this file:

process.source = cms.Source("PoolSource",
    fileNames = cms.untracked.vstring('inputfile.root'),
    inputCommands = cms.untracked.vstring('drop *',
        'keep *_generator_*_*',
        'keep *_g4SimHits_*_*'),
    dropDescendantsOfDroppedBranches = cms.untracked.bool(False)
)
 
  • Load a generator particularly configured for mixing:

Line: 35 to 64
 process.hiSignal = cms.EDFilter('PyquenProducer',....)
Changed:
<
<
  • Load the standard sequences for your job, and then add the extra sequences needed for hi-mixing:
>
>
  • Load the standard sequences for your job, including the standard GEN, SIM, DIGI stuff:

process.load('Configuration/StandardSequences/Services_cff')
process.load('Configuration/StandardSequences/Generator_cff')
process.load('Configuration/StandardSequences/Sim_cff')
process.load('Configuration/StandardSequences/Digi_cff')

and then add the extra sequences needed for hi-mixing:

 
process.load('Configuration/StandardSequences/HiEventMixing_cff')
process.load('SimGeneral/MixingModule/himixGEN_cff')

Line: 54 to 92
 
Changed:
<
<

Step by step Instructions

Generation

Vertex

Simulation

Mix

GenParticles

TrackingParticles

>
>

Other possibilities you may need

Mixing in Gen-Level only

  • Load only standard GEN sequences.
  • For mixing, use mixGenNoPU from HiEventMixing, by not loading; but importing.
 
Added:
>
>
from SimGeneral.MixingModule.HiEventMixing_cff import *
process.mix = mixGenHI
...
process.pmix = cms.Path(process.mix)
 
Added:
>
>

Running NoPileUp on hiSignal

 
Added:
>
>
You may want to take the already simulated signal events, which are mixed into HI background reconstructed, and run RECO on them without the heavy ion background. It is possible to save the RECO output of both mixed and signal-only event in the same file. Heere are the instructions to do it:
 
Changed:
<
<

Production Instructions

>
>
  • For now, you need to check out the HEAD of SimGeneral/MixingModule from the CVS.
  • Create a PoolSource that drops the DIGI, RAW, and local RECO of the input file.
  • Load only standard GEN, SIM, DIGI sequences.
  • For mixing, load HiEventMixing and change parameters to use only the signal:
 
Changed:
<
<

Instructions for running mixing in pre-releases with CRAB jobs at MIT

>
>

 
Changed:
<
<
CRAB can only recognize the official OSG installations at a Tier 2 site. In order to run with a prerelease, one needs to use a custom script. The instructions are in CmsafUserGuide
>
>
process.load("SimGeneral.MixingModule.HiEventMixing_cff") process.mix.srcGEN = ["hiSignal"] process.mix.srcSIM = ["hSignalG4SimHits"]
 
Added:
>
>
 
Changed:
<
<

Setup of the working area

>
>
  • Run standard DIGI, L1, RAW, RawToDigi sequences.
 
Changed:
<
<
Here are instruction for setting up a CMSSW project area that is capable to run the event embedding configurations. For detailed help on the steps involved, please consult the WorkBook, or MIT Tier-2/3 user guide for running locally at MIT.
>
>
If you want to keep both Mixed ans Signal-only reconstruction objects, then you need new names for the Signal-only RECO objects. This is also easy:
 
Changed:
<
<

CMSSW_3_3_X

>
>
  • Load standard RECO for heavy ions, but AFTER that, load the extra reco for hiSignal.
 
Deleted:
<
<
  • Setup your CMSSW area and environment
  • Setup you CVSROOT and get your kerberos 5 token
  • Execute the following:
 

Changed:
<
<
cvs co UserCode/CmsHi/Utilities/scripts/setup33X.sh ./UserCode/CmsHi/Utilities/scripts/setup33X.sh
>
>
process.load('Configuration/StandardSequences/ReconstructionHeavyIons_cff') process.load('RecoHI.Configuration.Reconstruction_hiSignal_cff')
 
Changed:
<
<

Running with Crab

>
>
This will modify the sequences defined in the standard configuration.

  • Run the standard reco sequence:
 
Changed:
<
<
>
>
process.reconstruction_step = cms.Path(process.reconstructionHeavyIons)
 

Configuration Examples

Changed:
<
<
UserCode/CmsHi/Utilities/test/pyquen_gammajet_pt20.py
>
>
http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/UserCode/CmsHi/Utilities/scripts/mixDiJet_reco.sh?view=markup
 

Related Links

Revision 32009-10-01 - YetkinYilmaz

Line: 1 to 1
 
META TOPICPARENT name="SWGuideHIDocReview09"

Mixing Signal Events into Heavy Ion Background

Deleted:
<
<
<!--/twistyPlugin twikiMakeVisibleInline-->
 
Deleted:
<
<
<!--/twistyPlugin-->
 

Instructions for generating, simulating and mixing signal event

Line: 21 to 12
 

Using cmsDriver.py

Added:
>
>
cmsDriver.py [Generator cfi - with label = hiSignal ] --himix --no_exec --scenario HeavyIons -s [Sequences, at least GEN,SIM] -n [Number of events] --conditions [Conditions with Tag] --datatier [Data Tier] --eventcontent [Event Content] --filein=[Input file LFN, or PFL with prefix] --fileout=[Output file]

Example (Mixing GammaJets):

cmsDriver.py Pyquen_GammaJet_pt20_4TeV.cfi --himix --no_exec --scenario HeavyIons -s GEN,SIM,DIGI,L1,DIGI2RAW,RAW2DIGI,RECO -n 1 --conditions FrontierConditions_GlobalTag,MC_31X_V8::All --datatier 'GEN-SIM-RAW-RECO' --eventcontent FEVTDEBUG --filein=/store/relval/CMSSW_3_3_0_pre3/RelValHydjetQ_MinBias_4TeV/GEN-SIM-RAW/MC_31X_V8-v1/0015/DC571B73-43A1-DE11-BD0C-000423D98804.root --fileout=gammajet20_MIX_RECO.root
 

Writing a custom configuration

Changed:
<
<
Create a PoolSource that opens an input (heavy ion background) file.
>
>
  • Create a PoolSource that opens an input (heavy ion background) file.
 
Changed:
<
<
Load a generator particularly configured for mixing:
>
>
  • Load a generator particularly configured for mixing:
 
process.load('Configuration.Generator.Pyquen_GammaJet_pt20_4TeV_cfi')
Line: 36 to 35
 process.hiSignal = cms.EDFilter('PyquenProducer',....)
Changed:
<
<
Load the heavy ion mixing module:
>
>
  • Load the standard sequences for your job, and then add the extra sequences needed for hi-mixing:
 

Changed:
<
<
process.load('Configuration.StandardSequences.HiEventMixing_cff')
>
>
process.load('Configuration/StandardSequences/HiEventMixing_cff') process.load('SimGeneral/MixingModule/himixGEN_cff') process.load('SimGeneral/MixingModule/himixSIMExtended_cff') process.load('SimGeneral/MixingModule/himixDIGI_cff')
 
Added:
>
>
Make sure you load the hi-mix cff files AFTER you load the standard ones in your cfg!
 
Changed:
<
<
Add the sequence as a first thing to run in a path, or the first path to run in a schedule.
>
>
  • Run the standard sequences, except pgen_himix instead of pgen_hi.
 

Changed:
<
<
process.signal_step = cms.Path(process.hiSignalSequence)
>
>
process.generation_step = cms.Path(process.pgen_himix) process.simulation_step = cms.Path(process.psim) process.digitisation_step = cms.Path(process.pdigi) ...
 
Line: 61 to 67
 

Production Instructions

Changed:
<
<

Setup

>
>

Instructions for running mixing in pre-releases with CRAB jobs at MIT

CRAB can only recognize the official OSG installations at a Tier 2 site. In order to run with a prerelease, one needs to use a custom script. The instructions are in CmsafUserGuide

Setup of the working area

  Here are instruction for setting up a CMSSW project area that is capable to run the event embedding configurations. For detailed help on the steps involved, please consult the WorkBook, or MIT Tier-2/3 user guide for running locally at MIT.

Revision 22009-09-28 - YetkinYilmaz

Line: 1 to 1
 
META TOPICPARENT name="SWGuideHIDocReview09"

Mixing Signal Events into Heavy Ion Background

Line: 17 to 17
 

Quick Instructions

Changed:
<
<
Load the necessary modules:
process.load('SimGeneral.MixingModule.mixHiSignal_cff')
>
>
Heavy Ion mixing job can be created in two ways, by either using cmsDriver.py command, or writing a cfg yourself.

Using cmsDriver.py

Writing a custom configuration

 
Changed:
<
<
Load the generator (labeled hiSignal) configuration cfi (make sure there is no "cms.Source" defined in it), and change parameters if necessary:
>
>
Create a PoolSource that opens an input (heavy ion background) file.
 
Added:
>
>
Load a generator particularly configured for mixing:
 
process.load('Configuration.Generator.Pyquen_GammaJet_pt20_4TeV_cfi')
Line: 33 to 36
 process.hiSignal = cms.EDFilter('PyquenProducer',....)
Added:
>
>
Load the heavy ion mixing module:
process.load('Configuration.StandardSequences.HiEventMixing_cff')
 Add the sequence as a first thing to run in a path, or the first path to run in a schedule.
process.signal_step = cms.Path(process.hiSignalSequence)

Revision 12009-09-08 - YetkinYilmaz

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="SWGuideHIDocReview09"

Mixing Signal Events into Heavy Ion Background

<!--/twistyPlugin twikiMakeVisibleInline-->
<!--/twistyPlugin-->

Instructions for generating, simulating and mixing signal event

Quick Instructions

Load the necessary modules:

process.load('SimGeneral.MixingModule.mixHiSignal_cff')

Load the generator (labeled hiSignal) configuration cfi (make sure there is no "cms.Source" defined in it), and change parameters if necessary:

process.load('Configuration.Generator.Pyquen_GammaJet_pt20_4TeV_cfi')

Or, define a generator module from scratch:

process.hiSignal = cms.EDFilter('PyquenProducer',....)

Add the sequence as a first thing to run in a path, or the first path to run in a schedule.

process.signal_step = cms.Path(process.hiSignalSequence)

Step by step Instructions

Generation

Vertex

Simulation

Mix

GenParticles

TrackingParticles

Production Instructions

Setup

Here are instruction for setting up a CMSSW project area that is capable to run the event embedding configurations. For detailed help on the steps involved, please consult the WorkBook, or MIT Tier-2/3 user guide for running locally at MIT.

CMSSW_3_3_X

  • Setup your CMSSW area and environment
  • Setup you CVSROOT and get your kerberos 5 token
  • Execute the following:
     cvs co UserCode/CmsHi/Utilities/scripts/setup33X.sh
     ./UserCode/CmsHi/Utilities/scripts/setup33X.sh

Running with Crab

Configuration Examples

UserCode/CmsHi/Utilities/test/pyquen_gammajet_pt20.py

Related Links

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback