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

#include <Bmumu_reco_mumu.h>

Inheritance diagram for DerivationFramework::Bmumu_reco_mumu:
Collaboration diagram for DerivationFramework::Bmumu_reco_mumu:

Public Member Functions

 Bmumu_reco_mumu (const std::string &t, const std::string &n, const IInterface *p)
 
StatusCode initialize () override
 
virtual 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"}
 
SG::ReadHandleKey< xAOD::VertexContainerm_pvContainerKey {this, "PVContainerName", "PrimaryVertices"}
 job options More...
 
SG::WriteHandleKey< xAOD::VertexContainerm_refContainerKey {this, "RefPVContainerName" , "RefittedPrimaryVertices"}
 
SG::WriteHandleKey< xAOD::VertexContainerm_outVtxContainerKey {this, "OutputVtxContainerName" , "OniaCandidates"}
 
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}
 

Detailed Description

Definition at line 42 of file Bmumu_reco_mumu.h.

Constructor & Destructor Documentation

◆ Bmumu_reco_mumu()

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

Definition at line 32 of file Bmumu_reco_mumu.cxx.

34  :
35  base_class(t,n,p){
36 
37  }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::Bmumu_reco_mumu::addBranches ( ) const
overridevirtual

Definition at line 65 of file Bmumu_reco_mumu.cxx.

65  {
66 
67  const EventContext& ctx = Gaudi::Hive::currentContext();
68  // Jpsi container and its auxilliary store
69  std::unique_ptr<xAOD::VertexContainer> vtxContainer = std::make_unique<xAOD::VertexContainer>();
70  std::unique_ptr<xAOD::VertexAuxContainer> vtxAuxContainer = std::make_unique<xAOD::VertexAuxContainer>();
71  vtxContainer->setStore(vtxAuxContainer.get());
72 
73  //----------------------------------------------------
74  // call Jpsi finder
75  //----------------------------------------------------
76  if( !m_jpsiFinder->performSearch(ctx, *vtxContainer).isSuccess() ) {
77  ATH_MSG_FATAL("Jpsi finder (" << m_jpsiFinder << ") failed.");
78  return StatusCode::FAILURE;
79  }
80 
81  //----------------------------------------------------
82  // retrieve primary vertices
83  //----------------------------------------------------
85  if (!pvContainer.isValid()){
86  ATH_MSG_FATAL("Failed to retrieve "<<m_pvContainerKey);
87  return StatusCode::FAILURE;
88  }
89 
90 
91  //----------------------------------------------------
92  // Try to retrieve refitted primary vertices
93  //----------------------------------------------------
94  std::unique_ptr<xAOD::VertexContainer> refPvContainer = std::make_unique<xAOD::VertexContainer>();
95  std::unique_ptr<xAOD::VertexAuxContainer> refPvAuxContainer = std::make_unique<xAOD::VertexAuxContainer>();
96  refPvContainer->setStore(refPvAuxContainer.get());
97 
98 
99  // Give the helper class the ptr to v0tools and beamSpotsSvc to use
101  if(!evt.isValid()) {
102  ATH_MSG_ERROR("Cannot Retrieve " << m_eventInfo_key.key() );
103  return StatusCode::FAILURE;
104  }
105  BPhysPVTools helper(&(*m_v0Tools), evt.cptr());
106  helper.SetMinNTracksInPV(m_PV_minNTracks);
107  helper.SetSave3d(m_do3d);
108 
109  if(m_refitPV && vtxContainer->size()){
110  ATH_CHECK(helper.FillCandwithRefittedVertices(vtxContainer.get(), pvContainer.cptr(), refPvContainer.get(), &(*m_pvRefitter) , m_PV_max, m_DoVertexType));
111  }else if (!m_refitPV && vtxContainer->size() >0){
112  ATH_CHECK(helper.FillCandExistingVertices(vtxContainer.get(), pvContainer.cptr(), m_DoVertexType));
113  }
114 
115 
116  //----------------------------------------------------
117  // save in the StoreGate
118  //----------------------------------------------------
120  auto nVertices = vtxContainer->size();
121  ATH_CHECK(outputVertices.record(std::move(vtxContainer), std::move(vtxAuxContainer)));
122 
123  if(m_refitPV) {
125  ATH_CHECK(refitVertices.record(std::move(refPvContainer), std::move(refPvAuxContainer)));
126  }
127 
128  // add counter for number of events seen
129  addEvent("dimuEvents");
130  // add counter for the number of events with >= 1 reco'd vertices
131  if ( nVertices > 0 ) {
132  addEvent("dimuWithVertexCand");
133  }
134  // add counter for the number of vertices
135  addToCounter("dimuNumVertices", nVertices);
136 
137  return StatusCode::SUCCESS;
138  }

