Mini-xAOD

class MinixAOD : public xAH::Algorithm

Produce xAOD outputs.

I can think up the following cases when a user is doing an EL Algorithm:

input containers in TEvent (simple) deep-copied containers in TStore (deep-copy) shallow-copied containers in TStore (shallow) CDV containers in TStore (cdv)

For the above use-cases, we might produce outputs like so:

write the input container to the output. This uses TEvent::copy(). write the deep-copied containers to the output. This calls TStore::retrieve() and then TEvent::record(). two options when we have shallow-copies:

  1. shallowIO=false: write to the output as a deep-copy like in the previous option

  2. shallowIO=true: write to the output as a shallow-copy, but make sure the original container is also written to the output

make a deep-copy of the ConstDataVector and then move from TStore to TEvent. The problem is that we point to local memory that will not persist when making the CDV.

The trickiest case is with shallow copies because those could be our systematics – and you might want to copy the original container, and only copy over systematics via true shallow copies to conserve memory and space.

Warning

Care must be taken when managing memory and using copies. You need to think about how copies point to each other and whether you can use shallow copies or deep copies or both.

Public Functions

MinixAOD()
virtual EL::StatusCode setupJob(EL::Job &job)
virtual EL::StatusCode fileExecute()
virtual EL::StatusCode histInitialize()
virtual EL::StatusCode changeInput(bool firstFile)
virtual EL::StatusCode initialize()
virtual EL::StatusCode execute()
virtual EL::StatusCode postExecute()
virtual EL::StatusCode finalize()
virtual EL::StatusCode histFinalize()

Public Members

std::string m_outputFileName = "out_miniXAOD"

name of the output file to use for xAOD dumping

bool m_createOutputFile = true

enable to create the output file for xAOD dumping

bool m_copyFileMetaData = false

copy the file metadata over

bool m_copyTriggerInfo = false

copy the trigger containers and meta data over

bool m_copyCutBookkeeper = false

copy the cutbookkeeper data over

std::string m_simpleCopyKeys = ""

names of containers to copy from the input file

Container names should be space-delimited:

"m_simpleCopyKeys": "EventInfo AntiKt4EMTopoJets"

std::string m_storeCopyKeys = ""

names of containers in the TStore to copy over

Container names should be space-delimited:

"m_storeCopyKeys": "BrandNewJetContainer ReclusteredJets"

Note

This option is appropriate for deep-copied containers.

std::string m_shallowCopyKeys = ""

names of containers that have been shallow-copied

This option is a little different because shallow-copied containers have parent containers. However, there are two options depending on the setShallowIO option

True

If this is set to true, you will want to specify the parent container so that we copy it over as well (it is assumed that the parent container is in TStore or TEvent):

"m_shallowCopyKeys": "SCAntiKt4EMTopoJets|AntiKt4EMTopoJets SCMuons|Muons_Presel"
False

If this is set to false, you will not want to specify the parent container

”m_shallowCopyKeys”: “SCAntiKt4EMTopoJets| SCMuons|”

Always specify your string in a space-delimited format where pairs are split up by shallow container name|parent container name.

Note

This option is appropriate for shallow-copied containers.

Warning

Please note that the shallowIO option is what determines how the memory is managed. If you run into issues with shallow-copied containers here, make sure you know whether this option was enabled or not before asking for help.

std::string m_deepCopyKeys = ""

names of containers that have been shallow-copied

Here, we will do the deep-copying for you, so that the containers can be correctly recorded into the output. Due to the way view-only containers work, we can’t figure out whether the memory points to a specific parent container we can copy, or to a non-persistable, local (stack) memory. The best option is to just deep-copy and allocate new memory instead:

"m_deepCopyKeys": "AntiKt4EMTopoJets|DeepCopyAntiKt4Jets Muons|DeepCopyMuons"

Always specify your string in a space-delimited format where pairs are split up by input container name|output container name.

Note

This option is appropriate for view-only containers such as ConstDataVector.

std::string m_vectorCopyKeys = ""

names of vectors that have container names for its contents

Here, we will do the copying for you by retrieving the vector of container names and copy each one over. See how MinixAOD::m_shallowCopyKeys works.

Always specify your string in a space-delimited format where pairs are split up by vector name|parent container name.

Note

This option is appropriate for groups shallow-copied containers such as when you are dealing with systematics.

Private Members

std::vector<std::string> m_simpleCopyKeys_vec

A vector of containers that are in TEvent that just need to be written to the output.

std::vector<std::pair<std::string, std::string>> m_shallowCopyKeys_vec

A vector of (container name, parent name) pairs for shallow-copied objects &#8212; if parent is empty, deep-copy it.

std::vector<std::pair<std::string, std::string>> m_deepCopyKeys_vec

A vector of (in container, output container) that need to be deep-copied first before moving to TStore.

std::vector<std::pair<std::string, std::string>> m_vectorCopyKeys_vec

A vector of (name of vector of container names, parent name) pairs for shallow-copied objects (like systematics) &#8212; if parent is empty, deep-copy it.

std::vector<std::string> m_copyFromStoreToEventKeys_vec

A vector of containers (and aux-pairs) in TStore to record in TEvent.

xAODMaker::FileMetaDataTool *m_fileMetaDataTool = nullptr

Pointer for the File MetaData Tool.

xAOD::CutBookkeeperContainer *m_outputCBKContainer = nullptr

Pointer for the TriggerMenu MetaData Tool.

Pointer for our CutBookkeeper

xAOD::CutBookkeeperAuxContainer *m_outputCBKContainer_aux = nullptr
xAOD::CutBookkeeperContainer *m_outputInCBKContainer = nullptr
xAOD::CutBookkeeperAuxContainer *m_outputInCBKContainer_aux = nullptr
xAOD::CutBookkeeper *m_outputCBK = nullptr