11 #include "GaudiKernel/MsgStream.h"
39 ISvcLocator* pSvcLocator) :
41 m_isMatchedOdd(false),
42 m_isUnmatchOdd(false),
76 ss <<
"odd_" <<
i <<
"_Tracks";
79 ss <<
"even_" <<
i <<
"_Tracks";
82 ss <<
"all_" <<
i <<
"_Tracks";
89 return StatusCode::SUCCESS;
98 return StatusCode::SUCCESS;
112 if (
sc.isFailure()) {
130 if(
sc.isFailure() || !vtxTES ) {
132 return StatusCode::SUCCESS;
142 if(
sc.isFailure() || !tpbTES ) {
144 return StatusCode::SUCCESS;
146 ATH_MSG_DEBUG(
"TrackParticleCandidate Collection successfully retrieved");
150 if(
sc.isFailure() || !trkTES ) {
152 return StatusCode::SUCCESS;
154 ATH_MSG_DEBUG(
"TrackParticleCandidate Collection successfully retrieved");
157 std::map<std::string,TrackCollection*> trackmap;
158 std::map<std::string,Trk::TrackParticleBaseCollection*> tpbmap;
164 trackmap[thisKey] = tempTracks;
165 if (
evtStore()->contains<TrackCollection>(thisKey) && (
evtStore()->
retrieve(trackmap[thisKey],thisKey)).isSuccess()){
174 tpbmap[thisKey] = tempTpbs;
175 if (
evtStore()->contains<Trk::TrackParticleBaseCollection>(thisKey) &&
186 bool trackmatched =
false;
195 std::stringstream sss;
196 std::string oeNameString;
197 oeNameString.reserve(20);
201 const std::vector<Trk::VxTrackAtVertex*> & vertexTracks = *vtx->vxTrackAtVertex();
202 ATH_MSG_DEBUG(
"parent vertex has "<<vertexTracks.size()<<
" tracks, at position: "<<vtx->recVertex().position().x());
203 std::vector<Trk::VxTrackAtVertex*>::const_iterator tavI = vertexTracks.begin();
204 std::vector<Trk::VxTrackAtVertex*>::const_iterator tavIe= vertexTracks.end();
205 for (; tavI != tavIe; ++tavI){
207 if (trkPerigee == vxTrkPerigee) {trackmatched =
true;}
212 oeNameString.clear();
217 std::string oecontainerName = sss.str();
218 std::string allNameString =
"all";
221 std::string allcontainerName = sss.str();
222 ATH_MSG_DEBUG(
"found an unmatched trackparticlebase, giving it the key: "<< oecontainerName);
223 tpbmap[oecontainerName]->push_back(trkCopy1);
224 ATH_MSG_DEBUG(
"found an unmatched trackparticlebase, giving it the key: "<< allcontainerName);
225 tpbmap[allcontainerName]->push_back(trkCopy2);
231 oeNameString.clear();
236 std::string oecontainerName = sss.str();
237 std::string allNameString =
"all";
240 std::string allcontainerName = sss.str();
241 ATH_MSG_DEBUG(
"found a matched trackparticlebase, giving it the key: "<< oecontainerName);
242 tpbmap[oecontainerName]->push_back(trkCopy1);
243 ATH_MSG_DEBUG(
"found a matched trackparticlebase, giving it the key: "<< allcontainerName);
244 tpbmap[allcontainerName]->push_back(trkCopy2);
257 for (; trkItr != trkItrE; ++trkItr){
258 const Trk::Perigee* trkPerigee = (*trkItr)->perigeeParameters();
259 bool trackmatched =
false;
271 std::stringstream sss;
272 std::string oeNameString;
273 oeNameString.reserve(20);
274 for (; vtxItr != vtxItrE; ++vtxItr){
277 const std::vector<Trk::VxTrackAtVertex*> & vertexTracks = (*(*vtxItr)->vxTrackAtVertex());
278 ATH_MSG_DEBUG(
"parent vertex has "<<vertexTracks.size()<<
" tracks, at position: "<<(*vtxItr)->recVertex().position().x());
279 std::vector<Trk::VxTrackAtVertex*>::const_iterator tavI = vertexTracks.begin();
280 std::vector<Trk::VxTrackAtVertex*>::const_iterator tavIe= vertexTracks.end();
281 for (; tavI != tavIe; ++tavI){
283 if (trkPerigee == vxTrkPerigee) {trackmatched =
true;}
288 oeNameString.clear();
293 std::string oecontainerName = sss.str();
294 std::string allNameString =
"all";
297 std::string allcontainerName = sss.str();
298 ATH_MSG_DEBUG(
"found an unmatched track, giving it the key: "<< oecontainerName);
299 trackmap[oecontainerName]->push_back(trkCopy1);
300 ATH_MSG_DEBUG(
"found an unmatched track, giving it the key: "<< allcontainerName);
301 trackmap[allcontainerName]->push_back(trkCopy2);
307 oeNameString.clear();
312 std::string oecontainerName = sss.str();
313 std::string allNameString =
"all";
316 std::string allcontainerName = sss.str();
317 ATH_MSG_DEBUG(
"found a matched track, giving it the key: "<< oecontainerName);
318 trackmap[oecontainerName]->push_back(trkCopy1);
319 ATH_MSG_DEBUG(
"found a matched track, giving it the key: "<< allcontainerName);
320 trackmap[allcontainerName]->push_back(trkCopy2);
344 return StatusCode::SUCCESS;