 |
ATLAS Offline Software
|
#include <FourMuonTool.h>
|
| | FourMuonTool (const std::string &t, const std::string &n, const IInterface *p) |
| |
| | ~FourMuonTool () |
| |
| StatusCode | initialize () |
| |
| StatusCode | performSearch (xAOD::VertexContainer *pairVxContainer, xAOD::VertexContainer *quadVxContainer, bool &acceptEvent, const EventContext &ctx) const |
| |
| xAOD::Vertex * | fit (const std::vector< const xAOD::TrackParticle * > &, const xAOD::TrackParticleContainer *importedTrackCollection, const Amg::Vector3D &beamSpot) const |
| |
| 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 | sysInitialize () override |
| | Perform system initialization for an algorithm. 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 |
| |
|
| 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...
|
| |
|
| Gaudi::Property< double > | m_ptCut {this, "ptCut", 0.0} |
| |
| Gaudi::Property< double > | m_etaCut {this, "etaCut", 0.0} |
| |
| Gaudi::Property< bool > | m_useV0Fitter {this, "useV0Fitter", false} |
| |
| SG::ReadHandleKey< xAOD::MuonContainer > | m_muonCollectionKey {this, "muonCollectionKey", "Muons"} |
| |
| SG::ReadHandleKey< xAOD::TrackParticleContainer > | m_TrkParticleCollection {this, "TrackParticleCollection", "TrackParticleCandidate"} |
| |
| PublicToolHandle< Trk::IVertexFitter > | m_iVertexFitter {this, "TrkVertexFitterTool", "Trk::TrkVKalVrtFitter"} |
| |
| PublicToolHandle< Trk::IVertexFitter > | m_iV0VertexFitter {this, "V0VertexFitterTool", "Trk::V0VertexFitter"} |
| |
| PublicToolHandle< Trk::ITrackSelectorTool > | m_trkSelector {this, "TrackSelectorTool", "InDet::TrackSelectorTool"} |
| |
| SG::ReadHandleKey< xAOD::EventInfo > | m_eventInfo_key {this, "EventInfo", "EventInfo", "Input event information"} |
| |
| SG::WriteDecorHandleKey< xAOD::MuonContainer > | m_muonIndex {this, "muonIndexDec", m_muonCollectionKey, "BPHY4MuonIndex"} |
| |
| StoreGateSvc_t | m_evtStore |
| | Pointer to StoreGate (event store by default) More...
|
| |
| StoreGateSvc_t | m_detStore |
| | Pointer to StoreGate (detector store by default) More...
|
| |
| std::vector< SG::VarHandleKeyArray * > | m_vhka |
| |
| bool | m_varHandleArraysDeclared |
| |
Definition at line 132 of file FourMuonTool.h.
◆ StoreGateSvc_t
◆ FourMuonTool()
| DerivationFramework::FourMuonTool::FourMuonTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~FourMuonTool()
| DerivationFramework::FourMuonTool::~FourMuonTool |
( |
| ) |
|
◆ buildCombinations()
| void DerivationFramework::FourMuonTool::buildCombinations |
( |
const std::vector< const xAOD::Muon * > & |
muonsIn, |
|
|
std::vector< Combination > & |
pairs, |
|
|
std::vector< Combination > & |
quadruplets, |
|
|
unsigned int |
nSelectedMuons |
|
) |
| |
|
static |
Definition at line 304 of file FourMuonTool.cxx.
309 std::vector<std::vector<unsigned int> > quadrupletIndices =
getQuadIndices(nSelectedMuons);
310 std::vector<std::pair<unsigned int, unsigned int> > pairIndices =
getPairIndices(nSelectedMuons);
313 std::vector<std::vector<unsigned int> >
::iterator quadItr;
314 for (quadItr=quadrupletIndices.begin(); quadItr!=quadrupletIndices.end(); ++quadItr) {
315 const std::vector<unsigned int> &
quad = (*quadItr);
316 std::vector<const xAOD::Muon*> theMuons = {muonsIn[
quad[0]],muonsIn[
quad[1]],muonsIn[
quad[2]],muonsIn[
quad[3]]};
319 tmpQuad.muons = std::move(theMuons);
320 tmpQuad.quadIndices =
quad;
321 quadruplets.emplace_back(std::move(tmpQuad));
323 if (quadruplets.size() == 0)
return;
326 std::vector<std::pair<unsigned int, unsigned int> >
::iterator pairItr;
327 for (pairItr=pairIndices.begin(); pairItr!=pairIndices.end(); ++pairItr) {
328 std::pair<unsigned int, unsigned int> pair = (*pairItr);
330 std::vector<const xAOD::Muon*> theMuons = {muonsIn[pair.first],muonsIn[pair.second]};
331 tmpPair.muons = std::move(theMuons);
332 tmpPair.pairIndices = pair;
333 pairs.emplace_back(std::move(tmpPair));
◆ combinatorics()
| void DerivationFramework::FourMuonTool::combinatorics |
( |
unsigned int |
offset, |
|
|
unsigned int |
k, |
|
|
std::vector< unsigned int > & |
combination, |
|
|
std::vector< unsigned int > & |
mainList, |
|
|
std::vector< std::vector< unsigned int > > & |
allCombinations |
|
) |
| |
|
static |
Definition at line 262 of file FourMuonTool.cxx.
268 allCombinations.push_back(combination);
272 for (
unsigned int i=
offset;
i<=mainList.size()-
k; ++
i) {
273 combination.push_back(mainList[
i]);
275 combination.pop_back();
◆ 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]
◆ 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
◆ fit()
Definition at line 206 of file FourMuonTool.cxx.
214 if(concreteVertexFitter == 0) {
215 ATH_MSG_FATAL(
"The vertex fitter passed is not a V0 Vertex Fitter");
229 return myVxCandidate;
◆ getPairIndices()
| std::vector< std::pair< unsigned int, unsigned int > > DerivationFramework::FourMuonTool::getPairIndices |
( |
unsigned int |
length | ) |
|
|
static |
Definition at line 284 of file FourMuonTool.cxx.
286 std::vector<std::pair<unsigned int, unsigned int> > uniquePairs;
287 std::vector<std::vector<unsigned int> > doublets =
mFromN(2,
length);
288 for (std::vector<std::vector<unsigned int> >::
iterator it=doublets.begin();
it!=doublets.end(); ++
it) {
289 std::pair<unsigned int, unsigned int> tmpPair = std::make_pair((*it).at(0),(*it).at(1));
290 uniquePairs.push_back(tmpPair);
◆ getQuadIndices()
| std::vector< std::vector< unsigned int > > DerivationFramework::FourMuonTool::getQuadIndices |
( |
unsigned int |
length | ) |
|
|
static |
◆ initialize()
| StatusCode DerivationFramework::FourMuonTool::initialize |
( |
| ) |
|
◆ 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.
◆ mFromN()
| std::vector< std::vector< unsigned int > > DerivationFramework::FourMuonTool::mFromN |
( |
unsigned int |
m, |
|
|
unsigned int |
n |
|
) |
| |
|
static |
Definition at line 252 of file FourMuonTool.cxx.
254 std::vector<std::vector<unsigned int> > allCombinations;
255 std::vector<unsigned int> mainList;
256 std::vector<unsigned int> combination;
257 for (
unsigned int i=0;
i<
N; ++
i) mainList.push_back(
i);
259 return allCombinations;
◆ 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.
◆ passesQuadSelection()
| bool DerivationFramework::FourMuonTool::passesQuadSelection |
( |
const std::vector< const xAOD::Muon * > & |
muonsIn | ) |
|
|
static |
◆ performSearch()
Definition at line 66 of file FourMuonTool.cxx.
73 ATH_CHECK(importedMuonCollection.isValid());
74 ATH_MSG_DEBUG(
"Muon container size "<<importedMuonCollection->size());
78 ATH_CHECK(importedTrackCollection.isValid());
79 ATH_MSG_DEBUG(
"ID TrackParticle container size "<< importedTrackCollection->size());
82 std::vector<const xAOD::Muon*> theMuonsAfterSelection;
84 unsigned int nCombMuons = 0;
85 unsigned int nSegmentTaggedMuons = 0;
87 for (
const auto *
muon : *importedMuonCollection) {
88 if ( !
muon )
continue;
89 muonDecorator(*
muon) = -1;
91 if (!
muon->inDetTrackParticleLink().isValid())
continue;
92 auto& link =
muon->inDetTrackParticleLink();
94 if ( !muonTrk )
continue;
97 if ( fabs(muonTrk->
pt())<
m_ptCut )
continue;
100 if (
muon->muonType() == xAOD::Muon::SegmentTagged ) ++nSegmentTaggedMuons;
101 theMuonsAfterSelection.push_back(
muon);
103 unsigned int nSelectedMuons = theMuonsAfterSelection.size();
104 ATH_MSG_DEBUG(
"Number of muons after selection: " << nSelectedMuons);
106 ATH_MSG_DEBUG(
"and " << nSegmentTaggedMuons <<
" are segment tagged");
107 if ( (nSelectedMuons < 4) || (nCombMuons < 1) ) {
109 return StatusCode::SUCCESS;
119 return b->pt() < a->pt();
123 unsigned int muonIndex(0);
124 for (
auto selMuon : theMuonsAfterSelection) {
125 muonDecorator(*selMuon) = muonIndex;
130 std::vector<Combination> quadruplets;
131 std::vector<Combination>
pairs;
133 if (quadruplets.size()==0) {
135 return StatusCode::SUCCESS;
146 std::vector<const xAOD::TrackParticle*> theTracks = (*pairItr).trackParticles(
"pair1");
148 if (pairVxCandidate) {
150 indexDecorator(*pairVxCandidate) = (*pairItr).combinationIndices();
151 chargeDecorator(*pairVxCandidate) = (*pairItr).combinationCharges();
155 std::vector<const xAOD::Muon*> theStoredMuons;
156 theStoredMuons = (*pairItr).muons;
157 helper.setMuons(theStoredMuons,importedMuonCollection.get());
159 pairVxContainer->
push_back(pairVxCandidate);
160 ATH_MSG_DEBUG(
"..... indices: " << (*pairItr).combinationIndices() <<
161 " charges: " << (*pairItr).combinationCharges() <<
172 std::vector<const xAOD::TrackParticle*> theDCTracks; theDCTracks.clear();
173 theDCTracks = (*quadItr).trackParticles(
"DC");
175 if (dcVxCandidate != 0) {
177 indexDecorator(*dcVxCandidate) = (*quadItr).combinationIndices();
178 chargeDecorator(*dcVxCandidate) = (*quadItr).combinationCharges();
184 const std::vector<const xAOD::Muon*> &theStoredMuons = (*quadItr).muons;
185 helper.setMuons(theStoredMuons,importedMuonCollection.get());
187 quadVxContainer->
push_back(dcVxCandidate);
188 ATH_MSG_DEBUG(
"..... indices: " << (*quadItr).combinationIndices() <<
189 " charges: " << (*quadItr).combinationCharges() <<
190 " chi2(DC): " << dcChi2);
197 return StatusCode::SUCCESS;;
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ 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_etaCut
| Gaudi::Property<double> DerivationFramework::FourMuonTool::m_etaCut {this, "etaCut", 0.0} |
|
private |
◆ m_eventInfo_key
◆ m_evtStore
◆ m_iV0VertexFitter
| PublicToolHandle< Trk::IVertexFitter > DerivationFramework::FourMuonTool::m_iV0VertexFitter {this, "V0VertexFitterTool", "Trk::V0VertexFitter"} |
|
private |
◆ m_iVertexFitter
◆ m_muonCollectionKey
◆ m_muonIndex
◆ m_ptCut
| Gaudi::Property<double> DerivationFramework::FourMuonTool::m_ptCut {this, "ptCut", 0.0} |
|
private |
◆ m_TrkParticleCollection
◆ m_trkSelector
| PublicToolHandle< Trk::ITrackSelectorTool > DerivationFramework::FourMuonTool::m_trkSelector {this, "TrackSelectorTool", "InDet::TrackSelectorTool"} |
|
private |
◆ m_useV0Fitter
| Gaudi::Property<bool> DerivationFramework::FourMuonTool::m_useV0Fitter {this, "useV0Fitter", false} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
StatusCode accept(const xAOD::Muon *mu)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const std::string & key() const
Return the StoreGate ID for the referenced object.
virtual void setOwner(IDataHandleHolder *o)=0
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Helper class to provide type-safe access to aux data.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Handle class for adding a decoration to an object.
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.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Eigen::Matrix< double, 3, 1 > Vector3D
virtual xAOD::Vertex * fit(const std::vector< const xAOD::TrackParticle * > &vectorTrk, const Amg::Vector3D &startingPoint) const override
Interface for xAOD::TrackParticle with Amg::Vector3D starting point.
float chiSquared() const
Returns the of the vertex fit as float.
Class describing a Vertex.
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthConfigFlags beamSpot(AthConfigFlags flags, str instanceName, str recoMode)
This class implements a vertex fitting algorithm optimised for V0 finding.
Class describing a TrackParticle.
size_type size() const noexcept
Returns the number of elements in the collection.