ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
DerivationFramework::Reco_mumu Class Reference

#include <Reco_mumu.h>

Inheritance diagram for DerivationFramework::Reco_mumu:
Collaboration diagram for DerivationFramework::Reco_mumu:

Public Member Functions

 Reco_mumu (const std::string &t, const std::string &n, const IInterface *p)
 
StatusCode initialize () override
 
StatusCode addBranches () const override
 

Private Attributes

ToolHandle< Trk::V0Toolsm_v0Tools {this, "V0Tools", "Trk::V0Tools"}
 tools More...
 
ToolHandle< Analysis::ICandidateSearchm_jpsiFinder {this,"JpsiFinder", "Analysis::JpsiFinder"}
 
ToolHandle< Analysis::PrimaryVertexRefitterm_pvRefitter {this, "PVRefitter", "Analysis::PrimaryVertexRefitter"}
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfo_key {this, "EventInfo", "EventInfo", "Input event information"}
 
Gaudi::Property< bool > m_refitPV {this, "RefitPV", false}
 
Gaudi::Property< int > m_PV_max {this, "MaxPVrefit", 1}
 
Gaudi::Property< int > m_DoVertexType {this, "DoVertexType", 1}
 
Gaudi::Property< unsigned int > m_PV_minNTracks {this, "MinNTracksInPV", 0}
 
Gaudi::Property< bool > m_do3d {this, "Do3d" , false}
 
Gaudi::Property< bool > m_checkCollections {this, "CheckCollections", false}
 
SG::ReadHandleKeyArray< xAOD::VertexContainerm_CollectionsToCheck {this, "CheckVertexContainers", {}}
 
SG::ReadHandleKey< xAOD::VertexContainerm_pvContainerKey {this,"PVContainerName", "PrimaryVertices"}
 
SG::WriteHandleKey< xAOD::VertexContainerm_refContainerKey {this, "RefPVContainerName","RefittedPrimaryVertices" }
 
SG::WriteHandleKey< xAOD::VertexContainerm_outContainerKey {this, "OutputVtxContainerName", "OniaCandidates"}
 

Detailed Description

Definition at line 27 of file Reco_mumu.h.

Constructor & Destructor Documentation

◆ Reco_mumu()

DerivationFramework::Reco_mumu::Reco_mumu ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 22 of file Reco_mumu.cxx.

24  :
25  base_class(t,n,p) {
26  }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::Reco_mumu::addBranches ( ) const
override

Definition at line 58 of file Reco_mumu.cxx.

