140 likes | 308 Views
An Introduction to PAT (1.2 How to access PAT candidates). Hamed Bakhshian PAT Tutorial 20.09.10. Outline. How to use PAT ? Installation recipes How to run PAT How to analyze PAT output Support and documentation Exercise. Installation recipes. It is very easy :
E N D
An Introduction to PAT(1.2 How to access PAT candidates) HamedBakhshian PAT Tutorial 20.09.10
Outline • How to use PAT ? • Installation recipes • How to run PAT • How to analyze PAT output • Support and documentation • Exercise
Installation recipes • It is very easy : • In CMSSW_3_8_X, no installation needed ! • The most recent release of PAT is linked to. • To see which version of PAT works with your version of CMSSW, have a look at SWGuidePATRecipes • PAT is regularly updated. Using last version is recommended • Release Notes is also provided
How to run PAT (an example) • The simplest config file so far: test_cfg.py • In this simple config file, you can set the input file(s) and the number of events to be PATified and also the name of output file. • Default settings of PAT can be modified after loading them. • Running this file by cmsRun, generates the PAT.rootfile. This file will be the input file for next analysis.
How to change PAT defaults • Read the default values of settings, using PYTHON The file created in last page Full name of a module The module contents CTRL+D to exit • To change the settings, edit the config file :
How to analyze PAT output The PatBasicAnalyer • For the here explained example have a look at:WorkBookPATAccessExercise • You run the PatBasicAnalyzer using the analyzePatBasics_cfg.py file. Load the PAT Tuple. We will continue mostly with the pat::Jet Load the most important PAT Candidate collections into the analyzer
How to analyze PAT output The PatBasicAnalyer • You find the implementation of the module in plugins/PatBasicAnalyzer.cc: Make the data formats known to the module Read in the InputTags We do this in the constructor of the module Receive the jet collection by label Loop the jet collection
Using FWLite to analyze the output file • For an examples with a FWLiteAnalyzer have a look at: • WorkBookPATExampleFWLite • You can find this FWLite executable in bin/PatBasicFWLiteAnalyzer.cc. • To tell scram that is should compile the source code we need aBuildFile.xml of the following type int the same directory: Here we make the needed libraries known to the compiler This line tells scram to compile our executable
Using FWLite to analyze the output file • You can also make use of a few cfg file features also in FWLite in the meantime. • You can find the parameters for the executable in analyzePatFWLite_cfg.py file: • You see that the cfg file looks pretty much like cfg file in the full framework. In PatBasicFWLiteAnalyzer the parameters are read in like this:
Using FWLite to analyze the output file • Also the rest of the executable has become pretty similar to an EDAnalyzer: Book histograms using the TFileService Loop the events of an input file This is one of the few differences wrtfull framework Receive the Muon collection by edm::Handle
PAT in Real World • This simple recipe works also on the real data : • IMPORTANT : • Turn off MCMatching when work with real-data . from PhysicsTools.PatAlgos.tools.coreTools import * removeMCMatching(process, 'All')
Documentation • SWGuidePATMain documentation page • SWGuidePATRecipesInstallation recipes • WorkBookModule configuration • WorkBookpat::Candidate description • WorkBookTools for event size estimate • WorkBookPAT workflow description • SWGuidePATToolsDescription of workflow configuration tools • WorkBookPATTutorialTutorials and examples to get started • And last but not least: This Tutorial...
Support • For more information on support have a look at SWGuidePAT: • Lecturers & Tutors • Hyper news • Community • POG/PAG contacts • Developers
Exercise • Preparing a work environment • Setup the CMSSW_3_8_4 • All of the exercises are listed in: • https://twiki.cern.ch/twiki/bin/view/CMS/WorkBookPATTutorial • The codes discussed in this lecture can be found at: • Making PATuple • https://twiki.cern.ch/twiki/bin/view/CMS/WorkBookPATTupleCreationExercise • Analyze the output with PatBasicAnalyzer • https://twiki.cern.ch/twiki/bin/view/CMS/WorkBookPATAccessExercise • Use FWLite to analyze the PATuple • https://twiki.cern.ch/twiki/bin/view/CMS/WorkBookPATExampleFWLite