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