ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::CutBookkeeper_v1 Class Reference

Description of the class that is used to keep track of event counts. More...

#include <CutBookkeeper_v1.h>

Inheritance diagram for xAOD::CutBookkeeper_v1:
Collaboration diagram for xAOD::CutBookkeeper_v1:

Classes

struct  Payload
 Add struct for payload and implement operator ,/....=,... More...

Public Types

enum  CutLogic {
  UNKNOWN = 0 , ALLEVENTSPROCESSED = 1 , ALLEVENTSWRITTEN = 2 , OTHER = 3 ,
  ACCEPT = 4 , REQUIRE = 5 , VETO = 6
}
 Enumeration of the logic of a cut. More...

Public Member Functions

 CutBookkeeper_v1 ()
 Constructor.
 ~CutBookkeeper_v1 ()
 Destructor.
bool operator== (const CutBookkeeper_v1 &rhs)
 Equality operator.
bool isEqualTo (const CutBookkeeper_v1 *eb) const
 Test for the equality of this CutBookkeeper with another one.
void toPersistent ()
 Function preparing the object to be persistified.
Getters and setters for the payload information, i.e., event coutners and weights
Payload payload () const
 Get the whole payload object (which contains all counters) in one go.
void setPayload (const Payload &payload)
 Set the whole payload object (which contains all counters) in one go.
uint64_t nAcceptedEvents () const
 Get the number of accepted events that this CutBookkeeper has seen.
void setNAcceptedEvents (uint64_t nEvents)
 Set the number of accepted events for this CutBookkeeper.
void addNAcceptedEvents (uint64_t nEvents)
 Add seen events to the number of accepted events that this CutBookkeeper has seen.
double sumOfEventWeights () const
 Get the sum-of-event-weights that this CutBookkeeper has seen.
void setSumOfEventWeights (double nWeightedEvents)
 Set the sum-of-event-weights that this CutBookkeeper has seen.
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.
void setSumOfEventWeightsSquared (double nWeightedEventsSquared)
 Set the sum-of-(event-weights-squared) that this CutBookkeeper has seen.
void addSumOfEventWeightsSquared (double nWeightedEventsSquared)
 Add more sum-of-(event-weights-squared) that this CutBookkeeper has seen.
Handling of the child-parent relationship between different CutBookkeepers
bool hasParent () const
 Check if there is a parent CutBookkeeper of this CutBookkeeper.
const xAOD::CutBookkeeper_v1parent () const
 Get the parent CutBookkeeper.
void setParent (const CutBookkeeper_v1 *parentEB)
 Set the parent CutBookkeeper of this CutBookkeeper.
std::size_t nChildren () const
 Get the number of children CutBookkeepers of this CutBookkeeper.
bool hasChild (const xAOD::CutBookkeeper_v1 *testCBK) const
 Test if a given child already exists.
const xAOD::CutBookkeeper_v1child (std::size_t i) const
 Get the child at position i.
void setChildren (const std::vector< CutBookkeeper_v1 * > &childrenEB)
 Set all children of this CutBookkeeper in one go.
void addChildren (const std::vector< CutBookkeeper_v1 * > &childrenEB)
 Add multiple children in one go to this CutBookkeeper.
void addChild (CutBookkeeper_v1 *childEB)
 Add one child to this CutBookkeeper.
CutBookkeeper_v1addNewChild (const std::string &name, const std::string &description)
 Create a new CutBookkeeper (using the given name and description) and add this new CutBookkeeper to this one as a child.
Handling of the usage of other CutBookkeepers by this one
std::size_t nUsedOthers () const
 Check if this CutBookkeeper has used others.
bool hasUsedOther (const xAOD::CutBookkeeper_v1 *testCBK) const
 Check if this CutBookkeeper has used others.
const xAOD::CutBookkeeper_v1usedOther (std::size_t i) const
 Get the usedOther at position i.
void setUsedOthers (const std::vector< CutBookkeeper_v1 * > &usedOthers)
 Set all CutBookkeeper that are used by this one in one go.
void addUsedOthers (const std::vector< CutBookkeeper_v1 * > &usedOthers)
 Add multiple children in one go to this CutBookkeeper.
void addUsedOther (CutBookkeeper_v1 *usedOtherEB)
 Add one other CutBookkeeper that is used by this one.
Handling of the siblings of this CutBookkeepers, i.e., the cuts

that happen at the same cut stage as this one, but in another (control) region

std::size_t nSiblings () const
 Check if this CutBookkeeper has siblings.
bool hasSibling (const xAOD::CutBookkeeper_v1 *testCBK) const
 Test if the provided CutBookkeeper is already a sibling.
const xAOD::CutBookkeeper_v1sibling (std::size_t i) const
 Get the sibling number i.
void setSiblings (const std::vector< CutBookkeeper_v1 * > &siblings)
 Set all CutBookkeeper that are siblings to this one in one go.
void addSiblings (const std::vector< CutBookkeeper_v1 * > &siblings)
 Add multiple siblings in one go to this CutBookkeeper.
void addSibling (CutBookkeeper_v1 *siblingsEB)
 Add one sibling CutBookkeeper to this one.

Getters and setters for the (sort of) 'static' information of the CutBookkeeper

unsigned int nameIdentifier () const
 Get the nameIdentifier for this CutBookkeeper.
unsigned int uniqueIdentifier () const
 Get the uniqueIdentifier for this CutBookkeeper.
