95 {
96#ifdef SUEP_DEBUG
97 std::cout << "[SUEP_DEBUG] " << "Start of user hook for this event." << std::endl;
98#endif
99
100
101 bool particleFound=false;
102
103#ifdef SUEP_DEBUG
104 for (
int ii=0; ii <
process.size(); ++ii) {
105 std::cout <<
"[SUEP_DEBUG] " << ii <<
": id=" <<
process[ii].id() <<
", Final=" <<
process[ii].isFinal() <<
", Status=" <<
process[ii].status() <<
", daughter1=" <<
process[ii].daughter1() <<
", daughter2=" <<
process[ii].daughter2() << std::endl;
106 }
107#endif
108
109 for (
int ii=0; ii <
process.size(); ++ii) {
111
112 Vec4 higgs4mom, mesonmom;
113 vector< Vec4 > suep_shower4momenta;
114 particleFound=true;
115
116
118
119#ifdef SUEP_DEBUG
120 std::cout <<
"[SUEP_DEBUG] " <<
"Particle (pdgId=" <<
m_pdgId(settingsPtr) <<
", isFinal=True) found. Decaying to SUEP now." << std::endl;
121#endif
122
123
125
126 int originalEventSize =
process.size();
127
128
130 int nShowerAttempts=0;
131 do {
132 try {
133 nShowerAttempts++;
134 suep_shower4momenta=suep_shower.generate_shower();
135 if( suep_shower4momenta.size()<3){
136
137
138 } else {
139
140 nShowerAttempts = -1;
141 }
142 } catch (std::exception &e) {
143
144
145
146 }
147 } while ((nShowerAttempts > 0) && (nShowerAttempts < 3));
148 if (nShowerAttempts >= 3) {
149
150 std::cout << "[SUEP] WARNING: Something went wrong in generating the shower. Skipping the event." << std::endl;
151 return true;
152 }
153
154
155 for (unsigned j = 0; j < suep_shower4momenta.size(); ++j){
156
157 mesonmom = suep_shower4momenta[j];
158
159
160 mesonmom.bst(higgs4mom.px()/higgs4mom.e(),higgs4mom.py()/higgs4mom.e(), higgs4mom.pz()/higgs4mom.e());
161
162
163 process.append(999999, 91, ii, 0, 0, 0, 0, 0, mesonmom.px(), mesonmom.py(), mesonmom.pz(), mesonmom.e(),
m_darkMesonMass(settingsPtr));
164
165#ifdef SUEP_DEBUG
166 std::cout <<
"[SUEP_DEBUG] " <<
"Adding dark meson with px=" << mesonmom.px() <<
", py=" << mesonmom.py() <<
", pz=" << mesonmom.pz() <<
", m=" <<
m_darkMesonMass(settingsPtr) << std::endl;
167#endif
168 }
169
170
171 if ( suep_shower4momenta.size() > 0 ) {
172#ifdef SUEP_DEBUG
173 std::cout <<
"[SUEP_DEBUG] " <<
"Setting original particle status-code as non-Final particle. Adding daughters with indices: " << originalEventSize <<
" - " <<
process.size()-1 << std::endl;
174#endif
175
177
178
180 }
181
182
183 break;
184
185 }
186
187 }
188
189 if (not particleFound) {
190 std::cout <<
"[DecayToSUEP] " <<
"Particle " <<
m_pdgId(settingsPtr) <<
" not found. Nothing to decay to SUEP for this event." << std::endl;
191 } else {
192#ifdef SUEP_DEBUG
193 std::cout << "[SEUP_DEBUG] " << "All Done for this event." << std::endl;
194#endif
195 }
196#ifdef SUEP_DEBUG
197 std::cout << "[SUEP_DEBUG] Printing event after adding SUEP:" << std::endl;
198 for (
int ii=0; ii <
process.size(); ++ii) {
199 std::cout <<
"[SUEP_DEBUG] " << ii <<
": id=" <<
process[ii].id() <<
", Final=" <<
process[ii].isFinal() <<
", mayDecay=" <<
process[ii].mayDecay() <<
", Status=" <<
process[ii].status() <<
", daughter1=" <<
process[ii].daughter1() <<
", daughter2=" <<
process[ii].daughter2() << std::endl;
200 }
201#endif
202
203
204 return false;
205 }
const std::string process