59  {
60  bool callJpsiFinder = true;
61  const EventContext& ctx = Gaudi::Hive::currentContext();
62  if(m_checkCollections) {
63  for( SG::ReadHandle<xAOD::VertexContainer> vertContainer : m_CollectionsToCheck.makeHandles(ctx)){
64  if (!vertContainer.isValid()){
65  ATH_MSG_FATAL("Failed to retrieve "<<vertContainer.key());
66  return StatusCode::FAILURE;
67  }
68  if(vertContainer->size() == 0) {
69  callJpsiFinder = false;
70  ATH_MSG_DEBUG("Container VertexContainer (" << vertContainer.key() << ") is empty");
71  break;//No point checking other containers
72  }
73  }
74  }
75 
76  // Jpsi container and its auxilliary store
77  std::unique_ptr<xAOD::VertexContainer> vtxContainer = std::make_unique<xAOD::VertexContainer>();
78  std::unique_ptr<xAOD::VertexAuxContainer> vtxAuxContainer = std::make_unique<xAOD::VertexAuxContainer>();
79  vtxContainer->setStore(vtxAuxContainer.get());
80 
81  std::unique_ptr<xAOD::VertexContainer> refPvContainer =std::make_unique<xAOD::VertexContainer>();
82  std::unique_ptr<xAOD::VertexAuxContainer> refPvAuxContainer = std::make_unique<xAOD::VertexAuxContainer>();
83  refPvContainer->setStore(refPvAuxContainer.get());
84 
85 
86  if(callJpsiFinder) {
87  //----------------------------------------------------
88  // call Jpsi finder
89  //----------------------------------------------------
90  ATH_CHECK(m_jpsiFinder->performSearch(ctx, *vtxContainer));
91 
92  //----------------------------------------------------
93  // retrieve primary vertices
94  //----------------------------------------------------
96  if (!pvContainer.isValid()){
97  ATH_MSG_FATAL("Failed to retrive "<<m_pvContainerKey.fullKey());
98  return StatusCode::FAILURE;
99  }
100  //----------------------------------------------------
101  // Try to retrieve refitted primary vertices
102  //----------------------------------------------------
103 
104  // Give the helper class the ptr to v0tools and beamSpotsSvc to use
106  if(not evt.isValid()) ATH_MSG_ERROR("Cannot Retrieve " << m_eventInfo_key.key() );
107 
108  // Give the helper class the ptr to v0tools and beamSpotsSvc to use
109  BPhysPVTools helper(&(*m_v0Tools), evt.cptr());
110  helper.SetMinNTracksInPV(m_PV_minNTracks);
111  helper.SetSave3d(m_do3d);
112 
113  if(m_refitPV && vtxContainer->size()){
114  ATH_CHECK(helper.FillCandwithRefittedVertices(vtxContainer.get(), pvContainer.cptr(), refPvContainer.get(), &(*m_pvRefitter) , m_PV_max, m_DoVertexType));
115  }else if (!m_refitPV && vtxContainer->size()){
116  ATH_CHECK(helper.FillCandExistingVertices(vtxContainer.get(), pvContainer.cptr(), m_DoVertexType));
117  }
118  }
119  //----------------------------------------------------
120  // save in the StoreGate
121  //----------------------------------------------------
123  ATH_CHECK(out_handle.record(std::move(vtxContainer), std::move(vtxAuxContainer)));
124  if(m_refitPV) {
126  ATH_CHECK(refitHandle.record(std::move(refPvContainer), std::move(refPvAuxContainer)));
127  }
128 
129  return StatusCode::SUCCESS;
130  }

◆ initialize()

StatusCode DerivationFramework::Reco_mumu::initialize ( )
override

Definition at line 30 of file Reco_mumu.cxx.

31  {
32 
33  ATH_MSG_DEBUG("in initialize()");
34 
35  // retrieve V0 tools
36  CHECK( m_v0Tools.retrieve() );
37 
38  // get the JpsiFinder tool
39  CHECK( m_jpsiFinder.retrieve() );
40 
41  // get the PrimaryVertexRefitter tool
42  CHECK( m_pvRefitter.retrieve() );
43 
44  // Get the beam spot service
46 
47  ATH_CHECK(m_CollectionsToCheck.initialize());
48  ATH_CHECK(m_pvContainerKey.initialize());
49  ATH_CHECK(m_outContainerKey.initialize());
51  return StatusCode::SUCCESS;
52  }

Member Data Documentation

◆ m_checkCollections

Gaudi::Property<bool> DerivationFramework::Reco_mumu::m_checkCollections {this, "CheckCollections", false}
private

Definition at line 51 of file Reco_mumu.h.

◆ m_CollectionsToCheck

SG::ReadHandleKeyArray<xAOD::VertexContainer> DerivationFramework::Reco_mumu::m_CollectionsToCheck {this, "CheckVertexContainers", {}}
private

Definition at line 53 of file Reco_mumu.h.

◆ m_do3d

Gaudi::Property<bool> DerivationFramework::Reco_mumu::m_do3d {this, "Do3d" , false}
private

Definition at line 50 of file Reco_mumu.h.

◆ m_DoVertexType

Gaudi::Property<int> DerivationFramework::Reco_mumu::m_DoVertexType {this, "DoVertexType", 1}
private

Definition at line 48 of file Reco_mumu.h.

◆ m_eventInfo_key

SG::ReadHandleKey<xAOD::EventInfo> DerivationFramework::Reco_mumu::m_eventInfo_key {this, "EventInfo", "EventInfo", "Input event information"}
private

Definition at line 41 of file Reco_mumu.h.

◆ m_jpsiFinder

ToolHandle<Analysis::ICandidateSearch> DerivationFramework::Reco_mumu::m_jpsiFinder {this,"JpsiFinder", "Analysis::JpsiFinder"}
private

Definition at line 39 of file Reco_mumu.h.

◆ m_outContainerKey

SG::WriteHandleKey<xAOD::VertexContainer> DerivationFramework::Reco_mumu::m_outContainerKey {this, "OutputVtxContainerName", "OniaCandidates"}
private