const std::string & name () const
 Get the name of this CutBookkeeper.
void setName (const std::string &name)
 Set the name of this CutBookkeeper.
const std::string & description () const
 Get the description of this CutBookkeeper.
void setDescription (const std::string &description)
 Set the description of this CutBookkeeper.
bool isTopFilter () const
 Check if this CutBookkeeper was a top filter.
void setTopFilter (bool isTopFilter)
 Set the top-filter property of this CutBookkeeper.
CutLogic cutLogic () const
 Get the cut logic of this CutBookkeeper, e.g., ACCEPT, REQUIRE, VETO.
void setCutLogic (CutLogic logic)
 Set the cut logic of this CutBookkeeper, e.g., ACCEPT, REQUIRE, VETO.
int cycle () const
 Get the skimming cycle that this CutBookkeeper was running in.
void setCycle (int cycle)
 Set the skimming cycle that this CutBookkeeper is running in.
const std::string & inputStream () const
 Get the name of the input-file stream object that was seen by this CutBookkeeper.
void setInputStream (const std::string &inputstream)
 Set the name of the current input-file stream object for this CutBookkeeper.
const std::vector< std::string > & outputStreams () const
 Get the names of the output-file stream objects that were seen by this CutBookkeeper.
bool hasOutputStream (const std::string &outputstream) const
 Check if the given output stream name is known to this CutBookkeeper.
void addOutputStream (const std::string &outputstream)
 Add the name of an output-file stream object for this CutBookkeeper.
void addOutputStreamForAllUsed ATLAS_NOT_THREAD_SAFE (const std::string &outputstream)
 Add the name of an output-file stream object for this CutBookkeeper.
void setOutputStreams (const std::vector< std::string > &outputstreams)
 Set the names of the output-file stream objects for this CutBookkeeper.
void setNameIdentifier (unsigned int hash)
 Set the nameIdentifier for this CutBookkeeper.
void setUniqueIdentifier (unsigned int hash)
 Set the uniqueIdentifier for this CutBookkeeper.

Detailed Description

Description of the class that is used to keep track of event counts.

Author
Karsten Koeneke karst.nosp@m.en.k.nosp@m.oenek.nosp@m.e@ce.nosp@m.rn.ch

$Revision$ $Date$

Definition at line 29 of file CutBookkeeper_v1.h.

Member Enumeration Documentation

◆ CutLogic

Enumeration of the logic of a cut.

Enumerator
UNKNOWN 
ALLEVENTSPROCESSED 
ALLEVENTSWRITTEN 
OTHER 
ACCEPT 
REQUIRE 
VETO 

Definition at line 34 of file CutBookkeeper_v1.h.

Constructor & Destructor Documentation

◆ CutBookkeeper_v1()

xAOD::CutBookkeeper_v1::CutBookkeeper_v1 ( )

Constructor.

Definition at line 71 of file CutBookkeeper_v1.cxx.

73 // m_cycle(-1),
74 // m_parentIndex(-1),
75 // m_childrenIndices()
76 {
77 // Create a private store all the time for this object.
78 // This is OK since it only happens in initialize that we create new objects
79 // of this type or when merging files.
80 this->makePrivateStore();
81
82 // Set default data members
83 nameIdentifierAcc(*this) = 0;
84 uniqueIdentifierAcc(*this) = 0;
85 nameAcc(*this) = std::string("");
86 descriptionAcc(*this) = std::string("");
87 cutLogicAcc(*this) = 0;
88 isTopFilterAcc(*this) = false;
89 cycleAcc(*this) = -1;
90 inputStreamAcc(*this) = std::string("");
91 outputStreamsAcc(*this) = std::vector< std::string >();
96 nAcceptedEventsAcc(*this) = 0;
97 sumOfEventWeightsAcc(*this) = 0.0;
98 sumOfEventWeightsSquaredAcc(*this) = 0.0;
99 }
void makePrivateStore()
Create a new (empty) private store for this object.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
static const SG::AuxElement::Accessor< uint64_t > nAcceptedEventsAcc("nAcceptedEvents")
static const SG::AuxElement::Accessor< xAOD::CutBookkeeperLinks_t > siblingsLinksAcc("siblingsLinks")
ElementLink< CutBookkeeperContainer > CutBookkeeperLink_t
std::vector< xAOD::CutBookkeeperLink_t > CutBookkeeperLinks_t
static const SG::AuxElement::Accessor< unsigned int > uniqueIdentifierAcc("uniqueIdentifier")
static const SG::AuxElement::Accessor< std::vector< std::string > > outputStreamsAcc("outputStreams")
static const SG::AuxElement::Accessor< std::string > inputStreamAcc("inputStream")
static const SG::AuxElement::Accessor< xAOD::CutBookkeeperLinks_t > othersLinksAcc("othersLinks")
static const SG::AuxElement::Accessor< double > sumOfEventWeightsSquaredAcc("sumOfEventWeightsSquared")
static const SG::AuxElement::Accessor< int > isTopFilterAcc("isTopFilter")
static const SG::AuxElement::Accessor< std::string > descriptionAcc("description")
static const SG::AuxElement::Accessor< xAOD::CutBookkeeperLink_t > parentLinkAcc("parentLink")
static const SG::AuxElement::Accessor< std::string > nameAcc("name")
static const SG::AuxElement::Accessor< double > sumOfEventWeightsAcc("sumOfEventWeights")
static const SG::AuxElement::Accessor< xAOD::CutBookkeeperLinks_t > childrenLinksAcc("childrenLinks")
static const SG::AuxElement::Accessor< int > cycleAcc("cycle")
static const SG::AuxElement::Accessor< unsigned int > nameIdentifierAcc("nameIdentifier")
static const SG::AuxElement::Accessor< unsigned int > cutLogicAcc("cutLogic")

