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 124 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 518 of file TreeBranchHelpers.cxx.

520 {
521 isNominal = true;
522
523 if (branchConfig.sgName.find ("%SYS%") != std::string::npos)
524 {
525 CP::SystematicSet matching;
526 if (SystematicSet::filterForAffectingSystematics (sys, branchConfig.sgNameFilterSys, matching).isFailure())
527 return StatusCode::FAILURE;
528 if (sysSvc.makeSystematicsName (sgName, branchConfig.sgName, matching).isFailure())
529 return StatusCode::FAILURE;
530 if (!matching.empty())
531 isNominal = false;
532 } else
533 sgName = branchConfig.sgName;
534
535 if (branchConfig.auxName.find ("%SYS%") != std::string::npos)
536 {
537 CP::SystematicSet matching;
538 if (SystematicSet::filterForAffectingSystematics (sys, branchConfig.auxNameFilterSys, matching).isFailure())
539 return StatusCode::FAILURE;
540 if (sysSvc.makeSystematicsName (auxName, branchConfig.auxName, matching).isFailure())
541 return StatusCode::FAILURE;
542 if (!matching.empty())
543 isNominal = false;
544 } else
545 auxName = branchConfig.auxName;
546
547 if (branchConfig.branchName.find ("%SYS%") != std::string::npos)
548 {
549 CP::SystematicSet matching;
550 if (SystematicSet::filterForAffectingSystematics (sys, branchConfig.branchNameFilterSys, matching).isFailure())
551 return StatusCode::FAILURE;
552 if (sysSvc.makeSystematicsName (branchName, branchConfig.branchName, matching).isFailure())
553 return StatusCode::FAILURE;
554 if (matching.empty() && !isNominal)
555 {
556 msg << MSG::FATAL << "Branch \"" << branchName << "\" is not affected by any of the requested systematics but is not nominal." << endmsg;
557 return StatusCode::FAILURE;
558 }
559 } else
560 {
561 branchName = branchConfig.branchName;
562 if (!sys.empty())
563 {
564 msg << MSG::FATAL << "Branch \"" << branchName << "\" without systematics is evaluated in a non-nominal context." << endmsg;
565 return StatusCode::FAILURE;
566 }
567 }
568
569 return StatusCode::SUCCESS;
570 }
#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 139 of file TreeBranchHelpers.h.

◆ branchConfig

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

the BranchConfig we are based on

Definition at line 127 of file TreeBranchHelpers.h.

◆ branchName

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

the name of the output branch

Definition at line 142 of file TreeBranchHelpers.h.

◆ isNominal

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

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

Definition at line 133 of file TreeBranchHelpers.h.

◆ sgName

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

the SG name of the object to read from

Definition at line 136 of file TreeBranchHelpers.h.

◆ sysIndex

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

the index in the systematics list

Definition at line 130 of file TreeBranchHelpers.h.


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