ATLAS Offline Software
MixingEventSelector.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 ATLAS_NO_CHECK_FILE_THREAD_SAFETY; // non-MT EventSelector
7 
8 #include "MixingEventSelector.h"
11 #include "EventInfo/EventInfo.h"
12 #include "EventInfo/EventID.h"
13 #include "EventInfo/EventType.h"
14 #include "EventInfo/TriggerInfo.h"
17 #include "StoreGate/StoreGateSvc.h"
18 #include "SGTools/DataProxy.h"
20 
21 #include "GaudiKernel/GaudiException.h"
22 #include "GaudiKernel/TypeNameString.h"
23 #include "GaudiKernel/MsgStream.h"
24 #include "GaudiKernel/GenericAddress.h"
25 #include "CLHEP/Random/RandFlat.h"
26 #include <boost/lexical_cast.hpp>
27 #include <boost/tokenizer.hpp>
28 #include <algorithm>
29 #include <cassert>
30 #include <functional>
31 #include <iostream>
32 #include <fstream>
33 #include <stdexcept>
34 #include <sstream>
35 #include <string>
36 
37 using namespace std;
38 using boost::lexical_cast;
39 using boost::tokenizer;
40 using boost::char_separator;
41 using SG::DataProxy;
42 
43 #ifdef DEBUG_OUTPUT_STATUS
44 ofstream outfile2("status.txt");
45 #endif
46 
47 MixingEventSelector::MixingEventSelector(const string& name, ISvcLocator* svc) :
48  base_class(name,svc),
49  m_helperTools(this),
50  m_trigList(), m_pCurrentTrigger(m_trigList.end()),
51  m_eventPos(0),
52  m_pEventStore( "StoreGateSvc", name ),
53  m_atRndmSvc("AtRndmGenSvc", name),
54  m_randomStreamName("MixingEventSelectorStream"),
55  m_chooseRangeRand(nullptr)
56 {
57  declareProperty("TriggerList", m_triggerListProp,
58  "list of triggers (streams) to be used. Format is SelectorType/SelectorName:firstEventToUse:lastEventToUse. One assumes events are consecutively numbered.");
59  m_triggerListProp.declareUpdateHandler(&MixingEventSelector::setUpTriggerList, this);
60  declareProperty("OutputRunNumber", m_outputRunNumber=123456789);
61  declareProperty("EventNumbers", m_eventNumbers,
62  "list of event numbers to be used for output stream. If list empty or not long enough, event numbers are assigned consucutively after last one in list");
63  declareProperty("StreamStatusFileName", m_statusFileName=string(),
64  "Name of the file recording the last event used and how many were available for each stream. Default is to produce no file." ); //no out
65  declareProperty("MergedEventInfoKey",
66  m_mergedEventInfoKey=string("MergedEventInfo"),
67  "StoreGate key for output (merged) event info object. Default is MergedEventInfo ");
68  declareProperty("RndmGenSvc", m_atRndmSvc, "IAtRndmGenSvc controlling the order with which events are takes from streams");
69  declareProperty("RndmStreamName", m_randomStreamName, "IAtRndmGenSvc stream used as engine for our random distributions");
70  declareProperty("HelperTools", m_helperTools, "a collection of selector tools");
71 
72 }
73 
75 }
76 
79  ATH_MSG_INFO ("Initializing " << name());
80 
81 // defer this (it triggers a init loop via PPS
82 // if (!m_pEventStore.retrieve().isSuccess())
83 // return StatusCode::FAILURE;
84 
85  //setup random stream
86  CLHEP::HepRandomEngine* collEng(m_atRndmSvc->GetEngine(m_randomStreamName.value()));
87  if(nullptr == collEng ) {
88  ATH_MSG_ERROR ("can not get random stream " << m_randomStreamName.value());
89  return StatusCode::FAILURE;
90  }
91  //flat distribution in [0,1] range
92  m_chooseRangeRand = new CLHEP::RandFlat(*(collEng), 0.0, 1.0);
93 
94  StatusCode sc= m_helperTools.retrieve();
95  std::vector<ToolHandle<IAthenaSelectorTool> >::iterator
96  i(m_helperTools.begin()), iE(m_helperTools.end());
97  while (sc.isSuccess() && (i != iE)) sc = (*i++)->postInitialize();
98 
99  return sc;
100 }
101 
104  ATH_MSG_DEBUG ("Finalizing " << name());
105 
106  StatusCode sc(StatusCode::SUCCESS);
107  std::vector<ToolHandle<IAthenaSelectorTool> >::iterator
108  i(m_helperTools.begin()), iE(m_helperTools.end());
109  while (i != iE) ((*i++)->preFinalize()).ignore();
110 
111  const std::string& fname(m_statusFileName.value());
112  ofstream outfile(fname.c_str());
113  if ( outfile ) {
116  while (i != iEnd) outfile << (*i++).toString();
117  } else if (!fname.empty()) {
118  ATH_MSG_WARNING("unable to open trigger list status file " << fname);
119  }
120 
121  m_helperTools.release().ignore();
122 
123  return sc;
124 
125 }
126 
127 
128 void
129 MixingEventSelector::setUpTriggerList(Gaudi::Details::PropertyBase&) {
130  using std::placeholders::_1;
132  for_each(m_triggerListProp.value().begin(), m_triggerListProp.value().end(),
133  bind(&MixingEventSelector::decodeTrigger, this, _1));
135 }
136 
137 void
139  //all this would be much more readable without error reporting...
140  typedef tokenizer<char_separator<char> > Tokenizer;
141  Tokenizer tokens(triggDescr, char_separator<char>(" :"));
142  //we need exactly three tokens: selector name, first and last event 2 B read
143  if ( (distance(tokens.begin(), tokens.end()) == 3) ||
144  (distance(tokens.begin(), tokens.end()) == 3) ){
145  Tokenizer::iterator iToken(tokens.begin());
146  try {
147  Gaudi::Utils::TypeNameString selTN(*iToken++);
148  //get selector
149  SmartIF<IEvtSelector> pSelector(serviceLocator()->service(selTN));
150  if (pSelector) {
151  //FIXME if (!pSelector.done()) {
152  //try to add to trig list
153  unsigned int firstEvt(boost::lexical_cast<unsigned int>(*iToken++));
154  unsigned int lastEvt(boost::lexical_cast<unsigned int>(*iToken));
155  if (m_trigList.add(Trigger(pSelector, firstEvt, lastEvt))) {
156  if (msgLvl(MSG::DEBUG)) {
157  SmartIF<INamedInterface> pNamed(pSelector);
158  if (pNamed) {
159  msg() << "decodeTrigger: added selector " << pNamed->name()
160  << " first event to be read " << firstEvt
161  << " last event to be read " << lastEvt << endmsg;
162  }
163  }
164  } else {
166  ("decodeTrigger: Selector ["
167  << selTN.type() << '/' << selTN.name()
168  << "] not added");
169  } //can add to range
170  } else {
172  ("decodeTrigger: Selector ["
173  << selTN.type() << '/' << selTN.name()
174  << "] can not be found or created");
175  } //selector available
176  } catch (const boost::bad_lexical_cast& e) {
178  ("decodeTrigger: Can't cast ["<< *iToken
179  << "] to double(frequency). SKIPPING");
180  } //can cast to frequency
181  } else {
183  ("decodeTrigger: Badly formatted descriptor ["
184  << triggDescr << "]. SKIPPING");
185  } //can parse property string
186 }
187 
188 #ifndef NDEBUG
189 #define FORWARD___DEBUG( METHOD )\
190  { ATH_MSG_VERBOSE ("forwarding " << #METHOD << " to service "\
191  << (validTrigger() ? currentTrigger()->name() : "NONE")); }
192 #else
193 #define FORWARD___DEBUG( METHOD )
194 #endif
195 
196 StatusCode MixingEventSelector::createContext(IEvtSelector::Context*& pctxt) const {
197  pctxt=nullptr;
198  if (!validTrigger()) return StatusCode::FAILURE;
200  StatusCode sc(StatusCode::FAILURE);
201  while (iTr != m_trigList.end() && (sc=(iTr++)->createContext(pctxt)).isSuccess()) ;
202  return sc;
203 }
204 
206 MixingEventSelector::next(IEvtSelector::Context& /*c*/) const {
207  StatusCode sc(StatusCode::FAILURE);
208  do {
209 #ifdef DEBUG_OUTPUT_STATUS
212  while (i != iEnd) outfile2 << (*i++).toString(); //output status
213 #endif
215  sc = currentTrigger()->next();
216  if (sc.isFailure()){
218  continue; // we have to add "continue;" after "m_trigList.remove(m_pCurrentTrigger);
219  }
220  } while ((sc.isFailure() || currentTrigger()->done()) && !m_trigList.empty() );
221  // use !m_trigList.empty() to replace validTrigger(), which is not working well
222 
223  std::vector<ToolHandle<IAthenaSelectorTool> >::const_iterator
224  i(m_helperTools.begin()), iE(m_helperTools.end());
225  while (i != iE) ((*i++)->preNext()).ignore();
226 
227  ++m_eventPos;
228  FORWARD___DEBUG( next );
229 
230  i=m_helperTools.begin(); iE=m_helperTools.end();
231  while (sc.isSuccess() && (i != iE)) {
232  sc =(*i)->postNext();
233  if (sc.isRecoverable())
234  ATH_MSG_INFO("Request skipping event from: " << (*i)->name());
235  else if (sc.isFailure())
236  ATH_MSG_WARNING((*i)->name() << ":postNext failed");
237  ++i;
238  }
239  return sc;
240 }
241 
242 
244 MixingEventSelector::createAddress(const IEvtSelector::Context& /*c*/,
245  IOpaqueAddress*& pAddr) const {
246  pAddr=nullptr;
247  if (!validTrigger()) return StatusCode::FAILURE;
248 
250  return (currentTrigger()->createAddress(pAddr).isSuccess() &&
251  pAddr != nullptr) ? StatusCode::SUCCESS : StatusCode::FAILURE;
252 }
253 
256  IAddressProvider::tadList& /*tads*/ ) {
257  return StatusCode::SUCCESS;
258 }
259 
262  IAddressProvider::tadList& /*tads*/ )
263 {
264  if (storeID != StoreID::EVENT_STORE && storeID != StoreID::PILEUP_STORE)
265  return StatusCode::SUCCESS;
266 
268  if (!m_pEventStore->contains (mclid, m_mergedEventInfoKey)) {
269  // We create the DataProxy here rather than relying on ProxyProvideSvc
270  // to do it because we want to set a non-default dataloader on the proxy.
271  SG::TransientAddress tad (mclid,
273  new GenericAddress (0, mclid),
274  false);
275  auto dp = std::make_unique<SG::DataProxy> (std::move(tad),
276  this,
277  true);
278  ATH_CHECK( m_pEventStore->addToStore (mclid, dp.release()) );
279  }
280  return StatusCode::SUCCESS;
281 }
282 
285  const EventContext&) {
286  return StatusCode::FAILURE;
287 }
288 
289 #undef FORWARD___DEBUG
290 
291 unsigned long MixingEventSelector::getEventNo() const {
292  return ( (m_eventNumbers.value().size() > m_eventPos) ?
293  m_eventNumbers.value()[m_eventPos] :
294  m_eventPos );
295 }
296 
297 //remember that m_pCurrentTrigger and m_trigList are mutable
300  //we look for the first trigger which is not done
301  do {
302  //if called before initialize, choose the last trigger in list
303  unsigned int iTrig = (nullptr != m_chooseRangeRand) ?
304  (unsigned int)(m_chooseRangeRand->fire() * double(m_trigList.todo())) :
305  m_trigList.todo();
307  } while (validTrigger() && m_pCurrentTrigger->done() &&
308  m_trigList.remove(m_pCurrentTrigger)); //remove a done trigger
309 
310  //printouts
311  if (!validTrigger()) {
312  ATH_MSG_INFO ("setCurrentTrigger: end of input");
313  } else {
314  ATH_MSG_DEBUG ("setCurrentTrigger: now using selector "
315  << currentTrigger()->name());
316  }
317 
318  return m_pCurrentTrigger;
319 }
320 
324 }
325 
326 bool
328  bool newElem(end() == find(begin(), end() , trig));
329  if (newElem) {
330  m_todo += trig.todo();
331  m_trigs.push_back(trig);
332  m_rangeEnd.push_back(m_todo);
333 #ifndef NDEBUG
334  MsgStream log(Athena::getMessageSvc(), "MixingEventSelector::TriggerList");
335  if (log.level() <= MSG::DEBUG) {
336  log << MSG::DEBUG << "add: trigger "
337  << trig.name() << ". New trigger table: \n" << toString() <<endmsg;
338  }
339 #endif
340  }
341  return newElem;
342 }
343 
344 bool
346  bool removed(false);
347  unsigned int nElem(m_trigs.size());
348  if (nElem) {
349  unsigned int trigTodo(iTrig->todo());
350  unsigned int trigIndex(iTrig - begin());
351 #ifndef NDEBUG
352  string trigName(iTrig->name());
353 #endif
354  m_trigs.erase(iTrig);
355  removed = nElem > m_trigs.size();
356  if (removed) {
357  //this means we erased iTrig. Remove its todo count from total
358  m_todo -= trigTodo;
359  //and from each of the subsequent ranges
360  for (unsigned int i=trigIndex+1; i<m_rangeEnd.size(); ++i)
361  m_rangeEnd[i] -= trigTodo;
362  //finally erase the corresponding rangeEnd element
363  m_rangeEnd.erase(m_rangeEnd.begin()+trigIndex);
364 #ifndef NDEBUG
365  MsgStream log(Athena::getMessageSvc(), "MixingEventSelector::TriggerList"); //FIXME
366  if (log.level() <= MSG::DEBUG) {
367  log << MSG::DEBUG << "remove: trigger "
368  << trigName
369  << ". New trigger table: \n" << toString() <<endmsg;
370  }
371 #endif
372  }
373  }
374  return removed;
375 }
376 
377 string
379  ostringstream os;
380  for (unsigned int i=0; i<m_trigs.size(); ++i) {
381  //cant do os << m_trigs[i].toString();
382  os << m_trigs[i].name() << ", already read=" << m_trigs[i].read()
383  << ", to do=" << m_trigs[i].todo()
384  << (m_trigs[i].done() ? " done " : " ")
385  << " - endRange: " << m_rangeEnd[i] << '\n';
386  }
387  os << endl;
388  return string(os.str());
389 }
390 
393  iterator iTrig(m_trigs.begin()), eTrig(m_trigs.end());
394  std::vector<unsigned int>::const_iterator iRange(m_rangeEnd.begin());
395  std::vector<unsigned int>::const_iterator eRange(m_rangeEnd.end());
396  while (eRange != iRange && eTrig != iTrig && i > *iRange){
397  ++iRange; ++iTrig;
398  }
399 #ifndef NDEBUG
400  MsgStream log(Athena::getMessageSvc(), "MixingEventSelector::TriggerList");
401  if (log.level() <= MSG::VERBOSE) {
402  if (eRange != iRange) log << MSG::VERBOSE
403  << "elementInRange: rangeEnd=" << *iRange
404  << " matches i=" << i << endmsg;
405  }
406 #endif
407  return iTrig;
408 }
409 
411  unsigned int firstEvt,
412  unsigned int lastEvt):
413  m_pSelector(pSel), m_firstEvent(firstEvt),
414  m_toRead(lastEvt+1), m_todo(m_toRead-firstEvt), m_reads(0),
415  m_current(nullptr)
416  { }
417 
418 IEvtSelector::Context& MixingEventSelector::Trigger::currentContext() const {
419  //make sure we have a context!
420  if (nullptr == m_current) {
421  IEvtSelector::Context* pTmp(nullptr);
422  if ((createContext(pTmp)).isFailure())
423  throw GaudiException("MixingEventSelector::Trigger::currentContext(): can't create context",
424  name(),StatusCode::FAILURE);
425  }
426  // cppcheck-suppress nullPointerRedundantCheck; createContext() sets m_current
427  return *m_current;
428 }
429 
430 std::string
432  ostringstream os;
433  os << name() << ", already read=" << m_reads
434  << ", to do=" << todo() << endl;
435  return string(os.str());
436 }
437 
440  StatusCode sc(StatusCode::FAILURE);
441  if (!done()) {
442  sc= selector().next(currentContext());
443  while (sc.isSuccess() && (++m_reads < m_firstEvent))
444  sc = selector().next(currentContext());// m_reads, m_current are mutable
445  }
446  // cout << "calling next on Trigger " << this << " " << dynamic_cast<IService&>(selector()).name() << endl;
447  return sc;
448 }
449 
452  return selector().previous(currentContext());
453 }
454 
456 MixingEventSelector::Trigger::createAddress(IOpaqueAddress*& pIOA) const {
457  return (done() ?
458  StatusCode::FAILURE :
459  selector().createAddress(currentContext(), pIOA) );
460 }
461 
463 MixingEventSelector::Trigger::createContext(IEvtSelector::Context*& pCtxt) const{
464  StatusCode sc(StatusCode::FAILURE);
465  if (!done()) {
466  sc = selector().createContext(pCtxt);
467  m_current = pCtxt;
468  }
469  return sc;
470 }
471 
472 bool
474  // cout << "calling done on Trigger " << this << " " << dynamic_cast<IService&>(selector()).name() << endl;
475  // cout << refCtxt << " " << selector().end() << endl;
476  // cout << toRead() << " " << m_reads << endl;
477  // cout << "done returns " << ((m_current && (currentContext() == *selector().end())) || (toRead() <= m_reads)) << endl;
478  return (toRead() <= m_reads);
479 }
480 
481 
482 StatusCode MixingEventSelector::last(IEvtSelector::Context&) const {
483  return StatusCode::FAILURE;
484 }
485 StatusCode MixingEventSelector::next(IEvtSelector::Context&, int) const {
486  return StatusCode::FAILURE;
487 }
488 StatusCode MixingEventSelector::previous(IEvtSelector::Context&) const {
489  return StatusCode::FAILURE;
490 }
491 StatusCode MixingEventSelector::previous(IEvtSelector::Context&,int) const {
492  return StatusCode::FAILURE;
493 }
494 StatusCode MixingEventSelector::rewind(IEvtSelector::Context&) const {
495  return StatusCode::FAILURE;
496 }
497 StatusCode MixingEventSelector::releaseContext(IEvtSelector::Context*&) const {
498  return StatusCode::FAILURE;
499 }
501  IEvtSelector::Context&)const {
502  return StatusCode::FAILURE;
503 }
504 
505 
506 // IConverter implementation.
508 {
510 }
512 {
513  return 0;
514 }
515 
516 
528 StatusCode MixingEventSelector::createObj(IOpaqueAddress* /*pAddress*/,
529  DataObject*& refpObject)
530 {
531  const EventInfo* pEInfo(nullptr);
532  if (!(m_pEventStore->retrieve(pEInfo)).isSuccess()) {
534  ("addMergedEventInfo: event store does not contain "\
535  "an EventInfo object!");
536  return StatusCode::RECOVERABLE;
537  }
538 
539  // copy the original event to a new MergedEventInfo
540  auto mei = std::make_unique<MergedEventInfo> (*pEInfo,
542  getEventNo());
543  refpObject = SG::asStorable (std::move (mei));
544 
545 
546  //finally slam a new EventID in place of the old! HACK!!! FIXME!!
547  (const_cast<EventInfo*>(pEInfo))->setEventID(
549 
550  return StatusCode::SUCCESS;
551 }
552 
553 
554 // IConverter dummies.
555 StatusCode MixingEventSelector::setDataProvider(IDataProviderSvc* /*pService*/)
556 {
557  std::abort();
558 }
559 SmartIF<IDataProviderSvc>& MixingEventSelector::dataProvider() const
560 {
561  std::abort();
562 }
564 {
565  std::abort();
566 }
567 SmartIF<IConversionSvc>& MixingEventSelector::conversionSvc() const
568 {
569  std::abort();
570 }
572 {
573  std::abort();
574 }
575 SmartIF<IAddressCreator>& MixingEventSelector::addressCreator() const
576 {
577  std::abort();
578 }
579 StatusCode MixingEventSelector::fillObjRefs(IOpaqueAddress* /*pAddress*/, DataObject* /*pObject*/)
580 {
581  std::abort();
582 }
583 StatusCode MixingEventSelector::updateObj(IOpaqueAddress* /*pAddress*/, DataObject* /*refpObject*/)
584 {
585  std::abort();
586 }
587 StatusCode MixingEventSelector::updateObjRefs(IOpaqueAddress* /*pAddress*/, DataObject* /*pObject*/)
588 {
589  std::abort();
590 }
591 StatusCode MixingEventSelector::createRep(DataObject* /*pObject*/, IOpaqueAddress*& /*refpAddress*/)
592 {
593  std::abort();
594 }
595 StatusCode MixingEventSelector::fillRepRefs(IOpaqueAddress* /*pAddress*/, DataObject* /*pObject*/)
596 {
597  std::abort();
598 }
599 StatusCode MixingEventSelector::updateRep(IOpaqueAddress* /*pAddress*/, DataObject* /*pObject*/)
600 {
601  std::abort();
602 }
603 StatusCode MixingEventSelector::updateRepRefs(IOpaqueAddress* /*pAddress*/, DataObject* /*pObject*/)
604 {
605  std::abort();
606 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
MixingEventSelector::m_pCurrentTrigger
TriggerList::iterator m_pCurrentTrigger
the current trigger
Definition: MixingEventSelector.h:246
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
TileDCSDataPlotter.dp
dp
Definition: TileDCSDataPlotter.py:840
MixingEventSelector::m_trigList
TriggerList m_trigList
the ingredients
Definition: MixingEventSelector.h:240
MixingEventSelector::MixingEventSelector
MixingEventSelector(const std::string &name, ISvcLocator *svc)
Definition: MixingEventSelector.cxx:47
MixingEventSelector::Trigger::toString
std::string toString() const
Definition: MixingEventSelector.cxx:431
MixingEventSelector::conversionSvc
virtual SmartIF< IConversionSvc > & conversionSvc() const override
Definition: MixingEventSelector.cxx:567
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
MixingEventSelector::m_atRndmSvc
ServiceHandle< IAtRndmGenSvc > m_atRndmSvc
Definition: MixingEventSelector.h:258
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
MixingEventSelector::TriggerList::remove
bool remove(iterator)
Definition: MixingEventSelector.cxx:345
MixingEventSelector::repSvcType
virtual long repSvcType() const override
Definition: MixingEventSelector.cxx:511
StorableConversions.h
convert to and from a SG storable
MixingEventSelector::objType
virtual const CLID & objType() const override
Definition: MixingEventSelector.cxx:507
MixingEventSelector::releaseContext
virtual StatusCode releaseContext(IEvtSelector::Context *&refCtxt) const override
Definition: MixingEventSelector.cxx:497
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
MixingEventSelector::TriggerList::m_rangeEnd
std::vector< unsigned int > m_rangeEnd
Definition: MixingEventSelector.h:222
SG::TransientAddress
Definition: TransientAddress.h:32
MixingEventSelector::setDataProvider
virtual StatusCode setDataProvider(IDataProviderSvc *pService) override
Definition: MixingEventSelector.cxx:555
MixingEventSelector::last
virtual StatusCode last(IEvtSelector::Context &) const override
Definition: MixingEventSelector.cxx:482
MixingEventSelector::setAddressCreator
virtual StatusCode setAddressCreator(IAddressCreator *creator) override
Definition: MixingEventSelector.cxx:571
TriggerInfo.h
This class contains trigger related information.
MixingEventSelector::TriggerList::end
iterator end()
Definition: MixingEventSelector.h:231
EventType.h
This class provides general information about an event. It extends EventInfo with a list of sub-evts ...
MixingEventSelector::TriggerList::empty
bool empty() const
Definition: MixingEventSelector.h:234
MixingEventSelector::Trigger::todo
unsigned int todo() const
Definition: MixingEventSelector.h:181
MixingEventSelector::TriggerList::todo
unsigned int todo() const
Definition: MixingEventSelector.h:236
MixingEventSelector::m_triggerListProp
StringArrayProperty m_triggerListProp
the recipe
Definition: MixingEventSelector.h:155
beamspotman.tokens
tokens
Definition: beamspotman.py:1284
MixingEventSelector::next
virtual StatusCode next(IEvtSelector::Context &refCtxt) const override
Definition: MixingEventSelector.cxx:206
MixingEventSelector::currentTrigger
TriggerList::iterator currentTrigger() const
"intelligent" accessor to the above
Definition: MixingEventSelector.cxx:322
MixingEventSelector::loadAddresses
virtual StatusCode loadAddresses(StoreID::type storeID, IAddressProvider::tadList &tads) override
Definition: MixingEventSelector.cxx:261
MixingEventSelector::getEventNo
unsigned long getEventNo() const
setup and lookup m_evtsNotUsedSoFar. Returns next event no
Definition: MixingEventSelector.cxx:291
MixingEventSelector::m_eventPos
unsigned long m_eventPos
the internal event number
Definition: MixingEventSelector.h:254
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
MixingEventSelector::m_outputRunNumber
IntegerProperty m_outputRunNumber
Definition: MixingEventSelector.h:156
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
MixingEventSelector::m_helperTools
ToolHandleArray< IAthenaSelectorTool > m_helperTools
Definition: MixingEventSelector.h:159
MixingEventSelector::setConversionSvc
virtual StatusCode setConversionSvc(IConversionSvc *pService) override
Definition: MixingEventSelector.cxx:563
MixingEventSelector::TriggerList::elementInRange
iterator elementInRange(unsigned int)
Definition: MixingEventSelector.cxx:392
MixingEventSelector::Trigger::previous
StatusCode previous() const
Definition: MixingEventSelector.cxx:451
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition: DataObjectSharedPtr.h:65
ClassID_traits::ID
static const CLID & ID()
the CLID of T
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:50
DiTauMassTools::ignore
void ignore(T &&)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:58
MergedEventInfo.h
This class provides general information about an event. It extends MergedEventInfo with a list of sub...
EventID.h
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
MixingEventSelector::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Create the transient representation of an object.
Definition: MixingEventSelector.cxx:528
MixingEventSelector::TriggerList::iterator
std::vector< Trigger >::iterator iterator
Definition: MixingEventSelector.h:227
MixingEventSelector::decodeTrigger
void decodeTrigger(std::string triggDescr)
functor that creates a Trigger object and adds it to m_trigList
Definition: MixingEventSelector.cxx:138
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
StoreID::PILEUP_STORE
@ PILEUP_STORE
Definition: StoreID.h:31
lumiFormat.i
int i
Definition: lumiFormat.py:85
CP::DetailSelectionExprParser::Tokenizer
boost::tokenizer< Separator > Tokenizer
Definition: SelectionExprParser.h:34
ClassID_traits.h
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MixingEventSelector::m_eventNumbers
UnsignedLongArrayProperty m_eventNumbers
use these as event numbers
Definition: MixingEventSelector.h:157
MixingEventSelector::dataProvider
virtual SmartIF< IDataProviderSvc > & dataProvider() const override
Definition: MixingEventSelector.cxx:559
FORWARD___DEBUG
#define FORWARD___DEBUG(METHOD)
Definition: MixingEventSelector.cxx:189
MixingEventSelector::Trigger::next
StatusCode next() const
Definition: MixingEventSelector.cxx:439
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MixingEventSelector::TriggerList::begin
iterator begin()
Definition: MixingEventSelector.h:230
MixingEventSelector::rewind
virtual StatusCode rewind(IEvtSelector::Context &refCtxt) const override
Definition: MixingEventSelector.cxx:494
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
Definition: MixingEventSelector.cxx:6
MixingEventSelector::setCurrentTrigger
TriggerList::iterator setCurrentTrigger() const
choose current trigger at random. Actually modifies state (use mutables)
Definition: MixingEventSelector.cxx:299
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
MixingEventSelector::TriggerList::m_trigs
std::vector< Trigger > m_trigs
Definition: MixingEventSelector.h:221
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
MixingEventSelector::m_chooseRangeRand
CLHEP::RandFlat * m_chooseRangeRand
Definition: MixingEventSelector.h:260
MixingEventSelector::TriggerList::m_todo
unsigned int m_todo
Definition: MixingEventSelector.h:223
IAtRndmGenSvc.h
MixingEventSelector::updateObj
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject) override
Definition: MixingEventSelector.cxx:583
MixingEventSelector::updateAddress
virtual StatusCode updateAddress(StoreID::type storeID, SG::TransientAddress *tad, const EventContext &ctx) override
Definition: MixingEventSelector.cxx:284
MixingEventSelector::m_mergedEventInfoKey
StringProperty m_mergedEventInfoKey
SG key of MergedEventInfo.
Definition: MixingEventSelector.h:158
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MixingEventSelector::setUpTriggerList
void setUpTriggerList(Gaudi::Details::PropertyBase &trigList)
TriggerList property call-back.
Definition: MixingEventSelector.cxx:129
MixingEventSelector::m_randomStreamName
StringProperty m_randomStreamName
Definition: MixingEventSelector.h:259
EventInfo
This class provides general information about an event. Event information is provided by the accessor...
Definition: EventInfo/EventInfo/EventInfo.h:43
MixingEventSelector::finalize
virtual StatusCode finalize() override
Definition: MixingEventSelector.cxx:103
MixingEventSelector::TriggerList::toString
std::string toString() const
Definition: MixingEventSelector.cxx:378
MixingEventSelector::previous
virtual StatusCode previous(IEvtSelector::Context &) const override
Definition: MixingEventSelector.cxx:488
MixingEventSelector::~MixingEventSelector
virtual ~MixingEventSelector()
Definition: MixingEventSelector.cxx:74
MixingEventSelector::Trigger
a selector with an associated frequency
Definition: MixingEventSelector.h:167
MixingEventSelector::fillRepRefs
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Definition: MixingEventSelector.cxx:595
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
MixingEventSelector::TriggerList::add
bool add(const Trigger &)
Definition: MixingEventSelector.cxx:327
MixingEventSelector::TriggerList::const_iterator
std::vector< Trigger >::const_iterator const_iterator
Definition: MixingEventSelector.h:226
MixingEventSelector::Trigger::name
const std::string & name() const
Definition: MixingEventSelector.h:202
MixingEventSelector::Trigger::done
bool done() const
Definition: MixingEventSelector.cxx:473
python.selector.AtlRunQuerySelectorLhcOlc.selector
selector
Definition: AtlRunQuerySelectorLhcOlc.py:611
StoreID::type
type
Definition: StoreID.h:24
MixingEventSelector::TriggerList
the list of available selectors with their frequency range
Definition: MixingEventSelector.h:219
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DEBUG
#define DEBUG
Definition: page_access.h:11
MixingEventSelector::initialize
virtual StatusCode initialize() override
Definition: MixingEventSelector.cxx:78
MixingEventSelector::createContext
virtual StatusCode createContext(IEvtSelector::Context *&refpCtxt) const override
Definition: MixingEventSelector.cxx:196
MixingEventSelector::preLoadAddresses
virtual StatusCode preLoadAddresses(StoreID::type storeID, IAddressProvider::tadList &tads) override
Definition: MixingEventSelector.cxx:255
MixingEventSelector::Trigger::Trigger
Trigger(IEvtSelector *pSel, unsigned int firstEvt, unsigned int lastEvt)
Definition: MixingEventSelector.cxx:410
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
EventID
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventID.h:35
IAddressProvider::tadList
std::list< SG::TransientAddress * > tadList
Definition: IAddressProvider.h:32
MixingEventSelector::createAddress
virtual StatusCode createAddress(const IEvtSelector::Context &refCtxt, IOpaqueAddress *&) const override
Definition: MixingEventSelector.cxx:244
MixingEventSelector::Trigger::createContext
StatusCode createContext(IEvtSelector::Context *&pCtxt) const
Definition: MixingEventSelector.cxx:463
MixingEventSelector::addressCreator
virtual SmartIF< IAddressCreator > & addressCreator() const override
Definition: MixingEventSelector.cxx:575
StoreID::EVENT_STORE
@ EVENT_STORE
Definition: StoreID.h:26
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
MixingEventSelector::m_statusFileName
StringProperty m_statusFileName
optional stream output snapshot
Definition: MixingEventSelector.h:154
checker_macros.h
Define macros for attributes used to control the static checker.
SG::DataProxy
Definition: DataProxy.h:45
MixingEventSelector::updateRep
virtual StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject) override
Definition: MixingEventSelector.cxx:599
PrepareReferenceFile.outfile
outfile
Definition: PrepareReferenceFile.py:42
MixingEventSelector.h
a stream of events read from different selectors.
MixingEventSelector::Trigger::currentContext
IEvtSelector::Context & currentContext() const
Definition: MixingEventSelector.cxx:418
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
StoreGateSvc.h
MixingEventSelector::Trigger::createAddress
StatusCode createAddress(IOpaqueAddress *&) const
Definition: MixingEventSelector.cxx:456
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
MixingEventSelector::fillObjRefs
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Definition: MixingEventSelector.cxx:579
MixingEventSelector::validTrigger
bool validTrigger() const
Definition: MixingEventSelector.h:151
MixingEventSelector::updateObjRefs
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Definition: MixingEventSelector.cxx:587
MixingEventSelector::m_pEventStore
StoreGateSvc_t m_pEventStore
Definition: MixingEventSelector.h:257
MixingEventSelector::resetCriteria
virtual StatusCode resetCriteria(const std::string &cr, IEvtSelector::Context &c) const override
Definition: MixingEventSelector.cxx:500
MixingEventSelector::createRep
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Definition: MixingEventSelector.cxx:591
MixingEventSelector::updateRepRefs
virtual StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Definition: MixingEventSelector.cxx:603
DataProxy.h