◆ ~CutBookkeeper_v1()

xAOD::CutBookkeeper_v1::~CutBookkeeper_v1 ( )

Destructor.

Definition at line 103 of file CutBookkeeper_v1.cxx.

103 {
104 }

Member Function Documentation

◆ addChild()

void xAOD::CutBookkeeper_v1::addChild ( CutBookkeeper_v1 * childEB)

Add one child to this CutBookkeeper.

Definition at line 442 of file CutBookkeeper_v1.cxx.

442 {
443 // See if the provided CutBookkeeper is already a child.
444 // If so, just do nothing
445 if ( this->hasChild(childEB) ) {
446 return;
447 }
448
449 //synchronize contextual info with the parent
450 childEB->setInputStream( this->inputStream() );
451 childEB->setCycle( this->cycle() );
452 childEB->setOutputStreams( this->outputStreams() );
453 childEB->setParent( this );
454
455 // Create the needed ElementLink
456 std::size_t ebIdx = childEB->index();
457 const xAOD::CutBookkeeperContainer_v1* ebCont =
458 dynamic_cast<const xAOD::CutBookkeeperContainer_v1*>(childEB->container());
459 if ( !ebCont ) {
460 throw std::runtime_error( "ERROR: Could not find the container for the child CutBookkeeper" );
461 }
462
463 // Finally, add the provided CutBookkeeper as a child
464 childrenLinksAcc(*this).emplace_back(*ebCont, ebIdx );
465
466 return;
467 }
bool hasChild(const xAOD::CutBookkeeper_v1 *testCBK) const
Test if a given child already exists.
int cycle() const
Get the skimming cycle that this CutBookkeeper was running in.
const std::string & inputStream() const
Get the name of the input-file stream object that was seen by this CutBookkeeper.
const std::vector< std::string > & outputStreams() const
Get the names of the output-file stream objects that were seen by this CutBookkeeper.

◆ addChildren()

void xAOD::CutBookkeeper_v1::addChildren ( const std::vector< CutBookkeeper_v1 * > & childrenEB)

Add multiple children in one go to this CutBookkeeper.

Definition at line 429 of file CutBookkeeper_v1.cxx.

429 {
430 // Reserve the space for the children vector
431 childrenLinksAcc(*this).reserve( childrenLinksAcc(*this).size() + childrenEB.size() );
432
433 // Add all children
434 for ( std::size_t i=0; i<childrenEB.size(); ++i ) {
435 this->addChild( childrenEB.at(i) );
436 }
437 return;
438 }
void addChild(CutBookkeeper_v1 *childEB)
Add one child to this CutBookkeeper.

◆ addNAcceptedEvents()

void xAOD::CutBookkeeper_v1::addNAcceptedEvents ( uint64_t nEvents)

Add seen events to the number of accepted events that this CutBookkeeper has seen.

Definition at line 302 of file CutBookkeeper_v1.cxx.

302 {
303 nAcceptedEventsAcc(*this) += nEvents;
304 return;
305 }
const int nEvents

◆ addNewChild()

CutBookkeeper_v1 * xAOD::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 this one as a child.

Definition at line 471 of file CutBookkeeper_v1.cxx.

472 {
473 // Get the container where this CutBookkeeper lives in.
474 // Throw an exception if we cannot find it
475 CutBookkeeperContainer_v1* ebCont = dynamic_cast<xAOD::CutBookkeeperContainer_v1*>(this->container());
476 if ( !ebCont ) {
477 throw std::runtime_error( "ERROR: Could not find the container for this CutBookkeeper" );
478 }
479
480 // Create a new CutBookkeeper and add it to the same container as this one
482 ebCont->push_back(eb);
483
484 // Set the properties of the new CutBookkeeper
485 eb->setName(name);
486 eb->setDescription(description);
487
488 addChild(eb);
489 return eb;
490 }
const std::string & description() const
Get the description of this CutBookkeeper.
const std::string & name() const
Get the name of this CutBookkeeper.
const SG::AuxVectorData * container() const
Return the container holding this element.

◆ addOutputStream()

void xAOD::CutBookkeeper_v1::addOutputStream ( const std::string & outputstream)

Add the name of an output-file stream object for this CutBookkeeper.

Definition at line 250 of file CutBookkeeper_v1.cxx.

250 {
251 for ( std::size_t i=0; i<outputStreamsAcc(*this).size(); ++i ) {
252 if ( outputstream == outputStreamsAcc(*this).at(i) ) {
253 return;
254 }
255 }
256 outputStreamsAcc(*this).push_back(outputstream);
257 }

◆ addSibling()

void xAOD::CutBookkeeper_v1::addSibling ( CutBookkeeper_v1 * siblingsEB)

Add one sibling CutBookkeeper to this one.

Definition at line 642 of file CutBookkeeper_v1.cxx.

