|
ATLAS Offline Software
|
Go to the documentation of this file.
16 #include "AthLinks/ElementLink.h"
29 unsigned int UtilsHash(
const std::string&
name ) {
31 static const std::hash< std::string >
helper;
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;
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;
134 return nameIdentifierAcc(*
this);
145 return uniqueIdentifierAcc(*
this);
157 return nameAcc(*
this);
162 nameAcc( *
this ) =
name;
164 std::ostringstream
str;
173 return descriptionAcc(*
this);
185 return static_cast<bool>(isTopFilterAcc(*
this));
189 isTopFilterAcc( *
this ) =
static_cast<int>(
val);
200 cutLogicAcc( *
this ) =
static_cast<unsigned int>(
val);
206 return cycleAcc(*
this);
211 cycleAcc(*
this) =
cycle;
212 std::ostringstream
str;
221 return inputStreamAcc(*
this);
226 inputStreamAcc(*
this) = inputstream;
227 std::ostringstream
str;
236 return outputStreamsAcc(*
this);
241 for ( std::size_t
i=0;
i<outputStreamsAcc(*this).size(); ++
i ) {
242 if ( outputstream == outputStreamsAcc(*this).at(
i) ) {
251 for ( std::size_t
i=0;
i<outputStreamsAcc(*this).size(); ++
i ) {
252 if ( outputstream == outputStreamsAcc(*this).at(
i) ) {
256 outputStreamsAcc(*this).push_back(outputstream);
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);
281 outputStreamsAcc(*
this) = outputstreams;
292 return nAcceptedEventsAcc(*
this);
296 nAcceptedEventsAcc( *
this ) =
val;
303 nAcceptedEventsAcc(*
this) +=
nEvents;
310 return sumOfEventWeightsAcc(*
this);
314 sumOfEventWeightsAcc( *
this ) =
val;
328 return sumOfEventWeightsSquaredAcc(*
this);
332 sumOfEventWeightsSquaredAcc( *
this ) =
val;
360 return ( parentLinkAcc(*this).isValid() );
365 if ( parentLinkAcc(*this).isValid() ) {
366 return *(parentLinkAcc(*
this));
374 std::size_t ebIdx = parentEB->
index();
378 throw std::runtime_error(
"ERROR: Could not find the container for the parent CutBookkeeper" );
388 return childrenLinksAcc(*this).size();
394 for ( std::size_t
i=0;
i<childrenLinksAcc(*this).size(); ++
i ) {
397 throw std::runtime_error(
"ERROR: Got an invalid child CutBookkeeper" );
409 if (
i >= childrenLinksAcc(*this).size() ) {
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" );
423 childrenLinksAcc(*this).clear();
431 childrenLinksAcc(*this).reserve( childrenLinksAcc(*this).size() + childrenEB.size() );
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" );
464 childrenLinksAcc(*this).emplace_back(*ebCont, ebIdx );
477 throw std::runtime_error(
"ERROR: Could not find the container for this CutBookkeeper" );
501 return othersLinksAcc(*this).size();
507 for ( std::size_t
i=0;
i<othersLinksAcc(*this).size(); ++
i ) {
510 throw std::runtime_error(
"ERROR: Got an invalid usedOther CutBookkeeper" );
522 if (
i >= othersLinksAcc(*this).size() ) {
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" );
536 othersLinksAcc(*this).clear();
544 othersLinksAcc(*this).reserve( othersLinksAcc(*this).size() + usedOthers.size() );
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" );
575 othersLinksAcc(*this).emplace_back(*ebCont, ebIdx );
588 return siblingsLinksAcc(*this).size();
594 for ( std::size_t
i=0;
i<siblingsLinksAcc(*this).size(); ++
i ) {
597 throw std::runtime_error(
"ERROR: Got an invalid sibling CutBookkeeper" );
609 if (
i >= siblingsLinksAcc(*this).size() ) {
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" );
623 siblingsLinksAcc(*this).clear();
631 siblingsLinksAcc(*this).reserve( siblingsLinksAcc(*this).size() + siblings.size() );
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" );
656 siblingsLinksAcc(*this).emplace_back(*ebCont, ebIdx );
671 if( parentLinkAcc.isAvailableWritable(*
this) ) {
672 parentLinkAcc(*this).toPersistent();
674 if( childrenLinksAcc.isAvailableWritable(*
this) ) {
677 for( ; itr != itrEnd; ++itr ) {
681 if( othersLinksAcc.isAvailableWritable(*
this) ) {
684 for( ; itr != itrEnd; ++itr ) {
688 if( siblingsLinksAcc.isAvailableWritable(*
this) ) {
691 for( ; itr != itrEnd; ++itr ) {
JetConstituentVector::iterator iterator
void addSiblings(const std::vector< CutBookkeeper_v1 * > &siblings)
Add multiple siblings in one go to this CutBookkeeper.
int cycle() const
Get the skimming cycle that this CutBookkeeper was running in.
std::vector< xAOD::CutBookkeeperLink_t > CutBookkeeperLinks_t
void setCycle(int cycle)
Set the skimming cycle that this CutBookkeeper is running in.
void setName(const std::string &name)
Set the name of this CutBookkeeper.
void setDescription(const std::string &description)
Set the description of this CutBookkeeper.
CutBookkeeper_v1()
Constructor.
const xAOD::CutBookkeeper_v1 * sibling(std::size_t i) const
Get the sibling number i.
Helper class to provide type-safe access to aux data.
void addSibling(CutBookkeeper_v1 *siblingsEB)
Add one sibling CutBookkeeper to this one.
Description of the class that is used to keep track of event counts.
void setOutputStreams(const std::vector< std::string > &outputstreams)
Set the names of the output-file stream objects for this CutBookkeeper.
double cycle(double a, double b)
std::size_t nUsedOthers() const
Check if this CutBookkeeper has used others.
void setUsedOthers(const std::vector< CutBookkeeper_v1 * > &usedOthers)
Set all CutBookkeeper that are used by this one in one go.
void addChild(CutBookkeeper_v1 *childEB)
Add one child to this CutBookkeeper.
double sumOfEventWeightsSquared() const
Get the sum-of-(event-weights-squared) that this CutBookkeeper has seen.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
const std::vector< std::string > & outputStreams() const
Get the names of the output-file stream objects that were seen by this CutBookkeeper.
CutLogic
Enumeration of the logic of a cut.
void addUsedOther(CutBookkeeper_v1 *usedOtherEB)
Add one other CutBookkeeper that is used by this one.
Payload payload() const
Get the whole payload object (which contains all counters) in one go.
std::size_t nSiblings() const
Check if this CutBookkeeper has siblings.
void toPersistent()
Function preparing the object to be persistified.
ElementLink< CutBookkeeperContainer > CutBookkeeperLink_t
double sumOfEventWeightsSquared
bool hasParent() const
Check if there is a parent CutBookkeeper of this CutBookkeeper.
bool isValid() const
Test to see if the link can be dereferenced.
void setUniqueIdentifier(unsigned int hash)
Set the uniqueIdentifier for this CutBookkeeper.
void setNAcceptedEvents(uint64_t nEvents)
Set the number of accepted events for this CutBookkeeper.
void ErrorHandler ATLAS_NOT_THREAD_SAFE(Int_t level, Bool_t abort, const char *location, const char *message)
Function filtering the warnings coming from ROOT.
void addChildren(const std::vector< CutBookkeeper_v1 * > &childrenEB)
Add multiple children in one go to this CutBookkeeper.
void addNAcceptedEvents(uint64_t nEvents)
Add seen events to the number of accepted events that this CutBookkeeper has seen.
void addUsedOthers(const std::vector< CutBookkeeper_v1 * > &usedOthers)
Add multiple children in one go to this CutBookkeeper.
unsigned int uniqueIdentifier() const
Get the uniqueIdentifier for this CutBookkeeper.
bool hasChild(const xAOD::CutBookkeeper_v1 *testCBK) const
Test if a given child already exists.
void setSumOfEventWeights(double nWeightedEvents)
Set the sum-of-event-weights that this CutBookkeeper has seen.
const std::string & description() const
Get the description of this CutBookkeeper.
void setParent(const CutBookkeeper_v1 *parentEB)
Set the parent CutBookkeeper of this CutBookkeeper.
Container that holds the Container of all CutBookkeepers.
void setChildren(const std::vector< CutBookkeeper_v1 * > &childrenEB)
Set all children of this CutBookkeeper in one go.
bool hasUsedOther(const xAOD::CutBookkeeper_v1 *testCBK) const
Check if this CutBookkeeper has used others.
void setSumOfEventWeightsSquared(double nWeightedEventsSquared)
Set the sum-of-(event-weights-squared) that this CutBookkeeper has seen.
bool isEqualTo(const CutBookkeeper_v1 *eb) const
Test for the equality of this CutBookkeeper with another one.
size_t index() const
Return the index of this element within its container.
std::string str(const TrigT2MbtsBits_v1 &trigT2MbtsBits)
bool hasSibling(const xAOD::CutBookkeeper_v1 *testCBK) const
Test if the provided CutBookkeeper is already a sibling.
def uniqueIdentifier()
return a URL-safe, base 64-encoded pseudorandom UUID
ElementLink implementation for ROOT usage.
void setInputStream(const std::string &inputstream)
Set the name of the current input-file stream object for this CutBookkeeper.
uint64_t nAcceptedEvents() const
Get the number of accepted events that this CutBookkeeper has seen.
const xAOD::CutBookkeeper_v1 * child(std::size_t i) const
Get the child at position i.
void addSumOfEventWeights(double nWeightedEvents)
Add more sum-of-event-weights that this CutBookkeeper has seen.
void setNameIdentifier(unsigned int hash)
Set the nameIdentifier for this CutBookkeeper.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
bool isTopFilter() const
Check if this CutBookkeeper was a top filter.
void makePrivateStore()
Create a new (empty) private store for this object.
double sumOfEventWeights() const
Get the sum-of-event-weights that this CutBookkeeper has seen.
void setCutLogic(CutLogic logic)
Set the cut logic of this CutBookkeeper, e.g., ACCEPT, REQUIRE, VETO.
const std::string & name() const
Get the name of this CutBookkeeper.
const xAOD::CutBookkeeper_v1 * usedOther(std::size_t i) const
Get the usedOther at position i.
unsigned int nameIdentifier() const
Get the nameIdentifier for this CutBookkeeper.
CutLogic cutLogic() const
Get the cut logic of this CutBookkeeper, e.g., ACCEPT, REQUIRE, VETO.
const std::string & inputStream() const
Get the name of the input-file stream object that was seen by this CutBookkeeper.
~CutBookkeeper_v1()
Destructor.
void setPayload(const Payload &payload)
Set the whole payload object (which contains all counters) in one go.
std::size_t nChildren() const
Get the number of children CutBookkeepers of this CutBookkeeper.
void addSumOfEventWeightsSquared(double nWeightedEventsSquared)
Add more sum-of-(event-weights-squared) that this CutBookkeeper has seen.
void addOutputStream(const std::string &outputstream)
Add the name of an output-file stream object for this CutBookkeeper.
Add struct for payload and implement operator *,/....*=,...
const SG::AuxVectorData * container() const
Return the container holding this element.
void setTopFilter(bool isTopFilter)
Set the top-filter property of this CutBookkeeper.
void setSiblings(const std::vector< CutBookkeeper_v1 * > &siblings)
Set all CutBookkeeper that are siblings to this one in one go.
bool hasOutputStream(const std::string &outputstream) const
Check if the given output stream name is known to this CutBookkeeper.
std::string description
glabal timer - how long have I taken so far?
const xAOD::CutBookkeeper_v1 * parent() const
Get the parent 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...