ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
EventBookkeeper Class Reference

#include <EventBookkeeper.h>

Collaboration diagram for EventBookkeeper:

Public Member Functions

 EventBookkeeper ()
 Constructors. More...
 
 EventBookkeeper (const std::string &name)
 
 EventBookkeeper (const std::string &name, const std::string &description, const std::string &logic)
 
 EventBookkeeper (const EventBookkeeper &rhs)
 
EventBookkeeperoperator= (const EventBookkeeper &rhs)
 
 ~EventBookkeeper ()
 
void Print (const std::string &indent="", std::ostream &out=std::cout)
 
void PrintToMsg (MsgStream &, const std::string &indent="")
 
void PrintFamily (const std::string &indent="")
 
const std::string & getName () const
 
void setName (const std::string &name)
 
const std::string & getInputStream () const
 
void setInputStream (const std::string &inputstream)
 
const std::string & getOutputStream () const
 
void setOutputStream (const std::string &outputstream)
 
void setOutputStreamOfFamily (const std::string &outputstream)
 
const std::string & getDescription () const
 
void setDescription (const std::string &description)
 
const std::string & getLogic () const
 
void setLogic (const std::string &logic)
 
uint64_t getNAcceptedEvents () const
 
void setNAcceptedEvents (uint64_t nEvents)
 
void addNAcceptedEvents (uint64_t nEvents)
 
double getNWeightedAcceptedEvents () const
 
void setNWeightedAcceptedEvents (double nWeightedEvents)
 
void addNWeightedAcceptedEvents (double nWeightedEvents)
 
void updateAcceptedEventsIncludingFamily (const EventBookkeeper *eb)
 
int getCycle () const
 
void setCycle (int cycle)
 
const std::vector< EventBookkeeper * > * getChildrenEventBookkeepers () const
 
void fillWithWholeFamily (EventBookkeeperCollection *family)
 
void setChildrenEventBookkeepers (std::vector< EventBookkeeper * > *childrenEB)
 
void AddChild (EventBookkeeper *eb)
 
void AddChildren (std::vector< EventBookkeeper * > *children)
 
EventBookkeeperAddNewChild (const std::string &name, const std::string &description)
 
bool isEqualTo (const EventBookkeeper *eb)
 

Private Member Functions

void SetDefaultDataMemberValues ()
 
EventBookkeeperDeepCopyForFlatStructure (EventBookkeeperCollection *collFLAT)
 

Private Attributes

std::string m_name
 
std::string m_description
 
std::string m_inputstream
 
std::string m_outputstream
 
std::string m_logic
 
uint64_t m_nAcceptedEvents
 
double m_nWeightedAcceptedEvents
 
int m_cycle
 
std::vector< EventBookkeeper * > * m_childrenEB
 
int m_parentIndex
 
std::vector< unsigned int > * m_childrenIndices
 
bool m_declaredChildFilter
 
bool m_declaredTopFilter
 

Friends

class CutFlowSvc
 
class EventBookkeeperCollection
 

Detailed Description

Definition at line 23 of file EventBookkeeper.h.

Constructor & Destructor Documentation

◆ EventBookkeeper() [1/4]

EventBookkeeper::EventBookkeeper ( )

Constructors.

Definition at line 16 of file EventBookkeeper.cxx.

17 {
19 }

◆ EventBookkeeper() [2/4]

EventBookkeeper::EventBookkeeper ( const std::string &  name)

Definition at line 21 of file EventBookkeeper.cxx.

22 {
24  m_name=name;
25 }

◆ EventBookkeeper() [3/4]

EventBookkeeper::EventBookkeeper ( const std::string &  name,
const std::string &  description,
const std::string &  logic 
)

Definition at line 27 of file EventBookkeeper.cxx.

30 {
32  m_name=name;
34  m_logic=logic;
35 }

◆ EventBookkeeper() [4/4]

EventBookkeeper::EventBookkeeper ( const EventBookkeeper rhs)

Definition at line 37 of file EventBookkeeper.cxx.