642 {
643 if ( this->hasSibling(siblingEB) ) {
644 return;
645 }
646
647 // Create the needed ElementLink
648 std::size_t ebIdx = siblingEB->index();
649 const xAOD::CutBookkeeperContainer_v1* ebCont =
650 dynamic_cast<const xAOD::CutBookkeeperContainer_v1*>(siblingEB->container());
651 if ( !ebCont ) {
652 throw std::runtime_error( "ERROR: Could not find the container for the sibling CutBookkeeper" );
653 }
654
655 // Finally, add the provided CutBookkeeper as a sibling
656 siblingsLinksAcc(*this).emplace_back(*ebCont, ebIdx );
657
658 //synchronize contextual info with the sibling
659 siblingEB->addSibling( this );
660
661 return;
662 }
bool hasSibling(const xAOD::CutBookkeeper_v1 *testCBK) const
Test if the provided CutBookkeeper is already a sibling.

◆ addSiblings()

void xAOD::CutBookkeeper_v1::addSiblings ( const std::vector< CutBookkeeper_v1 * > & siblings)

Add multiple siblings in one go to this CutBookkeeper.

Definition at line 629 of file CutBookkeeper_v1.cxx.

629 {
630 // Reserve the space for the siblings vector
631 siblingsLinksAcc(*this).reserve( siblingsLinksAcc(*this).size() + siblings.size() );
632
633 // Add all siblings
634 for ( std::size_t i=0; i<siblings.size(); ++i ) {
635 this->addSibling( siblings.at(i) );
636 }
637 return;
638 }
void addSibling(CutBookkeeper_v1 *siblingsEB)
Add one sibling CutBookkeeper to this one.

◆ addSumOfEventWeights()

void xAOD::CutBookkeeper_v1::addSumOfEventWeights ( double nWeightedEvents)

Add more sum-of-event-weights that this CutBookkeeper has seen.

Definition at line 320 of file CutBookkeeper_v1.cxx.

320 {
322 return;
323 }
double sumOfEventWeights() const
Get the sum-of-event-weights that this CutBookkeeper has seen.

◆ addSumOfEventWeightsSquared()

void xAOD::CutBookkeeper_v1::addSumOfEventWeightsSquared ( double nWeightedEventsSquared)

Add more sum-of-(event-weights-squared) that this CutBookkeeper has seen.

Definition at line 338 of file CutBookkeeper_v1.cxx.

338 {
340 return;
341 }
double sumOfEventWeightsSquared() const
Get the sum-of-(event-weights-squared) that this CutBookkeeper has seen.

◆ addUsedOther()

void xAOD::CutBookkeeper_v1::addUsedOther ( CutBookkeeper_v1 * usedOtherEB)

Add one other CutBookkeeper that is used by this one.

Definition at line 555 of file CutBookkeeper_v1.cxx.

555 {
556 if ( this->hasUsedOther(usedOtherEB) ) {
557 return;
558 }
559
560 // I don't think I need this as the others should have already been properly registered
561 // //synchronize contextual info with the used-other
562 // usedOtherEB->setInputStream( m_inputstream );
563 // usedOtherEB->setCycle( m_cycle );
564 // usedOtherEB->setOutputStream( m_outputstream );
565
566 // Create the needed ElementLink
567 std::size_t ebIdx = usedOtherEB->index();
568 const xAOD::CutBookkeeperContainer_v1* ebCont =
569 dynamic_cast<const xAOD::CutBookkeeperContainer_v1*>(usedOtherEB->container());
570 if ( !ebCont ) {
571 throw std::runtime_error( "ERROR: Could not find the container for the usedOthers CutBookkeeper" );
572 }
573
574 // Finally, add the provided CutBookkeeper as a usedOther
575 othersLinksAcc(*this).emplace_back(*ebCont, ebIdx );
576
577 return;
578 }
bool hasUsedOther(const xAOD::CutBookkeeper_v1 *testCBK) const
Check if this CutBookkeeper has used others.

◆ addUsedOthers()

void xAOD::CutBookkeeper_v1::addUsedOthers ( const std::vector< CutBookkeeper_v1 * > & usedOthers)

Add multiple children in one go to this CutBookkeeper.

Definition at line 542 of file CutBookkeeper_v1.cxx.

542 {
543 // Reserve the space for the used-other vector
544 othersLinksAcc(*this).reserve( othersLinksAcc(*this).size() + usedOthers.size() );
545
546 // Add all used ones
547 for ( std::size_t i=0; i<usedOthers.size(); ++i ) {
548 this->addUsedOther( usedOthers.at(i) );
549 }
550 return;
551 }
void addUsedOther(CutBookkeeper_v1 *usedOtherEB)
Add one other CutBookkeeper that is used by this one.

◆ ATLAS_NOT_THREAD_SAFE()

void addOutputStreamForAllUsed xAOD::CutBookkeeper_v1::ATLAS_NOT_THREAD_SAFE ( const std::string & outputstream)

Add the name of an output-file stream object for this CutBookkeeper.

◆ child()

const xAOD::CutBookkeeper_v1 * xAOD::CutBookkeeper_v1::child ( std::size_t i) const

Get the child at position i.

Definition at line 408 of file CutBookkeeper_v1.cxx.

408 {
409 if ( i >= childrenLinksAcc(*this).size() ) {
410 throw std::runtime_error( "ERROR: Got an index out of the range of childred CutBookkeepers" );
411 }
412 const xAOD::CutBookkeeperLink_t& tmpLink = childrenLinksAcc(*this).at(i);
413 if ( !(tmpLink.isValid()) ) {
414 throw std::runtime_error( "ERROR: Got an invalid child CutBookkeeper" );
415 }
416 const xAOD::CutBookkeeper_v1* tmpBK = *tmpLink;
417 return tmpBK;
418 }

