ATLAS Offline Software
BCMOverlay.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 #ifndef INDETOVERLAY_BCMOVERLAY_H
13 #define INDETOVERLAY_BCMOVERLAY_H
14 
17 
18 struct BCM_Pulse {
19  BCM_Pulse(unsigned int p_, unsigned int w_) {p = p_; w = w_;};
20  unsigned int p;
21  unsigned int w;
22 };
23 
25 {
26 public:
27 
28  BCMOverlay(const std::string &name, ISvcLocator *pSvcLocator);
29 
30  virtual StatusCode initialize() override final;
31  virtual StatusCode execute(const EventContext& ctx) const override final;
32 
33  StatusCode overlayContainer(const EventContext& ctx,
34  const BCM_RDO_Container *bkgContainer,
35  const BCM_RDO_Container *signalContainer,
36  BCM_RDO_Container *outputContainer) const;
37 
38 private:
39 
40  std::unique_ptr<BCM_RawData> mergeChannel(const BCM_RawData *bkgRDO,
41  const BCM_RawData *signalRDO) const;
42 
43  static void overlayPulses(std::vector<std::unique_ptr<BCM_Pulse>>& merged_pulses) ;
44 
45  static std::pair<BCM_Pulse*, BCM_Pulse*> timeOrder(BCM_Pulse* pulse1, BCM_Pulse* pulse2) ;
46 
47  static bool compare(const std::unique_ptr<BCM_Pulse>& a, const std::unique_ptr<BCM_Pulse>& b);
48 
49  Gaudi::Property<bool> m_dataOverlay{ this, "isDataOverlay", false, "Flag to switch between MC and data overlay" };
50  Gaudi::Property<bool> m_storeAllBCID{ this, "storeAllBCID", false, "Store all BCID" };
51 
52  SG::ReadHandleKey<BCM_RDO_Container> m_bkgInputKey{ this, "BkgInputKey", "Bkg_BCM_RDOs", "ReadHandleKey for Background Input BCM_RDO_Container" };
53  SG::ReadHandleKey<BCM_RDO_Container> m_signalInputKey{ this, "SignalInputKey", "Sig_BCM_RDOs", "ReadHandleKey for Signal Input BCM_RDO_Container" };
54  SG::WriteHandleKey<BCM_RDO_Container> m_outputKey{ this, "OutputKey", "BCM_RDOs", "WriteHandleKey for Output BCM_RDO_Container" };
55 
56 };
57 
58 #endif // INDETOVERLAY_BCMOVERLAY_H
BCM_Pulse::p
unsigned int p
Definition: BCMOverlay.h:19
BCMOverlay::m_storeAllBCID
Gaudi::Property< bool > m_storeAllBCID
Definition: BCMOverlay.h:50
BCM_Pulse::w
unsigned int w
Definition: BCMOverlay.h:21
BCMOverlay::mergeChannel
std::unique_ptr< BCM_RawData > mergeChannel(const BCM_RawData *bkgRDO, const BCM_RawData *signalRDO) const
Definition: BCMOverlay.cxx:156
BCMOverlay::initialize
virtual StatusCode initialize() override final
Definition: BCMOverlay.cxx:16
BCMOverlay::timeOrder
static std::pair< BCM_Pulse *, BCM_Pulse * > timeOrder(BCM_Pulse *pulse1, BCM_Pulse *pulse2)
Definition: BCMOverlay.cxx:279
SG::ReadHandleKey< BCM_RDO_Container >
BCM_Pulse
Definition: BCMOverlay.h:18
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
BCMOverlay::m_bkgInputKey
SG::ReadHandleKey< BCM_RDO_Container > m_bkgInputKey
Definition: BCMOverlay.h:52
SG::WriteHandleKey< BCM_RDO_Container >
BCM_RDO_Container
Definition: BCM_RDO_Container.h:27
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
BCM_RawData
Definition: BCM_RawData.h:36
BCMOverlay::m_dataOverlay
Gaudi::Property< bool > m_dataOverlay
Definition: BCMOverlay.h:49
BCMOverlay::overlayPulses
static void overlayPulses(std::vector< std::unique_ptr< BCM_Pulse >> &merged_pulses)
Definition: BCMOverlay.cxx:229
AthReentrantAlgorithm.h
BCMOverlay::overlayContainer
StatusCode overlayContainer(const EventContext &ctx, const BCM_RDO_Container *bkgContainer, const BCM_RDO_Container *signalContainer, BCM_RDO_Container *outputContainer) const
Definition: BCMOverlay.cxx:72
BCMOverlay::BCMOverlay
BCMOverlay(const std::string &name, ISvcLocator *pSvcLocator)
Definition: BCMOverlay.cxx:11
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
BCMOverlay::m_outputKey
SG::WriteHandleKey< BCM_RDO_Container > m_outputKey
Definition: BCMOverlay.h:54
BCM_RDO_Container.h
a
TList * a
Definition: liststreamerinfos.cxx:10
BCMOverlay::m_signalInputKey
SG::ReadHandleKey< BCM_RDO_Container > m_signalInputKey
Definition: BCMOverlay.h:53
BCMOverlay
Definition: BCMOverlay.h:25
BCMOverlay::compare
static bool compare(const std::unique_ptr< BCM_Pulse > &a, const std::unique_ptr< BCM_Pulse > &b)
Definition: BCMOverlay.cxx:288
BCMOverlay::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: BCMOverlay.cxx:31
BCM_Pulse::BCM_Pulse
BCM_Pulse(unsigned int p_, unsigned int w_)
Definition: BCMOverlay.h:19