16#include "AthLinks/ElementLink.h"
29 unsigned int UtilsHash(
const std::string& name ) {
31 static const std::hash< std::string >
helper;
85 nameAcc(*
this) = std::string(
"");
164 std::ostringstream
str;
200 cutLogicAcc( *
this ) =
static_cast<unsigned int>(val);
212 std::ostringstream
str;
227 std::ostringstream
str;
262 this->addOutputStream(outputstream);
268 throw std::runtime_error(
"ERROR: Could not find the container for this CutBookkeeper" );
273 for ( std::size_t i=0; i<this->nUsedOthers(); ++i ) {
275 otherEBK->addOutputStreamForAllUsed(outputstream);
374 std::size_t ebIdx = parentEB->
index();
378 throw std::runtime_error(
"ERROR: Could not find the container for the parent CutBookkeeper" );
397 throw std::runtime_error(
"ERROR: Got an invalid child CutBookkeeper" );
410 throw std::runtime_error(
"ERROR: Got an index out of the range of childred CutBookkeepers" );
414 throw std::runtime_error(
"ERROR: Got an invalid child CutBookkeeper" );
434 for ( std::size_t i=0; i<childrenEB.size(); ++i ) {
456 std::size_t ebIdx = childEB->
index();
460 throw std::runtime_error(
"ERROR: Could not find the container for the child CutBookkeeper" );
477 throw std::runtime_error(
"ERROR: Could not find the container for this CutBookkeeper" );
510 throw std::runtime_error(
"ERROR: Got an invalid usedOther CutBookkeeper" );
523 throw std::runtime_error(
"ERROR: Got an index out of the range of usedOthers CutBookkeepers" );
527 throw std::runtime_error(
"ERROR: Got an invalid usedOther CutBookkeeper" );
547 for ( std::size_t i=0; i<usedOthers.size(); ++i ) {
567 std::size_t ebIdx = usedOtherEB->
index();
571 throw std::runtime_error(
"ERROR: Could not find the container for the usedOthers CutBookkeeper" );
597 throw std::runtime_error(
"ERROR: Got an invalid sibling CutBookkeeper" );
610 throw std::runtime_error(
"ERROR: Got an index out of the range of sibling CutBookkeepers" );
614 throw std::runtime_error(
"ERROR: Got an invalid sibling CutBookkeeper" );
634 for ( std::size_t i=0; i<siblings.size(); ++i ) {
648 std::size_t ebIdx = siblingEB->
index();
652 throw std::runtime_error(
"ERROR: Could not find the container for the sibling CutBookkeeper" );
676 xAOD::CutBookkeeperLinks_t::iterator itrEnd =
childrenLinksAcc(*this).end();
677 for( ; itr != itrEnd; ++itr ) {
682 xAOD::CutBookkeeperLinks_t::iterator itr =
othersLinksAcc(*this).begin();
683 xAOD::CutBookkeeperLinks_t::iterator itrEnd =
othersLinksAcc(*this).end();
684 for( ; itr != itrEnd; ++itr ) {
690 xAOD::CutBookkeeperLinks_t::iterator itrEnd =
siblingsLinksAcc(*this).end();
691 for( ; itr != itrEnd; ++itr ) {
value_type emplace_back(value_type pElem)
Add an element to the end of the collection.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
bool isValid() const
Test to see if the link can be dereferenced.
void makePrivateStore()
Create a new (empty) private store for this object.
SG::Accessor< T, ALLOC > Accessor
const SG::AuxVectorData * container() const
Return the container holding this element.
AuxElement()
Default constructor.
size_t index() const
Return the index of this element within its container.
Container that holds the Container of all CutBookkeepers.
Description of the class that is used to keep track of event counts.
void addSumOfEventWeights(double nWeightedEvents)
Add more sum-of-event-weights that this CutBookkeeper has seen.
double sumOfEventWeightsSquared() const
Get the sum-of-(event-weights-squared) that this CutBookkeeper has seen.
bool hasChild(const xAOD::CutBookkeeper_v1 *testCBK) const
Test if a given child already exists.
std::size_t nSiblings() const
Check if this CutBookkeeper has siblings.
void setUniqueIdentifier(unsigned int hash)
Set the uniqueIdentifier for this CutBookkeeper.
void addSibling(CutBookkeeper_v1 *siblingsEB)
Add one sibling CutBookkeeper to this one.
void setPayload(const Payload &payload)
Set the whole payload object (which contains all counters) in one go.
const xAOD::CutBookkeeper_v1 * usedOther(std::size_t i) const
Get the usedOther at position i.
bool isEqualTo(const CutBookkeeper_v1 *eb) const
Test for the equality of this CutBookkeeper with another one.
bool isTopFilter() const
Check if this CutBookkeeper was a top filter.
void setName(const std::string &name)
Set the name of this CutBookkeeper.
std::size_t nChildren() const
Get the number of children CutBookkeepers of this CutBookkeeper.
void addChild(CutBookkeeper_v1 *childEB)
Add one child to this CutBookkeeper.
unsigned int uniqueIdentifier() const
Get the uniqueIdentifier for this CutBookkeeper.
const xAOD::CutBookkeeper_v1 * parent() const
Get the parent CutBookkeeper.
void addChildren(const std::vector< CutBookkeeper_v1 * > &childrenEB)
Add multiple children in one go to this CutBookkeeper.
int cycle() const
Get the skimming cycle that this CutBookkeeper was running in.
void setUsedOthers(const std::vector< CutBookkeeper_v1 * > &usedOthers)
Set all CutBookkeeper that are used by this one in one go.
~CutBookkeeper_v1()
Destructor.
void addSumOfEventWeightsSquared(double nWeightedEventsSquared)
Add more sum-of-(event-weights-squared) that this CutBookkeeper has seen.
const xAOD::CutBookkeeper_v1 * child(std::size_t i) const
Get the child at position i.
void addNAcceptedEvents(uint64_t nEvents)
Add seen events to the number of accepted events that this CutBookkeeper has seen.
void setParent(const CutBookkeeper_v1 *parentEB)
Set the parent CutBookkeeper of this CutBookkeeper.
unsigned int nameIdentifier() const
Get the nameIdentifier for this CutBookkeeper.
void addUsedOthers(const std::vector< CutBookkeeper_v1 * > &usedOthers)
Add multiple children in one go to this CutBookkeeper.
CutBookkeeper_v1 * addNewChild(const std::string &name, const std::string &description)
Create a new CutBookkeeper (using the given name and description) and add this new CutBookkeeper to t...
Payload payload() const
Get the whole payload object (which contains all counters) in one go.
const std::string & description() const
Get the description of this CutBookkeeper.
void setNAcceptedEvents(uint64_t nEvents)
Set the number of accepted events for this CutBookkeeper.
void setSumOfEventWeightsSquared(double nWeightedEventsSquared)
Set the sum-of-(event-weights-squared) that this CutBookkeeper has seen.
const std::string & inputStream() const
Get the name of the input-file stream object that was seen by this CutBookkeeper.
void setSumOfEventWeights(double nWeightedEvents)
Set the sum-of-event-weights that this CutBookkeeper has seen.
CutLogic
Enumeration of the logic of a cut.
double sumOfEventWeights() const
Get the sum-of-event-weights that this CutBookkeeper has seen.
void addUsedOther(CutBookkeeper_v1 *usedOtherEB)
Add one other CutBookkeeper that is used by this one.
void addSiblings(const std::vector< CutBookkeeper_v1 * > &siblings)
Add multiple siblings in one go to this CutBookkeeper.
const std::string & name() const
Get the name of this CutBookkeeper.
void addOutputStream(const std::string &outputstream)
Add the name of an output-file stream object for this CutBookkeeper.
const xAOD::CutBookkeeper_v1 * sibling(std::size_t i) const
Get the sibling number i.
bool hasSibling(const xAOD::CutBookkeeper_v1 *testCBK) const
Test if the provided CutBookkeeper is already a sibling.
void setDescription(const std::string &description)
Set the description of this CutBookkeeper.
uint64_t nAcceptedEvents() const
Get the number of accepted events that this CutBookkeeper has seen.
void toPersistent()
Function preparing the object to be persistified.
bool hasOutputStream(const std::string &outputstream) const
Check if the given output stream name is known to this CutBookkeeper.
void setOutputStreams(const std::vector< std::string > &outputstreams)
Set the names of the output-file stream objects for this CutBookkeeper.
bool hasUsedOther(const xAOD::CutBookkeeper_v1 *testCBK) const
Check if this CutBookkeeper has used others.
CutBookkeeper_v1()
Constructor.
void setChildren(const std::vector< CutBookkeeper_v1 * > &childrenEB)
Set all children of this CutBookkeeper in one go.
void setCutLogic(CutLogic logic)
Set the cut logic of this CutBookkeeper, e.g., ACCEPT, REQUIRE, VETO.
CutLogic cutLogic() const
Get the cut logic of this CutBookkeeper, e.g., ACCEPT, REQUIRE, VETO.
void setInputStream(const std::string &inputstream)
Set the name of the current input-file stream object for this CutBookkeeper.
void setTopFilter(bool isTopFilter)
Set the top-filter property of this CutBookkeeper.
const std::vector< std::string > & outputStreams() const
Get the names of the output-file stream objects that were seen by this CutBookkeeper.
void setSiblings(const std::vector< CutBookkeeper_v1 * > &siblings)
Set all CutBookkeeper that are siblings to this one in one go.
std::size_t nUsedOthers() const
Check if this CutBookkeeper has used others.
bool hasParent() const
Check if there is a parent CutBookkeeper of this CutBookkeeper.
void setCycle(int cycle)
Set the skimming cycle that this CutBookkeeper is running in.
void setNameIdentifier(unsigned int hash)
Set the nameIdentifier for this CutBookkeeper.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
ElementLink< CutBookkeeperContainer > CutBookkeeperLink_t
static const SG::AuxElement::Accessor< std::string > nameAcc("name")
static const SG::AuxElement::Accessor< int > cycleAcc("cycle")
std::vector< xAOD::CutBookkeeperLink_t > CutBookkeeperLinks_t
static const SG::AuxElement::Accessor< unsigned int > uniqueIdentifierAcc("uniqueIdentifier")
static const SG::AuxElement::Accessor< std::string > descriptionAcc("description")
static const SG::AuxElement::Accessor< double > sumOfEventWeightsAcc("sumOfEventWeights")
static const SG::AuxElement::Accessor< xAOD::CutBookkeeperLinks_t > siblingsLinksAcc("siblingsLinks")
static const SG::AuxElement::Accessor< uint64_t > nAcceptedEventsAcc("nAcceptedEvents")
static const SG::AuxElement::Accessor< std::string > inputStreamAcc("inputStream")
static const SG::AuxElement::Accessor< std::vector< std::string > > outputStreamsAcc("outputStreams")
static const SG::AuxElement::Accessor< unsigned int > nameIdentifierAcc("nameIdentifier")
static const SG::AuxElement::Accessor< xAOD::CutBookkeeperLinks_t > othersLinksAcc("othersLinks")
static const SG::AuxElement::Accessor< xAOD::CutBookkeeperLink_t > parentLinkAcc("parentLink")
static const SG::AuxElement::Accessor< xAOD::CutBookkeeperLinks_t > childrenLinksAcc("childrenLinks")
void ClearTransientTrees ATLAS_NOT_THREAD_SAFE()
Function cleaning up the managed memory.
static const SG::AuxElement::Accessor< unsigned int > cutLogicAcc("cutLogic")
static const SG::AuxElement::Accessor< double > sumOfEventWeightsSquaredAcc("sumOfEventWeightsSquared")
static const SG::AuxElement::Accessor< int > isTopFilterAcc("isTopFilter")
Add struct for payload and implement operator ,/....=,...
double sumOfEventWeightsSquared