37 return StatusCode::SUCCESS;
42 ATH_MSG_INFO(
"Statistics of X->VV, V->decay scanning all ancestors of V in order to find X");
46 return StatusCode::SUCCESS;
51 bool okPDGChild1 =
false;
52 bool okPDGChild2 =
false;
58 const HepMC::GenEvent* genEvt = (*itr);
59 for (
const auto& pitr: *genEvt) {
63 if (!isGrandParentOK)
continue;
69 ATH_MSG_DEBUG(
"Result " << nGoodParent <<
" " << okPDGChild1 <<
" " << okPDGChild2);
71 if (nGoodParent == 2) {
73 if (okPDGChild1 && okPDGChild2) {
75 return StatusCode::SUCCESS;
80 setFilterPassed(
false);
81 return StatusCode::SUCCESS;
88 if (! pitr->production_vertex()) {
94 if (pitr->production_vertex()->particles_in().size()==0) {
107 auto pitr_current = pitr;
116 HepMC::GenVertex::particle_iterator firstMother = pitr->production_vertex()->particles_begin(
HepMC::parents);
117 HepMC::GenVertex::particle_iterator endMother = pitr->production_vertex()->particles_end(
HepMC::parents);
118 HepMC::GenVertex::particle_iterator thisMother = firstMother;
119 if (firstMother == endMother) {
147 if (! pitr->production_vertex()) {
152 bool isGrandParentOK =
false;
154 if (pitr->production_vertex()->particles_in().size()==0) {
162 for (
const auto& thisMother: pitr->production_vertex()->particles_in()) {
163 ATH_MSG_DEBUG(
"Now on this mother: " << (thisMother)->pdg_id() <<
" " << n_mothers);
166 if ( (thisMother)->pdg_id() ==
m_PDGGrandParent && n_mothers == 1) { isGrandParentOK =
true; }
170 if (isGrandParentOK) {
177 return pitr->production_vertex()->particles_in()[0];
179 HepMC::GenVertex::particle_iterator firstMother = pitr->production_vertex()->particles_begin(
HepMC::parents);
180 HepMC::GenVertex::particle_iterator endMother = pitr->production_vertex()->particles_end(
HepMC::parents);
181 HepMC::GenVertex::particle_iterator thisMother = firstMother;
182 if (firstMother == endMother) {
190 for (; thisMother != endMother; ++thisMother) {
191 ATH_MSG_DEBUG(
"Now on this mother: " << (*thisMother)->pdg_id() <<
" " << n_mothers);
194 if ( (*thisMother)->pdg_id() ==
m_PDGGrandParent && n_mothers == 1) { isGrandParentOK =
true; }
198 if (isGrandParentOK) {
204 return (*firstMother);
210 int targetPDGID,
bool& okPDGChild1,
bool& okPDGChild2)
const{
211 if (!searchvertex)
return;
212 for (
const auto& thisAncestor: *searchvertex){
213 if (std::abs(thisAncestor->pdg_id()) == targetPDGID) {
214 FindAncestor(thisAncestor->end_vertex(), targetPDGID, okPDGChild1, okPDGChild2);
218 if (std::abs(thisAncestor->pdg_id()) ==
m_PDGChild1[
i]) {
223 if (okPDGChild1)
break;
227 if (std::abs(thisAncestor->pdg_id()) ==
m_PDGChild2[
i]) {
232 if (okPDGChild2)
break;