ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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. 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...
 
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 More...
 
virtual StatusCode processAllSubEvents (const EventContext &ctx) override final
 Propagate the HijingParsections to the output StoreGate. More...
 

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

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  :
11 {
12 }

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());
17  return StatusCode::SUCCESS;
18 }

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

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

◆ processAllSubEvents() [1/2]

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 }

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

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

◆ m_firstSubEvent

bool MergeHijingParsTool::m_firstSubEvent {true}
private

Definition at line 54 of file MergeHijingParsTool.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_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.

◆ m_pMergeSvc

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

Definition at line 51 of file MergeHijingParsTool.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
SG::VarHandleBase::name
const std::string & name() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:75
MergeHijingParsTool::m_pMergeSvc
ServiceHandle< PileUpMergeSvc > m_pMergeSvc
Definition: MergeHijingParsTool.h:51
MergeHijingParsTool::m_outputObjectKey
SG::WriteHandleKey< HijingEventParams > m_outputObjectKey
Definition: MergeHijingParsTool.h:52
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
PileUpMergeSvc::TimedList::type
std::list< value_t > type
type of the collection of timed data object
Definition: PileUpMergeSvc.h:75
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HijingEventParams
Definition: HijingEventParams.h:23
HijingEventParams::set_psi
void set_psi(int ihar, float psi)
Definition: HijingEventParams.h:107
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
SG::WriteHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MergeHijingParsTool::m_firstSubEvent
bool m_firstSubEvent
Definition: MergeHijingParsTool.h:54
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SubEventIterator
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition: IPileUpTool.h:22
MergeHijingParsTool::m_outputObject
SG::WriteHandle< HijingEventParams > m_outputObject
Definition: MergeHijingParsTool.h:53