コード例 #1
0
ファイル: DelphesSaveGenJets.cpp プロジェクト: jlingema/FCCSW
void DelphesSaveGenJets::findJetPartMC(Candidate* cand, int rangeMCPart, std::set<int>& idRefMCPart) {
  // Warning - no MC relation found
  if (cand->GetCandidates()->GetEntries()==0) {

    warning() << "Can't build one of the relations from Jet to MC particle!" << std::endl;
  }
  // Relation can be found
  else {

    for (auto itCand=cand->GetCandidates()->begin(); itCand!=cand->GetCandidates()->end(); ++itCand) {

      Candidate* refCand = static_cast<Candidate*>(*itCand);
      int id = refCand->GetUniqueID()-1;

      //std::cout << "Depth: " << depth << " " << id << std::endl;
      // Relation found
      if (id<rangeMCPart) {
        //std::cout << ">>> " << id << std::endl;
        idRefMCPart.insert(id);
      }
      // Not found -> step one level below
      else findJetPartMC(refCand, rangeMCPart, idRefMCPart);
    }
  }
}