ATLAS Offline Software
Loading...
Searching...
No Matches
CutBookkeeper_v1.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id$
8#ifndef XAODCUTFLOW_VERSIONS_CUTBOOKKEEPER_V1_H
9#define XAODCUTFLOW_VERSIONS_CUTBOOKKEEPER_V1_H
10
11// STL includes
12#include <string>
13#include <iosfwd>
14#include <stdint.h>
15#include <vector>
16
17// Core include(s):
20namespace xAOD {
21
30
31 public:
32
43
44
46 struct Payload {
47 public:
48 Payload operator+( const Payload& rhs ) {
50 result.nAcceptedEvents = this->nAcceptedEvents + rhs.nAcceptedEvents;
51 result.sumOfEventWeights = this->sumOfEventWeights + rhs.sumOfEventWeights;
52 result.sumOfEventWeightsSquared = this->sumOfEventWeightsSquared + rhs.sumOfEventWeightsSquared;
53 return result;
54 }
55
56 Payload& operator+=( const Payload& rhs ) {
60 return *this;
61 }
62
63 public:
67 };
68
69
70
73
74
75
78
79
80
82 bool operator==( const CutBookkeeper_v1& rhs ) {
83 return this->isEqualTo( &rhs );
84 }
85
86
89
91 unsigned int nameIdentifier() const;
93 unsigned int uniqueIdentifier() const;
94
95 private:
97 void setNameIdentifier( unsigned int hash );
99 void setUniqueIdentifier( unsigned int hash );
100
101 public:
103 const std::string& name() const;
105 void setName( const std::string& name );
106
108 const std::string& description() const;
110 void setDescription( const std::string &description );
111
112
114 bool isTopFilter() const;
116 void setTopFilter( bool isTopFilter );
117
118
120 CutLogic cutLogic() const;
122 void setCutLogic( CutLogic logic );
123
125 int cycle() const;
127 void setCycle( int cycle );
128
130 const std::string& inputStream() const;
132 void setInputStream( const std::string& inputstream );
133
135 const std::vector<std::string>& outputStreams() const;
137 bool hasOutputStream( const std::string& outputstream ) const;
139 void addOutputStream( const std::string& outputstream );
141 void addOutputStreamForAllUsed ATLAS_NOT_THREAD_SAFE ( const std::string& outputstream );
143 void setOutputStreams( const std::vector<std::string>& outputstreams );
144
146
147
150
153 Payload payload() const;
155 void setPayload( const Payload& payload );
156
163
165 double sumOfEventWeights() const;
167 void setSumOfEventWeights( double nWeightedEvents );
169 void addSumOfEventWeights( double nWeightedEvents );
170
172 double sumOfEventWeightsSquared() const;
174 void setSumOfEventWeightsSquared( double nWeightedEventsSquared );
176 void addSumOfEventWeightsSquared( double nWeightedEventsSquared );
177
179
180
182 bool isEqualTo( const CutBookkeeper_v1 *eb ) const;
183
184
185
188
190 bool hasParent() const;
192 const xAOD::CutBookkeeper_v1* parent() const;
194 void setParent( const CutBookkeeper_v1* parentEB );
196 std::size_t nChildren() const;
198 bool hasChild( const xAOD::CutBookkeeper_v1* testCBK ) const;
200 const xAOD::CutBookkeeper_v1* child( std::size_t i ) const;
202 void setChildren( const std::vector< CutBookkeeper_v1* >& childrenEB );
204 void addChildren( const std::vector< CutBookkeeper_v1* >& childrenEB );
206 void addChild( CutBookkeeper_v1* childEB );
209 CutBookkeeper_v1* addNewChild( const std::string& name,
210 const std::string& description );
211
213
214
215
218
220 std::size_t nUsedOthers() const;
222 bool hasUsedOther( const xAOD::CutBookkeeper_v1* testCBK ) const;
224 const xAOD::CutBookkeeper_v1* usedOther( std::size_t i ) const;
226 void setUsedOthers( const std::vector< CutBookkeeper_v1* >& usedOthers );
228 void addUsedOthers( const std::vector< CutBookkeeper_v1* >& usedOthers );
230 void addUsedOther( CutBookkeeper_v1* usedOtherEB );
231
233
234
235
239
241 std::size_t nSiblings() const;
243 bool hasSibling( const xAOD::CutBookkeeper_v1* testCBK ) const;
245 const xAOD::CutBookkeeper_v1* sibling( std::size_t i ) const;
247 void setSiblings( const std::vector< CutBookkeeper_v1* >& siblings );
249 void addSiblings( const std::vector< CutBookkeeper_v1* >& siblings );
251 void addSibling( CutBookkeeper_v1* siblingsEB );
252
254
255
257 void toPersistent();
258
259
260 };
261
262
263} // namespace xAOD
264
265
266#endif //> XAODCUTFLOW_VERSIONS_CUTBOOKKEEPER_V1_H
Base class for elements of a container that can have aux data.
double cycle(double a, double b)
Define macros for attributes used to control the static checker.
Base class for elements of a container that can have aux data.
Definition AuxElement.h:483
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.
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.
void addOutputStreamForAllUsed ATLAS_NOT_THREAD_SAFE(const std::string &outputstream)
Add the name of an output-file stream object for this CutBookkeeper.
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.
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.
bool operator==(const CutBookkeeper_v1 &rhs)
Equality operator.
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.
const int nEvents
std::string description
glabal timer - how long have I taken so far?
Definition hcg.cxx:91
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Add struct for payload and implement operator ,/....=,...
Payload operator+(const Payload &rhs)
Payload & operator+=(const Payload &rhs)