◆ cutLogic()

CutBookkeeper_v1::CutLogic xAOD::CutBookkeeper_v1::cutLogic ( ) const

Get the cut logic of this CutBookkeeper, e.g., ACCEPT, REQUIRE, VETO.

Definition at line 195 of file CutBookkeeper_v1.cxx.

195 {
196 return static_cast<CutBookkeeper_v1::CutLogic>(cutLogicAcc(*this));
197 }
CutLogic
Enumeration of the logic of a cut.

◆ cycle()

int xAOD::CutBookkeeper_v1::cycle ( ) const

Get the skimming cycle that this CutBookkeeper was running in.

Definition at line 205 of file CutBookkeeper_v1.cxx.

205 {
206 return cycleAcc(*this);
207 }

◆ description()

const std::string & xAOD::CutBookkeeper_v1::description ( ) const

Get the description of this CutBookkeeper.

Definition at line 172 of file CutBookkeeper_v1.cxx.

172 {
173 return descriptionAcc(*this);
174 }

◆ hasChild()

bool xAOD::CutBookkeeper_v1::hasChild ( const xAOD::CutBookkeeper_v1 * testCBK) const

Test if a given child already exists.

Definition at line 392 of file CutBookkeeper_v1.cxx.

392 {
393 // Search for the child in the existing chidren
394 for ( std::size_t i=0; i<childrenLinksAcc(*this).size(); ++i ) {
395 const xAOD::CutBookkeeperLink_t& tmpLink = childrenLinksAcc(*this).at(i);
396 if ( !(tmpLink.isValid()) ) {
397 throw std::runtime_error( "ERROR: Got an invalid child CutBookkeeper" );
398 }
399 const xAOD::CutBookkeeper_v1* tmpBK = *tmpLink;
400 if ( tmpBK->isEqualTo(testCBK) ) {
401 return true;
402 }
403 }
404 return false;
405 }
bool isEqualTo(const CutBookkeeper_v1 *eb) const
Test for the equality of this CutBookkeeper with another one.

◆ hasOutputStream()

bool xAOD::CutBookkeeper_v1::hasOutputStream ( const std::string & outputstream) const

Check if the given output stream name is known to this CutBookkeeper.

Definition at line 240 of file CutBookkeeper_v1.cxx.

240 {
241 for ( std::size_t i=0; i<outputStreamsAcc(*this).size(); ++i ) {
242 if ( outputstream == outputStreamsAcc(*this).at(i) ) {
243 return true;
244 }
245 }
246 return false;
247 }

◆ hasParent()

bool xAOD::CutBookkeeper_v1::hasParent ( ) const

Check if there is a parent CutBookkeeper of this CutBookkeeper.

Definition at line 359 of file CutBookkeeper_v1.cxx.

359 {
360 return ( parentLinkAcc(*this).isValid() );
361 }

◆ hasSibling()

bool xAOD::CutBookkeeper_v1::hasSibling ( const xAOD::CutBookkeeper_v1 * testCBK) const

Test if the provided CutBookkeeper is already a sibling.

Definition at line 592 of file CutBookkeeper_v1.cxx.

592 {
593 // Search for the sibling in the existing sibings
594 for ( std::size_t i=0; i<siblingsLinksAcc(*this).size(); ++i ) {
595 const xAOD::CutBookkeeperLink_t& tmpLink = siblingsLinksAcc(*this).at(i);
596 if ( !(tmpLink.isValid()) ) {
597 throw std::runtime_error( "ERROR: Got an invalid sibling CutBookkeeper" );
598 }
599 const xAOD::CutBookkeeper_v1* tmpBK = *tmpLink;
600 if ( tmpBK->isEqualTo(testCBK) ) {
601 return true;
602 }
603 }
604 return false;
605 }

◆ hasUsedOther()

bool xAOD::CutBookkeeper_v1::hasUsedOther ( const xAOD::CutBookkeeper_v1 * testCBK) const

Check if this CutBookkeeper has used others.

Definition at line 505 of file CutBookkeeper_v1.cxx.

505 {
506 // Search for the usedOther in the existing usedOthers
507 for ( std::size_t i=0; i<othersLinksAcc(*this).size(); ++i ) {
508 const xAOD::CutBookkeeperLink_t& tmpLink = othersLinksAcc(*this).at(i);
509 if ( !(tmpLink.isValid()) ) {
510 throw std::runtime_error( "ERROR: Got an invalid usedOther CutBookkeeper" );
511 }
512 const xAOD::CutBookkeeper_v1* tmpBK = *tmpLink;
513 if ( tmpBK->isEqualTo(testCBK) ) {
514 return true;
515 }
516 }
517 return false;
518 }

◆ inputStream()

const std::string & xAOD::CutBookkeeper_v1::inputStream ( ) const

Get the name of the input-file stream object that was seen by this CutBookkeeper.

Definition at line 220 of file CutBookkeeper_v1.cxx.

220 {
221 return inputStreamAcc(*this);
222 }

◆ isEqualTo()

bool xAOD::CutBookkeeper_v1::isEqualTo ( const CutBookkeeper_v1 * eb) const

Test for the equality of this CutBookkeeper with another one.

Definition at line 348 of file CutBookkeeper_v1.cxx.

