Examples of Simulation+Reconstruction Chain in CMSSW

The user should be aware that CMSSW evolving rapidly, and all examples will change quickly. This page is for training people who will help in the rapid development and testing cycle. What you learn is not garanteed to work for very long . . .

The full chain includes following steps: The entire chain is split into two pieces: generation (which includes generation, simulation and digitization) and reconstruction.

This procedure works for vanila CMSSW_0_8_1.
Jet users should use 0_8_1 instead of 0_8_0 for jet analysis because 0_8_1 works with Framework Lite and 0_8_0 does not.

scramv1 project CMSSW CMSSW_0_8_1
cd CMSSW_0_8_1/src
eval `scramv1 runtime -csh`
cmscvsroot CMSSW
cvs co -r CMSSW_0_8_1 Configuration
   (first time you do it you will need to "cvs login" with password 98passwd)
cmsRun -p Configuration/Applications/data/Zprime_Dijets_700_JetMETintegration.cfg 
This will generate, simulate and reconstruct 2 events of Z' decaying to dijets. Output files are

This procedure works for vanila CMSSW_0_7_0.

scramv1 project CMSSW CMSSW_0_7_0
cd CMSSW_0_7_0/src
eval `scramv1 runtime -csh`
cmscvsroot CMSSW
cvs co -r MCPROD_0_7_0 Configuration/Applications/ 
   (first time you do it you will need to "cvs login" with password 98passwd)
cmsRun -p Configuration/Applications/data/Zprime_Dijets_700_JetMETintegration.cfg 
This will generate, simulate and reconstruct 2 events of Z' decaying to dijets. Output files are

This procedure works for vanila CMSSW_0_6_0.

Setup working area

Usual sequence for CMSSW_0_6_0:

scramv1 project CMSSW CMSSW_0_6_0
cd CMSSW_0_6_0/src
eval `scramv1 runtime -csh`

Patch to CMSSW_0_6_0 to fix rare crashes and allow for iterative cone algorithm

cmscvsroot CMSSW
cvs co -r MP_IC_ALGO_051106 RecoJets 
scramv1 b
Get configuration files:

Particle Gun Example

Pythia Z'->Dijets Example

Pythia QCD->Dijets Config File

Generation

To generate, simulate and digitize 5 events with a single charged pion from a particle gun:
cmsRun -p Example_Gen+DetSim+Digi.cfg
To generate, simulate and digitize 5 events with 700 GeV Z'->Dijets :
cmsRun -p Example_Gen+DetSim+Digi_Pythia.cfg
The former file includes pt_gun.cfi, while the latter file includes pythia_Z700_dijets.cfi, and otherwise the two files are identical. Both jobs generate 5 events and produce file evtgen_detsim_digi.root containing generator level information, SimHits including CaloSimHits, and digis.
CMSSW_0_6_0_pre6 generation job may coredump in the very end. This is a known issue not affecting the generated data file.

Reconstruction

To reconstruct events in evtgen_detsim_digi.root that were generated with a particle gun:
cmsRun -p  Example_Calorimetry+Jets.cfg
To reconstruct events in evtgen_detsim_digi.root that were generated with Pythia:
cmsRun -p  Example_Calorimetry+Jets_Pythia.cfg
The two files look for generator level information in different places, needed by GenJets, but otherwise the two files are identical.
The produced file evtgen_jets.root contains generator level information, reconstructed intermediate objects, like CaloTowers, jets reconstructed from particles (GenJets), and jets reconstructed from CaloTowers (CaloJets).
This results in the following files for the case of Pythia Z'->dijets:
There is a larger file pythia_zprime_700GeV_400evts_Reco.root at /uscms_data/d1/cmsjtmet/data/ available on the CMS UAF.

Jet Analysis

As a hook for further analysis, let's make a simple distribution:
root.exe evtgen_jets.root
root [1] Events->Draw("CaloJets_mcone5.obj.m_data.e");
This plots energy of all reconstructed CaloJets reconstructed with midpoint algoithm and a cone size of 0.5.

Comments

Some comments to the configuration files are below...


        module out = PoolOutputModule {
            untracked string fileName = 'evtgen_jets.root'
            untracked vstring outputCommands = 
          {
            "keep *",
            "drop *_muoncscdigi_*_*",
            "drop *_muondtdigi_*_*",
            "drop *_stripdigi_*_*",
            "drop *_pixdigi_*_*",
            "drop *_hcaldigi_*_*",
            "drop *_ecaldigi_*_*",
            "drop *_SimG4Object_*_*"
          }
        } 
