ATLAS Offline Software
Loading...
Searching...
No Matches
MergeHijingParsTool Class Reference

an algorithm to propagate HijingPars to the overlay store More...

#include <MergeHijingParsTool.h>

Inheritance diagram for MergeHijingParsTool:
Collaboration diagram for MergeHijingParsTool:

Public Member Functions

 MergeHijingParsTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override final
virtual StatusCode prepareEvent (const EventContext &ctx, unsigned int nInputEvents) override final
 called before the subevts loop.
virtual StatusCode mergeEvent (const EventContext &ctx) override final
 called at the end of the subevts loop.
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
virtual bool toProcess (int bunchXing) const override final
 return false if not interested in certain xing times (in ns) implemented by default in PileUpToolBase as FirstXing<=bunchXing<=LastXing
virtual StatusCode processAllSubEvents (const EventContext &ctx) override final
 Propagate the HijingParsections to the output StoreGate.

Private Attributes

ServiceHandle< PileUpMergeSvcm_pMergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc", ""}
SG::WriteHandleKey< HijingEventParamsm_outputObjectKey {this, "HijingParamsKey", "Hijing_event_params", ""}
SG::WriteHandle< HijingEventParamsm_outputObject
bool m_firstSubEvent {true}

structors and AlgTool implementation

virtual bool filterPassed () const override
 dummy implementation of passing filter
virtual void resetFilter () override
 dummy implementation of filter reset
Gaudi::Property< int > m_firstXing
Gaudi::Property< int > m_lastXing
Gaudi::Property< int > m_vetoPileUpTruthLinks
bool m_filterPassed {true}

Detailed Description

an algorithm to propagate HijingPars to the overlay store

$Id:

Author
DCost.nosp@m.anzo.nosp@m.@bnl..nosp@m.gov (from Paolo's MergeMcEventCollTool)

Definition at line 26 of file MergeHijingParsTool.h.

Constructor & Destructor Documentation

◆ MergeHijingParsTool()

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

Definition at line 7 of file MergeHijingParsTool.cxx.

9 :
10 PileUpToolBase(type, name, parent)
11{
12}
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)

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()

StatusCode MergeHijingParsTool::initialize ( )
finaloverridevirtual

Reimplemented from PileUpToolBase.

Definition at line 14 of file MergeHijingParsTool.cxx.

14 {
15 ATH_CHECK(m_pMergeSvc.retrieve());
16 ATH_CHECK(m_outputObjectKey.initialize());
17 return StatusCode::SUCCESS;
18}
#define ATH_CHECK
Evaluate an expression and check for errors.
ServiceHandle< PileUpMergeSvc > m_pMergeSvc
SG::WriteHandleKey< HijingEventParams > m_outputObjectKey

◆ mergeEvent()

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

called at the end of the subevts loop.

Not (necessarily) able to access SubEvents

Definition at line 75 of file MergeHijingParsTool.cxx.

76{
77 //Double check that something was found.
78 if(!m_outputObject.isValid()) {
79 ATH_MSG_ERROR ( "mergeEvent: No HijingEventParams found in the signal or background eventStores." );
80 return StatusCode::FAILURE;
81 }
82 return StatusCode::SUCCESS;
83}
#define ATH_MSG_ERROR(x)
SG::WriteHandle< HijingEventParams > m_outputObject

◆ prepareEvent()

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

called before the subevts loop.

Not (necessarily) able to access SubEvents

Definition at line 20 of file MergeHijingParsTool.cxx.

20 {
21 ATH_MSG_VERBOSE ( "Calling prepareEvent()" );
22 ATH_MSG_DEBUG( "prepareEvent: there are " << nInputEvents << " subevents in this event.");
23 m_firstSubEvent=true;
25 return StatusCode::SUCCESS;
26}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ processAllSubEvents()

StatusCode MergeHijingParsTool::processAllSubEvents ( const EventContext & ctx)
finaloverridevirtual

Propagate the HijingParsections to the output StoreGate.

Reimplemented from PileUpToolBase.

Definition at line 91 of file MergeHijingParsTool.cxx.