348 {
349 //This function is mostly a placeholder in case we decide to complexify later.
350 return ( this->uniqueIdentifier() == eb->uniqueIdentifier() );
351 }
unsigned int uniqueIdentifier() const
Get the uniqueIdentifier for this CutBookkeeper.

◆ isTopFilter()

bool xAOD::CutBookkeeper_v1::isTopFilter ( ) const

Check if this CutBookkeeper was a top filter.

Definition at line 184 of file CutBookkeeper_v1.cxx.

184 {
185 return static_cast<bool>(isTopFilterAcc(*this));
186 }

◆ nAcceptedEvents()

uint64_t xAOD::CutBookkeeper_v1::nAcceptedEvents ( ) const

Get the number of accepted events that this CutBookkeeper has seen.

Definition at line 291 of file CutBookkeeper_v1.cxx.

291 {
292 return nAcceptedEventsAcc(*this);
293 }

◆ name()

const std::string & xAOD::CutBookkeeper_v1::name ( ) const

Get the name of this CutBookkeeper.

Definition at line 156 of file CutBookkeeper_v1.cxx.

156 {
157 return nameAcc(*this);
158 }

◆ nameIdentifier()

unsigned int xAOD::CutBookkeeper_v1::nameIdentifier ( ) const

Get the nameIdentifier for this CutBookkeeper.

Definition at line 133 of file CutBookkeeper_v1.cxx.

133 {
134 return nameIdentifierAcc(*this);
135 }

◆ nChildren()

std::size_t xAOD::CutBookkeeper_v1::nChildren ( ) const

Get the number of children CutBookkeepers of this CutBookkeeper.

Definition at line 387 of file CutBookkeeper_v1.cxx.

387 {
388 return childrenLinksAcc(*this).size();
389 }

◆ nSiblings()

std::size_t xAOD::CutBookkeeper_v1::nSiblings ( ) const

Check if this CutBookkeeper has siblings.

Definition at line 587 of file CutBookkeeper_v1.cxx.

587 {
588 return siblingsLinksAcc(*this).size();
589 }

◆ nUsedOthers()

std::size_t xAOD::CutBookkeeper_v1::nUsedOthers ( ) const

Check if this CutBookkeeper has used others.

Definition at line 500 of file CutBookkeeper_v1.cxx.

500 {
501 return othersLinksAcc(*this).size();
502 }

◆ operator==()

bool xAOD::CutBookkeeper_v1::operator== ( const CutBookkeeper_v1 & rhs)
inline

Equality operator.

Definition at line 82 of file CutBookkeeper_v1.h.

82 {
83 return this->isEqualTo( &rhs );
84 }

◆ outputStreams()

const std::vector< std::string > & xAOD::CutBookkeeper_v1::outputStreams ( ) const

Get the names of the output-file stream objects that were seen by this CutBookkeeper.

Definition at line 235 of file CutBookkeeper_v1.cxx.

235 {
236 return outputStreamsAcc(*this);
237 }

◆ parent()

const xAOD::CutBookkeeper_v1 * xAOD::CutBookkeeper_v1::parent ( ) const

Get the parent CutBookkeeper.

Definition at line 364 of file CutBookkeeper_v1.cxx.

364 {
365 if ( parentLinkAcc(*this).isValid() ) {
366 return *(parentLinkAcc(*this));
367 }
368 return nullptr;
369 }

◆ payload()

CutBookkeeper_v1::Payload xAOD::CutBookkeeper_v1::payload ( ) const

Get the whole payload object (which contains all counters) in one go.

Return it by value as it only contains three numbers.

Definition at line 112 of file CutBookkeeper_v1.cxx.

112 {
113 CutBookkeeper_v1::Payload payload;
114 payload.nAcceptedEvents = this->nAcceptedEvents();
115 payload.sumOfEventWeights = this->sumOfEventWeights();
116 payload.sumOfEventWeightsSquared = this->sumOfEventWeightsSquared();
117 return payload;
118 }
Payload payload() const
Get the whole payload object (which contains all counters) in one go.
uint64_t nAcceptedEvents() const
Get the number of accepted events that this CutBookkeeper has seen.

◆ setChildren()

void xAOD::CutBookkeeper_v1::setChildren ( const std::vector< CutBookkeeper_v1 * > & childrenEB)

Set all children of this CutBookkeeper in one go.

Definition at line 422 of file CutBookkeeper_v1.cxx.

422 {
423 childrenLinksAcc(*this).clear();
424 return this->addChildren(childrenEB);
425 }
void addChildren(const std::vector< CutBookkeeper_v1 * > &childrenEB)
Add multiple children in one go to this CutBookkeeper.

◆ setCutLogic()

void xAOD::CutBookkeeper_v1::setCutLogic ( CutBookkeeper_v1::CutLogic val)

Set the cut logic of this CutBookkeeper, e.g., ACCEPT, REQUIRE, VETO.

Definition at line 199 of file CutBookkeeper_v1.cxx.

199 {
200 cutLogicAcc( *this ) = static_cast<unsigned int>(val);
201 }

◆ setCycle()

void xAOD::CutBookkeeper_v1::setCycle ( int cycle)

Set the skimming cycle that this CutBookkeeper is running in.

Definition at line 209 of file CutBookkeeper_v1.cxx.

209 {
210 static const SG::AuxElement::Accessor< int > cycleAcc( "cycle" );
211 cycleAcc(*this) = cycle;
212 std::ostringstream str;
213 str << name() << inputStream() << cycle;
214 this->setUniqueIdentifier( ::UtilsHash( str.str() ) );
215 return;
216 }
void setUniqueIdentifier(unsigned int hash)
Set the uniqueIdentifier for this CutBookkeeper.

◆ setDescription()

void xAOD::CutBookkeeper_v1::setDescription ( const std::string & description)

Set the description of this CutBookkeeper.

Definition at line 177 of file CutBookkeeper_v1.cxx.

177 {
178 descriptionAcc( *this ) = description;
179 return;
180 }

◆ setInputStream()

void xAOD::CutBookkeeper_v1::setInputStream ( const std::string & inputstream)

Set the name of the current input-file stream object for this CutBookkeeper.

Definition at line 225 of file CutBookkeeper_v1.cxx.

225 {
226 inputStreamAcc(*this) = inputstream;
227 std::ostringstream str;
228 str << name() << inputstream << cycle();
229 this->setUniqueIdentifier( ::UtilsHash( str.str() ) );
230 return;
231 }

◆ setNAcceptedEvents()

void xAOD::CutBookkeeper_v1::setNAcceptedEvents ( uint64_t nEvents)

Set the number of accepted events for this CutBookkeeper.

Definition at line 295 of file CutBookkeeper_v1.cxx.

295 {
296 nAcceptedEventsAcc( *this ) = val;
297 return;
298 }

◆ setName()

void xAOD::CutBookkeeper_v1::setName ( const std::string & name)

Set the name of this CutBookkeeper.

Definition at line 161 of file CutBookkeeper_v1.cxx.

161 {
162 nameAcc( *this ) = name;
163 this->setNameIdentifier( ::UtilsHash( name ) );
164 std::ostringstream str;
165 str << name << inputStream() << cycle();
166 this->setUniqueIdentifier( ::UtilsHash( str.str() ) );
167 return;
168 }
void setNameIdentifier(unsigned int hash)
Set the nameIdentifier for this CutBookkeeper.

◆ setNameIdentifier()

void xAOD::CutBookkeeper_v1::setNameIdentifier ( unsigned int hash)
private

Set the nameIdentifier for this CutBookkeeper.

Definition at line 137 of file CutBookkeeper_v1.cxx.

137 {
139 return;
140 }
unsigned int nameIdentifier() const
Get the nameIdentifier for this CutBookkeeper.

◆ setOutputStreams()

void xAOD::CutBookkeeper_v1::setOutputStreams ( const std::vector< std::string > & outputstreams)

Set the names of the output-file stream objects for this CutBookkeeper.

Definition at line 280 of file CutBookkeeper_v1.cxx.

280 {
281 outputStreamsAcc(*this) = outputstreams;
282 return;
283 }

◆ setParent()

void xAOD::CutBookkeeper_v1::setParent ( const CutBookkeeper_v1 * parentEB)

Set the parent CutBookkeeper of this CutBookkeeper.

Definition at line 372 of file CutBookkeeper_v1.cxx.

372 {
373 // Get the index of the provided CutBookkeeper in its container
374 std::size_t ebIdx = parentEB->index();
375 const xAOD::CutBookkeeperContainer_v1* ebCont =
376 dynamic_cast<const xAOD::CutBookkeeperContainer_v1*>(parentEB->container());
377 if ( !ebCont ) {
378 throw std::runtime_error( "ERROR: Could not find the container for the parent CutBookkeeper" );
379 }
380 parentLinkAcc(*this) = xAOD::CutBookkeeperLink_t( *ebCont, ebIdx );
381 return;
382 }

◆ setPayload()

void xAOD::CutBookkeeper_v1::setPayload ( const Payload & payload)

Set the whole payload object (which contains all counters) in one go.

Definition at line 121 of file CutBookkeeper_v1.cxx.

121 {
122 this->setNAcceptedEvents( payload.nAcceptedEvents );
123 this->setSumOfEventWeights( payload.sumOfEventWeights );
124 this->setSumOfEventWeightsSquared( payload.sumOfEventWeightsSquared );
125 }
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.
void setSumOfEventWeights(double nWeightedEvents)
Set the sum-of-event-weights that this CutBookkeeper has seen.

◆ setSiblings()

void xAOD::CutBookkeeper_v1::setSiblings ( const std::vector< CutBookkeeper_v1 * > & siblings)

Set all CutBookkeeper that are siblings to this one in one go.

Definition at line 622 of file CutBookkeeper_v1.cxx.

622 {
623 siblingsLinksAcc(*this).clear();
624 return this->addSiblings(siblings);
625 }
void addSiblings(const std::vector< CutBookkeeper_v1 * > &siblings)
Add multiple siblings in one go to this CutBookkeeper.

◆ setSumOfEventWeights()

void xAOD::CutBookkeeper_v1::setSumOfEventWeights ( double nWeightedEvents)

Set the sum-of-event-weights that this CutBookkeeper has seen.

Definition at line 313 of file CutBookkeeper_v1.cxx.

313 {
314 sumOfEventWeightsAcc( *this ) = val;
315 return;
316 }

◆ setSumOfEventWeightsSquared()

void xAOD::CutBookkeeper_v1::setSumOfEventWeightsSquared ( double nWeightedEventsSquared)

Set the sum-of-(event-weights-squared) that this CutBookkeeper has seen.

Definition at line 331 of file CutBookkeeper_v1.cxx.

331 {
333 return;
334 }

◆ setTopFilter()