Drop all digis and all simulation objects from output.
   module genCandidates = HepMCCandidateProducer {
# pick right source - different for different generators
   	# string src = "PythiaSource"
   	string src = "FlatRandomPtGunSource"
        untracked bool verbose = false
        bool stableOnly = true
    	# vstring excludeList = { "nu(e)0", "nu(mu)0", "nu(tau)0", "mu-", "K(L)0", "n0" }
    	vstring excludeList = { }
  }
This converts generator level particles into generic CandidateCollection to be used as a unified input by jet algorithms. Note, that generator module name needs to be explicitly specified here. Note that no particles are excluded from the GenJets, although the user can exclude particles, and an example of how to do it is commented out above.
   module towermaker = CaloTowersCreator {
      double HBThreshold = 0.9     // GeV, Scheme B
      double HOThreshold = 1.1     // GeV, Scheme B
      double HESThreshold = 1.4    // GeV, Scheme B
      double HEDThreshold = 1.4    // GeV, Scheme B
      double HF1Threshold = 0.5    // GeV, ORCA value
      double HF2Threshold = 0.5    // GeV, ORCA value
      double EBThreshold = 0.09    // GeV, ORCA value w/o selective readout
      double EEThreshold = 0.45    // GeV, ORCA value w/o selective readout
      
      double EBSumThreshold = 0.2  // GeV, Scheme B
      double EESumThreshold = 0.45 // GeV, Scheme B
      double HcalThreshold = -1000 // GeV, -1000 means cut not used 
      double EcutTower = -1000     // GeV, -1000 means cut not used
      double EBWeight = 1.0
      double EEWeight = 1.0
      double HBWeight = 1.0
      double HESWeight = 1.0
      double HEDWeight = 1.0
      double HOWeight = 1.0
      double HF1Weight = 1.0
      double HF2Weight = 1.0
      bool UseHO = true
      string hbheInput = "recohbhe"
      string hoInput = "recoho"
      string hfInput = "recohf"
      vstring ecalInputs = {"ecalrechit/EcalRecHitsEB", "ecalrechit/EcalRecHitsEE" }
      untracked bool AllowMissingInputs = true
   }
This constructs CaloTowers with the Scheme B tower threshold cuts and including HO energy in the CaloTower's energy values and therefore also in the jets.
   module caloTowers = CaloTowerCandidateCreator {
          string src = "towermaker"
   }
 
This converts CaloTowers collection into generic CandidateCollection to be used as a unified input by jet algorithms.
   block mcone_jet_parameters = {
          untracked int32 debugLevel = 1
          double seedThreshold = 1.0
          double towerThreshold = 0.5
          double coneAreaFraction = 1.0
          int32 maxPairSize = 2
          int32 maxIterations = 100
          double overlapThreshold = .75
   }

   block kt_jet_parameters = {
          int32 ktAngle = 2
          int32 ktRecom = 1
          double ktECut = 1.0
          double ktRParam = 1.0
   }
Common MidConeJets and KtJets reconstruction parameters.
   module mcone5gen =  MidpointJetProducer {
          using mcone_jet_parameters
          double coneRadius = 0.5
          string src = "genCandidates"
          untracked string jetType = "GenJet"
   }

   module mcone7gen =  MidpointJetProducer {
          using mcone_jet_parameters
          double coneRadius = 0.7
          string src = "genCandidates"
          untracked string jetType = "GenJet"
   }

   module ktjetgen =  KtJetProducer {
          using kt_jet_parameters
          string src = "genCandidates"
          untracked string jetType = "GenJet"
         }
Specific parameters for MidCone 0.5, MidCone 0.7, and Kt jets reconstructed from Generator particles and producing specific CaloJets
  
   module mcone5 =  MidpointJetProducer {
          using mcone_jet_parameters
          double coneRadius = 0.5
          string src = "caloTowers"
          untracked string jetType = "CaloJet"
   }

   module mcone7 =  MidpointJetProducer {
          using mcone_jet_parameters
          double coneRadius = 0.7
          string src = "caloTowers"
          untracked string jetType = "CaloJet"
   }

   module ktjet =  KtJetProducer {
          using kt_jet_parameters
          string src = "caloTowers"
	  untracked string jetType = "CaloJet"
         }
Specific parameters for MidCone 0.5, MidCone 0.7, and Kt jets reconstructed from CaloTowers and producing specific CaloJets
Configurations for CMSSW_0_6_0_pre3 are still available: however generator jets are not fully functioning in this release.
Last updated July 24, 2006 by Fedor Ratnikov and Robert Harris