90 likes | 208 Views
Lecture 2.2: PAT Embedding. Andreas Hinzmann RWTH Aachen University PAT Tutorial @ CERN, 4-8 July 2011. Embedding in PAT. This lecture is about a mechanism in PAT introduced to optimize the event size of a pat::Tuple : Embedding
E N D
Lecture 2.2:PAT Embedding Andreas Hinzmann RWTH Aachen University PAT Tutorial @ CERN, 4-8 July 2011
Embedding in PAT • This lecture is about a mechanism in PAT introduced to optimize the event size of a pat::Tuple: Embedding • In order to save disk space we have to reduce the EventContent to what is really needed. This means to drop some collections from our output pat::Tuple. • But one may want to retain some collections for later uses. • PAT embedding has been conceived for retain useful information without burdening on pat::Tuple size. • We will see: • how to get infos on event size using edmEventSizeTool • what is the issue of internal references • what is the PAT solution – the embedding
EventSize • The typical event size of a standard PAT output, is ~ 6-60 KB • It depends on the user's choice • There are some tools to estimate the event size. They can be useful when you want to decide which content of the event to be kept or dropped • Run this command and see the output file • Have a look at SWGuidePATEventSizefor more details: • https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATEventSize edmEventSize –v patTuple.root
The problem of references • To save disc space reco::Objectscontain pointer references: • Note: • when dropping collections all pointer relations to them turn invalid! • have to know all pointer relations to estimate the consequences. • even when the target collections are still in the event not all ref’s can be resolved in FWLite.
Examples : Jets & CaloTowers • CaloJets keep references to the CaloTowers they were produced from: • NOTE : • when dropping the CaloTower collection the references will turn in valid. • calling the corresponding member function will cause an edm::Exception.
The PAT Answer • The PAT answer is the Embedding of objects into pat::Objects when is required to access them. • The following objects can be embedded: • gsfTrackandSuperCluster in Electron • All of the tracks in Muon • Calo towers in Jets • etc. • You can safely use the’ reference pointer 'in FWLite • Note: Embedding is fully supported in compiled FWLite. Note that some functionality is for the moment not available in InteractiveFWLite (CINT) or PyFWLite. Therefore it is safer to use compiled FWLite code. Configure the input
Embedding Mechanism: pat::Muons/Electrons • There are two different implementations of embedding in PAT. • For pat::Muons/Electrons: • The referencedobjects are hard-copyiedinto the pat::Objects! • Calling the member function for the pat::Objectwill check for embedding internally and return the according references (completely user transparent). • You can safely drop the embedded collection (you should indeed) by the EventContent reducing the size of the pat::Tuple and refer to the embedding objects that became part of the pat::Object itself. Configure the input
Embedding Mechanism: pat::Jets For improved performance, the large pat::Jet objects use a different implementation for embedding: Separate collections containing all the CaloTowers / PFCandidates which were clustered into thepat::Jets are stored. The size of these collections is sensibly smaller w.r.t. the collection of ALL CaloTowers / PFCandidates. The event content then looks like this: patJets_cleanPatJets__PAT CaloTowers_selectedPatJets_caloTowers_PAT PFCandidates_selectedPatJets_pfCandidates_PAT How much space we can gain embedding CaloTowers in pat::Jet collection? You will evaluate this in the exercise! Configure the input
Explain Exercise n°6 • You are ready to go to Exercise 6 section: • https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATEmbeddingExercise • where you will learn: • what the problem of internal references is within the EDM. • how PAT solves this situation. • how to embed extra information into a pat::Candidate. • You will find some Exercises to practice what you have learnt. Please go through all of them and fill the answers into the • e-learning results for this section. • Have fun! Configure the input