ATLAS Offline Software
List of all members
TestPileUpTool Class Reference

#include <TestPileUpTool.h>

Inheritance diagram for TestPileUpTool:
Collaboration diagram for TestPileUpTool:

Public Member Functions

Constructor
 TestPileUpTool (const std::string &type, const std::string &name, const IInterface *parent)
 

IPileUpTool methods

std::vector< std::pair< unsigned int, int > > m_seen
 return false if not interested in certain xing times (in ns) implemented by default in PileUpToolBase as FirstXing<=bunchXing<=LastXing More...
 
Gaudi::Property< bool > m_doFiltering {this, "DoFiltering", false, ""}
 
Gaudi::Property< unsigned int > m_maxInTimePileUp {this, "MaxInTimePileUp", 4, ""}
 
virtual StatusCode prepareEvent (const EventContext &ctx, unsigned int nInputEvents) override final
 called before the bunchXing loop More...
 
virtual StatusCode mergeEvent (const EventContext &ctx) override final
 called at the end of the subevts loop. More...
 
virtual StatusCode processBunchXing (int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents) override final
 called for each active bunch-crossing to process current SubEvents bunchXing is in ns More...
 

structors and AlgTool implementation

virtual StatusCode initialize () override
 
virtual bool toProcess (int bunchXing) const override
 the method this base class helps implementing More...
 
virtual StatusCode processAllSubEvents (const EventContext &) override
 
virtual StatusCode processAllSubEvents (const EventContext &ctx)=0
 dummy implementation to allow compilation while all Digitization packages are migrated to use this new interface. More...
 
virtual bool filterPassed () const override
 dummy implementation of passing filter More...
 
virtual void resetFilter () override
 dummy implementation of filter reset More...
 
Gaudi::Property< int > m_firstXing
 
Gaudi::Property< int > m_lastXing
 
Gaudi::Property< int > m_vetoPileUpTruthLinks
 
bool m_filterPassed {true}
 

Detailed Description

Definition at line 18 of file TestPileUpTool.h.

Constructor & Destructor Documentation

◆ TestPileUpTool()

TestPileUpTool::TestPileUpTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 9 of file TestPileUpTool.cxx.

13 {
14 }

Member Function Documentation

◆ filterPassed()

virtual bool PileUpToolBase::filterPassed ( ) const
inlineoverridevirtualinherited

dummy implementation of passing filter

Definition at line 49 of file PileUpToolBase.h.

49 { return m_filterPassed; }

◆ initialize()

virtual StatusCode PileUpToolBase::initialize ( )
inlineoverridevirtualinherited

◆ mergeEvent()

StatusCode TestPileUpTool::mergeEvent ( const EventContext &  ctx)
finaloverridevirtual

called at the end of the subevts loop.

Not (necessarily) able to access SubEvents

Definition at line 22 of file TestPileUpTool.cxx.

23 {
24  for (const auto& bc : m_seen)
25  {
26  ATH_MSG_INFO( "mergeEvent: there are " << bc.first << " events in bunch xing " << bc.second );
27  }
28  return StatusCode::SUCCESS;
29 }

◆ prepareEvent()

StatusCode TestPileUpTool::prepareEvent ( const EventContext &  ctx,
unsigned int  nInputEvents 
)
finaloverridevirtual

called before the bunchXing loop

Definition at line 16 of file TestPileUpTool.cxx.

17 {
18  ATH_MSG_INFO( "prepareEvent: expect to process " << nInputEvents << " events this time." );
19  return StatusCode::SUCCESS;
20 }

◆ processAllSubEvents() [1/2]

virtual StatusCode PileUpToolBase::processAllSubEvents ( const EventContext &  )
inlineoverridevirtualinherited

◆ processAllSubEvents() [2/2]

virtual StatusCode IPileUpTool::processAllSubEvents
inherited

dummy implementation to allow compilation while all Digitization packages are migrated to use this new interface.

◆ processBunchXing()

StatusCode TestPileUpTool::processBunchXing ( int  bunchXing,
SubEventIterator  bSubEvents,
SubEventIterator  eSubEvents 
)
finaloverridevirtual

called for each active bunch-crossing to process current SubEvents bunchXing is in ns

Reimplemented from PileUpToolBase.

Definition at line 31 of file TestPileUpTool.cxx.

34 {
35  m_seen.push_back(std::make_pair(std::distance(bSubEvents,eSubEvents), bunchXing));
36  if(m_doFiltering && bunchXing==0)
37  {
38  if(m_maxInTimePileUp < m_seen.back().first)
39  {
40  ATH_MSG_INFO("Triggering filter as there were " << m_seen.back().first << " pile-up events in time.");
41  m_filterPassed = false;
42  }
43  }
44 
45  SubEventIterator iEvt(bSubEvents);
46  while (iEvt != eSubEvents)
47  {
48  StoreGateSvc& seStore(*iEvt->ptr()->evtStore());
49  ATH_MSG_DEBUG("SubEvt EventInfo from StoreGate " << seStore.name() << " : "
50  << " bunch crossing : " << bunchXing
51  << " time offset: " << iEvt->time()
52  << " event: " << iEvt->ptr()->eventNumber()
53  << " run: " << iEvt->ptr()->runNumber()
54  );
55  ++iEvt;
56  }
57  return StatusCode::SUCCESS;
58 }

◆ resetFilter()

virtual void PileUpToolBase::resetFilter ( )
inlineoverridevirtualinherited

dummy implementation of filter reset

Reimplemented in MergeTruthJetsTool.

Definition at line 51 of file PileUpToolBase.h.

51 { m_filterPassed=true; }

◆ toProcess()

virtual bool PileUpToolBase::toProcess ( int  bunchXing) const
inlineoverridevirtualinherited

the method this base class helps implementing

Reimplemented in MergeHijingParsTool, and MergeTrackRecordCollTool.

Definition at line 32 of file PileUpToolBase.h.

32  {
33  //closed interval [m_firstXing,m_lastXing]
34  return !((m_firstXing > bunchXing) || (bunchXing > m_lastXing));
35  }

Member Data Documentation

◆ m_doFiltering

Gaudi::Property<bool> TestPileUpTool::m_doFiltering {this, "DoFiltering", false, ""}
private

Definition at line 45 of file TestPileUpTool.h.

◆ m_filterPassed

bool PileUpToolBase::m_filterPassed {true}
protectedinherited

Definition at line 60 of file PileUpToolBase.h.

◆ m_firstXing

Gaudi::Property<int> PileUpToolBase::m_firstXing
protectedinherited
Initial value:
{this, "FirstXing", -999,
"First bunch-crossing in which det is live"}

Definition at line 54 of file PileUpToolBase.h.

◆ m_lastXing

Gaudi::Property<int> PileUpToolBase::m_lastXing
protectedinherited
Initial value:
{this, "LastXing", 999,
"Last bunch-crossing in which det is live"}

Definition at line 56 of file PileUpToolBase.h.

◆ m_maxInTimePileUp

Gaudi::Property<unsigned int> TestPileUpTool::m_maxInTimePileUp {this, "MaxInTimePileUp", 4, ""}
private

Definition at line 46 of file TestPileUpTool.h.

◆ m_seen

std::vector<std::pair<unsigned int, int> > TestPileUpTool::m_seen
private

return false if not interested in certain xing times (in ns) implemented by default in PileUpToolBase as FirstXing<=bunchXing<=LastXing

Definition at line 44 of file TestPileUpTool.h.

◆ m_vetoPileUpTruthLinks

Gaudi::Property<int> PileUpToolBase::m_vetoPileUpTruthLinks
protectedinherited
Initial value:
{this, "VetoPileUpTruthLinks", true,
"Ignore links to suppressed pile-up truth"}

Definition at line 58 of file PileUpToolBase.h.


The documentation for this class was generated from the following files:
PileUpToolBase::m_filterPassed
bool m_filterPassed
Definition: PileUpToolBase.h:60
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TestPileUpTool::m_seen
std::vector< std::pair< unsigned int, int > > m_seen
return false if not interested in certain xing times (in ns) implemented by default in PileUpToolBase...
Definition: TestPileUpTool.h:44
PileUpToolBase::m_lastXing
Gaudi::Property< int > m_lastXing
Definition: PileUpToolBase.h:56
TestPileUpTool::m_maxInTimePileUp
Gaudi::Property< unsigned int > m_maxInTimePileUp
Definition: TestPileUpTool.h:46
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
PileUpToolBase::PileUpToolBase
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PileUpToolBase.cxx:7
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TestPileUpTool::m_doFiltering
Gaudi::Property< bool > m_doFiltering
Definition: TestPileUpTool.h:45
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
PileUpToolBase::m_firstXing
Gaudi::Property< int > m_firstXing
Definition: PileUpToolBase.h:54
SubEventIterator
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition: IPileUpTool.h:22
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