ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFramework::FourMuonTool Class Reference

#include <FourMuonTool.h>

Inheritance diagram for DerivationFramework::FourMuonTool:
Collaboration diagram for DerivationFramework::FourMuonTool:

Public Member Functions

 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::Vertexfit (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.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static std::vector< std::vector< unsigned int > > getQuadIndices (unsigned int length)
static std::vector< std::pair< unsigned int, unsigned int > > getPairIndices (unsigned int length)
static std::vector< std::vector< unsigned int > > mFromN (unsigned int m, unsigned int n)
static void 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 void buildCombinations (const std::vector< const xAOD::Muon * > &muonsIn, std::vector< Combination > &pairs, std::vector< Combination > &quadruplets, unsigned int nSelectedMuons)
static bool passesQuadSelection (const std::vector< const xAOD::Muon * > &muonsIn)

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

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::MuonContainerm_muonCollectionKey {this, "muonCollectionKey", "Muons"}
SG::ReadHandleKey< xAOD::TrackParticleContainerm_TrkParticleCollection {this, "TrackParticleCollection", "TrackParticleCandidate"}
PublicToolHandle< Trk::IVertexFitterm_iVertexFitter {this, "TrkVertexFitterTool", "Trk::TrkVKalVrtFitter"}
PublicToolHandle< Trk::IVertexFitterm_iV0VertexFitter {this, "V0VertexFitterTool", "Trk::V0VertexFitter"}
PublicToolHandle< Trk::ITrackSelectorToolm_trkSelector {this, "TrackSelectorTool", "InDet::TrackSelectorTool"}
SG::ReadHandleKey< xAOD::EventInfom_eventInfo_key {this, "EventInfo", "EventInfo", "Input event information"}
SG::WriteDecorHandleKey< xAOD::MuonContainerm_muonIndex {this, "muonIndexDec", m_muonCollectionKey, "BPHY4MuonIndex"}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 132 of file FourMuonTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ FourMuonTool()

DerivationFramework::FourMuonTool::FourMuonTool ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 56 of file FourMuonTool.cxx.

56 : AthAlgTool(t,n,p)
57 {
58 }
AthAlgTool()
Default constructor:

◆ ~FourMuonTool()

DerivationFramework::FourMuonTool::~FourMuonTool ( )

Definition at line 60 of file FourMuonTool.cxx.

60{ }

Member Function Documentation

◆ 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.

306 {
307
308 std::vector<std::vector<unsigned int> > quadrupletIndices = getQuadIndices(nSelectedMuons);
309 std::vector<std::pair<unsigned int, unsigned int> > pairIndices = getPairIndices(nSelectedMuons);
310
311 // Quadruplets
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]]};
316 if (!passesQuadSelection(theMuons)) continue;
317 Combination tmpQuad;
318 tmpQuad.muons = std::move(theMuons);
319 tmpQuad.quadIndices = quad;
320 quadruplets.emplace_back(std::move(tmpQuad));
321 }
322 if (quadruplets.size() == 0) return;
323
324 // pairs
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);
328 Combination tmpPair;
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));
333 }
334
335 return;
336
337 }
static bool passesQuadSelection(const std::vector< const xAOD::Muon * > &muonsIn)
static std::vector< std::vector< unsigned int > > getQuadIndices(unsigned int length)
static std::vector< std::pair< unsigned int, unsigned int > > getPairIndices(unsigned int length)

◆ 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.

265 {
266 if (k==0) {
267 allCombinations.push_back(combination);
268 return;
269 }
270 if (k>0) {
271 for (unsigned int i=offset; i<=mainList.size()-k; ++i) {
272 combination.push_back(mainList[i]);
273 combinatorics(i+1,k-1,combination,mainList,allCombinations);
274 combination.pop_back();
275 }
276 }
277 }
static void combinatorics(unsigned int offset, unsigned int k, std::vector< unsigned int > &combination, std::vector< unsigned int > &mainList, std::vector< std::vector< unsigned int > > &allCombinations)

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

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()

xAOD::Vertex * DerivationFramework::FourMuonTool::fit ( const std::vector< const xAOD::TrackParticle * > & inputTracks,
const xAOD::TrackParticleContainer * importedTrackCollection,
const Amg::Vector3D & beamSpot ) const