91 {
92 ATH_MSG_VERBOSE ( "processAllSubEvents()" );
94 typedef PileUpMergeSvc::TimedList<HijingEventParams>::type TimedHijingParamsList;
95 TimedHijingParamsList HijingList;
96 const HijingEventParams *hijing_pars(nullptr);
97 if (!(m_pMergeSvc->retrieveSubEvtsData(m_outputObject.name(), HijingList).isSuccess())
98 || HijingList.size()==0) {
99 ATH_MSG_INFO ( " Cannot find HijingEventParams from PileUp service " );
100 return StatusCode::SUCCESS;
101 }
102 ATH_MSG_DEBUG ( " HijingEventParams found from PileUp service " );
103 for (const auto& hijingParams: HijingList) {
104 hijing_pars = hijingParams.second;
105 // create new container for overlayed event
106 ATH_CHECK(m_outputObject.record(std::make_unique<HijingEventParams>(hijing_pars->get_np(),
107 hijing_pars->get_nt(),
108 hijing_pars->get_n0(),
109 hijing_pars->get_n01(),
110 hijing_pars->get_n10(),
111 hijing_pars->get_n11(),
112 hijing_pars->get_natt(),
113 hijing_pars->get_jatt(),
114 hijing_pars->get_b(),
115 hijing_pars->get_bphi())));
116 // FIXME Why is there no copy constructor for this class?!
117 // add in setting Psi angles manually.
118 for(int n=1;n<7;++n) {
119 m_outputObject->set_psi(n,hijing_pars->get_psi(n));
120 }
121 break;
122 }
123 //Double check that something was found.
124 if(!m_outputObject.isValid()) {
125 ATH_MSG_ERROR( "processAllSubEvents: No HijingEventParams found in the signal or background eventStores." );
126 return StatusCode::FAILURE;
127 }
128 return StatusCode::SUCCESS;
129}
#define ATH_MSG_INFO(x)
std::list< value_t > type
type of the collection of timed data object

◆ processBunchXing()

StatusCode MergeHijingParsTool::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 28 of file MergeHijingParsTool.cxx.

31{
32 ATH_MSG_VERBOSE ( "processBunchXing()" );
33 if(m_outputObject.isValid()) {
34 ATH_MSG_VERBOSE("Already written out a HijingEventParams for the current signal event.");
35 return StatusCode::SUCCESS;
36 }
37 SubEventIterator iEvt = bSubEvents;
38 for (; iEvt!=eSubEvents; ++iEvt) {
39 const HijingEventParams *hijing_pars(nullptr);
40 if (m_pMergeSvc->retrieveSingleSubEvtData(m_outputObject.name(), hijing_pars,
41 bunchXing, iEvt).isSuccess()) {
42 ATH_CHECK(m_outputObject.record(std::make_unique<HijingEventParams>(hijing_pars->get_np(),
43 hijing_pars->get_nt(),
44 hijing_pars->get_n0(),
45 hijing_pars->get_n01(),
46 hijing_pars->get_n10(),
47 hijing_pars->get_n11(),
48 hijing_pars->get_natt(),
49 hijing_pars->get_jatt(),
50 hijing_pars->get_b(),
51 hijing_pars->get_bphi())));
52 // FIXME Why is there no copy constructor for this class?!
53 // add in setting Psi angles manually.
54 for(int n=1;n<7;++n) {
55 m_outputObject->set_psi(n,hijing_pars->get_psi(n));
56 }
57
58 if(m_firstSubEvent) {
59 ATH_MSG_DEBUG( "processBunchXing: copied original event HijingEventParams" );
60 }
61 else {
62 ATH_MSG_DEBUG( "processBunchXing: copied background event HijingEventParams" );
63 }
64 return StatusCode::SUCCESS;
65 }
66
67 if(m_firstSubEvent) {
68 ATH_MSG_VERBOSE("processBunchXing: No HijingEventParams found in the signal eventStore." );
69 m_firstSubEvent=false;
70 }
71 }
72 return StatusCode::SUCCESS;
73}
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition IPileUpTool.h:22

◆ 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()

bool MergeHijingParsTool::toProcess ( int bunchXing) const
finaloverridevirtual

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

Reimplemented from PileUpToolBase.

Definition at line 85 of file MergeHijingParsTool.cxx.

85 {
86 //We are only interested in the HijingEventParams for the original event
87 //which should be in BC 0 !
88 return (bunchXing==0);
89}

Member Data Documentation

◆ m_filterPassed

bool PileUpToolBase::m_filterPassed {true}
protectedinherited

Definition at line 60 of file PileUpToolBase.h.

60{true};

◆ m_firstSubEvent

bool MergeHijingParsTool::m_firstSubEvent {true}
private

Definition at line 54 of file MergeHijingParsTool.h.

54{true};

◆ 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.

54 {this, "FirstXing", -999,
55 "First bunch-crossing in which det is live"};

◆ 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.

56 {this, "LastXing", 999,
57 "Last bunch-crossing in which det is live"};

◆ m_outputObject

SG::WriteHandle<HijingEventParams> MergeHijingParsTool::m_outputObject
private

Definition at line 53 of file MergeHijingParsTool.h.

◆ m_outputObjectKey

SG::WriteHandleKey<HijingEventParams> MergeHijingParsTool::m_outputObjectKey {this, "HijingParamsKey", "Hijing_event_params", ""}
private

Definition at line 52 of file MergeHijingParsTool.h.

52{this, "HijingParamsKey", "Hijing_event_params", ""};

◆ m_pMergeSvc

ServiceHandle<PileUpMergeSvc> MergeHijingParsTool::m_pMergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc", ""}
private

Definition at line 51 of file MergeHijingParsTool.h.

51{this, "PileUpMergeSvc", "PileUpMergeSvc", ""};

◆ 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.

58 {this, "VetoPileUpTruthLinks", true,
59 "Ignore links to suppressed pile-up truth"};

The documentation for this class was generated from the following files: