|
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 134 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 357 of file FourMuonTool.cxx.
362 std::vector<std::vector<unsigned int> > quadrupletIndices =
getQuadIndices(nSelectedMuons);
363 std::vector<std::pair<unsigned int, unsigned int> > pairIndices =
getPairIndices(nSelectedMuons);
366 std::vector<std::vector<unsigned int> >
::iterator quadItr;
367 for (quadItr=quadrupletIndices.begin(); quadItr!=quadrupletIndices.end(); ++quadItr) {
368 const std::vector<unsigned int> &
quad = (*quadItr);
369 std::vector<const xAOD::Muon*> theMuons = {muonsIn[
quad[0]],muonsIn[
quad[1]],muonsIn[
quad[2]],muonsIn[
quad[3]]};
372 tmpQuad.muons = std::move(theMuons);
373 tmpQuad.quadIndices =
quad;
374 quadruplets.emplace_back(std::move(tmpQuad));
376 if (quadruplets.size() == 0)
return;
379 std::vector<std::pair<unsigned int, unsigned int> >
::iterator pairItr;
380 for (pairItr=pairIndices.begin(); pairItr!=pairIndices.end(); ++pairItr) {
381 std::pair<unsigned int, unsigned int> pair = (*pairItr);
383 std::vector<const xAOD::Muon*> theMuons = {muonsIn[pair.first],muonsIn[pair.second]};
384 tmpPair.muons = std::move(theMuons);
385 tmpPair.pairIndices = pair;
386 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 315 of file FourMuonTool.cxx.
321 allCombinations.push_back(combination);
325 for (
unsigned int i=
offset;
i<=mainList.size()-
k; ++
i) {
326 combination.push_back(mainList[
i]);
328 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 259 of file FourMuonTool.cxx.
267 if(concreteVertexFitter == 0) {
268 ATH_MSG_FATAL(
"The vertex fitter passed is not a V0 Vertex Fitter");
282 return myVxCandidate;
◆ getPairIndices()
std::vector< std::pair< unsigned int, unsigned int > > DerivationFramework::FourMuonTool::getPairIndices |
( |
unsigned int |
length | ) |
|
|
static |
Definition at line 337 of file FourMuonTool.cxx.
339 std::vector<std::pair<unsigned int, unsigned int> > uniquePairs;
340 std::vector<std::vector<unsigned int> > doublets =
mFromN(2,
length);
341 for (std::vector<std::vector<unsigned int> >::
iterator it=doublets.begin();
it!=doublets.end(); ++
it) {
342 std::pair<unsigned int, unsigned int> tmpPair = std::make_pair((*it).at(0),(*it).at(1));
343 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.
◆ interfaceID()
static const InterfaceID& DerivationFramework::FourMuonTool::interfaceID |
( |
| ) |
|
|
inlinestatic |
◆ mFromN()
std::vector< std::vector< unsigned int > > DerivationFramework::FourMuonTool::mFromN |
( |
unsigned int |
m, |
|
|
unsigned int |
n |
|
) |
| |
|
static |
Definition at line 305 of file FourMuonTool.cxx.
307 std::vector<std::vector<unsigned int> > allCombinations;
308 std::vector<unsigned int> mainList;
309 std::vector<unsigned int> combination;
310 for (
unsigned int i=0;
i<
N; ++
i) mainList.push_back(
i);
312 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 91 of file FourMuonTool.cxx.
100 pairVxContainer->setStore(pairVxAuxContainer);
104 quadVxContainer->setStore(quadVxAuxContainer);
109 ATH_CHECK(importedMuonCollection.isValid());
110 ATH_MSG_DEBUG(
"Muon container size "<<importedMuonCollection->size());
114 ATH_CHECK(importedTrackCollection.isValid());
115 ATH_MSG_DEBUG(
"ID TrackParticle container size "<< importedTrackCollection->size());
118 std::vector<const xAOD::Muon*> theMuonsAfterSelection;
120 unsigned int nCombMuons = 0;
121 unsigned int nSegmentTaggedMuons = 0;
123 for (
auto muItr=importedMuonCollection->begin(); muItr!=importedMuonCollection->end(); ++muItr) {
124 if ( *muItr == NULL )
continue;
125 muonDecorator(**muItr) = -1;
126 if ( ((*muItr)->muonType() !=
xAOD::Muon::Combined ) && ((*muItr)->muonType() != xAOD::Muon::SegmentTagged ) )
continue;
127 if (!(*muItr)->inDetTrackParticleLink().isValid())
continue;
128 auto& link = (*muItr)->inDetTrackParticleLink();
130 if ( muonTrk==NULL)
continue;
133 if ( fabs(muonTrk->
pt())<
m_ptCut )
continue;
136 if ( (*muItr)->muonType() == xAOD::Muon::SegmentTagged ) ++nSegmentTaggedMuons;
137 theMuonsAfterSelection.push_back(*muItr);
139 unsigned int nSelectedMuons = theMuonsAfterSelection.size();
140 ATH_MSG_DEBUG(
"Number of muons after selection: " << nSelectedMuons);
142 ATH_MSG_DEBUG(
"and " << nSegmentTaggedMuons <<
" are segment tagged");
143 if ( (nSelectedMuons < 4) || (nCombMuons < 1) ) {
145 return StatusCode::SUCCESS;
157 return b->pt() < a->pt();
161 unsigned int muonIndex(0);
162 for (
auto selMuon : theMuonsAfterSelection) {
163 muonDecorator(*selMuon) = muonIndex;
168 std::vector<Combination> quadruplets;
169 std::vector<Combination>
pairs;
171 if (quadruplets.size()==0) {
173 return StatusCode::SUCCESS;
184 std::vector<const xAOD::TrackParticle*> theTracks = (*pairItr).trackParticles(
"pair1");
186 if (pairVxCandidate != 0) {
188 indexDecorator(*pairVxCandidate) = (*pairItr).combinationIndices();
189 chargeDecorator(*pairVxCandidate) = (*pairItr).combinationCharges();
193 std::vector<const xAOD::Muon*> theStoredMuons;
194 theStoredMuons = (*pairItr).muons;
195 helper.setMuons(theStoredMuons,importedMuonCollection.get());
197 pairVxContainer->
push_back(pairVxCandidate);
198 ATH_MSG_DEBUG(
"..... indices: " << (*pairItr).combinationIndices() <<
199 " charges: " << (*pairItr).combinationCharges() <<
210 std::vector<const xAOD::TrackParticle*> theDCTracks; theDCTracks.clear();
213 theDCTracks = (*quadItr).trackParticles(
"DC");
224 if (dcVxCandidate != 0) {
226 indexDecorator(*dcVxCandidate) = (*quadItr).combinationIndices();
227 chargeDecorator(*dcVxCandidate) = (*quadItr).combinationCharges();
235 const std::vector<const xAOD::Muon*> &theStoredMuons = (*quadItr).muons;
236 helper.setMuons(theStoredMuons,importedMuonCollection.get());
238 quadVxContainer->
push_back(dcVxCandidate);
239 ATH_MSG_DEBUG(
"..... indices: " << (*quadItr).combinationIndices() <<
240 " charges: " << (*quadItr).combinationCharges() <<
241 " chi2(DC): " << dcChi2);
250 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
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>