Definition at line 205 of file FourMuonTool.cxx.

207 {
208
209 const Trk::TrkV0VertexFitter* concreteVertexFitter=0;
210 if (m_useV0Fitter) {
211 // making a concrete fitter for the V0Fitter
212 concreteVertexFitter = dynamic_cast<const Trk::TrkV0VertexFitter * >(&(*m_iV0VertexFitter));
213 if(concreteVertexFitter == 0) {
214 ATH_MSG_FATAL("The vertex fitter passed is not a V0 Vertex Fitter");
215 return nullptr;
216 }
217 }
218
219 xAOD::Vertex* myVxCandidate{};
220 if (m_useV0Fitter) {
221 myVxCandidate = concreteVertexFitter->fit(inputTracks, beamSpot /*vertex startingPoint*/ );
222 } else {
223 myVxCandidate = m_iVertexFitter->fit(inputTracks, beamSpot /*vertex startingPoint*/ );
224 }
225
226 if(myVxCandidate) BPhysPVTools::PrepareVertexLinks(myVxCandidate, importedTrackCollection);
227
228 return myVxCandidate;
229
230 } // End of fit method
#define ATH_MSG_FATAL(x)
static void PrepareVertexLinks(xAOD::Vertex *theResult, const xAOD::TrackParticleContainer *importedTrackCollection)
PublicToolHandle< Trk::IVertexFitter > m_iVertexFitter
Gaudi::Property< bool > m_useV0Fitter
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.
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ getPairIndices()

std::vector< std::pair< unsigned int, unsigned int > > DerivationFramework::FourMuonTool::getPairIndices ( unsigned int length)
static

Definition at line 283 of file FourMuonTool.cxx.

283 {
284
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);
290 }
291
292 return(uniquePairs);
293 }
double length(const pvec &v)
static std::vector< std::vector< unsigned int > > mFromN(unsigned int m, unsigned int n)

◆ getQuadIndices()

std::vector< std::vector< unsigned int > > DerivationFramework::FourMuonTool::getQuadIndices ( unsigned int length)
static

Definition at line 239 of file FourMuonTool.cxx.

239 {
240
241 std::vector<std::vector<unsigned int> > quadIndices = mFromN(4,length);
242 return(quadIndices);
243 }

◆ initialize()

StatusCode DerivationFramework::FourMuonTool::initialize ( )

Definition at line 32 of file FourMuonTool.cxx.

32 {
33
34 // retrieving vertex Fitter
35 ATH_CHECK( m_iVertexFitter.retrieve() );
36 ATH_MSG_DEBUG("Retrieved tool " << m_iVertexFitter);
37
38 // retrieving V0 Fitter
39 ATH_CHECK( m_iV0VertexFitter.retrieve(DisableTool{!m_useV0Fitter}));
40
41 // Get the track selector tool from ToolSvc
42 ATH_CHECK ( m_trkSelector.retrieve() );
43 ATH_MSG_DEBUG("Retrieved tool " << m_trkSelector);
44
45 // Get the beam spot service
46 ATH_CHECK( m_eventInfo_key.initialize() );
47 ATH_CHECK(m_muonCollectionKey.initialize());
49 ATH_CHECK(m_muonIndex.initialize());
50 ATH_MSG_DEBUG("Initialize successful");
51
52 return StatusCode::SUCCESS;
53
54 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo_key
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrkParticleCollection
PublicToolHandle< Trk::ITrackSelectorTool > m_trkSelector
SG::ReadHandleKey< xAOD::MuonContainer > m_muonCollectionKey
SG::WriteDecorHandleKey< xAOD::MuonContainer > m_muonIndex
PublicToolHandle< Trk::IVertexFitter > m_iV0VertexFitter

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

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.

251 {
252
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);
257 combinatorics(0,m,combination,mainList,allCombinations);
258 return allCombinations;
259 }

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

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

Definition at line 345 of file FourMuonTool.cxx.

