16 typedef std::vector<const xAOD::TrackParticle*>
TrackBag;
23 return StatusCode::FAILURE;
31 return StatusCode::FAILURE;
39 return StatusCode::SUCCESS;
44 return StatusCode::SUCCESS;
49 m_vertexContainerKey(
""),
50 m_TrackPContainerKey(
""),
51 m_MuonsUsedInJpsiKey(
""),
52 m_Vtx1MassConstraint(0.),
53 m_Vtx2MassConstraint(0.0),
54 m_trkThresholdPt(0.0),
59 m_roughMassLower(0.0),
60 m_roughMassUpper(0.0),
61 m_iVertexFitter(
"Trk::TrkVKalVrtFitter"),
62 m_trkSelector(
"InDet::TrackSelectorTool")
90 total.SetVectM(
Tracks[0]->p4().Vect(), massHypotheses[0]);
93 temp.SetVectM(
Tracks[
i]->p4().Vect(), massHypotheses[
i]);
100 bool isContained(
false);
101 for (
auto muItr=theColl->
cbegin(); muItr!=theColl->
cend(); ++muItr) {
102 auto& link = ( *muItr )->inDetTrackParticleLink();
103 if ( link.isValid() && ( *link == theTrack ) ) {isContained=
true;
break;}
111 assert(cascadeinfoContainer!=
nullptr);
113 if(!vertexContainer.
isValid()){
115 return StatusCode::FAILURE;
120 if(!TrackPContainer.
isValid()){
122 return StatusCode::FAILURE;
130 if(handle.
isValid()) importedMuonCollection = handle.
cptr();
133 return StatusCode::FAILURE;
140 for (
auto tp : *TrackPContainer){
143 if (importedMuonCollection!=NULL) {
146 if (
m_trkSelector->decision(*
tp, NULL) ) theIDTracksAfterSelection.push_back(
tp);
150 const std::vector<double> initialVertexMassHypo(fullMassHypoth.begin(), fullMassHypoth.end()-1);
152 TrackBag originalVertexTracks(initialVertexMassHypo.size());
153 TrackBag secondVertexTracks(fullMassHypoth.size());
155 const std::vector< Trk::VertexID > emptyVtxList;
159 assert(fullMassHypoth.size() == secondVertexTracks.size());
161 for(
auto vertex : *vertexContainer){
163 size_t OriginaltrackNum =
vertex->nTrackParticles();
164 if(initialVertexMassHypo.size() != OriginaltrackNum){
166 return StatusCode::FAILURE;
168 for(
size_t i = 0;
i<OriginaltrackNum;
i++)
169 originalVertexTracks[
i] = secondVertexTracks[
i] = (
vertex->trackParticle(
i));
171 for(
auto newtrack : theIDTracksAfterSelection){
173 if(
std::find(originalVertexTracks.begin(), originalVertexTracks.end(), newtrack) != originalVertexTracks.end())
continue;
175 secondVertexTracks.back() = newtrack;
184 auto vID1 =
m_iVertexFitter->startVertex( originalVertexTracks, initialVertexMassHypo, *state );
185 auto vID2 =
m_iVertexFitter->nextVertex( secondVertexTracks, fullMassHypoth, *state );
203 assert(
result->vertices().size()==2);
204 cascadeinfoContainer->push_back(
result);
209 ATH_MSG_DEBUG(
"cascadeinfoContainer size " << cascadeinfoContainer->size());
210 return StatusCode::SUCCESS;