ATLAS Offline Software
PFTrackFiller.cxx
Go to the documentation of this file.
2 
4 
6 {
7 
8  for (auto thisEflowCaloObject : *data.caloObjects){
9 
10  unsigned int nTrk = thisEflowCaloObject->nTracks();
11 
12  if (0 == thisEflowCaloObject->nClusters()){
13  //If there are no matched clusters we mark each track in thisEflowCaloObject has one that has been processed ("subtracted")
14  //and continue to the next eflowCaloObject
15  for (unsigned int iTrk = 0; iTrk < nTrk; ++iTrk) {
16  eflowRecTrack* thisEfRecTrack = thisEflowCaloObject->efRecTrack(iTrk);
17  if (!thisEfRecTrack->isSubtracted()) thisEfRecTrack->setSubtracted();
18  }//loop on tracks on thisEflowCaloObject
19  continue;
20  }//if thisEflowCaloObject has zero CaloCluster
21 
22  //ignore cluster only systems and go to the next eflowCaloObject
23  if(nTrk == 0) continue;
24 
25  //Else process systems with only tracks or combinations of tracks and clusters
26 
27  //Create a vector to keep a list of tracks we don't want to consider
28  std::vector<eflowRecTrack*> updatedTracks;
29 
30  for (unsigned int iTrack = 0; iTrack < nTrk; ++iTrack){
31  eflowRecTrack* thisEfRecTrack = thisEflowCaloObject->efRecTrack(iTrack);
32  //If this track was already processed ("subtracted") we continue on to the next track
33  if (thisEfRecTrack->isSubtracted()){
34  updatedTracks.push_back(thisEfRecTrack);
35  continue;
36  }
37  //remove existing matched CaloCluster and add this track to our list that we want to consider
38  //for charged hadron subtraction
39  thisEfRecTrack->clearClusterMatches();
40  //flag that this track underwent split showers recovery
41  thisEfRecTrack->setIsRecovered();
42  data.tracks.push_back(thisEfRecTrack);
43  }//loop on tracks in thisEflowCaloObject
44 
45  //Now remove all tracks from thisEflowCaloObject
46  thisEflowCaloObject->clearTracks();
47  //Add back the tracks we won't consider for charged hadron subtraction (if any)
48  if (!updatedTracks.empty()) thisEflowCaloObject->addTracks(updatedTracks);
49  //SHOULD WE ALWAYS DO THIS? TO BE TESTED
50  else thisEflowCaloObject->clearLinks();
51  }
52 
53  std::sort(data.tracks.begin(),data.tracks.end(),eflowRecTrack::SortDescendingPt());
54 
55 }
56 
58 {
59  for (unsigned int count = 0; count < recTrackContainer.size(); count++) data.tracks.push_back(recTrackContainer[count]);
60 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
eflowRecTrack::clearClusterMatches
void clearClusterMatches()
Definition: eflowRecTrack.h:69
eflowRecTrack::setIsRecovered
void setIsRecovered()
Definition: eflowRecTrack.h:120
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
eflowRecTrack
This class extends the information about a xAOD::Track.
Definition: eflowRecTrack.h:45
eflowRecTrack::setSubtracted
void setSubtracted()
Definition: eflowRecTrack.h:81
eflowRecTrack::isSubtracted
bool isSubtracted() const
Definition: eflowRecTrack.h:79
eflowRecTrack::SortDescendingPt
Definition: eflowRecTrack.h:160
PFData
Definition: PFData.h:11
eflowCaloObject.h
eflowRecTrackContainer
Definition: eflowRecTrack.h:194
PFTrackFiller::fillTracksToConsider
static void fillTracksToConsider(PFData &data, eflowRecTrackContainer &recTrackContainer)
Definition: PFTrackFiller.cxx:57
PFTrackFiller::fillTracksToRecover
static void fillTracksToRecover(PFData &data)
Definition: PFTrackFiller.cxx:5
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
PFTrackFiller.h