345 {
346 bool accept(false);
347 bool charges(true);
348 bool quality(false);
349 if (( muons.at(0)->muonType() == xAOD::Muon::Combined ) ||
350 ( muons.at(1)->muonType() == xAOD::Muon::Combined ) ||
351 ( muons.at(2)->muonType() == xAOD::Muon::Combined ) ||
352 ( muons.at(3)->muonType() == xAOD::Muon::Combined )
353 ) quality = true;
354 if (charges && quality) accept = true;
355 return accept;
356 }
StatusCode accept(const xAOD::Muon *mu)

◆ performSearch()

StatusCode DerivationFramework::FourMuonTool::performSearch ( xAOD::VertexContainer * pairVxContainer,
xAOD::VertexContainer * quadVxContainer,
bool & acceptEvent,
const EventContext & ctx ) const

Definition at line 65 of file FourMuonTool.cxx.

66 {
67 ATH_MSG_DEBUG( "FourMuonTool::performSearch" );
68 selectEvent = false;
69
70 // Get the muons from StoreGate
71 SG::ReadHandle<xAOD::MuonContainer> importedMuonCollection(m_muonCollectionKey, ctx);
72 ATH_CHECK(importedMuonCollection.isValid());
73 ATH_MSG_DEBUG("Muon container size "<<importedMuonCollection->size());
74
75 // Get ID tracks
76 SG::ReadHandle<xAOD::TrackParticleContainer> importedTrackCollection(m_TrkParticleCollection, ctx);
77 ATH_CHECK(importedTrackCollection.isValid());
78 ATH_MSG_DEBUG("ID TrackParticle container size "<< importedTrackCollection->size());
79
80 // Select the muons
81 std::vector<const xAOD::Muon*> theMuonsAfterSelection;
82 SG::WriteDecorHandle<xAOD::MuonContainer, int> muonDecorator(m_muonIndex, ctx);
83 unsigned int nCombMuons = 0;
84 unsigned int nSegmentTaggedMuons = 0;
85
86 for (const auto * muon : *importedMuonCollection) {
87 if ( !muon ) continue;
88 muonDecorator(*muon) = -1; // all muons must be decorated
89 if ( (muon->muonType() != xAOD::Muon::Combined ) && (muon->muonType() != xAOD::Muon::SegmentTagged ) ) continue;
90 if (!muon->inDetTrackParticleLink().isValid()) continue; // No muons without ID tracks
91 auto& link = muon->inDetTrackParticleLink();
92 const xAOD::TrackParticle* muonTrk = *link;
93 if ( !muonTrk ) continue;
94 const xAOD::Vertex* vx{};
95 if ( !m_trkSelector->decision(*muonTrk, vx) ) continue; // all ID tracks must pass basic tracking cuts
96 if ( fabs(muonTrk->pt())<m_ptCut ) continue; // pt cut
97 if ( fabs(muonTrk->eta())>m_etaCut ) continue; // eta cut
98 if ( muon->muonType() == xAOD::Muon::Combined ) ++nCombMuons;
99 if ( muon->muonType() == xAOD::Muon::SegmentTagged ) ++nSegmentTaggedMuons;
100 theMuonsAfterSelection.push_back(muon);
101 }
102 unsigned int nSelectedMuons = theMuonsAfterSelection.size();
103 ATH_MSG_DEBUG("Number of muons after selection: " << nSelectedMuons);
104 ATH_MSG_DEBUG("of which " << nCombMuons << " are combined");
105 ATH_MSG_DEBUG("and " << nSegmentTaggedMuons << " are segment tagged");
106 if ( (nSelectedMuons < 4) || (nCombMuons < 1) ) {
107 ATH_MSG_DEBUG("Muon criteria not met. Skipping event.");
108 return StatusCode::SUCCESS;
109 }
110 selectEvent = true; // if we got this far we should definitively accept the event
111
112 // Decorators
113 SG::AuxElement::Decorator< std::string > indexDecorator("CombinationCode");
114 SG::AuxElement::Decorator< std::string > chargeDecorator("ChargeCode");
115
116 // Order by pT
117 std::sort(theMuonsAfterSelection.begin(), theMuonsAfterSelection.end(), [](const xAOD::Muon *a, const xAOD::Muon *b) {
118 return b->pt() < a->pt();
119 });
120
121 // Decorate the selected muons (now pT ordered) with their index
122 unsigned int muonIndex(0);
123 for (auto selMuon : theMuonsAfterSelection) {
124 muonDecorator(*selMuon) = muonIndex;
125 ++muonIndex;
126 }
127
128 // Quadruplet combinatorics
129 std::vector<Combination> quadruplets;
130 std::vector<Combination> pairs;
131 buildCombinations(theMuonsAfterSelection,pairs,quadruplets,nSelectedMuons);
132 if (quadruplets.size()==0) {
133 ATH_MSG_DEBUG("No acceptable quadruplets");
134 return StatusCode::SUCCESS;
135 }
136
137 // Get the beam spot (for the vertexing starting point)
138 SG::ReadHandle<xAOD::EventInfo> evt(m_eventInfo_key, ctx);
139 ATH_CHECK(evt.isValid());
140 const Amg::Vector3D beamSpot(evt->beamPosX(), evt->beamPosY(), evt->beamPosZ());
141
142 // fit pairs
143 ATH_MSG_DEBUG("Successful pairs.....");
144 for (std::vector<Combination>::iterator pairItr = pairs.begin(); pairItr!=pairs.end(); ++pairItr) {
145 std::vector<const xAOD::TrackParticle*> theTracks = (*pairItr).trackParticles("pair1");
146 xAOD::Vertex* pairVxCandidate = fit(theTracks,importedTrackCollection.get(),beamSpot); // This line actually does the fitting and object making
147 if (pairVxCandidate) {
148 // decorate the candidate with its codes
149 indexDecorator(*pairVxCandidate) = (*pairItr).combinationIndices();
150 chargeDecorator(*pairVxCandidate) = (*pairItr).combinationCharges();
151 // decorate the candidate with refitted tracks and muons via the BPhysHelper
152 xAOD::BPhysHelper helper(pairVxCandidate);
153 helper.setRefTrks();
154 std::vector<const xAOD::Muon*> theStoredMuons;
155 theStoredMuons = (*pairItr).muons;
156 helper.setMuons(theStoredMuons,importedMuonCollection.get());
157 // Retain the vertex
158 pairVxContainer->push_back(pairVxCandidate);
159 ATH_MSG_DEBUG("..... indices: " << (*pairItr).combinationIndices() <<
160 " charges: " << (*pairItr).combinationCharges() <<
161 " chi2: " << pairVxCandidate->chiSquared());
162 } else { // fit failed
163 ATH_MSG_DEBUG("Fitter failed!");
164 }
165 }
166 ATH_MSG_DEBUG("pairContainer size " << pairVxContainer->size());
167
168 // fit quadruplets
169 ATH_MSG_DEBUG("Successful quadruplets.....");
170 for (std::vector<Combination>::iterator quadItr = quadruplets.begin(); quadItr!=quadruplets.end(); ++quadItr) {
171 std::vector<const xAOD::TrackParticle*> theDCTracks; theDCTracks.clear();
172 theDCTracks = (*quadItr).trackParticles("DC");
173 xAOD::Vertex* dcVxCandidate = fit(theDCTracks,importedTrackCollection.get(), beamSpot);
174 if (dcVxCandidate != 0) {
175 // decorate the candidate with its codes
176 indexDecorator(*dcVxCandidate) = (*quadItr).combinationIndices();
177 chargeDecorator(*dcVxCandidate) = (*quadItr).combinationCharges();
178 // Decorate the DC candidate with the differences between its chi2 and the other
179 double dcChi2 = dcVxCandidate->chiSquared();
180 // decorate the candidate with refitted tracks and muons via the BPhysHelper
181 xAOD::BPhysHelper helper(dcVxCandidate);
182 helper.setRefTrks();
183 const std::vector<const xAOD::Muon*> &theStoredMuons = (*quadItr).muons;
184 helper.setMuons(theStoredMuons,importedMuonCollection.get());
185 // Retain the vertex
186 quadVxContainer->push_back(dcVxCandidate);
187 ATH_MSG_DEBUG("..... indices: " << (*quadItr).combinationIndices() <<
188 " charges: " << (*quadItr).combinationCharges() <<
189 " chi2(DC): " << dcChi2);
190 } else { // fit failed
191 ATH_MSG_DEBUG("Fitter failed!");
192 }
193 }
194 ATH_MSG_DEBUG("quadruplet container size " << quadVxContainer->size());
195
196 return StatusCode::SUCCESS;;
197 }
static Double_t a
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
xAOD::Vertex * fit(const std::vector< const xAOD::TrackParticle * > &, const xAOD::TrackParticleContainer *importedTrackCollection, const Amg::Vector3D &beamSpot) const
static void buildCombinations(const std::vector< const xAOD::Muon * > &muonsIn, std::vector< Combination > &pairs, std::vector< Combination > &quadruplets, unsigned int nSelectedMuons)
Gaudi::Property< double > m_etaCut
Gaudi::Property< double > m_ptCut
SG::Decorator< T, ALLOC > Decorator
Definition AuxElement.h:575
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
float chiSquared() const
Returns the of the vertex fit as float.
Eigen::Matrix< double, 3, 1 > Vector3D
AthConfigFlags beamSpot(AthConfigFlags flags, str instanceName, str recoMode)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version:

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_etaCut