◆ initialize()

StatusCode DerivationFramework::Bmumu_reco_mumu::initialize ( )
override

Definition at line 41 of file Bmumu_reco_mumu.cxx.

42  {
43 
44  ATH_MSG_DEBUG("in initialize()");
45 
46  // retrieve V0 tools
47  CHECK( m_v0Tools.retrieve() );
48 
49  // get the JpsiFinder tool
50  CHECK( m_jpsiFinder.retrieve() );
51 
52  // get the PrimaryVertexRefitter tool
53  CHECK( m_pvRefitter.retrieve() );
54 
55  // Get the beam spot service
57  ATH_CHECK(m_pvContainerKey.initialize());
59  ATH_CHECK(m_outVtxContainerKey.initialize());
60 
61  return StatusCode::SUCCESS;
62 
63  }

Member Data Documentation

◆ m_do3d

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

Definition at line 74 of file Bmumu_reco_mumu.h.

◆ m_DoVertexType

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

Definition at line 71 of file Bmumu_reco_mumu.h.

◆ m_eventInfo_key

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

Definition at line 58 of file Bmumu_reco_mumu.h.

◆ m_jpsiFinder

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

Definition at line 56 of file Bmumu_reco_mumu.h.

◆ m_outVtxContainerKey

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

Definition at line 67 of file Bmumu_reco_mumu.h.

◆ m_PV_max

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

Definition at line 70 of file Bmumu_reco_mumu.h.

◆ m_PV_minNTracks

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

Definition at line 73 of file Bmumu_reco_mumu.h.

◆ m_pvContainerKey

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

job options

Definition at line 63 of file Bmumu_reco_mumu.h.

◆ m_pvRefitter

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

Definition at line 57 of file Bmumu_reco_mumu.h.

◆ m_refContainerKey

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

Definition at line 65 of file Bmumu_reco_mumu.h.

◆ m_refitPV

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

Definition at line 69 of file Bmumu_reco_mumu.h.

◆ m_v0Tools

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

tools

Definition at line 55 of file Bmumu_reco_mumu.h.


The documentation for this class was generated from the following files:
DerivationFramework::Bmumu_reco_mumu::m_refitPV
Gaudi::Property< bool > m_refitPV
Definition: Bmumu_reco_mumu.h:69
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
NSWL1::nVertices
int nVertices(const Polygon &p)
Definition: GeoUtils.cxx:35
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
DerivationFramework::Bmumu_reco_mumu::m_DoVertexType
Gaudi::Property< int > m_DoVertexType
Definition: Bmumu_reco_mumu.h:71
DerivationFramework::Bmumu_reco_mumu::m_jpsiFinder
ToolHandle< Analysis::ICandidateSearch > m_jpsiFinder
Definition: Bmumu_reco_mumu.h:56
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
DerivationFramework::Bmumu_reco_mumu::m_PV_minNTracks
Gaudi::Property< unsigned int > m_PV_minNTracks
Definition: Bmumu_reco_mumu.h:73
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
DerivationFramework::Bmumu_reco_mumu::m_do3d
Gaudi::Property< bool > m_do3d
Definition: Bmumu_reco_mumu.h:74
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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::Bmumu_reco_mumu::m_pvContainerKey
SG::ReadHandleKey< xAOD::VertexContainer > m_pvContainerKey
job options
Definition: Bmumu_reco_mumu.h:63
DerivationFramework::Bmumu_reco_mumu::m_PV_max
Gaudi::Property< int > m_PV_max
Definition: Bmumu_reco_mumu.h:70
DerivationFramework::Bmumu_reco_mumu::m_eventInfo_key
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo_key
Definition: Bmumu_reco_mumu.h:58
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
DerivationFramework::Bmumu_reco_mumu::m_v0Tools
ToolHandle< Trk::V0Tools > m_v0Tools
tools
Definition: Bmumu_reco_mumu.h:55
DerivationFramework::Bmumu_reco_mumu::m_refContainerKey
SG::WriteHandleKey< xAOD::VertexContainer > m_refContainerKey
Definition: Bmumu_reco_mumu.h:65
DerivationFramework::Bmumu_reco_mumu::m_outVtxContainerKey
SG::WriteHandleKey< xAOD::VertexContainer > m_outVtxContainerKey
Definition: Bmumu_reco_mumu.h:67
DerivationFramework::Bmumu_reco_mumu::m_pvRefitter
ToolHandle< Analysis::PrimaryVertexRefitter > m_pvRefitter
Definition: Bmumu_reco_mumu.h:57
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.