ATLAS Offline Software
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):
20 namespace xAOD {
21 
30 
31  public:
32 
34  enum CutLogic {
35  UNKNOWN = 0,
38  OTHER = 3,
39  ACCEPT = 4,
40  REQUIRE = 5,
41  VETO = 6,
42  };
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 ) {
57  this->nAcceptedEvents += rhs.nAcceptedEvents;
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 
158  uint64_t nAcceptedEvents() const;
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
xAOD::CutBookkeeper_v1::addSiblings
void addSiblings(const std::vector< CutBookkeeper_v1 * > &siblings)
Add multiple siblings in one go to this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:629
xAOD::CutBookkeeper_v1::cycle
int cycle() const
Get the skimming cycle that this CutBookkeeper was running in.
Definition: CutBookkeeper_v1.cxx:205
get_generator_info.result
result
Definition: get_generator_info.py:21
xAOD::CutBookkeeper_v1::setCycle
void setCycle(int cycle)
Set the skimming cycle that this CutBookkeeper is running in.
Definition: CutBookkeeper_v1.cxx:209
xAOD::CutBookkeeper_v1::setName
void setName(const std::string &name)
Set the name of this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:161
xAOD::CutBookkeeper_v1::setDescription
void setDescription(const std::string &description)
Set the description of this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:177
xAOD::CutBookkeeper_v1::CutBookkeeper_v1
CutBookkeeper_v1()
Constructor.
Definition: CutBookkeeper_v1.cxx:71
xAOD::CutBookkeeper_v1::sibling
const xAOD::CutBookkeeper_v1 * sibling(std::size_t i) const
Get the sibling number i.
Definition: CutBookkeeper_v1.cxx:608
xAOD::CutBookkeeper_v1::addSibling
void addSibling(CutBookkeeper_v1 *siblingsEB)
Add one sibling CutBookkeeper to this one.
Definition: CutBookkeeper_v1.cxx:642
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:472
xAOD::CutBookkeeper_v1
Description of the class that is used to keep track of event counts.
Definition: CutBookkeeper_v1.h:29
xAOD::CutBookkeeper_v1::setOutputStreams
void setOutputStreams(const std::vector< std::string > &outputstreams)
Set the names of the output-file stream objects for this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:280
xAOD::CutBookkeeper_v1::nUsedOthers
std::size_t nUsedOthers() const
Check if this CutBookkeeper has used others.
Definition: CutBookkeeper_v1.cxx:500
xAOD::CutBookkeeper_v1::setUsedOthers
void setUsedOthers(const std::vector< CutBookkeeper_v1 * > &usedOthers)
Set all CutBookkeeper that are used by this one in one go.
Definition: CutBookkeeper_v1.cxx:535
xAOD::CutBookkeeper_v1::addChild
void addChild(CutBookkeeper_v1 *childEB)
Add one child to this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:442
xAOD::CutBookkeeper_v1::sumOfEventWeightsSquared
double sumOfEventWeightsSquared() const
Get the sum-of-(event-weights-squared) that this CutBookkeeper has seen.
Definition: CutBookkeeper_v1.cxx:327
xAOD::CutBookkeeper_v1::VETO
@ VETO
Definition: CutBookkeeper_v1.h:41
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::CutBookkeeper_v1::outputStreams
const std::vector< std::string > & outputStreams() const
Get the names of the output-file stream objects that were seen by this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:235
xAOD::CutBookkeeper_v1::CutLogic
CutLogic
Enumeration of the logic of a cut.
Definition: CutBookkeeper_v1.h:34
xAOD::CutBookkeeper_v1::addUsedOther
void addUsedOther(CutBookkeeper_v1 *usedOtherEB)
Add one other CutBookkeeper that is used by this one.
Definition: CutBookkeeper_v1.cxx:555
xAOD::CutBookkeeper_v1::payload
Payload payload() const
Get the whole payload object (which contains all counters) in one go.
Definition: CutBookkeeper_v1.cxx:112
xAOD::CutBookkeeper_v1::nSiblings
std::size_t nSiblings() const
Check if this CutBookkeeper has siblings.
Definition: CutBookkeeper_v1.cxx:587
xAOD::CutBookkeeper_v1::toPersistent
void toPersistent()
Function preparing the object to be persistified.
Definition: CutBookkeeper_v1.cxx:670
xAOD::CutBookkeeper_v1::Payload::sumOfEventWeightsSquared
double sumOfEventWeightsSquared
Definition: CutBookkeeper_v1.h:66
xAOD::CutBookkeeper_v1::hasParent
bool hasParent() const
Check if there is a parent CutBookkeeper of this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:359
xAOD::CutBookkeeper_v1::setUniqueIdentifier
void setUniqueIdentifier(unsigned int hash)
Set the uniqueIdentifier for this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:148
xAOD::CutBookkeeper_v1::ALLEVENTSPROCESSED
@ ALLEVENTSPROCESSED
Definition: CutBookkeeper_v1.h:36
xAOD::CutBookkeeper_v1::ALLEVENTSWRITTEN
@ ALLEVENTSWRITTEN
Definition: CutBookkeeper_v1.h:37
xAOD::CutBookkeeper_v1::setNAcceptedEvents
void setNAcceptedEvents(uint64_t nEvents)
Set the number of accepted events for this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:295
xAOD::CutBookkeeper_v1::addChildren
void addChildren(const std::vector< CutBookkeeper_v1 * > &childrenEB)
Add multiple children in one go to this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:429
xAOD::CutBookkeeper_v1::REQUIRE
@ REQUIRE
Definition: CutBookkeeper_v1.h:40
xAOD::CutBookkeeper_v1::addNAcceptedEvents
void addNAcceptedEvents(uint64_t nEvents)
Add seen events to the number of accepted events that this CutBookkeeper has seen.
Definition: CutBookkeeper_v1.cxx:302
xAOD::CutBookkeeper_v1::addUsedOthers
void addUsedOthers(const std::vector< CutBookkeeper_v1 * > &usedOthers)
Add multiple children in one go to this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:542
lumiFormat.i
int i
Definition: lumiFormat.py:85
xAOD::CutBookkeeper_v1::uniqueIdentifier
unsigned int uniqueIdentifier() const
Get the uniqueIdentifier for this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:144
xAOD::CutBookkeeper_v1::hasChild
bool hasChild(const xAOD::CutBookkeeper_v1 *testCBK) const
Test if a given child already exists.
Definition: CutBookkeeper_v1.cxx:392
xAOD::CutBookkeeper_v1::setSumOfEventWeights
void setSumOfEventWeights(double nWeightedEvents)
Set the sum-of-event-weights that this CutBookkeeper has seen.
Definition: CutBookkeeper_v1.cxx:313
xAOD::CutBookkeeper_v1::description
const std::string & description() const
Get the description of this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:172
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
xAOD::CutBookkeeper_v1::setParent
void setParent(const CutBookkeeper_v1 *parentEB)
Set the parent CutBookkeeper of this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:372
nEvents
int nEvents
Definition: fbtTestBasics.cxx:79
xAOD::CutBookkeeper_v1::setChildren
void setChildren(const std::vector< CutBookkeeper_v1 * > &childrenEB)
Set all children of this CutBookkeeper in one go.
Definition: CutBookkeeper_v1.cxx:422
xAOD::CutBookkeeper_v1::hasUsedOther
bool hasUsedOther(const xAOD::CutBookkeeper_v1 *testCBK) const
Check if this CutBookkeeper has used others.
Definition: CutBookkeeper_v1.cxx:505
xAOD::CutBookkeeper_v1::setSumOfEventWeightsSquared
void setSumOfEventWeightsSquared(double nWeightedEventsSquared)
Set the sum-of-(event-weights-squared) that this CutBookkeeper has seen.
Definition: CutBookkeeper_v1.cxx:331
xAOD::CutBookkeeper_v1::isEqualTo
bool isEqualTo(const CutBookkeeper_v1 *eb) const
Test for the equality of this CutBookkeeper with another one.
Definition: CutBookkeeper_v1.cxx:348
xAOD::CutBookkeeper_v1::hasSibling
bool hasSibling(const xAOD::CutBookkeeper_v1 *testCBK) const
Test if the provided CutBookkeeper is already a sibling.
Definition: CutBookkeeper_v1.cxx:592
xAOD::CutBookkeeper_v1::OTHER
@ OTHER
Definition: CutBookkeeper_v1.h:38
xAOD::CutBookkeeper_v1::Payload::operator+
Payload operator+(const Payload &rhs)
Definition: CutBookkeeper_v1.h:48
xAOD::CutBookkeeper_v1::setInputStream
void setInputStream(const std::string &inputstream)
Set the name of the current input-file stream object for this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:225
xAOD::CutBookkeeper_v1::nAcceptedEvents
uint64_t nAcceptedEvents() const
Get the number of accepted events that this CutBookkeeper has seen.
Definition: CutBookkeeper_v1.cxx:291
xAOD::CutBookkeeper_v1::child
const xAOD::CutBookkeeper_v1 * child(std::size_t i) const
Get the child at position i.
Definition: CutBookkeeper_v1.cxx:408
xAOD::CutBookkeeper_v1::Payload::sumOfEventWeights
double sumOfEventWeights
Definition: CutBookkeeper_v1.h:65
xAOD::CutBookkeeper_v1::addSumOfEventWeights
void addSumOfEventWeights(double nWeightedEvents)
Add more sum-of-event-weights that this CutBookkeeper has seen.
Definition: CutBookkeeper_v1.cxx:320
xAOD::CutBookkeeper_v1::UNKNOWN
@ UNKNOWN
Definition: CutBookkeeper_v1.h:35
xAOD::CutBookkeeper_v1::setNameIdentifier
void setNameIdentifier(unsigned int hash)
Set the nameIdentifier for this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:137
xAOD::CutBookkeeper_v1::isTopFilter
bool isTopFilter() const
Check if this CutBookkeeper was a top filter.
Definition: CutBookkeeper_v1.cxx:184
xAOD::CutBookkeeper_v1::sumOfEventWeights
double sumOfEventWeights() const
Get the sum-of-event-weights that this CutBookkeeper has seen.
Definition: CutBookkeeper_v1.cxx:309
xAOD::CutBookkeeper_v1::setCutLogic
void setCutLogic(CutLogic logic)
Set the cut logic of this CutBookkeeper, e.g., ACCEPT, REQUIRE, VETO.
Definition: CutBookkeeper_v1.cxx:199
xAOD::CutBookkeeper_v1::name
const std::string & name() const
Get the name of this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:156
xAOD::CutBookkeeper_v1::usedOther
const xAOD::CutBookkeeper_v1 * usedOther(std::size_t i) const
Get the usedOther at position i.
Definition: CutBookkeeper_v1.cxx:521
xAOD::CutBookkeeper_v1::nameIdentifier
unsigned int nameIdentifier() const
Get the nameIdentifier for this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:133
xAOD::CutBookkeeper_v1::cutLogic
CutLogic cutLogic() const
Get the cut logic of this CutBookkeeper, e.g., ACCEPT, REQUIRE, VETO.
Definition: CutBookkeeper_v1.cxx:195
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
xAOD::CutBookkeeper_v1::inputStream
const std::string & inputStream() const
Get the name of the input-file stream object that was seen by this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:220
xAOD::CutBookkeeper_v1::~CutBookkeeper_v1
~CutBookkeeper_v1()
Destructor.
Definition: CutBookkeeper_v1.cxx:103
xAOD::CutBookkeeper_v1::Payload::nAcceptedEvents
uint64_t nAcceptedEvents
Definition: CutBookkeeper_v1.h:64
xAOD::CutBookkeeper_v1::ATLAS_NOT_THREAD_SAFE
void addOutputStreamForAllUsed ATLAS_NOT_THREAD_SAFE(const std::string &outputstream)
Add the name of an output-file stream object for this CutBookkeeper.
xAOD::CutBookkeeper_v1::operator==
bool operator==(const CutBookkeeper_v1 &rhs)
Equality operator.
Definition: CutBookkeeper_v1.h:82
xAOD::CutBookkeeper_v1::setPayload
void setPayload(const Payload &payload)
Set the whole payload object (which contains all counters) in one go.
Definition: CutBookkeeper_v1.cxx:121
xAOD::CutBookkeeper_v1::nChildren
std::size_t nChildren() const
Get the number of children CutBookkeepers of this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:387
xAOD::CutBookkeeper_v1::addSumOfEventWeightsSquared
void addSumOfEventWeightsSquared(double nWeightedEventsSquared)
Add more sum-of-(event-weights-squared) that this CutBookkeeper has seen.
Definition: CutBookkeeper_v1.cxx:338
xAOD::CutBookkeeper_v1::addOutputStream
void addOutputStream(const std::string &outputstream)
Add the name of an output-file stream object for this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:250
xAOD::CutBookkeeper_v1::Payload
Add struct for payload and implement operator *,/....*=,...
Definition: CutBookkeeper_v1.h:46
xAOD::CutBookkeeper_v1::ACCEPT
@ ACCEPT
Definition: CutBookkeeper_v1.h:39
xAOD::CutBookkeeper_v1::setTopFilter
void setTopFilter(bool isTopFilter)
Set the top-filter property of this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:188
xAOD::CutBookkeeper_v1::setSiblings
void setSiblings(const std::vector< CutBookkeeper_v1 * > &siblings)
Set all CutBookkeeper that are siblings to this one in one go.
Definition: CutBookkeeper_v1.cxx:622
checker_macros.h
Define macros for attributes used to control the static checker.
xAOD::CutBookkeeper_v1::hasOutputStream
bool hasOutputStream(const std::string &outputstream) const
Check if the given output stream name is known to this CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:240
xAOD::CutBookkeeper_v1::Payload::operator+=
Payload & operator+=(const Payload &rhs)
Definition: CutBookkeeper_v1.h:56
AuxElement.h
Base class for elements of a container that can have aux data.
xAOD::CutBookkeeper_v1::parent
const xAOD::CutBookkeeper_v1 * parent() const
Get the parent CutBookkeeper.
Definition: CutBookkeeper_v1.cxx:364
xAOD::CutBookkeeper_v1::addNewChild
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...
Definition: CutBookkeeper_v1.cxx:471