170 likes | 314 Views
How to Access PAT Candidate Information. PAT Tutorial CERN December 2012 lecturer: Andreas Hinzmann (CERN) tutors: Guillermo Breto (UCD), Sudhir Malik ( Nebraska) and the PAT tutorial team. The Pat Tuple. In the morning section you have learned : how to find documentation
E N D
How to Access PAT Candidate Information PAT Tutorial CERN December 2012 lecturer: Andreas Hinzmann (CERN)tutors: Guillermo Breto (UCD), SudhirMalik (Nebraska) and the PAT tutorial team
The Pat Tuple • In themorningsectionyouhavelearned: • how to find documentation • how to produce PAT Tuples • how to inspectyourconfigurationfile • how to customizethe PAT Tupleworkflow • how to look at the PAT Tuple Event Content • Nowyou will learnhow to access to PAT Tuplesproduced in • order to performyouanalysis.
The Pat Tuple A PAT Tupleis and EDM file: • Rootfilewithpredifinedfilestructure • Trees of CMS customizedDataFormats (Muon, Electron, Track) TBrowser edmDumpEventContent DataFormat ModuleLabel InstanceLabel Process
Example pat::Muon Typicalclassstructuresfor HEP Collaborations http://cmssdt.cern.ch/SDT/doxygen
Access PAT Tuple • Access is as to normal Rootfile. • PAT provides also moreappropriateaccessmethods: • Analysis performeddirectly on PAT Tuples (BasicAnalyzerconcept) • Withinthe Full Framework (EDAnalyzer) • With FW Lite (FWLiteAnalyzer) • Production of flatntuples (again EDM files) • Analysis performedwithyourrootmacrosorFW/FWLiteanalyzer EDMTuple PAT Tuple EDAnalyzer Full framework FWLiteAnalyzer FWLite
BasicAnalyzerConcept • Decidelatewhetheryouwant to useFWLiteorfullframework • Writethecode to becompatiblewithboth BasicAnalyzer PAT Tuple EDAnalyzer Full framework FWLiteAnalyzer FWLite https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookFWLiteExamples#ExampleFive
Example PatMuonAnalyzer Classdeclaration: YourclassinheritsfromBasicAnalyzerclass http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/PhysicsTools/PatExamples/interface/PatMuonAnalyzer.h?revision=1.1&view=markup&pathrev=V00-05-26
Example PatMuonAnalyzer Classimplementation: http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/PhysicsTools/PatExamples/src/PatMuonAnalyzer.cc?revision=1.1&view=markup&pathrev=V00-05-26
FWLite or Full Framework? BasicAnalyzer EDAnalyzer FWLite • Veryeasy to wrapthesamecodeintooneortheother • Keepbothifyoulike and usewhatfits best to thecurrentpurposes ...
Recommendations FWLite: Usethisifyouneed quick turn around, whentheanalysistaskisnottoocomplex (would also fit to a singleEDAnalyzer), whenyoucan still handle all objectsthatyoucreate and destroy on your way... Full Framework: Usethiswhentheanalysistasksgrowcomplex, whenyouintend to usecraborbatchsystems, whenyouintend to usetheedm::Event to manage theamount of objectsthatyoucreate and use on the way, whenyouwant flexible (plugin-wise) use of yourcode... Advantage of bothoveryouprivate solution: Easy implementation, easy to learn and to understand, easy to maintain, maximal use of CMSSW infrastructure (i.e. DataFormats, TFileServise, Event managemente.g. no event double counting)...
How to run the examples: • FWLite: • Full Framework: https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookPATAccessExercise
The EDM-Tupleizer • The Analysis Tools Group (AT) also providespre-writtentools • and recommendations to makefully EDM complientflatntuples: • theCandViewNtpProducer: • Itis a genericntupledumper • Easy to configure • Don‘tneed to write c++ code to produceyourflatntuplesfromyour PAT Tuples • More info and examples in the Twiki: https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideEDMNtuples
The EDM-Tupleizer • Easy access via stringparsing to variables youwant to store in yourflatntuple https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideEDMNtuples
The EDM-Tupleizer Output • Theoutputis a fulledmcompliantedmTuple, youcaninspectit as it was a standard PAT Tuple... It is still and EDM file: TBrowser edmDumpEventContent InstanceLabel Process ModuleLabel DataFormat
The EDM-Tupleizer Output • Analyzeyour EDM flatntuplewith an interactive/compiledrootmacro • OruseFWLite/fullframwork to makeuse of full CMSSW capabilities. • In theExercise 4 you will find a guideline to deal with EDM flatntuples
Remark • General Remark: • As yousee AT covers a broadbunch of usecasesforanalysisfromsmallestscale/complexity to largestscale/complexity. • Youcanmakeuse of easyaccess to datainformation, and a wholebunch of Services and tools (TFileService, PAT features, Candidate Tools, HepMCtools, POG tools) • All thesetoolsareestablished, acceptedcollaborationwide, tested, maintained, ... • ~50 peopleareworkinghard to make CMSSW youranalysissoftware (comparethis to themanpowersituation in youruniversity) • Don'twaistyour time on there-invention, re-developement, maintainance of youown private framework, spentyour time on physics! • On theother hand thereisalwaysroomfordevelopments/improvement. Joining AT developmentsisrewarded (Credit bypoints).. So, don‘thesitateifyouwish to contribute
Final Remark • Everythingwhichhas beendiscussedhereispart of Exercise 4. Take your time to gothroughit and enjoy!