|  | ATLAS Offline Software
    | 
 
 
 
Go to the documentation of this file.
   30 #include "GaudiKernel/IMessageSvc.h" 
   36   std::string thisName(
"TrigInDetTrackTruth::addMatch");
 
   39   log << 
MSG::DEBUG<< 
"Inserting HepMcParticleLink and TrigIDHitStats to TrigInDetTrackTruth map" << 
endmsg;
 
   41   int indx = 
index(p_tru_part);
 
   44     log << 
MSG::DEBUG<< 
"HepMcParticleLink already in map: replacing"  
   79     if (hep_link == (*it1)) {
 
   98   std::string thisName(
"TrigInDetTrackTruth::updateFamilyTree");
 
  103   int nr_mothers_found=0;
 
  114       if ( !it1->isValid() ) 
continue; 
 
  116       auto p_child = (*it1).cptr();
 
  117       log << 
MSG::DEBUG << 
"GenParticle " << child << 
" (" << p_child << 
"); PDG id="  
  118       << p_child->pdg_id() << 
"; status=" << p_child->status() 
 
  119       << 
"; pT=" << p_child->momentum().perp() 
 
  120       << 
"; searches mother..."  
  124       auto p_child_vtx = p_child->production_vertex();
 
  130       log << 
MSG::DEBUG<< 
"GenParticle "<< child << 
" comes from vertex with pointer " 
  137       if ( p_child_vtx->particles_in_size()==0)
 
  143      auto p_mum = p_child_vtx->particles_in().begin();
 
  145       HepMC::GenVertex::particles_in_const_iterator p_mum = p_child_vtx->particles_in_const_begin();
 
  147       log << 
MSG::DEBUG<< 
"Mother GenParticle (" << *p_mum << 
") found; PDG id="  
  148       << (*p_mum)->pdg_id() << 
"; status=" << (*p_mum)->status()
 
  149       << 
"; pT=" << (*p_mum)->momentum().perp() 
 
  150       << 
"; does it match track?"  
  155       bool mum_found=
false;
 
  156       for (
unsigned int mum=0; it2 != 
end; ++it2, ++mum) 
 
  159           << 
" and mother index=" << mum << 
endmsg;
 
  163           m_family_tree.push_back( std::pair<unsigned int, unsigned int>(mum,child) );
 
  169           << 
" mother-daughter relations found so far" << 
endmsg;
 
  171           << p_child->pdg_id() << 
"; pT=" << p_child->momentum().perp() 
 
  172           << 
") comes from mother " << mum << 
" (PDG id="  
  173           << (*p_mum)->status() << 
"; pT=" << p_child->momentum().perp() 
 
  177       if (!mum_found) 
log << 
MSG::DEBUG << 
"* Mother doesn't match track" 
  180   return nr_mothers_found;
 
  261   std::vector< std::pair<unsigned int, unsigned int> >::const_iterator 
it,it_end = 
m_family_tree.end();
 
  264     if (daughter == (*it).second) 
return (
int)(*it).first; 
 
  279   std::vector<unsigned int> v_indx;
 
  283   std::vector< std::pair<unsigned int, unsigned int> >::const_iterator 
it,it_end = 
m_family_tree.end();
 
  286     if (mother == (*it).first) {
 
  298   return ( !(v_indx.empty()) );
 
  
JetConstituentVector::iterator iterator
const std::vector< std::pair< unsigned int, unsigned int > > & getFamilyTree() const
returns copy of family tree "map"
unsigned int nrCommonHitsBestTRT() const
returns total number of common hits from best match true particle and TrigInDetTrack
singleton-like access to IMessageSvc via open function and helper
std::vector< HepMcParticleLink > m_true_part_vec
int index(HepMcParticleLink &) const
method to find if a given HepMcParticleLink already exists in "map" and, if so, what is its index; if...
const HepMcParticleLink * bestSiMatch() const
returns best match according to the number of hits
std::vector< std::pair< unsigned int, unsigned int > > m_family_tree
const HepMcParticleLink * bestMatch() const
returns best match according to the number of hits
unsigned int nrCommonTRTHits(unsigned int i) const
returns number of common hits from true particle i and TrigInDetTrack
IMessageSvc * getMessageSvc(bool quiet=false)
const HepMcParticleLink * truthMatch(unsigned int i) const
returns matching true particle number i
a link optimized in size for a GenParticle in a McEventCollection
unsigned int nrCommonHitsBestSi() const
returns total number of common hits from best match true particle and TrigInDetTrack
std::vector< TrigIDHitStats > m_nr_common_hits
bool daughtersInChain(unsigned int) const
given index of a GenParticle which matches the track returns true if it has stable a daughter which a...
unsigned int nrCommonSiHits(unsigned int i) const
returns number of common hits from true particle i and TrigInDetTrack
int m_best_TRT_match_hits
const HepMcParticleLink * bestTRTMatch() const
returns best match according to the number of hits
int addMatch(HepMcParticleLink p_tru_part, TrigIDHitStats hits)
accessor to fill object: returns index of new entry in vectors
std::vector< unsigned int > daughterIndicesInChain(unsigned int) const
given index of a GenParticle which matches the track returns vector with indices of its daughters,...
unsigned int nrMatches() const
returns number of matching particles
int motherIndexInChain(unsigned int) const
given index of a GenParticle which matches the track returns index of   its mother,...
bool motherInChain(unsigned int) const
given index of a GenParticle which matches the track returns true if its mother also matches the trac...
int updateFamilyTree()
accessor to fill family tree: for each HepMcParticleLink in the internal vector of HepMC::GenParticle...
unsigned int nrCommonHits(unsigned int i) const
returns number of common hits from true particle i and TrigInDetTrack