Gaudi::Property<double> DerivationFramework::FourMuonTool::m_etaCut {this, "etaCut", 0.0}
private

Definition at line 161 of file FourMuonTool.h.

161{this, "etaCut", 0.0};

◆ m_eventInfo_key

SG::ReadHandleKey<xAOD::EventInfo> DerivationFramework::FourMuonTool::m_eventInfo_key {this, "EventInfo", "EventInfo", "Input event information"}
private

Definition at line 168 of file FourMuonTool.h.

168{this, "EventInfo", "EventInfo", "Input event information"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_iV0VertexFitter

PublicToolHandle< Trk::IVertexFitter > DerivationFramework::FourMuonTool::m_iV0VertexFitter {this, "V0VertexFitterTool", "Trk::V0VertexFitter"}
private

Definition at line 166 of file FourMuonTool.h.

166{this, "V0VertexFitterTool", "Trk::V0VertexFitter"};

◆ m_iVertexFitter

PublicToolHandle< Trk::IVertexFitter > DerivationFramework::FourMuonTool::m_iVertexFitter {this, "TrkVertexFitterTool", "Trk::TrkVKalVrtFitter"}
private

Definition at line 165 of file FourMuonTool.h.

165{this, "TrkVertexFitterTool", "Trk::TrkVKalVrtFitter"};

◆ m_muonCollectionKey

SG::ReadHandleKey<xAOD::MuonContainer> DerivationFramework::FourMuonTool::m_muonCollectionKey {this, "muonCollectionKey", "Muons"}
private

Definition at line 163 of file FourMuonTool.h.

163{this, "muonCollectionKey", "Muons"};

◆ m_muonIndex

SG::WriteDecorHandleKey<xAOD::MuonContainer> DerivationFramework::FourMuonTool::m_muonIndex {this, "muonIndexDec", m_muonCollectionKey, "BPHY4MuonIndex"}
private

Definition at line 169 of file FourMuonTool.h.

169{this, "muonIndexDec", m_muonCollectionKey, "BPHY4MuonIndex"};

◆ m_ptCut

Gaudi::Property<double> DerivationFramework::FourMuonTool::m_ptCut {this, "ptCut", 0.0}
private

Definition at line 160 of file FourMuonTool.h.

160{this, "ptCut", 0.0};

◆ m_TrkParticleCollection

SG::ReadHandleKey<xAOD::TrackParticleContainer> DerivationFramework::FourMuonTool::m_TrkParticleCollection {this, "TrackParticleCollection", "TrackParticleCandidate"}
private

Definition at line 164 of file FourMuonTool.h.

164{this, "TrackParticleCollection", "TrackParticleCandidate"};

◆ m_trkSelector

PublicToolHandle< Trk::ITrackSelectorTool > DerivationFramework::FourMuonTool::m_trkSelector {this, "TrackSelectorTool", "InDet::TrackSelectorTool"}
private

Definition at line 167 of file FourMuonTool.h.

167{this, "TrackSelectorTool", "InDet::TrackSelectorTool"};

◆ m_useV0Fitter

Gaudi::Property<bool> DerivationFramework::FourMuonTool::m_useV0Fitter {this, "useV0Fitter", false}
private

Definition at line 162 of file FourMuonTool.h.

162{this, "useV0Fitter", false};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: