ATLAS Offline Software
Functions
PileUpMisc.cxx File Reference
#include "PileUpTools/PileUpMisc.h"
#include "StoreGate/ActiveStoreSvc.h"
#include "StoreGate/StoreGateSvc.h"
#include "GaudiKernel/IEvtSelector.h"
#include "xAODEventInfo/EventInfoContainer.h"
#include "PileUpTools/IBeamIntensity.h"
Include dependency graph for PileUpMisc.cxx:

Go to the source code of this file.

Functions

xAOD::EventInfoaddSubEvent (xAOD::EventInfo *targetEv, const xAOD::EventInfo::SubEvent &subev, xAOD::EventInfoContainer *eiContainer, const std::string &eiContKey, StoreGateSvc *subev_store)
 
xAOD::EventInfoaddSubEvent (xAOD::EventInfo *targetEv, const xAOD::EventInfo *ev2add, int16_t subev_time, xAOD::EventInfo::PileUpType subev_type, xAOD::EventInfoContainer *eiContainer, const std::string &eiContKey, StoreGateSvc *ev2add_store)
 

Function Documentation

◆ addSubEvent() [1/2]

xAOD::EventInfo* addSubEvent ( xAOD::EventInfo targetEv,
const xAOD::EventInfo ev2add,
int16_t  subev_time,
xAOD::EventInfo::PileUpType  subev_type,
xAOD::EventInfoContainer eiContainer,
const std::string &  eiContKey,
StoreGateSvc ev2add_store 
)

Definition at line 42 of file PileUpMisc.cxx.

49 {
50  // add a EI copy to the EI container
51  xAOD::EventInfo* newEv;
52  eiContainer->push_back( newEv=new xAOD::EventInfo( *ev2add ) );
53  if(newEv->evtStore()==nullptr && ev2add_store!=nullptr) newEv->setEvtStore(ev2add_store);
54 
55  // link to the fresh EI added to the container:
56  ElementLink< xAOD::EventInfoContainer > eilink( eiContKey, eiContainer->size()-1, targetEv->evtStore() );
57  xAOD::EventInfo::SubEvent newsubev( subev_time, targetEv->subEvents().size(), subev_type, eilink );
58  targetEv->addSubEvent( newsubev );
59 
60  // copy subevents recursively
61  for( const auto& subev: ev2add->subEvents() ) {
62  addSubEvent( targetEv, subev, eiContainer, eiContKey );
63  }
64 
65  return newEv;
66 }

◆ addSubEvent() [2/2]

xAOD::EventInfo* addSubEvent ( xAOD::EventInfo targetEv,
const xAOD::EventInfo::SubEvent subev,
xAOD::EventInfoContainer eiContainer,
const std::string &  eiContKey,
StoreGateSvc subev_store 
)

Definition at line 17 of file PileUpMisc.cxx.

22 {
23  // add a EI copy to the EI container
24  xAOD::EventInfo* newEv;
25  eiContainer->push_back( newEv=new xAOD::EventInfo( * subev.ptr() ) );
26  if(newEv->evtStore()==nullptr && subev_store!=nullptr) newEv->setEvtStore(subev_store);
27 
28  // link to the fresh EI added to the container:
29  ElementLink< xAOD::EventInfoContainer > eilink( eiContKey, eiContainer->size()-1, targetEv->evtStore() );
30  xAOD::EventInfo::SubEvent newsubev( subev.time(), subev.index(), subev.type(), eilink );
31  targetEv->addSubEvent( newsubev );
32 
33  // copy subevents recursively
34  for( const auto& se: subev.ptr()->subEvents() ) {
35  addSubEvent( targetEv, se, eiContainer, eiContKey );
36  }
37 
38  return newEv;
39 }
xAOD::EventInfo_v1::SubEvent::ptr
const EventInfo_v1 * ptr() const
Get a pointer to the EventInfo object describing the pileup event.
Definition: EventInfo_v1.cxx:501
keylayer_zslicemap.se
se
Definition: keylayer_zslicemap.py:194
xAOD::EventInfo_v1::SubEvent::time
int16_t time() const
Get the time wrt. the signal event (which has time() == 0)
Definition: EventInfo_v1.cxx:450
xAOD::EventInfo_v1::SubEvent::index
uint16_t index() const
Get the index of the sub-event.
Definition: EventInfo_v1.cxx:455
xAOD::EventInfo_v1::addSubEvent
void addSubEvent(const SubEvent &subEvent)
Add one sub-event to the existing list.
Definition: EventInfo_v1.cxx:629
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
addSubEvent
xAOD::EventInfo * addSubEvent(xAOD::EventInfo *targetEv, const xAOD::EventInfo::SubEvent &subev, xAOD::EventInfoContainer *eiContainer, const std::string &eiContKey, StoreGateSvc *subev_store)
Definition: PileUpMisc.cxx:17
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
xAOD::EventInfo_v1::SubEvent::type
PileUpType type() const
Get the type of the pileup event.
Definition: EventInfo_v1.cxx:460
xAOD::EventInfo_v1::subEvents
const std::vector< SubEvent > & subEvents() const
Get the pileup events that were used in the simulation.
Definition: EventInfo_v1.cxx:596
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
xAOD::EventInfo_v1::SubEvent
Class describing the properties of one pileup sub-event.
Definition: EventInfo_v1.h:286