ATLAS Offline Software
Loading...
Searching...
No Matches
CP::TreeBranchHelpers::OutputBranchData Struct Reference

the data for a single output branch More...

#include <TreeBranchHelpers.h>

Collaboration diagram for CP::TreeBranchHelpers::OutputBranchData:

Public Member Functions

StatusCode configureNames (const BranchConfig &branchConfig, const CP::SystematicSet &sys, ISystematicsSvc &sysSvc, MsgStream &msg)
 configure names for systematics

Public Attributes

const BranchConfigbranchConfig = nullptr
 the BranchConfig we are based on
std::size_t sysIndex = 0u
 the index in the systematics list
bool isNominal = false
 whether this is unaffected by systematics (i.e. nominal)
std::string sgName
 the SG name of the object to read from
std::string auxName
 the name of the decoration in the aux-store
std::string branchName
 the name of the output branch

Detailed Description

the data for a single output branch

Definition at line 128 of file TreeBranchHelpers.h.

Member Function Documentation

◆ configureNames()

StatusCode CP::TreeBranchHelpers::OutputBranchData::configureNames ( const BranchConfig & branchConfig,
const CP::SystematicSet & sys,
ISystematicsSvc & sysSvc,
MsgStream & msg )

configure names for systematics

Definition at line 579 of file TreeBranchHelpers.cxx.

581 {
582 isNominal = true;
583
584 if (branchConfig.sgName.find ("%SYS%") != std::string::npos)
585 {
586 CP::SystematicSet matching;
587 if (SystematicSet::filterForAffectingSystematics (sys, branchConfig.sgNameFilterSys, matching).isFailure())
588 return StatusCode::FAILURE;
589 if (sysSvc.makeSystematicsName (sgName, branchConfig.sgName, matching).isFailure())
590 return StatusCode::FAILURE;
591 if (!matching.empty())
592 isNominal = false;
593 } else
594 sgName = branchConfig.sgName;
595
596 if (branchConfig.auxName.find ("%SYS%") != std::string::npos)
597 {
598 CP::SystematicSet matching;
599 if (SystematicSet::filterForAffectingSystematics (sys, branchConfig.auxNameFilterSys, matching).isFailure())
600 return StatusCode::FAILURE;
601 if (sysSvc.makeSystematicsName (auxName, branchConfig.auxName, matching).isFailure())
602 return StatusCode::FAILURE;
603 if (!matching.empty())
604 isNominal = false;
605 } else
606 auxName = branchConfig.auxName;
607
608 if (branchConfig.branchName.find ("%SYS%") != std::string::npos)
609 {
610 CP::SystematicSet matching;
611 if (SystematicSet::filterForAffectingSystematics (sys, branchConfig.branchNameFilterSys, matching).isFailure())
612 return StatusCode::FAILURE;
613 if (sysSvc.makeSystematicsName (branchName, branchConfig.branchName, matching).isFailure())
614 return StatusCode::FAILURE;
615 if (matching.empty() && !isNominal)
616 {
617 msg << MSG::FATAL << "Branch \"" << branchName << "\" is not affected by any of the requested systematics but is not nominal." << endmsg;
618 return StatusCode::FAILURE;
619 }
620 } else
621 {
622 branchName = branchConfig.branchName;
623 if (!sys.empty())
624 {
625 msg << MSG::FATAL << "Branch \"" << branchName << "\" without systematics is evaluated in a non-nominal context." << endmsg;
626 return StatusCode::FAILURE;
627 }
628 }
629
630 return StatusCode::SUCCESS;
631 }
#define endmsg
bool empty() const
returns: whether the set is empty
static StatusCode filterForAffectingSystematics(const SystematicSet &systConfig, const SystematicSet &affectingSystematics, SystematicSet &filteredSystematics)
description: filter the systematics for the affected systematics returns: success guarantee: strong f...
bool isNominal
whether this is unaffected by systematics (i.e. nominal)
const BranchConfig * branchConfig
the BranchConfig we are based on
std::string auxName
the name of the decoration in the aux-store
std::string sgName
the SG name of the object to read from
std::string branchName
the name of the output branch
MsgStream & msg
Definition testRead.cxx:32

Member Data Documentation

◆ auxName

std::string CP::TreeBranchHelpers::OutputBranchData::auxName

the name of the decoration in the aux-store

Definition at line 143 of file TreeBranchHelpers.h.

◆ branchConfig

const BranchConfig* CP::TreeBranchHelpers::OutputBranchData::branchConfig = nullptr

the BranchConfig we are based on

Definition at line 131 of file TreeBranchHelpers.h.

◆ branchName

std::string CP::TreeBranchHelpers::OutputBranchData::branchName

the name of the output branch

Definition at line 146 of file TreeBranchHelpers.h.

◆ isNominal

bool CP::TreeBranchHelpers::OutputBranchData::isNominal = false

whether this is unaffected by systematics (i.e. nominal)

Definition at line 137 of file TreeBranchHelpers.h.

◆ sgName

std::string CP::TreeBranchHelpers::OutputBranchData::sgName

the SG name of the object to read from

Definition at line 140 of file TreeBranchHelpers.h.

◆ sysIndex

std::size_t CP::TreeBranchHelpers::OutputBranchData::sysIndex = 0u

the index in the systematics list

Definition at line 134 of file TreeBranchHelpers.h.


The documentation for this struct was generated from the following files: