<!-- ====================== SETTINGS FOR THIS PAGE: (active are only those with 3 spaces before `*') ====================== HIGHLIGT (VERBATIM and SYNTAX) * Set USERSTYLEURL = https://twiki.cern.ch/twiki/pub/Main/AlexanderFedotov/My_Highlight.css HIDE LEFT BAR * Set USERSTYLEURL = https://twiki.cern.ch/twiki/pub/TWiki/PatternSkinCssCookbookNoLeftBar/hideleftbar.css HIGHLIGT + HIDE LEFT BAR * Set USERSTYLEURL = https://twiki.cern.ch/twiki/pub/Main/AlexanderFedotov/My_Highlight_Hideleftbar.css LATEX VIA MATHMODEPLUGIN * Set DISABLEDPLUGINS = LatexModePlugin * Set LATEXFONTSIZE = footnotesize DEFINE A VARIABLE (reference with %My40Blanks%) * Set My40Blanks = --> -- Main.AlexanderFedotov - 24-Jul-2010 <center> | <h1> Learning Pythia6 output for photon+jets </h1> | </center> %TOC{ title = "Sections:" }% ---++ Links <!-- ================================================= --> %TABLE{tableframe = "void" tablerules ="none" headerbg="#FFFFFF" headercolor="#000000" tablewidth="100%" columnwidths="60%,40%"}% |CMSPublic.SWGuideDataFormatTable| \ *Data Format Tables for the Offline Guide*| %My40Blanks% Contents: %TWISTY{showlink="Show" hidelink="Hide"}% %TOC{"SWGuideDataFormatTable" web = "CMSPublic"}% %ENDTWISTY% <!-- ================================================= --> %TABLE{tableframe = "void" tablerules ="none" headerbg="#FFFFFF" headercolor="#000000" tablewidth="100%" columnwidths="60%,40%"}% |CMSPublic.SWGuideDataFormatGeneratorInterface| \ *Data Formats in !GeneratorInterface*| %My40Blanks% Contents: %TWISTY{showlink="Show" hidelink="Hide"}% %TOC{"SWGuideDataFormatGeneratorInterface" web = "CMSPublic"}% %ENDTWISTY% <!-- ================================================= --> %TABLE{tableframe = "void" tablerules ="none" headerbg="#FFFFFF" headercolor="#000000" tablewidth="100%" columnwidths="60%,40%"}% |CMSPublic.WorkBookGenParticleCandidate| \ *Generator event format in AOD*| %My40Blanks% Contents: %TWISTY{showlink="Show" hidelink="Hide"}% %TOC{"WorkBookGenParticleCandidate" web = "CMSPublic"}% %ENDTWISTY% <!-- ================================================= --> %TABLE{tableframe = "void" tablerules ="none" headerbg="#FFFFFF" headercolor="#000000" tablewidth="100%" columnwidths="60%,40%"}% |CMSPublic.SWGuideEventGeneration| \ *Event Generation Offline Guide*| %My40Blanks% Contents: %TWISTY{showlink="Show" hidelink="Hide"}% %TOC{"SWGuideEventGeneration" web = "CMSPublic"}% %ENDTWISTY% <!-- ================================================= --> %TABLE{tableframe = "void" tablerules ="none" headerbg="#FFFFFF" headercolor="#000000" tablewidth="100%" columnwidths="60%,40%"}% |CMSPublic.SWGuidePythia6Interface| \ *Pythia6 Interface to CMSSW*| %My40Blanks% Contents: %TWISTY{showlink="Show" hidelink="Hide"}% %TOC{"SWGuidePythia6Interface" web = "CMSPublic"}% %ENDTWISTY% <!-- ================================================= --> %TABLE{tableframe = "void" tablerules ="none" headerbg="#FFFFFF" headercolor="#000000" tablewidth="100%" columnwidths="60%,40%"}% |CMSPublic.SWGuidePhysicsTools| \ *Physics Analysis Tools Offline Guide*| %My40Blanks% Contents: %TWISTY{showlink="Show" hidelink="Hide"}% %TOC{"SWGuidePhysicsTools" web = "CMSPublic"}% %ENDTWISTY% <!-- ================================================= --> %TABLE{tableframe = "void" tablerules ="none" headerbg="#FFFFFF" headercolor="#000000" tablewidth="100%" columnwidths="60%,40%"}% |CMSPublic.SWGuideCandidateModules| \ *Common Candidate Modules*| %My40Blanks% Contents: %TWISTY{showlink="Show" hidelink="Hide"}% %TOC{"SWGuideCandidateModules" web = "CMSPublic"}% %ENDTWISTY% ---++ Products ---+++ All GEN-SIM-RECO products #TheFile ---++++ A GEN-SIM-RECO file The following dataset of Pythya6 origin was chosen for tests: * [[https://cmsweb.cern.ch/dbs_discovery/getData?ajax=0&phedex=off&userMode=user&group=*&tier=*&app=*&primD=*&site=*&caseSensitive=on&dbsInst=cms_dbs_prod_global&proc=%2FRelValPhotonJets_Pt_10%2FCMSSW_3_7_0-START37_V4-v1%2FGEN-SIM-RECO][/RelValPhotonJets_Pt_10/CMSSW_3_7_0-START37_V4-v1/GEN-SIM-RECO ]] * 9000 evs in 5 files: %TWISTY{}% %SYNTAX{"python"}% replace PoolSource.fileNames = { '/store/relval/CMSSW_3_7_0/RelValPhotonJets_Pt_10/GEN-SIM-RECO/START37_V4-v1/0026/028B3ACD-8E69-DF11-8530-002618943877.root', '/store/relval/CMSSW_3_7_0/RelValPhotonJets_Pt_10/GEN-SIM-RECO/START37_V4-v1/0024/EA7C9196-3A69-DF11-B02C-00304867BF18.root', '/store/relval/CMSSW_3_7_0/RelValPhotonJets_Pt_10/GEN-SIM-RECO/START37_V4-v1/0024/C450BF07-3969-DF11-8F9A-00248C55CC97.root', '/store/relval/CMSSW_3_7_0/RelValPhotonJets_Pt_10/GEN-SIM-RECO/START37_V4-v1/0024/BE5CCD08-3869-DF11-9158-001A92971B68.root', '/store/relval/CMSSW_3_7_0/RelValPhotonJets_Pt_10/GEN-SIM-RECO/START37_V4-v1/0024/4E27E978-3869-DF11-BEEE-002618943925.root' } %ENDSYNTAX% %ENDTWISTY% * Its parent dataset /RelValPhotonJets_Pt_10/CMSSW_3_7_0-START37_V4-v1/GEN-SIM-DIGI-RAW-HLTDEBUG had the following pythia parameters in the config file: %TWISTY{}% %SYNTAX{"python"}% process.generator = cms.EDFilter("Pythia6GeneratorFilter", pythiaPylistVerbosity = cms.untracked.int32(0), filterEfficiency = cms.untracked.double(1.0), pythiaHepMCVerbosity = cms.untracked.bool(False), comEnergy = cms.double(7000.0), maxEventsToPrint = cms.untracked.int32(0), PythiaParameters = cms.PSet( pythiaUESettings = cms.vstring('MSTJ(11)=3 ! Choice of the fragmentation function', 'MSTJ(22)=2 ! Decay those unstable particles', 'PARJ(71)=10 . ! for which ctau 10 mm', 'MSTP(2)=1 ! which order running alphaS', 'MSTP(33)=0 ! no K factors in hard cross sections', 'MSTP(51)=10042 ! structure function chosen (external PDF CTEQ6L1)', 'MSTP(52)=2 ! work with LHAPDF', 'MSTP(81)=1 ! multiple parton interactions 1 is Pythia default', 'MSTP(82)=4 ! Defines the multi-parton model', 'MSTU(21)=1 ! Check on possible errors during program execution', 'PARP(82)=1.8387 ! pt cutoff for multiparton interactions', 'PARP(89)=1960. ! sqrts for which PARP82 is set', 'PARP(83)=0.5 ! Multiple interactions: matter distrbn parameter', 'PARP(84)=0.4 ! Multiple interactions: matter distribution parameter', 'PARP(90)=0.16 ! Multiple interactions: rescaling power', 'PARP(67)=2.5 ! amount of initial-state radiation', 'PARP(85)=1.0 ! gluon prod. mechanism in MI', 'PARP(86)=1.0 ! gluon prod. mechanism in MI', 'PARP(62)=1.25 ! ', 'PARP(64)=0.2 ! ', 'MSTP(91)=1 !', 'PARP(91)=2.1 ! kt distribution', 'PARP(93)=15.0 ! '), processParameters = cms.vstring('MSEL=10 ! Pythia Photon+Jet processes', 'CKIN(3)=10. ! minimum pt hat for hard interactions'), parameterSets = cms.vstring('pythiaUESettings', 'processParameters') ) ) %ENDSYNTAX% %ENDTWISTY% #ListOfProd ---++++ List of products The full list of products in the [[#TheFile][above dataset]] was obtained by * copying one event to a separate file ([[http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/UserCode/fedotov/ut/jobs/copy_data_from_store/copy_cfg.py?revision=1.1&view=markup][ copy job ]]) * applying the ==edmDumpEventContent== utility to the one-event file * [[Main.AVFedotovLogA008App1][ *the output* ]] _Another type_ of the list was obtained by running the [[https://twiki.cern.ch/twiki/bin/view/CMS/WorkBookTroubleShooting#EventContent][ \ ==EventContentAnalyzer== ]] * [[Main.AVFedotovLogA008App2][ *the list* ]] ---++++ Product sizes The _product sizes_ were obtained with the ==edmEventSize== utility ( CMS.SWGuideEdmEventSize , [[https://twiki.cern.ch/twiki/bin/view/CMS/WorkBookEdmUtilities#edm_EventSize][ \ WorkBook reference]] ) %SYNTAX{"sh"}% edmEventSize -v -o out rfio:///castor/cern.ch/cms//store/relval/CMSSW_3_7_0/RelValPhotonJets_Pt_10/GEN-SIM-RECO/START37_V4-v1/0024/EA7C9196-3A69-DF11-B02C-00304867BF18.root %ENDSYNTAX% * [[%ATTACHURL%/edmEventSize.out.txt][ *the output file* ==out== ]] *Note:* the two reported numbers for a products are the average _plain and compressed sizes (in bytes)._ The sum of compressed sizes over all products, 355757 bytes, can be compared to the average record size = (file length) / nEvents = 746345755/2000 = 373173 . => The overhead for the event structure seems to be about 5% . ---+++ Generator products A table from CMS.SWGuideDataFormatGeneratorInterface with links corrected: %TABLE{ tablerules="all" databg="#ffffff" }% |*InputTag/Module (Instance name)* |*Container* |*Description* | |||| | *GeneratorInterface collections (in RECOSIM and AODSIM)* ||| | generator | [[http://cmsdoc.cern.ch/cms/cpt/Software/html/General/redirect.php?r=3_7_0&c=GenEventInfoProduct][GenEventInfoProduct]] | General characteristics of a generated event. | | generator | [[http://cmsdoc.cern.ch/cms/cpt/Software/html/General/redirect.php?r=3_7_0&c=GenRunInfoProduct][GenRunInfoProduct]] | Run-specific parameters that define event generation, such as cross-sections, etc. | | *GeneratorInterface collections (in RECOSIM only)* ||| | generator | [[http://cmsdoc.cern.ch/cms/cpt/Software/html/General/redirect.php?r=3_7_0&c=HepMCProduct][edm::HepMCProduct]] | A tree of final-state particles that form a generated event. | | generator | [[http://cmsdoc.cern.ch/cms/cpt/Software/html/General/redirect.php?r=3_7_0&c=GenEventInfoProduct][GenEventInfoProduct]] | General characteristics of a generated event. | | generator | [[http://cmsdoc.cern.ch/cms/cpt/Software/html/General/redirect.php?r=3_7_0&c=GenRunInfoProduct][GenRunInfoProduct]] | Run-specific parameters that define event generation, such as cross-sections, etc. | ---++++ Examples of accessing =edm::HepMCProduct= , =GenEventInfoProduct= and =GenRunInfoProduct= Simple examples are given in CMS.SWGuideDataFormatGeneratorInterface in the section [[https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideDataFormatGeneratorInterface#How_to_use_the_table ][ \ How_to_use_the_table ]] ---++++ Example: fetching %RED% pthat %ENDCOLOR% The example is taken from * [[http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/GeneratorInterface/Pythia6Interface/test/HZZ4muAnalyzer.cc?revision=1.8&view=markup][CMSSW/GeneratorInterface/Pythia6Interface/test/HZZ4muAnalyzer.cc]] %SYNTAX{ "cpp" }% //. . . #include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" //. . . void HZZ4muAnalyzer::analyze( const Event& e, const EventSetup& ) { Handle< GenEventInfoProduct > GenInfoHandle; e.getByLabel( "generator", GenInfoHandle ); double pthat = ( GenInfoHandle->hasBinningValues() ? (GenInfoHandle->binningValues())[0] : 0.0); //. . . %ENDSYNTAX% ---++++ ==BuildFile== : taking care of While accessing a generator product, do not forget to add a coresponding line to the ==BuildFile== . E.g., in case of =GenEventInfoProduct=, the following line has to be added: <verbatim> <use name=SimDataFormats/GeneratorProducts> </verbatim> Otherwise an unclear *fatal* linking *error* message will be issued by =scramv1 b= : %PURPLE% <br>.../libYOUR-PACKAGE-NAME.so: undefined reference to `typeinfo for !GenEventInfoProduct' <br> collect2: ld returned 1 exit status %ENDCOLOR% ---+++ reco::%RED%GenParticleCollection%ENDCOLOR% ---++++ Definition In the CMS.AOD event content, the %RED% edm::HepMCProduct %ENDCOLOR% format of the generated event is *replaced* by the "lighter" (about 2 times) record/product of type %SYNTAX{"cpp"}% reco::GenParticleCollection %ENDSYNTAX% The %GREEN% reco::GenParticleCollection %ENDCOLOR% [[http://cms-service-sdtweb.web.cern.ch/cms-service-sdtweb/doxygen/new1/CMSSW_3_7_0/doc/html/d8/da7/GenParticleFwd_8h.html][ \ is ]] *a typedef* for %SYNTAX{"cpp"}% std::vector < reco::GenParticle > %ENDSYNTAX% For an info on the __reco::GenParticle__ , see [[#CenParticle][ below ]] ---++++ !GenParticleProducer The _reco::GenParticleCollection_ is *produced* from the _reco::HepMCProduct_ by the *GenParticleProducer* * [[http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/PhysicsTools/HepMCCandAlgos/plugins/GenParticleProducer.cc?view=log ][ \ CMSSW/PhysicsTools/HepMCCandAlgos/plugins/GenParticleProducer.cc]] configured with the * [[http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/PhysicsTools/HepMCCandAlgos/python/genParticles_cfi.py?sortdir=down&view=log ][ \ .../python/genParticles_cfi.py]] . There are short descriptions of the module in [[https://twiki.cern.ch/twiki/bin/view/CMS/WorkBookGenParticleCandidate#GenParticle_Conversion_from_HepM][ \ !WorkBook ]] and [[https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCandidateModules#GenParticleProducer ][ \ SWGuide]] (%RED% ? %ENDCOLOR% both claim that the configuration file is located in the _.../data/_ directory which seems to be empty actually). ---++++ !GenParticleCollection in the edmDumpEventContent output The _reco::GenParticleCollection_ is reported in the [[#ListOfProd][ above Full List of Pruducts ]] as <verbatim> vector<reco::GenParticle> "genParticles" "" "HLT." </verbatim> There is another product with the label __genParticles__ also originating from the !GenParticleProducer : <verbatim> vector<int> "genParticles" "" "HLT." </verbatim> whose content %RED% is not clear %ENDCOLOR% . #CenParticle ---++++ reco::%RED%GenParticle%ENDCOLOR% * [[http://cms-service-sdtweb.web.cern.ch/cms-service-sdtweb/doxygen/new1/CMSSW_3_7_0/doc/html/d5/dd4/classreco_1_1GenParticle.html][ \ Class Reference ]] * header file: %SYNTAX{ "cpp"}% #include <DataFormats/HepMCCandidate/interface/GenParticle.h> %ENDSYNTAX% #InheritanceDiagram * inheritance diagram: <center> %TABLE{databg = "#FFFF00" }% | [[http://cms-service-sdtweb.web.cern.ch/cms-service-sdtweb/doxygen/new1/CMSSW_3_7_0/doc/html/de/d9a/classreco_1_1Candidate.html][ \ *reco::Candidate* ]]| %ICON{parent_gray}% %TABLE{databg = "#FFFF00" }% | [[http://cms-service-sdtweb.web.cern.ch/cms-service-sdtweb/doxygen/new1/CMSSW_3_7_0/doc/html/dc/d78/classreco_1_1LeafCandidate.html][ \ *reco::LeafCandidate* ]] | %ICON{parent_gray}% %TABLE{databg = "#FFFF00" }% | [[http://cms-service-sdtweb.web.cern.ch/cms-service-sdtweb/doxygen/new1/CMSSW_3_7_0/doc/html/de/d46/classreco_1_1CompositeRefCandidateT.html][ \ *reco::CompositeRefCandidateT* ]] <br> *<* \ [[http://cms-service-sdtweb.web.cern.ch/cms-service-sdtweb/doxygen/new1/CMSSW_3_7_0/doc/html/d8/da7/GenParticleFwd_8h.html][ \ *reco::GenParticleRefVector* ]] *>* | %ICON{parent_gray}% %TABLE{databg = "#FFE4B5"}% | [[http://cms-service-sdtweb.web.cern.ch/cms-service-sdtweb/doxygen/new1/CMSSW_3_7_0/doc/html/d5/dd4/classreco_1_1GenParticle.html][ \ *reco::GenParticle* ]]| </center> * The _generator particles_ may contain _mother_ and/or _daughter_ links to particles in the same collection (picture from [[https://twiki.cern.ch/twiki/pub/CMS/WorkBookGenParticleCandidate/GenParticleCandidate.gif][ \ here]]): <center> <!-- the external link does not work sometimes! %IMAGE{"GenParticleCandidate.gif" web="CMS" topic="WorkBookGenParticleCandidate" size="300"}% ---> <img src="%ATTACHURLPATH%/WorkBookGenParticleCandidate.GenParticleCandidate.gif" width='300' /> </center> ---+++++ =pdgID()= and =status()= member functions of reco::GenParticle The material is [[https://twiki.cern.ch/twiki/bin/view/CMS/WorkBookGenParticleCandidate#GenPCand ][ \ from the !WorkBook ]]. * ==pdgId()== : a [[http://pdg.lbl.gov/2005/reviews/montecarlorpp.pdf][PDG identifier]] (=pdg_id()= in =HepMC::GenParticle=) * ==status()== : a status code (=status()= in =HepMC::GenParticle=). Standard status codes are described in [[http://lcgapp.cern.ch/project/simu/HepMC/20400/HepMC2_user_manual.pdf][HepMC manual]] . <br><br> * Status codes have the following convention in *Pythia*: <br><br> %TABLE{ tablerules="all" databg="#ffffff" }% | *Value* | *Meaning* | | 0 | null entry | | 1 | existing entry not decayed or fragmented, represents the final state as given by the generator | | 2 | decayed or fragmented entry (i.e. decayed particle or parton produced in shower.)| | 3 | identifes the "hard part" of the interaction, i.e. the partons that are used in the matrix element calculation, including immediate decays of resonances. (documentation entry, defined separately from the event history. _"This includes the two incoming colliding particles and partons produced in hard interaction."_ [ [[http://cepa.fnal.gov/psm/simulation/mcgen/lund/pythia_manual/pythia6.3/pythia6301/node39.html][*]] ]) | | 4-10 | undefined, reserved for future standards | | 11-200 | at the disposal of each model builder equivalent to a null line | | 201-... | at the disposal of the user, in particular for event tracking in the detector | <br> * Other generators may have more complex conventions. See, for instance: <br> * [[http://webber.home.cern.ch/webber/hw65_manual.html#htoc96][ \ *Herwig* particle codes ]] ---++++ Example of accessing a !GenParticleCollection The example is [[https://twiki.cern.ch/twiki/bin/view/CMS/WorkBookGenParticleCandidate#GenPColl ][ \ from the !WorkBook ]] . %SYNTAX{"cpp"}% #include "DataFormats/HepMCCandidate/interface/GenParticle.h" using namespace reco; // to access types reco::GenParticleCollection , // reco::Candidate void MyModule::analyze(const edm::Event & event, ...) { // get the handle Handle<GenParticleCollection> genParticles; event.getByLabel("genParticles", genParticles); // loop over particles for(size_t i = 0; i < genParticles->size(); ++ i) { // the reference p to the i-th particle: const GenParticle & p = (*genParticles)[i]; // get pdgId: int id = p.pdgId(); // get status: int st = p.status(); // get pointer to mother (reco::Candidate type!): const Candidate * mom = p.mother(); // get pt, eta, phi, mass: double pt = p.pt(), eta = p.eta(), phi = p.phi(), mass = p.mass(); // get vertex components: double vx = p.vx(), vy = p.vy(), vz = p.vz(); // get charge: int charge = p.charge(); // get no. of daughters: int n = p.numberOfDaughters(); // loop over daughters: for(size_t j = 0; j < n; ++ j) { // get pointer d to a daughter (reco::Candidate type!): const Candidate * d = p.daughter( j ); // get daughter's id: int dauId = d->pdgId(); // . . . } // . . . } } %ENDSYNTAX% *Notes:* * The ==reco::GenParticle== __member functions__ mentioned in the above example, are defined as _purely virtual_ in the base class ==reco::Candidate== , then actually implemented in the class ==reco::LeafCandidate== (see [[#InheritanceDiagram][ InheritanceDiagram ]]). * There are __many more__ inherited __member functions__ (see _links_ from the [[#InheritanceDiagram][ InheritanceDiagram ]]). * Check *typedef's* in the __reco:: namespace__: * in the [[http://cms-service-sdtweb.web.cern.ch/cms-service-sdtweb/doxygen/new1/CMSSW_3_7_0/doc/html/de/d9a/classreco_1_1Candidate.html][ \ reco::Candidate Class Reference]] <br> (corresponds to the =DataFormats/Candidate/interface/Candidate.h= ), * in the [[http://cms-service-sdtweb.web.cern.ch/cms-service-sdtweb/doxygen/new1/CMSSW_3_7_0/doc/html/db/dd4/CandidateFwd_8h.html][ \ CandidateFwd.h File Reference]] , * and (?) similar references in the inheritance chain. #ParticleListDrawer ---++++ Using the %RED% !ParticleListDrawer %ENDCOLOR% plugin as a slave class in an !EDAnalyzer The [[http://cms-service-sdtweb.web.cern.ch/cms-service-sdtweb/doxygen/new1/CMSSW_3_7_0/doc/html/de/dc4/classParticleListDrawer.html][ \ !ParticleListDrawer ]] module produces the output which is similar to the one from the Pythia routine PYLIST. The plugin usage is described [[https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCandidateModules#ParticleListDrawer_Utility][ \ in !SWGuide ]]. One can also use it directly from c++ of an !EDAnalyzer. Here is an example. 1. Add into your ==..._cfg.py== : * the *load* statement: %SYNTAX{"python"}% process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi") %ENDSYNTAX% * The file =SimGeneral/HepPDTESSource/python/pythiapdt_cfi.py= gets loaded containing %SYNTAX{"python"}% HepPDTESSource = cms.ESSource( "HepPDTESSource", pdtFileName = cms.FileInPath( 'SimGeneral/HepPDTESSource/data/pythiaparticle.tbl' ) ) %ENDSYNTAX% * the =ParticleListDrawerConfig= _parameter set_ to the configuration block of your Analyzer module. This parameter set will be used later on to config a _ParticleListDrawer object_ in your code: %SYNTAX{"python"}% . . . process.aName = cms.EDAnalyzer( 'YourAnalyzerName', . . . , # # parameter set for a ParticleListDrawer object: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ParticleListDrawerConfig = cms.untracked.PSet( # +--------------------------------------+ # parameter default # +--------------------------------------+ # src "src" # maxEventsToPrint 1 # printVertex False # printOnlyHardInteraction False # useMessageLogger False # +--------------------------------------+ src = cms.InputTag ("genParticles"), maxEventsToPrint = cms.untracked.int32 (-1) # default settings are commented out: #printVertex = cms.untracked.bool (False) #printOnlyHardInteraction = cms.untracked.bool (False) #useMessageLogger = cms.untracked.bool (False) ) ) . . . process.p = cms.Path(process.aName) %ENDSYNTAX% The name =ParticleListDrawerConfig= is chosen arbitrarily. Also the configuration options may be different. 2. In the ==YourAnalizer.cc==: * add the following *#include* e.g. as the first =include= : %SYNTAX{"cpp"}% //include other plugins: #include "PhysicsTools/HepMCCandAlgos/plugins/ParticleListDrawer.cc" %ENDSYNTAX% * add a *data member* _in the class prototype_: %SYNTAX{"cpp"}% public: // or private: . . . ParticleListDrawer * partListDr; %ENDSYNTAX% * *instantiate* the object _in the constructor_: %SYNTAX{"cpp"}% YourAnalyzer:: YourAnalyzer ( const edm::ParameterSet & iConfig) { partListDr = new ParticleListDrawer ( iConfig.getUntrackedParameterSet ("ParticleListDrawerConfig") ) ; . . . %ENDSYNTAX% * finally, *print the list* whenever you want _in the `analyze' function_: %SYNTAX{"cpp"}% void YourAnalyzer:: analyze ( const edm::Event & iEvent, const edm::EventSetup & iSetup) { . . . if (. . .) partListDr -> analyze( iEvent, iSetup) ; . . . %ENDSYNTAX% 3. Add to your ==BuildFile== : %SYNTAX{"wmlscript"}% . . . <use name=PhysicsTools/HepMCCandAlgos> <use name=DataFormats/Candidate> . . . <export> . . . <use name=PhysicsTools/HepMCCandAlgos> <use name=DataFormats/Candidate> </export> %ENDSYNTAX% ---+++++ %RED% !ParticleTreeDrawer %ENDCOLOR% as a slave The use case for the [[http://cms-service-sdtweb.web.cern.ch/cms-service-sdtweb/doxygen/new1/CMSSW_3_7_0/doc/html/d1/d7c/classParticleTreeDrawer.html][ \ !ParticleTreeDrawer]] described in [[https://twiki.cern.ch/twiki/bin/viewauth/CMS/SWGuideCandidateModules#ParticleTreeDrawer_Utility][ \ in SWGuide]] would be __identical__ (up to a different configuration) to the [[#ParticleListDrawer][ !Particle%RED%List%ENDCOLOR%Drawer above ]] __if__ the ==analyze== function of the !ParticleTreeDrawer __would not be declared__ *private*. The way out is * to copy the =PhysicsTools/HepMCCandAlgos/plugins/ParticleTreeDrawer.cc= to our package =src= directory, * change *private:* to *public:* for the ==analyze== function * split the file into a ==.h== and ==.cc== (or may be (?) just rename the ==.cc== into ==.h== ) * and then proceed similarily to the [[#ParticleListDrawer][ !ParticleListDrawer case]] The *include* line should now be %SYNTAX{"cpp"}% //include other plugins: // In the standard ParticleTreeDrawer, `analyse' is private // => use a local version where it has been made public //#include "PhysicsTools/HepMCCandAlgos/plugins/ParticleTreeDrawer.cc" #include "ParticleTreeDrawer.h" %ENDSYNTAX% And the configuration for the !ParticleTreeDrawer has to be different: %SYNTAX{"python"}% . . process.aName = cms.EDAnalyzer( 'YourAnalyzerName', . . . , # # parameter set for a ParticleTreeDrawer object: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ParticleTreeDrawerConfig = cms.untracked.PSet( # +----------------------------------------------------+ # parameter default # +----------------------------------------------------+ # src "src" # printP4 False # printPtEtaPhi False # printVertex False # printStatus False # printIndex False # status empty list of statuses (means: print all) # +----------------------------------------------------+ src = cms.InputTag ("genParticles"), printIndex = cms.untracked.bool (True), status = cms.untracked.vint32 (3) # default settings are commented out: #printP4 = cms.untracked.bool (False), #printPtEtaPhi = cms.untracked.bool (False), #printVertex = cms.untracked.bool (False), #printStatus = cms.untracked.bool (True), ) ) . . . process.p = cms.Path(process.aName) %ENDSYNTAX% In the above example only the particles from the _hard part_ of the interaction (status code = 3) are printed out. It is noteworthy that a _full_ listing is too long and indigestible. ---++++ PYLIST's and Parton Flow sketches for ISUB=29,14,18 There are three subprocesses occuring in the [[#TheFile][file above]] (the subrocess number comes from the =GenEventInfoProduct::signalProcessID()= function, %TWISTY{}% %SYNTAX{"cpp"}% // get handle to the GenEventInfoProduct edm::Handle < GenEventInfoProduct > genEvInfo ; iEvent.getByLabel (genEventInfoLabel_ , genEvInfo) ; // get pythia subprocess: int pyIsub = (int) genEvInfo -> signalProcessID () ; %ENDSYNTAX% %ENDTWISTY% ): <center> <img src="%ATTACHURLPATH%/SignalProcessId.gif" alt="SignalProcessId.gif" width='300' /> <br> %ICON{arrowdown}% <font size="-2">zoom</font> <br> <img src="%ATTACHURLPATH%/SignalProcessId.zoomed.gif" alt="SignalProcessId.zoomed.gif" width='400' /> <br> [[%ATTACHURLPATH%/SignalProcessId.zoomed.gif ][ gif ]] </center> Thus, one has: <center> %TABLE{ tablerules="all" databg="#ffffff" }% | *subprocess* || *fraction* | | 29 | %$ q_i g \to q_i \gamma$% | 93 % | | 14 | %$ q_i \bar{q}_i \to g \gamma $% | 7 % | | 18 | %$ f_i \bar{f}_i \to \gamma \gamma $% | .02 % | | possible but not present (too low statistics?): ||| | 114 | %$ g g \to \gamma \gamma $% | 0 | | 115 | %$ g g \to g \gamma $% | 0 | </center> Some PYLIST's (the outputs of the [[#ParticleListDrawer][ !ParticleListDrawer ]] actually ) for the available subprocesses can be found in the following text files: * [[%ATTACHURL%/pylist.pthat15.isub29.txt][ \ ISUB = 29]] (10 evs with pthat > 15 !GeV) * [[%ATTACHURL%/pylist.pthat15.isub14.txt][ \ ISUB = 14]] (10 evs with pthat > 15 !GeV) * [[%ATTACHURL%/pylist.pthat10.isub18.txt][ \ ISUB = 18]] (2 evs with pthat > 10 !GeV) One can also look at the *parton-flow sketches* made for the first few events from each of the above files: %TWISTY{}% <br> <!-- =========================================================== --> <br> \ *ISUB = 29:* %TWISTY{}% <!-- ========= event =========== --> \ *Event 1:* %TWISTY{}% <center> <img src="%ATTACHURLPATH%/PartonFlow.isub29.ev1.gif" alt="PartonFlow.isub29.ev1.gif" width='500' /> </center> %ENDTWISTY% <!-- ========= event =========== --> \ *Event 2:* %TWISTY{}% <center> <img src="%ATTACHURLPATH%/PartonFlow.isub29.ev2.gif" alt="PartonFlow.isub29.ev2.gif" width='500' /> </center> %ENDTWISTY% <!-- ========= event =========== --> \ *Event 3:* %TWISTY{}% <center> <img src="%ATTACHURLPATH%/PartonFlow.isub29.ev3.gif" alt="PartonFlow.isub29.ev3.gif" width='500' /> </center> %ENDTWISTY% <!-- ========= event =========== --> \ *Event 4:* %TWISTY{}% <center> <img src="%ATTACHURLPATH%/PartonFlow.isub29.ev4.gif" alt="PartonFlow.isub29.ev4.gif" width='500' /> </center> %ENDTWISTY% %ENDTWISTY% <!-- =========================================================== --> <br> \ *ISUB = 14:* %TWISTY{}% <!-- ========= event =========== --> \ *Event 1:* %TWISTY{}% <center> <img src="%ATTACHURLPATH%/PartonFlow.isub14.ev1.gif" alt="PartonFlow.isub14.ev1.gif" width='500' /> </center> %ENDTWISTY% <!-- ========= event =========== --> \ *Event 2:* %TWISTY{}% <center> <img src="%ATTACHURLPATH%/PartonFlow.isub14.ev2.gif" alt="PartonFlow.isub14.ev2.gif" width='500' /> </center> %ENDTWISTY% <!-- ========= event =========== --> \ *Event 3:* %TWISTY{}% <center> <img src="%ATTACHURLPATH%/PartonFlow.isub14.ev3.gif" alt="PartonFlow.isub14.ev3.gif" width='500' /> </center> %ENDTWISTY% %ENDTWISTY% <!-- =========================================================== --> <br> \ *ISUB = 18:* %TWISTY{}% <!-- ========= event =========== --> \ *Event 1:* %TWISTY{}% <center> <img src="%ATTACHURLPATH%/PartonFlow.isub18.ev1.gif" alt="PartonFlow.isub18.ev1.gif" width='500' /> </center> %ENDTWISTY% <!-- ========= event =========== --> \ *Event 2:* %TWISTY{}% <center> <img src="%ATTACHURLPATH%/PartonFlow.isub18.ev2.gif" alt="PartonFlow.isub18.ev2.gif" width='500' /> </center> %ENDTWISTY% %ENDTWISTY% <!-- =========================================================== --> <br><br> Original files: \ *gif:* %TWISTY{}% ISUB=29: [[%ATTACHURLPATH%/PartonFlow.isub29.ev1.gif ][ 1 ]], [[%ATTACHURLPATH%/PartonFlow.isub29.ev2.gif ][ 2 ]], [[%ATTACHURLPATH%/PartonFlow.isub29.ev3.gif ][ 3 ]], [[%ATTACHURLPATH%/PartonFlow.isub29.ev4.gif ][ 4 ]], ISUB=14: [[%ATTACHURLPATH%/PartonFlow.isub14.ev1.gif ][ 1 ]], [[%ATTACHURLPATH%/PartonFlow.isub14.ev2.gif ][ 2 ]], [[%ATTACHURLPATH%/PartonFlow.isub14.ev3.gif ][ 3 ]], ISUB=18: [[%ATTACHURLPATH%/PartonFlow.isub18.ev1.gif ][ 1 ]], [[%ATTACHURLPATH%/PartonFlow.isub18.ev2.gif ][ 2 ]], %ENDTWISTY% \ *fig:* %TWISTY{}% ISUB=29: [[%ATTACHURLPATH%/PartonFlow.isub29.ev1.fig ][ 1 ]], [[%ATTACHURLPATH%/PartonFlow.isub29.ev2.fig ][ 2 ]], [[%ATTACHURLPATH%/PartonFlow.isub29.ev3.fig ][ 3 ]], [[%ATTACHURLPATH%/PartonFlow.isub29.ev4.fig ][ 4 ]], ISUB=14: [[%ATTACHURLPATH%/PartonFlow.isub14.ev1.fig ][ 1 ]], [[%ATTACHURLPATH%/PartonFlow.isub14.ev2.fig ][ 2 ]], [[%ATTACHURLPATH%/PartonFlow.isub14.ev3.fig ][ 3 ]], ISUB=18: [[%ATTACHURLPATH%/PartonFlow.isub18.ev1.fig ][ 1 ]], [[%ATTACHURLPATH%/PartonFlow.isub18.ev2.fig ][ 2 ]] %ENDTWISTY% %ENDTWISTY%
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
fig
PartonFlow.isub14.ev1.fig
r1
manage
4.0 K
2010-08-15 - 20:20
AlexanderFedotov
gif
PartonFlow.isub14.ev1.gif
r1
manage
6.7 K
2010-08-15 - 20:11
AlexanderFedotov
fig
PartonFlow.isub14.ev2.fig
r1
manage
3.4 K
2010-08-15 - 20:21
AlexanderFedotov
gif
PartonFlow.isub14.ev2.gif
r1
manage
5.1 K
2010-08-15 - 21:22
AlexanderFedotov
fig
PartonFlow.isub14.ev3.fig
r1
manage
3.6 K
2010-08-15 - 20:21
AlexanderFedotov
gif
PartonFlow.isub14.ev3.gif
r1
manage
5.9 K
2010-08-15 - 20:13
AlexanderFedotov
fig
PartonFlow.isub18.ev1.fig
r1
manage
3.3 K
2010-08-15 - 20:22
AlexanderFedotov
gif
PartonFlow.isub18.ev1.gif
r1
manage
5.2 K
2010-08-15 - 20:14
AlexanderFedotov
fig
PartonFlow.isub18.ev2.fig
r1
manage
3.4 K
2010-08-15 - 20:22
AlexanderFedotov
gif
PartonFlow.isub18.ev2.gif
r1
manage
5.3 K
2010-08-15 - 20:16
AlexanderFedotov
fig
PartonFlow.isub29.ev1.fig
r1
manage
4.6 K
2010-08-15 - 20:18
AlexanderFedotov
gif
PartonFlow.isub29.ev1.gif
r1
manage
7.9 K
2010-08-15 - 20:07
AlexanderFedotov
fig
PartonFlow.isub29.ev2.fig
r1
manage
3.7 K
2010-08-15 - 20:19
AlexanderFedotov
gif
PartonFlow.isub29.ev2.gif
r1
manage
6.4 K
2010-08-15 - 20:09
AlexanderFedotov
fig
PartonFlow.isub29.ev3.fig
r1
manage
3.8 K
2010-08-15 - 20:19
AlexanderFedotov
gif
PartonFlow.isub29.ev3.gif
r1
manage
6.4 K
2010-08-15 - 20:09
AlexanderFedotov
fig
PartonFlow.isub29.ev4.fig
r1
manage
4.1 K
2010-08-15 - 20:19
AlexanderFedotov
gif
PartonFlow.isub29.ev4.gif
r1
manage
7.2 K
2010-08-15 - 20:10
AlexanderFedotov
gif
SignalProcessId.gif
r1
manage
10.8 K
2010-08-08 - 22:09
AlexanderFedotov
gif
SignalProcessId.zoomed.gif
r1
manage
11.3 K
2010-08-08 - 22:10
AlexanderFedotov
gif
WorkBookGenParticleCandidate.GenParticleCandidate.gif
r1
manage
13.1 K
2010-08-01 - 02:17
AlexanderFedotov
txt
edmEventSize.out.txt
r1
manage
27.3 K
2010-10-04 - 03:12
AlexanderFedotov
txt
pylist.pthat10.isub18.txt
r1
manage
99.0 K
2010-08-08 - 22:17
AlexanderFedotov
txt
pylist.pthat15.isub14.txt
r1
manage
631.2 K
2010-08-08 - 22:16
AlexanderFedotov
txt
pylist.pthat15.isub29.txt
r1
manage
691.9 K
2010-08-08 - 22:13
AlexanderFedotov
css
tutorial.css
r1
manage
0.2 K
2010-07-26 - 05:52
AlexanderFedotov
obsolete!
This topic: Main
>
TWikiUsers
>
AlexanderFedotov
>
AVFedotovLogA
>
AVFedotovLogA008
Topic revision: r33 - 2013-11-01 - AlexanderFedotov
Copyright &© 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use
Discourse
or
Send feedback