Loading [MathJax]/extensions/tex2jax.js
 |
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::VertexAuxContainer *&pairVxAuxContainer, xAOD::VertexContainer *&quadVxContainer, xAOD::VertexAuxContainer *&quadVxAuxContainer, bool &acceptEvent) 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 > &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 |
|
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 356 of file FourMuonTool.cxx.
361 std::vector<std::vector<unsigned int> > quadrupletIndices =
getQuadIndices(nSelectedMuons);
362 std::vector<std::pair<unsigned int, unsigned int> > pairIndices =
getPairIndices(nSelectedMuons);
365 std::vector<std::vector<unsigned int> >
::iterator quadItr;
366 for (quadItr=quadrupletIndices.begin(); quadItr!=quadrupletIndices.end(); ++quadItr) {
367 const std::vector<unsigned int> &
quad = (*quadItr);
368 std::vector<const xAOD::Muon*> theMuons = {muonsIn[
quad[0]],muonsIn[
quad[1]],muonsIn[
quad[2]],muonsIn[
quad[3]]};
371 tmpQuad.muons = std::move(theMuons);
372 tmpQuad.quadIndices =
quad;
373 quadruplets.emplace_back(std::move(tmpQuad));
375 if (quadruplets.size() == 0)
return;
378 std::vector<std::pair<unsigned int, unsigned int> >
::iterator pairItr;
379 for (pairItr=pairIndices.begin(); pairItr!=pairIndices.end(); ++pairItr) {
380 std::pair<unsigned int, unsigned int> pair = (*pairItr);
382 std::vector<const xAOD::Muon*> theMuons = {muonsIn[pair.first],muonsIn[pair.second]};
383 tmpPair.muons = std::move(theMuons);
384 tmpPair.pairIndices = pair;
385 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 314 of file FourMuonTool.cxx.
320 allCombinations.push_back(combination);
324 for (
unsigned int i=
offset;
i<=mainList.size()-
k; ++
i) {
325 combination.push_back(mainList[
i]);
327 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 258 of file FourMuonTool.cxx.
266 if(concreteVertexFitter == 0) {
267 ATH_MSG_FATAL(
"The vertex fitter passed is not a V0 Vertex Fitter");
281 return myVxCandidate;
◆ getPairIndices()
std::vector< std::pair< unsigned int, unsigned int > > DerivationFramework::FourMuonTool::getPairIndices |
( |
unsigned int |
length | ) |
|
|
static |
Definition at line 336 of file FourMuonTool.cxx.
338 std::vector<std::pair<unsigned int, unsigned int> > uniquePairs;
339 std::vector<std::vector<unsigned int> > doublets =
mFromN(2,
length);
340 for (std::vector<std::vector<unsigned int> >::
iterator it=doublets.begin();
it!=doublets.end(); ++
it) {
341 std::pair<unsigned int, unsigned int> tmpPair = std::make_pair((*it).at(0),(*it).at(1));
342 uniquePairs.push_back(tmpPair);
◆ getQuadIndices()
std::vector< std::vector< unsigned int > > DerivationFramework::FourMuonTool::getQuadIndices |
( |
unsigned int |
length | ) |
|
|
static |
◆ initialize()
StatusCode DerivationFramework::FourMuonTool::initialize |
( |
| ) |
|
Definition at line 32 of file FourMuonTool.cxx.
37 return StatusCode::FAILURE;
48 return StatusCode::FAILURE;
61 return StatusCode::SUCCESS;
◆ 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 304 of file FourMuonTool.cxx.
306 std::vector<std::vector<unsigned int> > allCombinations;
307 std::vector<unsigned int> mainList;
308 std::vector<unsigned int> combination;
309 for (
unsigned int i=0;
i<
N; ++
i) mainList.push_back(
i);
311 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 90 of file FourMuonTool.cxx.
99 pairVxContainer->setStore(pairVxAuxContainer);
103 quadVxContainer->setStore(quadVxAuxContainer);
108 ATH_CHECK(importedMuonCollection.isValid());
109 ATH_MSG_DEBUG(
"Muon container size "<<importedMuonCollection->size());
113 ATH_CHECK(importedTrackCollection.isValid());
114 ATH_MSG_DEBUG(
"ID TrackParticle container size "<< importedTrackCollection->size());
117 std::vector<const xAOD::Muon*> theMuonsAfterSelection;
119 unsigned int nCombMuons = 0;
120 unsigned int nSegmentTaggedMuons = 0;
122 for (
auto muItr=importedMuonCollection->begin(); muItr!=importedMuonCollection->end(); ++muItr) {
123 if ( *muItr == NULL )
continue;
124 muonDecorator(**muItr) = -1;
125 if ( ((*muItr)->muonType() !=
xAOD::Muon::Combined ) && ((*muItr)->muonType() != xAOD::Muon::SegmentTagged ) )
continue;
126 if (!(*muItr)->inDetTrackParticleLink().isValid())
continue;
127 auto& link = (*muItr)->inDetTrackParticleLink();
129 if ( muonTrk==NULL)
continue;
132 if ( fabs(muonTrk->
pt())<
m_ptCut )
continue;
135 if ( (*muItr)->muonType() == xAOD::Muon::SegmentTagged ) ++nSegmentTaggedMuons;
136 theMuonsAfterSelection.push_back(*muItr);
138 unsigned int nSelectedMuons = theMuonsAfterSelection.size();
139 ATH_MSG_DEBUG(
"Number of muons after selection: " << nSelectedMuons);
141 ATH_MSG_DEBUG(
"and " << nSegmentTaggedMuons <<
" are segment tagged");
142 if ( (nSelectedMuons < 4) || (nCombMuons < 1) ) {
144 return StatusCode::SUCCESS;
156 return b->pt() < a->pt();
160 unsigned int muonIndex(0);
161 for (
auto selMuon : theMuonsAfterSelection) {
162 muonDecorator(*selMuon) = muonIndex;
167 std::vector<Combination> quadruplets;
168 std::vector<Combination>
pairs;
170 if (quadruplets.size()==0) {
172 return StatusCode::SUCCESS;
183 std::vector<const xAOD::TrackParticle*> theTracks = (*pairItr).trackParticles(
"pair1");
185 if (pairVxCandidate != 0) {
187 indexDecorator(*pairVxCandidate) = (*pairItr).combinationIndices();
188 chargeDecorator(*pairVxCandidate) = (*pairItr).combinationCharges();
192 std::vector<const xAOD::Muon*> theStoredMuons;
193 theStoredMuons = (*pairItr).muons;
194 helper.setMuons(theStoredMuons,importedMuonCollection.get());
196 pairVxContainer->
push_back(pairVxCandidate);
197 ATH_MSG_DEBUG(
"..... indices: " << (*pairItr).combinationIndices() <<
198 " charges: " << (*pairItr).combinationCharges() <<
209 std::vector<const xAOD::TrackParticle*> theDCTracks; theDCTracks.clear();
212 theDCTracks = (*quadItr).trackParticles(
"DC");
223 if (dcVxCandidate != 0) {
225 indexDecorator(*dcVxCandidate) = (*quadItr).combinationIndices();
226 chargeDecorator(*dcVxCandidate) = (*quadItr).combinationCharges();
234 const std::vector<const xAOD::Muon*> &theStoredMuons = (*quadItr).muons;
235 helper.setMuons(theStoredMuons,importedMuonCollection.get());
237 quadVxContainer->
push_back(dcVxCandidate);
238 ATH_MSG_DEBUG(
"..... indices: " << (*quadItr).combinationIndices() <<
239 " charges: " << (*quadItr).combinationCharges() <<
240 " chi2(DC): " << dcChi2);
249 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
double DerivationFramework::FourMuonTool::m_etaCut |
|
private |
◆ m_eventInfo_key
◆ m_evtStore
◆ m_iV0VertexFitter
◆ m_iVertexFitter
◆ m_muonCollectionKey
◆ m_muonIndex
◆ m_ptCut
double DerivationFramework::FourMuonTool::m_ptCut |
|
private |
◆ m_TrkParticleCollection
◆ m_trkSelector
◆ m_useV0Fitter
bool DerivationFramework::FourMuonTool::m_useV0Fitter |
|
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.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
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.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
virtual void setOwner(IDataHandleHolder *o)=0
Helper class to provide type-safe access to aux data.
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
Handle class for adding a decoration to an object.
#define CHECK(...)
Evaluate an expression and check for errors.
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.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>