void xAOD::CutBookkeeper_v1::setTopFilter ( bool isTopFilter)

Set the top-filter property of this CutBookkeeper.

Definition at line 188 of file CutBookkeeper_v1.cxx.

188 {
189 isTopFilterAcc( *this ) = static_cast<int>(val);
190 return;
191 }

◆ setUniqueIdentifier()

void xAOD::CutBookkeeper_v1::setUniqueIdentifier ( unsigned int hash)
private

Set the uniqueIdentifier for this CutBookkeeper.

Definition at line 148 of file CutBookkeeper_v1.cxx.

148 {
150 return;
151 }

◆ setUsedOthers()

void xAOD::CutBookkeeper_v1::setUsedOthers ( const std::vector< CutBookkeeper_v1 * > & usedOthers)

Set all CutBookkeeper that are used by this one in one go.

Definition at line 535 of file CutBookkeeper_v1.cxx.

535 {
536 othersLinksAcc(*this).clear();
537 return this->addUsedOthers(usedOthers);
538 }
void addUsedOthers(const std::vector< CutBookkeeper_v1 * > &usedOthers)
Add multiple children in one go to this CutBookkeeper.

◆ sibling()

const xAOD::CutBookkeeper_v1 * xAOD::CutBookkeeper_v1::sibling ( std::size_t i) const

Get the sibling number i.

Definition at line 608 of file CutBookkeeper_v1.cxx.

608 {
609 if ( i >= siblingsLinksAcc(*this).size() ) {
610 throw std::runtime_error( "ERROR: Got an index out of the range of sibling CutBookkeepers" );
611 }
612 const xAOD::CutBookkeeperLink_t& tmpLink = siblingsLinksAcc(*this).at(i);
613 if ( !(tmpLink.isValid()) ) {
614 throw std::runtime_error( "ERROR: Got an invalid sibling CutBookkeeper" );
615 }
616 const xAOD::CutBookkeeper_v1* tmpBK = *tmpLink;
617 return tmpBK;
618 }

◆ sumOfEventWeights()

double xAOD::CutBookkeeper_v1::sumOfEventWeights ( ) const

Get the sum-of-event-weights that this CutBookkeeper has seen.

Definition at line 309 of file CutBookkeeper_v1.cxx.

309 {
310 return sumOfEventWeightsAcc(*this);
311 }

◆ sumOfEventWeightsSquared()

double xAOD::CutBookkeeper_v1::sumOfEventWeightsSquared ( ) const

Get the sum-of-(event-weights-squared) that this CutBookkeeper has seen.

Definition at line 327 of file CutBookkeeper_v1.cxx.

327 {
328 return sumOfEventWeightsSquaredAcc(*this);
329 }

◆ toPersistent()

void xAOD::CutBookkeeper_v1::toPersistent ( )

Function preparing the object to be persistified.

Definition at line 670 of file CutBookkeeper_v1.cxx.

670 {
671 if( parentLinkAcc.isAvailableWritable(*this) ) {
672 parentLinkAcc(*this).toPersistent();
673 }
674 if( childrenLinksAcc.isAvailableWritable(*this) ) {
675 xAOD::CutBookkeeperLinks_t::iterator itr = childrenLinksAcc(*this).begin();
676 xAOD::CutBookkeeperLinks_t::iterator itrEnd = childrenLinksAcc(*this).end();
677 for( ; itr != itrEnd; ++itr ) {
678 itr->toPersistent();
679 }
680 }
681 if( othersLinksAcc.isAvailableWritable(*this) ) {
682 xAOD::CutBookkeeperLinks_t::iterator itr = othersLinksAcc(*this).begin();
683 xAOD::CutBookkeeperLinks_t::iterator itrEnd = othersLinksAcc(*this).end();
684 for( ; itr != itrEnd; ++itr ) {
685 itr->toPersistent();
686 }
687 }
688 if( siblingsLinksAcc.isAvailableWritable(*this) ) {
689 xAOD::CutBookkeeperLinks_t::iterator itr = siblingsLinksAcc(*this).begin();
690 xAOD::CutBookkeeperLinks_t::iterator itrEnd = siblingsLinksAcc(*this).end();
691 for( ; itr != itrEnd; ++itr ) {
692 itr->toPersistent();
693 }
694 }
695 return;
696 }

◆ uniqueIdentifier()

unsigned int xAOD::CutBookkeeper_v1::uniqueIdentifier ( ) const

Get the uniqueIdentifier for this CutBookkeeper.

Definition at line 144 of file CutBookkeeper_v1.cxx.

144 {
145 return uniqueIdentifierAcc(*this);
146 }

◆ usedOther()

const xAOD::CutBookkeeper_v1 * xAOD::CutBookkeeper_v1::usedOther ( std::size_t i) const

Get the usedOther at position i.

Definition at line 521 of file CutBookkeeper_v1.cxx.

521 {
522 if ( i >= othersLinksAcc(*this).size() ) {
523 throw std::runtime_error( "ERROR: Got an index out of the range of usedOthers CutBookkeepers" );
524 }
525 const xAOD::CutBookkeeperLink_t& tmpLink = othersLinksAcc(*this).at(i);
526 if ( !(tmpLink.isValid()) ) {
527 throw std::runtime_error( "ERROR: Got an invalid usedOther CutBookkeeper" );
528 }
529 const xAOD::CutBookkeeper_v1* tmpBK = *tmpLink;
530 return tmpBK;
531 }

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