 |
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 303 of file FourMuonTool.cxx.
308 std::vector<std::vector<unsigned int> > quadrupletIndices =
getQuadIndices(nSelectedMuons);
309 std::vector<std::pair<unsigned int, unsigned int> > pairIndices =
getPairIndices(nSelectedMuons);
312 std::vector<std::vector<unsigned int> >
::iterator quadItr;
313 for (quadItr=quadrupletIndices.begin(); quadItr!=quadrupletIndices.end(); ++quadItr) {
314 const std::vector<unsigned int> &
quad = (*quadItr);
315 std::vector<const xAOD::Muon*> theMuons = {muonsIn[
quad[0]],muonsIn[
quad[1]],muonsIn[
quad[2]],muonsIn[
quad[3]]};
318 tmpQuad.muons = std::move(theMuons);
319 tmpQuad.quadIndices =
quad;
320 quadruplets.emplace_back(std::move(tmpQuad));
322 if (quadruplets.size() == 0)
return;
325 std::vector<std::pair<unsigned int, unsigned int> >
::iterator pairItr;
326 for (pairItr=pairIndices.begin(); pairItr!=pairIndices.end(); ++pairItr) {
327 std::pair<unsigned int, unsigned int> pair = (*pairItr);
329 std::vector<const xAOD::Muon*> theMuons = {muonsIn[pair.first],muonsIn[pair.second]};
330 tmpPair.muons = std::move(theMuons);
331 tmpPair.pairIndices = pair;
332 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 261 of file FourMuonTool.cxx.
267 allCombinations.push_back(combination);
271 for (
unsigned int i=
offset;
i<=mainList.size()-
k; ++
i) {
272 combination.push_back(mainList[
i]);
274 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 205 of file FourMuonTool.cxx.
213 if(concreteVertexFitter == 0) {
214 ATH_MSG_FATAL(
"The vertex fitter passed is not a V0 Vertex Fitter");
228 return myVxCandidate;
◆ getPairIndices()
| std::vector< std::pair< unsigned int, unsigned int > > DerivationFramework::FourMuonTool::getPairIndices |
( |
unsigned int |
length | ) |
|
|
static |
Definition at line 283 of file FourMuonTool.cxx.
285 std::vector<std::pair<unsigned int, unsigned int> > uniquePairs;
286 std::vector<std::vector<unsigned int> > doublets =
mFromN(2,
length);
287 for (std::vector<std::vector<unsigned int> >::
iterator it=doublets.begin();
it!=doublets.end(); ++
it) {
288 std::pair<unsigned int, unsigned int> tmpPair = std::make_pair((*it).at(0),(*it).at(1));
289 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 251 of file FourMuonTool.cxx.
253 std::vector<std::vector<unsigned int> > allCombinations;
254 std::vector<unsigned int> mainList;
255 std::vector<unsigned int> combination;
256 for (
unsigned int i=0;
i<
N; ++
i) mainList.push_back(
i);
258 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 65 of file FourMuonTool.cxx.
72 ATH_CHECK(importedMuonCollection.isValid());
73 ATH_MSG_DEBUG(
"Muon container size "<<importedMuonCollection->size());
77 ATH_CHECK(importedTrackCollection.isValid());
78 ATH_MSG_DEBUG(
"ID TrackParticle container size "<< importedTrackCollection->size());
81 std::vector<const xAOD::Muon*> theMuonsAfterSelection;
83 unsigned int nCombMuons = 0;
84 unsigned int nSegmentTaggedMuons = 0;
86 for (
const auto *
muon : *importedMuonCollection) {
87 if ( !
muon )
continue;
88 muonDecorator(*
muon) = -1;
90 if (!
muon->inDetTrackParticleLink().isValid())
continue;
91 auto& link =
muon->inDetTrackParticleLink();
93 if ( !muonTrk )
continue;
96 if ( fabs(muonTrk->
pt())<
m_ptCut )
continue;
99 if (
muon->muonType() == xAOD::Muon::SegmentTagged ) ++nSegmentTaggedMuons;
100 theMuonsAfterSelection.push_back(
muon);
102 unsigned int nSelectedMuons = theMuonsAfterSelection.size();
103 ATH_MSG_DEBUG(
"Number of muons after selection: " << nSelectedMuons);
105 ATH_MSG_DEBUG(
"and " << nSegmentTaggedMuons <<
" are segment tagged");
106 if ( (nSelectedMuons < 4) || (nCombMuons < 1) ) {
108 return StatusCode::SUCCESS;
118 return b->pt() < a->pt();
122 unsigned int muonIndex(0);
123 for (
auto selMuon : theMuonsAfterSelection) {
124 muonDecorator(*selMuon) = muonIndex;
129 std::vector<Combination> quadruplets;
130 std::vector<Combination>
pairs;
132 if (quadruplets.size()==0) {
134 return StatusCode::SUCCESS;
145 std::vector<const xAOD::TrackParticle*> theTracks = (*pairItr).trackParticles(
"pair1");
147 if (pairVxCandidate) {
149 indexDecorator(*pairVxCandidate) = (*pairItr).combinationIndices();
150 chargeDecorator(*pairVxCandidate) = (*pairItr).combinationCharges();
154 std::vector<const xAOD::Muon*> theStoredMuons;
155 theStoredMuons = (*pairItr).muons;
156 helper.setMuons(theStoredMuons,importedMuonCollection.get());
158 pairVxContainer->
push_back(pairVxCandidate);
159 ATH_MSG_DEBUG(
"..... indices: " << (*pairItr).combinationIndices() <<
160 " charges: " << (*pairItr).combinationCharges() <<
171 std::vector<const xAOD::TrackParticle*> theDCTracks; theDCTracks.clear();
172 theDCTracks = (*quadItr).trackParticles(
"DC");
174 if (dcVxCandidate != 0) {
176 indexDecorator(*dcVxCandidate) = (*quadItr).combinationIndices();
177 chargeDecorator(*dcVxCandidate) = (*quadItr).combinationCharges();
183 const std::vector<const xAOD::Muon*> &theStoredMuons = (*quadItr).muons;
184 helper.setMuons(theStoredMuons,importedMuonCollection.get());
186 quadVxContainer->
push_back(dcVxCandidate);
187 ATH_MSG_DEBUG(
"..... indices: " << (*quadItr).combinationIndices() <<
188 " charges: " << (*quadItr).combinationCharges() <<
189 " chi2(DC): " << dcChi2);
196 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
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.