 |
ATLAS Offline Software
|
#include <MuSAVtxJPsiValidationAlg.h>
|
| MuSAVtxJPsiValidationAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
const xAOD::Muon * | findMuonFromTrack (const xAOD::TrackParticle *tp, const xAOD::MuonContainer *muons) |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T, V, H > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
SG::ReadHandleKey< xAOD::MuonContainer > | m_muonContainer { this, "MuonContainer", "Muons", "input muon collection" } |
|
SG::ReadHandleKey< xAOD::EventInfo > | m_eventInfo { this, "EventInfo", "EventInfo", "event info" } |
|
SG::WriteHandleKey< xAOD::MuonContainer > | m_JPsiMuonContainer { this, "JPsiMuonContainer", "JPsiMuons", "output J/Psi muon collection" } |
|
SG::WriteHandleKey< xAOD::VertexContainer > | m_JPsiVertexContainer { this, "JPsiVertexContainer", "JPsiVertices", "output J/Psi vertex collection" } |
|
SG::WriteHandleKey< xAOD::TrackParticleContainer > | m_JPsiTrackParticleContainer { this, "JPsiTrackParticleContainer", "JPsiVerticesTracks", "output J/Psi track collection" } |
|
ToolHandle< Analysis::JpsiFinder > | m_JPsiFinderTool { this, "JpsiFinderTool", "Analysis::JpsiFinder/JpsiFinder", "find J/Psi -> mumu" } |
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 18 of file MuSAVtxJPsiValidationAlg.h.
◆ StoreGateSvc_t
◆ MuSAVtxJPsiValidationAlg()
Rec::MuSAVtxJPsiValidationAlg::MuSAVtxJPsiValidationAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode Rec::MuSAVtxJPsiValidationAlg::execute |
( |
| ) |
|
|
overridevirtual |
Definition at line 63 of file MuSAVtxJPsiValidationAlg.cxx.
65 const EventContext& ctx = Gaudi::Hive::currentContext();
74 ATH_CHECK(JPsiMuonContainer.record(std::make_unique<xAOD::MuonContainer>(), std::make_unique<xAOD::MuonAuxContainer>()));
77 ATH_CHECK(JPsiVertexContainer.record(std::make_unique<xAOD::VertexContainer>(), std::make_unique<xAOD::VertexAuxContainer>()));
80 ATH_CHECK(JPsiTrackParticleContainer.record(std::make_unique<xAOD::TrackParticleContainer>(), std::make_unique<xAOD::TrackParticleAuxContainer>()));
83 auto jpsiVtxs = std::make_unique<xAOD::VertexContainer>();
84 auto jpsiAux = std::make_unique<xAOD::VertexAuxContainer>();
85 jpsiVtxs->setStore(jpsiAux.get());
88 if (jpsiVtxs->empty()) {
90 return StatusCode::SUCCESS;
92 ATH_MSG_DEBUG(
"Found " << jpsiVtxs->size() <<
" J/Psi candidates");
96 const auto&
links = vtx->trackParticleLinks();
97 if (
links.size() == 2) {
104 ATH_MSG_WARNING(
"No muons found for J/Psi vertex with index " << vtx->index());
106 }
else if (!mu1 || !mu2) {
107 ATH_MSG_WARNING(
"Only one muon found for J/Psi vertex with index " << vtx->index());
109 ATH_MSG_DEBUG(
"Found J/Psi vertex with index " << vtx->index() <<
" and muons: " << mu1->
index() <<
", " << mu2->
index());
112 if (mu1) JPsiMuonContainer->push_back(
new xAOD::Muon(*mu1));
113 if (mu2) JPsiMuonContainer->push_back(
new xAOD::Muon(*mu2));
119 JPsiVertexContainer->push_back(newVtx);
128 for (
const auto& link : vtx->trackParticleLinks()) {
129 if (!link.isValid())
continue;
133 JPsiTrackParticleContainer->push_back(newTrack);
139 constexpr
double muonMass = 105.658;
140 TLorentzVector sumP4_muon, sumP4_electron, sumP4_selected;
141 std::vector<const xAOD::TrackParticle*> vtxTracks;
147 if (!
track)
continue;
153 TLorentzVector p4_muon, p4_electron;
154 p4_muon.SetPtEtaPhiM(
pt,
eta,
phi, muonMass);
157 sumP4_muon += p4_muon;
158 sumP4_electron += p4_electron;
159 sumP4_selected += p4_muon;
161 vtxCharge +=
track->charge();
162 vtxTracks.push_back(
track);
167 if (vtxTracks.size() == 2) {
168 float dEta = vtxTracks[0]->eta() - vtxTracks[1]->eta();
169 float dPhi = std::abs(vtxTracks[0]->
phi() - vtxTracks[1]->
phi());
174 vtx_pxAcc(*newVtx) = sumP4_muon.Px();
175 vtx_pyAcc(*newVtx) = sumP4_muon.Py();
176 vtx_pzAcc(*newVtx) = sumP4_muon.Pz();
177 vtx_massAcc(*newVtx) = sumP4_muon.M();
178 vtx_chargeAcc(*newVtx) = vtxCharge;
179 minOpAngAcc(*newVtx) = vtxDeltaR;
180 chi2_coreAcc(*newVtx) = vtx->chiSquared();
181 ndof_coreAcc(*newVtx) = vtx->numberDoF();
182 chi2_assocAcc(*newVtx) = vtx->chiSquared();
183 ndof_assocAcc(*newVtx) = vtx->numberDoF();
184 massAcc(*newVtx) = sumP4_muon.M();
185 mass_eAcc(*newVtx) = sumP4_electron.M();
186 mass_selectedTracksAcc(*newVtx) = sumP4_selected.M();
187 num_trksAcc(*newVtx) =
links.size();
188 num_selectedTracksAcc(*newVtx) =
links.size();
189 num_associatedTracksAcc(*newVtx) =
links.size();
190 dCloseVrtAcc(*newVtx) = 0;
193 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ findMuonFromTrack()
Definition at line 196 of file MuSAVtxJPsiValidationAlg.cxx.
198 if (
mu->trackParticle(xAOD::Muon::CombinedTrackParticle) ==
tp)
return mu;
199 if (
mu->trackParticle(xAOD::Muon::InnerDetectorTrackParticle) ==
tp)
return mu;
◆ initialize()
StatusCode Rec::MuSAVtxJPsiValidationAlg::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_detStore
◆ m_eventInfo
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_JPsiFinderTool
◆ m_JPsiMuonContainer
◆ m_JPsiTrackParticleContainer
◆ m_JPsiVertexContainer
◆ m_muonContainer
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
xAOD::MuonContainer * muonContainer
void setPosition(const Amg::Vector3D &position)
Sets the 3-position.
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
Scalar phi() const
phi method
Vertex_v1 Vertex
Define the latest version of the vertex class.
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_JPsiTrackParticleContainer
Scalar eta() const
pseudorapidity method
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
SG::WriteHandleKey< xAOD::VertexContainer > m_JPsiVertexContainer
void setCovariance(const std::vector< float > &value)
Sets the covariance matrix as a simple vector of values.
SG::ReadHandleKey< xAOD::MuonContainer > m_muonContainer
virtual void setOwner(IDataHandleHolder *o)=0
TrackParticle_v1 TrackParticle
Reference the current persistent version:
void setVertexType(VxType::VertexType vType)
Set the type of the vertex.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
void addTrackAtVertex(const ElementLink< TrackParticleContainer > &tr, float weight=1.0)
Add a new track to the vertex.
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, float &out)
ToolHandle< Analysis::JpsiFinder > m_JPsiFinderTool
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
size_t index() const
Return the index of this element within its container.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
constexpr double mass_electron
void makePrivateStore()
Create a new (empty) private store for this object.
DataObjIDColl m_extendedExtraObjects
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, float &out)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthAlgorithm()
Default constructor:
Class describing a TrackParticle.
const xAOD::Muon * findMuonFromTrack(const xAOD::TrackParticle *tp, const xAOD::MuonContainer *muons)
SG::WriteHandleKey< xAOD::MuonContainer > m_JPsiMuonContainer