38  : m_name (rhs.m_name),
42  m_logic (rhs.m_logic),
45  m_cycle (rhs.m_cycle),
49 {
50  //Make a new deep copy of the children, as these will be owned by this
51  m_childrenEB = new std::vector<EventBookkeeper*>;
52  m_childrenEB->reserve(rhs.m_childrenEB->size());
53  for(unsigned int i=0; i<rhs.m_childrenEB->size(); i++){
54  EventBookkeeper* child=new EventBookkeeper(*rhs.m_childrenEB->at(i));
55  m_childrenEB->push_back(child);
56  }
57  m_childrenIndices = new std::vector<unsigned int>;
58  m_childrenIndices->reserve(rhs.m_childrenIndices->size());
59  for(unsigned int i=0; i<rhs.m_childrenIndices->size(); i++){
60  m_childrenIndices->push_back(rhs.m_childrenIndices->at(i));
61  }
62 }

◆ ~EventBookkeeper()

EventBookkeeper::~EventBookkeeper ( )

Definition at line 146 of file EventBookkeeper.cxx.

147 {
148  //std::cout<<"Destructing "<<m_name<<std::endl;
149  for(unsigned int i=0; i<m_childrenEB->size(); i++){ delete m_childrenEB->at(i); }
150  m_childrenEB->clear();
151  delete m_childrenEB;
152 
153  m_childrenIndices->clear();
154  delete m_childrenIndices;
155 }

Member Function Documentation

◆ AddChild()

void EventBookkeeper::AddChild ( EventBookkeeper eb)

Definition at line 248 of file EventBookkeeper.cxx.

249 {
250  //synchronize contextual info with the parent
252  eb->setCycle( m_cycle );
254  bool notFound=true;
255  for(unsigned int i=0; (i<m_childrenEB->size()) && notFound; i++){
256  if(m_childrenEB->at(i)==eb){
257  notFound=false;
258  }
259  }
260  if(notFound){ m_childrenEB->push_back(eb); }
261  //else{ ATH_MSG_WARNING("Two requests for the same child. Second one ignored."); }
262  return;
263 }

◆ AddChildren()

void EventBookkeeper::AddChildren ( std::vector< EventBookkeeper * > *  children)

Definition at line 264 of file EventBookkeeper.cxx.

264  {
265  for(unsigned int i=0; i<children->size(); i++){
266  AddChild( children->at(i) );
267  }
268  return;
269 }

◆ addNAcceptedEvents()

void EventBookkeeper::addNAcceptedEvents ( uint64_t  nEvents)

Definition at line 205 of file EventBookkeeper.cxx.

206 {
208 }

◆ AddNewChild()

EventBookkeeper * EventBookkeeper::AddNewChild ( const std::string &  name,
const std::string &  description 
)

Definition at line 271 of file EventBookkeeper.cxx.

273 {
274  EventBookkeeper* eb = new EventBookkeeper(name,description,"Child");
275  AddChild(eb);
276  return eb;
277 }

◆ addNWeightedAcceptedEvents()

void EventBookkeeper::addNWeightedAcceptedEvents ( double  nWeightedEvents)

Definition at line 217 of file EventBookkeeper.cxx.

218 {
219  m_nWeightedAcceptedEvents+=nWeightedEvents;
220 }

◆ DeepCopyForFlatStructure()

EventBookkeeper * EventBookkeeper::DeepCopyForFlatStructure ( EventBookkeeperCollection collFLAT)
private

Definition at line 115 of file EventBookkeeper.cxx.

116 {
118  book->m_name = m_name;
119  book->m_description = m_description;
120  book->m_inputstream = m_inputstream;
121  book->m_outputstream = m_outputstream;
122  book->m_logic = m_logic;
123  book->m_nAcceptedEvents = m_nAcceptedEvents;
124  book->m_nWeightedAcceptedEvents = m_nWeightedAcceptedEvents;
125  book->m_cycle = m_cycle;
126  book->m_declaredChildFilter = m_declaredChildFilter;
127  book->m_declaredTopFilter = m_declaredTopFilter;
128 
129  //now deal here with the flat indices from collFLAT. Only the direct children are filled, NOT the whole family.
130  for(unsigned int i=0; i<m_childrenEB->size(); i++){
131  bool notFound=true;
132  for(unsigned int j=0; (j<collFLAT->size() && notFound); j++){
133  if(m_childrenEB->at(i)==collFLAT->at(j)){
134  book->m_childrenIndices->push_back(j);
135  notFound=false;
136  }
137  }
138  }
139  //parentIndex is dealt in a separate function of EventBookkeeperCollection
140  book->m_parentIndex=m_parentIndex;
141 
142  //the caller now owns book
143  return book;
144 }

◆ fillWithWholeFamily()

void EventBookkeeper::fillWithWholeFamily ( EventBookkeeperCollection family)

Definition at line 317 of file EventBookkeeper.cxx.

318 {
319 
320  //family does not include self
321  for(unsigned int i=0; i<m_childrenEB->size(); i++){
322  family->push_back(m_childrenEB->at(i));
323  m_childrenEB->at(i)->fillWithWholeFamily(family);
324  }
325 
326  return;
327 }

◆ getChildrenEventBookkeepers()

const std::vector<EventBookkeeper*>* EventBookkeeper::getChildrenEventBookkeepers ( ) const
inline

Definition at line 73 of file EventBookkeeper.h.

73 { return m_childrenEB; }

◆ getCycle()

int EventBookkeeper::getCycle ( ) const
inline

Definition at line 70 of file EventBookkeeper.h.

70 { return m_cycle; }

◆ getDescription()

const std::string& EventBookkeeper::getDescription ( ) const
inline

Definition at line 54 of file EventBookkeeper.h.

54 { return m_description; }

◆ getInputStream()

const std::string& EventBookkeeper::getInputStream ( ) const
inline

Definition at line 47 of file EventBookkeeper.h.

47 { return m_inputstream; }

◆ getLogic()

const std::string& EventBookkeeper::getLogic ( ) const
inline

Definition at line 57 of file EventBookkeeper.h.

57 { return m_logic; }

◆ getNAcceptedEvents()

uint64_t EventBookkeeper::getNAcceptedEvents ( ) const
inline

Definition at line 60 of file EventBookkeeper.h.

60 { return m_nAcceptedEvents; }

◆ getName()

const std::string& EventBookkeeper::getName ( ) const
inline

Definition at line 44 of file EventBookkeeper.h.

44 { return m_name; }

◆ getNWeightedAcceptedEvents()

double EventBookkeeper::getNWeightedAcceptedEvents ( ) const
inline

Definition at line 64 of file EventBookkeeper.h.

64 { return m_nWeightedAcceptedEvents; }

◆ getOutputStream()

const std::string& EventBookkeeper::getOutputStream ( ) const
inline

Definition at line 50 of file EventBookkeeper.h.

50 { return m_outputstream; }

◆ isEqualTo()

bool EventBookkeeper::isEqualTo ( const EventBookkeeper eb)

Definition at line 280 of file EventBookkeeper.cxx.

280  {
281  //This function is mostly a placeholder in case we decide to complexify later.
282  return (m_name==eb->getName() && m_cycle==eb->getCycle());
283 }

◆ operator=()

EventBookkeeper & EventBookkeeper::operator= ( const EventBookkeeper rhs)

Definition at line 65 of file EventBookkeeper.cxx.

66 {
67  if (this != &rhs) {
68  m_name=rhs.m_name;
72  m_logic = rhs.m_logic;
75  m_cycle=rhs.m_cycle;
77  //Make a new deep copy of the children, as these will be owned by this
78  m_childrenEB = new std::vector<EventBookkeeper*>;
79  m_childrenEB->reserve(rhs.m_childrenEB->size());
80  for(unsigned int i=0; i<rhs.m_childrenEB->size(); i++){
81  EventBookkeeper* child=new EventBookkeeper(*rhs.m_childrenEB->at(i));
82  m_childrenEB->push_back(child);
83  }
84  m_childrenIndices = new std::vector<unsigned int>;
85  m_childrenIndices->reserve(rhs.m_childrenIndices->size());
86  for(unsigned int i=0; i<rhs.m_childrenIndices->size(); i++){
87  m_childrenIndices->push_back(rhs.m_childrenIndices->at(i));
88  }
91  }
92  return *this;
93 }

◆ Print()

void EventBookkeeper::Print ( const std::string &  indent = "",
std::ostream &  out = std::cout 
)

Definition at line 299 of file EventBookkeeper.cxx.

300 {
301  out<<indent<<m_name<<" "<<m_inputstream<<" "<<m_outputstream<<" "<<m_logic<<" "<<m_cycle<<" ("<<m_childrenEB->size()<<" children) "<<": "<<m_description<<" ==> "<<m_nAcceptedEvents<<" "<<m_nWeightedAcceptedEvents<<std::endl;
302  return;
303 }

◆ PrintFamily()

void EventBookkeeper::PrintFamily ( const std::string &  indent = "")

Definition at line 306 of file EventBookkeeper.cxx.

307 {
308  Print(indent);
309  std::string indent_ = indent + " ";
310  for(unsigned int i=0; i<m_childrenEB->size(); i++){
311  m_childrenEB->at(i)->PrintFamily(indent_);
312  }
313  return;
314 }

◆ PrintToMsg()

void EventBookkeeper::PrintToMsg ( MsgStream &  log,
const std::string &  indent = "" 
)

Definition at line 286 of file EventBookkeeper.cxx.

287 {
288  if(log.level()==MSG::DEBUG){
289  log<<MSG::DEBUG<<indent<<m_name<<" "<<m_inputstream<<" "<<m_outputstream<<" "<<m_logic<<" "<<m_cycle<<" ("<<m_childrenEB->size()<<" children) "<<": "<<m_description<<" ==> "<<m_nAcceptedEvents<<" "<<m_nWeightedAcceptedEvents<<endmsg;
290  }
291  else{
292  log<<MSG::INFO<<indent<<m_name<<": "<<m_description<<" ==> "<<m_nAcceptedEvents<<endmsg;
293  }
294 
295  return;
296 }

◆ setChildrenEventBookkeepers()

void EventBookkeeper::setChildrenEventBookkeepers ( std::vector< EventBookkeeper * > *  childrenEB)

Definition at line 242 of file EventBookkeeper.cxx.

243 {
244  m_childrenEB=childrenEB;
245 }

◆ setCycle()

void EventBookkeeper::setCycle ( int  cycle)

Definition at line 236 of file EventBookkeeper.cxx.

237 {
238  m_cycle=cycle;
239 }

◆ SetDefaultDataMemberValues()

void EventBookkeeper::SetDefaultDataMemberValues ( )
private

Definition at line 96 of file EventBookkeeper.cxx.

97 {
98  m_name="";
99  m_description="";
100  m_inputstream="unkwn";
101  m_outputstream="unkwn";
102  m_logic="unkwn";
105  m_cycle=-1;
106  m_childrenEB = new std::vector<EventBookkeeper*>;
107  m_parentIndex=-1;
108  m_childrenIndices = new std::vector<unsigned int>;
109  m_declaredChildFilter=false;
110  m_declaredTopFilter=false;
111  return;
112 }

◆ setDescription()

void EventBookkeeper::setDescription ( const std::string &  description)

Definition at line 165 of file EventBookkeeper.cxx.

166 {
168 }

◆ setInputStream()

void EventBookkeeper::setInputStream ( const std::string &  inputstream)

Definition at line 171 of file EventBookkeeper.cxx.

172 {
173  m_inputstream=inputstream;
174 }

◆ setLogic()

void EventBookkeeper::setLogic ( const std::string &  logic)

Definition at line 193 of file EventBookkeeper.cxx.

194 {
195  m_logic=logic;
196 }

◆ setNAcceptedEvents()

void EventBookkeeper::setNAcceptedEvents ( uint64_t  nEvents)

Definition at line 199 of file EventBookkeeper.cxx.

200 {
202 }

◆ setName()

void EventBookkeeper::setName ( const std::string &  name)

Definition at line 159 of file EventBookkeeper.cxx.

160 {
161  m_name=name;
162 }

◆ setNWeightedAcceptedEvents()

void EventBookkeeper::setNWeightedAcceptedEvents ( double  nWeightedEvents)

Definition at line 211 of file EventBookkeeper.cxx.

212 {
213  m_nWeightedAcceptedEvents=nWeightedEvents;
214 }

◆ setOutputStream()

void EventBookkeeper::setOutputStream ( const std::string &  outputstream)

Definition at line 177 of file EventBookkeeper.cxx.

178 {
179  m_outputstream=outputstream;
180 }

◆ setOutputStreamOfFamily()

void EventBookkeeper::setOutputStreamOfFamily ( const std::string &  outputstream)

Definition at line 183 of file EventBookkeeper.cxx.

184 {
185  setOutputStream(outputstream);
186  for(unsigned int i=0; i<m_childrenEB->size(); i++){
187  m_childrenEB->at(i)->setOutputStreamOfFamily(outputstream);
188  }
189  return;
190 }

◆ updateAcceptedEventsIncludingFamily()

void EventBookkeeper::updateAcceptedEventsIncludingFamily ( const EventBookkeeper eb)

Definition at line 223 of file EventBookkeeper.cxx.

224 {
227 
228  const std::vector<EventBookkeeper*>* eb_children = eb->getChildrenEventBookkeepers();
229  for(unsigned int i=0; i<m_childrenEB->size(); i++){
230  m_childrenEB->at(i)->updateAcceptedEventsIncludingFamily(eb_children->at(i));
231  }
232  return;
233 }

Friends And Related Function Documentation

◆ CutFlowSvc

friend class CutFlowSvc
friend

Definition at line 99 of file EventBookkeeper.h.

◆ EventBookkeeperCollection

friend class EventBookkeeperCollection
friend

Definition at line 100 of file EventBookkeeper.h.

Member Data Documentation

◆ m_childrenEB

std::vector<EventBookkeeper*>* EventBookkeeper::m_childrenEB
private

Definition at line 94 of file EventBookkeeper.h.

◆ m_childrenIndices

std::vector<unsigned int>* EventBookkeeper::m_childrenIndices
private

Definition at line 103 of file EventBookkeeper.h.

◆ m_cycle

int EventBookkeeper::m_cycle
private

Definition at line 93 of file EventBookkeeper.h.

◆ m_declaredChildFilter

bool EventBookkeeper::m_declaredChildFilter
private

Definition at line 106 of file EventBookkeeper.h.

◆ m_declaredTopFilter

bool EventBookkeeper::m_declaredTopFilter
private

Definition at line 107 of file EventBookkeeper.h.

◆ m_description

std::string EventBookkeeper::m_description
private

Definition at line 87 of file EventBookkeeper.h.

◆ m_inputstream

std::string EventBookkeeper::m_inputstream
private

Definition at line 88 of file EventBookkeeper.h.

◆ m_logic

std::string EventBookkeeper::m_logic
private

Definition at line 90 of file EventBookkeeper.h.

◆ m_nAcceptedEvents

uint64_t EventBookkeeper::m_nAcceptedEvents
private

Definition at line 91 of file EventBookkeeper.h.

◆ m_name

std::string EventBookkeeper::m_name
private

Definition at line 86 of file EventBookkeeper.h.

◆ m_nWeightedAcceptedEvents

double EventBookkeeper::m_nWeightedAcceptedEvents
private

Definition at line 92 of file EventBookkeeper.h.

◆ m_outputstream

std::string EventBookkeeper::m_outputstream
private

Definition at line 89 of file EventBookkeeper.h.

◆ m_parentIndex

int EventBookkeeper::m_parentIndex
private

Definition at line 102 of file EventBookkeeper.h.


