|
ATLAS Offline Software
|
Go to the documentation of this file.
24 int minCycle,
int maxCycle ) {
26 if (!cbkCont)
return nullptr;
29 const int cbkMaxCycle = cbkCont->
maxCycle();
30 if (maxCycle<0) maxCycle = cbkMaxCycle;
33 std::vector<const xAOD::CutBookkeeper*> cbks;
34 cbks.reserve(cbkCont->
size());
36 const int cycle = cbk->cycle();
37 if (
cycle >= minCycle &&
cycle <= maxCycle ){ cbks.push_back(cbk); }
39 const std::size_t nCBK = cbks.size();
44 ::TH1* resultHist = new ::TH1D(
histName.c_str(), histTitle.c_str(),
47 resultHist->GetXaxis()->SetTitle(
"CutBookkeeper Name");
48 resultHist->GetYaxis()->SetTitle(
"nAcceptedEvents");
51 for (std::size_t
i=0;
i<nCBK; ++
i){
55 const std::string&
name = cbk->
name();
56 const int binIdx =
static_cast<int>(
i+1);
57 resultHist->SetBinContent(binIdx,
nEvents);
58 resultHist->SetBinError(binIdx,
error);
59 resultHist->GetXaxis()->SetBinLabel(binIdx,
name.c_str());
74 const std::vector<size_t> &otherIndexMap )
79 if (matchIter != contToUpdate.
end()) {
87 if (matchIter != contToUpdate.
end()) {
88 std::size_t
pos = matchIter - otherCont.
begin();
89 return contToUpdate[otherIndexMap[
pos]];
108 std::size_t origSize = contToUpdate->
size();
111 std::vector<std::size_t> otherIndexMap(otherCont->
size());
114 for (std::size_t
i = 0;
i < otherCont->
size(); ++
i) {
118 bool foundEBKToUpdate{
false};
119 for (std::size_t j = 0; j < contToUpdate->
size(); ++j) {
124 otherIndexMap[
i] = j;
125 foundEBKToUpdate =
true;
129 if (!foundEBKToUpdate) {
134 std::size_t ebIdx = newEBK->
index();
135 otherIndexMap[
i] = ebIdx;
140 for (std::size_t
i = origSize;
i < contToUpdate->
size(); ++
i) {
154 std::vector<xAOD::CutBookkeeper *> newChildren;
155 for ( std::size_t oldIdx = 0; oldIdx < ebkToModify->
nChildren(); ++oldIdx) {
157 newChildren.push_back(resolveLink(oldEBK,
165 std::vector<xAOD::CutBookkeeper *> newOthers;
166 for (std::size_t oldIdx = 0; oldIdx < ebkToModify->
nUsedOthers(); ++oldIdx) {
168 newOthers.push_back(resolveLink(oldEBK,
176 std::vector<xAOD::CutBookkeeper*> newSiblings;
177 for (std::size_t oldIdx = 0; oldIdx < ebkToModify->
nSiblings(); ++oldIdx) {
179 newSiblings.push_back(resolveLink(oldEBK,
Const iterator class for DataVector/DataList.
std::string find(const std::string &s)
return a remapped string
const xAOD::CutBookkeeper_v1 * sibling(std::size_t i) const
Get the sibling number i.
Description of the class that is used to keep track of event counts.
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.
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.
bool hasParent() const
Check if there is a parent CutBookkeeper of this CutBookkeeper.
(Non-const) Iterator class for DataVector/DataList.
bool usingPrivateStore() const
Test to see if this object is currently using a private store.
::TH1 * nAcceptedEvents(const xAOD::CutBookkeeperContainer *cbkCont, const std::string &histName, int minCycle=0, int maxCycle=-1)
Make a histogram of the number of accepted events from a container.
int maxCycle() const
Get the maximum cycle number of any xAOD::CutBookkeepers in the container.
void releasePrivateStore()
Release and free any private store associated with this object.
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.
void updateContainer(xAOD::CutBookkeeperContainer *contToUpdate, const xAOD::CutBookkeeperContainer *otherCont)
Helper function to update a container with information from another one.
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.
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.
std::string to_string(const DetectorType &type)
CutBookkeeper_v1 CutBookkeeper
Define the latest version of the CutBookkeeper class.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
void makePrivateStore()
Create a new (empty) private store for this object.
const std::string & name() const
Get the name of this CutBookkeeper.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const xAOD::CutBookkeeper_v1 * usedOther(std::size_t i) const
Get the usedOther at position i.
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.
const T * at(size_type n) const
Access an element, as an rvalue.
void setSiblings(const std::vector< CutBookkeeper_v1 * > &siblings)
Set all CutBookkeeper that are siblings to this one in one go.
size_type size() const noexcept
Returns the number of elements in the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
const xAOD::CutBookkeeper_v1 * parent() const
Get the parent CutBookkeeper.