an algorithm to merge truth particles collections in the overlay store
More...
#include <MergeTruthParticlesTool.h>
|
ServiceHandle< PileUpMergeSvc > | m_pMergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc", ""} |
|
Gaudi::Property< std::string > | m_inputTruthParticleCollKey {this, "InputTruthParticleCollKey", "TruthPileupParticles", ""} |
|
Gaudi::Property< std::string > | m_inTimeOutputTruthParticleCollKey {this, "InTimeOutputTruthParticleCollKey", "TruthPileupParticles", ""} |
|
Gaudi::Property< bool > | m_includeSignalTruthParticles {this, "IncludeSignalTruthParticles", false, ""} |
|
xAOD::TruthParticleContainer * | m_inTimeOutputTruthParticleContainer {} |
|
bool | m_first_event {true} |
|
an algorithm to merge truth particles collections in the overlay store
Definition at line 23 of file MergeTruthParticlesTool.h.
◆ MergeTruthParticlesTool()
MergeTruthParticlesTool::MergeTruthParticlesTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ filterPassed()
virtual bool PileUpToolBase::filterPassed |
( |
| ) |
const |
|
inlineoverridevirtualinherited |
◆ initialize()
StatusCode MergeTruthParticlesTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
◆ mergeEvent()
StatusCode MergeTruthParticlesTool::mergeEvent |
( |
const EventContext & |
ctx | ) |
|
|
finaloverridevirtual |
called at the end of the subevts loop.
Not (necessarily) able to access SubEvents
Definition at line 70 of file MergeTruthParticlesTool.cxx.
75 ATH_MSG_ERROR(
"mergeEvent: Failed to record InTimeOutputTruthParticleContainer");
76 return StatusCode::FAILURE;
82 return StatusCode::SUCCESS;
◆ prepareEvent()
StatusCode MergeTruthParticlesTool::prepareEvent |
( |
const EventContext & |
ctx, |
|
|
unsigned int |
nInputEvents |
|
) |
| |
|
finaloverridevirtual |
called before the subevts loop.
Not (necessarily) able to access SubEvents
Definition at line 26 of file MergeTruthParticlesTool.cxx.
29 ATH_MSG_DEBUG (
"prepareEvent: there are " << nInputEvents <<
" subevents in this event." );
33 return StatusCode::SUCCESS;
◆ processAllSubEvents() [1/2]
StatusCode MergeTruthParticlesTool::processAllSubEvents |
( |
const EventContext & |
ctx | ) |
|
|
finaloverridevirtual |
Merge the Truth TruthParticleContainers using the PileUpMergeSvc.
Reimplemented from PileUpToolBase.
Definition at line 109 of file MergeTruthParticlesTool.cxx.
118 TruthParticleList truthList;
120 if (!truthList.empty()) {
122 TruthParticleList::const_iterator truthParticleColl_iter(truthList.begin());
123 const TruthParticleList::const_iterator endOfTruthParticleColls(truthList.end());
124 while (truthParticleColl_iter!=endOfTruthParticleColls) {
125 const int eventNumber{
static_cast<int>((truthParticleColl_iter)->
first.index())};
134 ++truthParticleColl_iter;
138 ATH_MSG_DEBUG (
"processAllSubEvents: TruthParticleList is empty" );
142 ATH_MSG_ERROR (
"processAllSubEvents: Can not find TruthParticleList" );
146 ATH_MSG_ERROR (
"processAllSubEvents: Failed to record InTimeOutputTruthParticleContainer" );
147 return StatusCode::FAILURE;
154 return StatusCode::SUCCESS;
◆ 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()
called for each active bunch-crossing to process current SubEvents bunchXing is in ns
Reimplemented from PileUpToolBase.
Definition at line 36 of file MergeTruthParticlesTool.cxx.
42 while (iEvt != eSubEvents) {
45 bunchXing, iEvt).isSuccess()) {
47 if ( !inputTruthParticleContainer ) {
49 return StatusCode::FAILURE;
51 ATH_MSG_DEBUG (
"processBunchXing: bunch Crossing = " << bunchXing <<
" xAOD::TruthParticleContainer size = " << inputTruthParticleContainer->size());
59 ATH_MSG_DEBUG (
"processBunchXing: No TruthParticleContainer found." );
67 return StatusCode::SUCCESS;
◆ processTruthParticleContainer()
TruthParticleContainer Loop.
Definition at line 158 of file MergeTruthParticlesTool.cxx.
160 if (!inputTruthParticleContainer || !outputTruthParticleContainer) {
return StatusCode::FAILURE; }
167 outputTruthParticleContainer->
push_back(xTruthParticle);
168 *xTruthParticle = *theParticle;
170 eventNumberAccessor(*xTruthParticle) =
eventNumber;
172 return StatusCode::SUCCESS;
◆ record()
Definition at line 85 of file MergeTruthParticlesTool.cxx.
89 ATH_MSG_DEBUG(
"Check Aux store: " << pTruthParticles <<
" ... " << &pTruthParticles->
auxbase() <<
" ... " << pTruthParticlesAux );
90 if ( !pTruthParticlesAux ) {
91 ATH_MSG_ERROR(
"Unable to retrieve xAOD::TruthParticleAuxContainer");
92 return StatusCode::FAILURE;
95 if ( evtStore()->
record(pTruthParticlesAux, truthParticleContainerName+
"Aux.").isFailure() ) {
96 ATH_MSG_ERROR(
"Unable to write new xAOD::TruthParticleAuxContainer to event store: " << truthParticleContainerName);
97 return StatusCode::FAILURE;
100 if ( evtStore()->
record(pTruthParticles, truthParticleContainerName).isFailure() ) {
101 ATH_MSG_ERROR(
"Unable to write new xAOD::TruthParticleContainer to event store: " << truthParticleContainerName);
102 return StatusCode::FAILURE;
104 ATH_MSG_DEBUG(
"Created new xAOD::TruthParticleContainer in event store: " << truthParticleContainerName);
105 return StatusCode::SUCCESS;
◆ resetFilter()
virtual void PileUpToolBase::resetFilter |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ toProcess()
virtual bool PileUpToolBase::toProcess |
( |
int |
bunchXing | ) |
const |
|
inlineoverridevirtualinherited |
◆ m_filterPassed
bool PileUpToolBase::m_filterPassed {true} |
|
protectedinherited |
◆ m_first_event
bool MergeTruthParticlesTool::m_first_event {true} |
|
private |
◆ 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_includeSignalTruthParticles
Gaudi::Property<bool> MergeTruthParticlesTool::m_includeSignalTruthParticles {this, "IncludeSignalTruthParticles", false, ""} |
|
private |
◆ m_inputTruthParticleCollKey
Gaudi::Property<std::string> MergeTruthParticlesTool::m_inputTruthParticleCollKey {this, "InputTruthParticleCollKey", "TruthPileupParticles", ""} |
|
private |
◆ m_inTimeOutputTruthParticleCollKey
Gaudi::Property<std::string> MergeTruthParticlesTool::m_inTimeOutputTruthParticleCollKey {this, "InTimeOutputTruthParticleCollKey", "TruthPileupParticles", ""} |
|
private |
◆ m_inTimeOutputTruthParticleContainer
◆ 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_pMergeSvc
◆ 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:
Auxiliary store for the truth vertices.
Class describing a truth particle in the MC record.