Definition at line 57 of file Reco_mumu.h.

◆ m_PV_max

Gaudi::Property<int> DerivationFramework::Reco_mumu::m_PV_max {this, "MaxPVrefit", 1}
private

Definition at line 47 of file Reco_mumu.h.

◆ m_PV_minNTracks

Gaudi::Property<unsigned int> DerivationFramework::Reco_mumu::m_PV_minNTracks {this, "MinNTracksInPV", 0}
private

Definition at line 49 of file Reco_mumu.h.

◆ m_pvContainerKey

SG::ReadHandleKey<xAOD::VertexContainer> DerivationFramework::Reco_mumu::m_pvContainerKey {this,"PVContainerName", "PrimaryVertices"}
private

Definition at line 54 of file Reco_mumu.h.

◆ m_pvRefitter

ToolHandle<Analysis::PrimaryVertexRefitter> DerivationFramework::Reco_mumu::m_pvRefitter {this, "PVRefitter", "Analysis::PrimaryVertexRefitter"}
private

Definition at line 40 of file Reco_mumu.h.

◆ m_refContainerKey

SG::WriteHandleKey<xAOD::VertexContainer> DerivationFramework::Reco_mumu::m_refContainerKey {this, "RefPVContainerName","RefittedPrimaryVertices" }
private

Definition at line 56 of file Reco_mumu.h.

◆ m_refitPV

Gaudi::Property<bool> DerivationFramework::Reco_mumu::m_refitPV {this, "RefitPV", false}
private

Definition at line 46 of file Reco_mumu.h.

◆ m_v0Tools

ToolHandle<Trk::V0Tools> DerivationFramework::Reco_mumu::m_v0Tools {this, "V0Tools", "Trk::V0Tools"}
private

tools

Definition at line 38 of file Reco_mumu.h.


The documentation for this class was generated from the following files:
DerivationFramework::Reco_mumu::m_do3d
Gaudi::Property< bool > m_do3d
Definition: Reco_mumu.h:50
DerivationFramework::Reco_mumu::m_eventInfo_key
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo_key
Definition: Reco_mumu.h:41
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DerivationFramework::Reco_mumu::m_pvRefitter
ToolHandle< Analysis::PrimaryVertexRefitter > m_pvRefitter
Definition: Reco_mumu.h:40
DerivationFramework::Reco_mumu::m_DoVertexType
Gaudi::Property< int > m_DoVertexType
Definition: Reco_mumu.h:48
DerivationFramework::Reco_mumu::m_checkCollections
Gaudi::Property< bool > m_checkCollections
Definition: Reco_mumu.h:51
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
DerivationFramework::Reco_mumu::m_refitPV
Gaudi::Property< bool > m_refitPV
Definition: Reco_mumu.h:46
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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
DerivationFramework::Reco_mumu::m_refContainerKey
SG::WriteHandleKey< xAOD::VertexContainer > m_refContainerKey
Definition: Reco_mumu.h:56
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
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
DerivationFramework::Reco_mumu::m_pvContainerKey
SG::ReadHandleKey< xAOD::VertexContainer > m_pvContainerKey
Definition: Reco_mumu.h:54
DerivationFramework::Reco_mumu::m_outContainerKey
SG::WriteHandleKey< xAOD::VertexContainer > m_outContainerKey
Definition: Reco_mumu.h:57
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
DerivationFramework::Reco_mumu::m_PV_max
Gaudi::Property< int > m_PV_max
Definition: Reco_mumu.h:47
DerivationFramework::Reco_mumu::m_CollectionsToCheck
SG::ReadHandleKeyArray< xAOD::VertexContainer > m_CollectionsToCheck
Definition: Reco_mumu.h:53
DerivationFramework::Reco_mumu::m_v0Tools
ToolHandle< Trk::V0Tools > m_v0Tools
tools
Definition: Reco_mumu.h:38
DerivationFramework::Reco_mumu::m_PV_minNTracks
Gaudi::Property< unsigned int > m_PV_minNTracks
Definition: Reco_mumu.h:49
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DerivationFramework::Reco_mumu::m_jpsiFinder
ToolHandle< Analysis::ICandidateSearch > m_jpsiFinder
Definition: Reco_mumu.h:39