The documentation for this class was generated from the following files:
EventBookkeeper::m_nWeightedAcceptedEvents
double m_nWeightedAcceptedEvents
Definition: EventBookkeeper.h:92
EventBookkeeper::m_declaredChildFilter
bool m_declaredChildFilter
Definition: EventBookkeeper.h:106
EventBookkeeper::addNWeightedAcceptedEvents
void addNWeightedAcceptedEvents(double nWeightedEvents)
Definition: EventBookkeeper.cxx:217
EventBookkeeper::m_cycle
int m_cycle
Definition: EventBookkeeper.h:93
cycle
double cycle(double a, double b)
Definition: SiHitCollectionCnv_p2.cxx:37
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
EventBookkeeper::setCycle
void setCycle(int cycle)
Definition: EventBookkeeper.cxx:236
EventBookkeeper::m_outputstream
std::string m_outputstream
Definition: EventBookkeeper.h:89
EventBookkeeper::m_description
std::string m_description
Definition: EventBookkeeper.h:87
EventBookkeeper::setOutputStream
void setOutputStream(const std::string &outputstream)
Definition: EventBookkeeper.cxx:177
EventBookkeeper::EventBookkeeper
EventBookkeeper()
Constructors.
Definition: EventBookkeeper.cxx:16
EventBookkeeper::m_name
std::string m_name
Definition: EventBookkeeper.h:86
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:18
book
T * book(const std::string &n, const std::string &t, unsigned nbins)
Definition: main_benchmark.cxx:138
lumiFormat.i
int i
Definition: lumiFormat.py:92
EventBookkeeper::addNAcceptedEvents
void addNAcceptedEvents(uint64_t nEvents)
Definition: EventBookkeeper.cxx:205
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EventBookkeeper::m_nAcceptedEvents
uint64_t m_nAcceptedEvents
Definition: EventBookkeeper.h:91
EventBookkeeper
Definition: EventBookkeeper.h:24
nEvents
int nEvents
Definition: fbtTestBasics.cxx:77
EventBookkeeper::m_parentIndex
int m_parentIndex
Definition: EventBookkeeper.h:102
EventBookkeeper::getNAcceptedEvents
uint64_t getNAcceptedEvents() const
Definition: EventBookkeeper.h:60
EventBookkeeper::getNWeightedAcceptedEvents
double getNWeightedAcceptedEvents() const
Definition: EventBookkeeper.h:64
EventBookkeeper::m_declaredTopFilter
bool m_declaredTopFilter
Definition: EventBookkeeper.h:107
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
EventBookkeeper::Print
void Print(const std::string &indent="", std::ostream &out=std::cout)
Definition: EventBookkeeper.cxx:299
python.DecayParser.children
children
Definition: DecayParser.py:32
EventBookkeeper::m_childrenEB
std::vector< EventBookkeeper * > * m_childrenEB
Definition: EventBookkeeper.h:94
EventBookkeeper::m_childrenIndices
std::vector< unsigned int > * m_childrenIndices
Definition: EventBookkeeper.h:103
EventBookkeeper::AddChild
void AddChild(EventBookkeeper *eb)
Definition: EventBookkeeper.cxx:248
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
EventBookkeeper::getChildrenEventBookkeepers
const std::vector< EventBookkeeper * > * getChildrenEventBookkeepers() const
Definition: EventBookkeeper.h:73
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
EventBookkeeper::SetDefaultDataMemberValues
void SetDefaultDataMemberValues()
Definition: EventBookkeeper.cxx:96
EventBookkeeper::m_inputstream
std::string m_inputstream
Definition: EventBookkeeper.h:88
description
std::string description
glabal timer - how long have I taken so far?
Definition: hcg.cxx:88
EventBookkeeper::m_logic
std::string m_logic
Definition: EventBookkeeper.h:90
EventBookkeeper::setInputStream
void setInputStream(const std::string &inputstream)
Definition: EventBookkeeper.cxx:171
EventBookkeeper::getCycle
int getCycle() const
Definition: EventBookkeeper.h:70
EventBookkeeper::getName
const std::string & getName() const
Definition: EventBookkeeper.h:44