File indexing completed on 2024-04-06 12:25:30
0001 <html>
0002 <head>
0003 <title>Examples of Simulation+Reconstruction Chain in CMSSW</title>
0004 </head>
0005 <h2>
0006 Examples of Simulation+Reconstruction Chain in CMSSW
0007 </h2>
0008 <p>
0009 The user should be aware that CMSSW evolving rapidly,
0010 and all examples will change quickly. This page is for training
0011 people who will help in the rapid development and testing cycle. What you learn
0012 is not garanteed to work for very long . . .
0013 </p>
0014 <p>
0015 This procedure is supposed to work for vanila CMSSW_0_6_0.
0016 It has been tested with CMSSW_0_6_0_pre6 with some patches (see below)
0017 </p>
0018
0019 The full chain includes following steps:
0020 <ul>
0021 <li> Generation of the event. Producing generator level information.
0022 <li> Running GEANT4 simulation for the CMS detector. Producing SimHits.
0023 <li> Digitization, simulation of detector readout. Producing digits.
0024 <li> Calorimeter reconstruction. Producing CaloHits.
0025 <li> Combining CaloHits into Calorimeter towers. Producing CaloTowers.
0026 <li> Running jet algorithms. Producing Jets.
0027 </ul>
0028
0029 The entire chain is split into two pieces: generation and reconstruction.
0030
0031 <h3> Setup working area </h3>
0032 Usual sequence for CMSSW_0_6_0:
0033 <pre>
0034 scramv1 project CMSSW CMSSW_0_6_0
0035 cd CMSSW_0_6_0/src
0036 eval `scramv1 runtime -csh`
0037 </pre>
0038 Need extra patches for CMSSW_0_6_0_pre6:
0039 <pre>
0040 scramv1 project CMSSW CMSSW_0_6_0_pre6
0041 cd CMSSW_0_6_0_pre6/src
0042 cmscvsroot CMSSW
0043 cvs co -r V01-03-00 DataFormats/JetReco
0044 cvs co -r V00-01-07 RecoJets/JetAlgorithms
0045 cvs co -r V00-01-06 RecoJets/JetProducers
0046 cvs co -r V00-04-02 RecoLocalCalo/CaloTowersCreator
0047 eval `scramv1 runtime -csh`
0048 scramv1 b
0049 </pre>
0050 Get configuration files:
0051 <ul>
0052 <li> <a href='../../test/Example_Gen+DetSim+Digi.cfg'> Example_Gen+DetSim+Digi.cfg</a>
0053 <li> <a href='../../Example_Calorimetry+Jets.cfg'> Example_Calorimetry+Jets.cfg</a>
0054 <li> <a href='../../pt_gun.cfi'> pt_gun.cfi </a>
0055 <li> <a href='../../pythia_Z700_dijets.cfi'> pythia_Z700_dijets.cfi </a>
0056 </ul>
0057
0058 <h3> Generation </h3>
0059 The configuration file is <a href='../../Example_Gen+DetSim+Digi.cfg'> Example_Gen+DetSim+Digi.cfg</a>.
0060 To run particle gun sample, run
0061 <pre>
0062 cmsRun Example_Gen+DetSim+Digi.cfg
0063 </pre>
0064 To run Pythia Z'(700)->dijets,
0065 first include <a href='pythia_Z700_dijets.cfi'> pythia_Z700_dijets.cfi </a> instead of
0066 <a href='pt_gun.cfi'> pt_gun.cfi </a> in the Example_Gen+DetSim+Digi.cfg file.
0067
0068 It generates 5 events and produces file evtgen_detsim_digi.root containing generator level information, SimHits including
0069 CaloSimHits, and digis.
0070 <br>
0071 CMSSW_0_6_0_pre6 generation job may coredump in the very end. This is a known issue not affecting the generated data file.
0072
0073 <h3>Reconstruction </h3>
0074 The configuration file is <a href='Example_Calorimetry+Jets.cfg'> Example_Calorimetry+Jets.cfg</a>.
0075 To run particle gun sample, run
0076 <pre>
0077 cmsRun Example_Calorimetry+Jets.cfg
0078 </pre>
0079
0080 The produced file evtgen_jets.root contains generator level information, reconstructed intermediate objects,
0081 like CaloTowers, and also jets reconstracted using generator level information as well as true CaloTower
0082 information.
0083
0084 <p>Some comments to the configuration file are below...</p>
0085 <hr align='left' width=50%>
0086 <pre>
0087 module out = PoolOutputModule {
0088 untracked string fileName = 'evtgen_jets.root'
0089 untracked vstring outputCommands =
0090 {
0091 "keep *",
0092 "drop *_muoncscdigi_*_*",
0093 "drop *_muondtdigi_*_*",
0094 "drop *_stripdigi_*_*",
0095 "drop *_pixdigi_*_*",
0096 "drop *_hcaldigi_*_*",
0097 "drop *_ecaldigi_*_*",
0098 "drop *_SimG4Object_*_*"
0099 }
0100 }
0101 </pre>
0102 Drop all digis and all simulation objects from output.
0103 <hr align='left' width=50%>
0104 <pre>
0105 module genCandidates = HepMCCandidateProducer {
0106 # pick right source - different for different generators
0107 # string src = "PythiaSource"
0108 string src = "FlatRandomPtGunSource"
0109 untracked bool verbose = false
0110 bool stableOnly = true
0111 vstring excludeList = { "nu(e)0", "nu(mu)0", "nu(tau)0", "mu-", "K(L)0", "n0" }
0112 }
0113 </pre>
0114 This converts generator level particles into generic CandidateCollectin
0115 to be used as a unified input by jet algorithms.
0116 Note, that generator module name needs to be explicitly specified here.
0117 <hr align='left' width=50%>
0118 <pre>
0119 # module caloTowers = CaloTowerCandidateCreator {
0120 # string src = "towermaker"
0121 # }
0122 module caloTowers = CaloTowerCandidateProducer {
0123 string src = "towermaker"
0124 }
0125 </pre>
0126 This converts CaloTowers collection into generic CandidateCollectin
0127 to be used as a unified input by jet algorithms. In pre3 we still
0128 use CaloTowerCandidateProducer, however in later releases supported by
0129 the Calorimetry group CaloTowerCandidateCreator should be used.
0130 <hr align='left' width=50%>
0131 <pre>
0132 block mcone_jet_parameters = {
0133 untracked int32 debugLevel = 1
0134 double seedThreshold = 3.0
0135 double towerThreshold = 1.0
0136 double coneAreaFraction = 1.0
0137 int32 maxPairSize = 2
0138 int32 maxIterations = 100
0139 double overlapThreshold = .75
0140 }
0141
0142 block kt_jet_parameters = {
0143 int32 ktAngle = 2
0144 int32 ktRecom = 1
0145 double ktECut = 1.0
0146 double ktRParam = 1.0
0147 }
0148 </pre>
0149 Common MidConeJets and KtJets reconstruction parameters.
0150 <hr align='left' width=50%>
0151 <pre>
0152 module mcone5gen = MidpointJetProducer {
0153 using mcone_jet_parameters
0154 double coneRadius = 0.5
0155 string src = "genCandidates"
0156 untracked string jetType = "GenJet"
0157 }
0158
0159 module mcone7gen = MidpointJetProducer {
0160 using mcone_jet_parameters
0161 double coneRadius = 0.7
0162 string src = "genCandidates"
0163 untracked string jetType = "GenJet"
0164 }
0165
0166 module ktjetgen = KtJetProducer {
0167 using kt_jet_parameters
0168 string src = "genCandidates"
0169 untracked string jetType = "GenJet"
0170 }
0171 </pre>
0172 Specific parameters for MidCone 0.5, MidCone 0.7, and Kt jets reconstructed
0173 from Generator particles and producing specific CaloJets
0174 <hr align='left' width=50%>
0175 <pre>
0176 module mcone5 = MidpointJetProducer {
0177 using mcone_jet_parameters
0178 double coneRadius = 0.5
0179 string src = "caloTowers"
0180 untracked string jetType = "CaloJet"
0181 }
0182
0183 module mcone7 = MidpointJetProducer {
0184 using mcone_jet_parameters
0185 double coneRadius = 0.7
0186 string src = "caloTowers"
0187 untracked string jetType = "CaloJet"
0188 }
0189
0190 module ktjet = KtJetProducer {
0191 using kt_jet_parameters
0192 string src = "caloTowers"
0193 untracked string jetType = "CaloJet"
0194 }
0195 </pre>
0196 Specific parameters for MidCone 0.5, MidCone 0.7, and Kt jets reconstructed
0197 from CaloTowers and producing specific CaloJets
0198
0199 <h3> Jet Analysis </h3>
0200 As a hook for further analysis, let's make a simple distribution:
0201 <pre>
0202 root.exe evtgen_jets.root
0203 root [1] Events->Draw("CaloJets_mcone5.obj.m_data.e:GenJets_mcone5gen.obj.m_data.e");
0204 </pre>
0205 This plots energy of reconstructed CaloJet vs energy of corresponding reconstructed GenJet.
0206
0207 <hr align=center>
0208 Last updated
0209 May 2, 2006 by <a HREF="mailto:ratnikov@fnal.gov"> Fedor Ratnikov </a>
0210 </html>