135 for (
int itrack = 0; itrack <
m_tracks2D.getEntries(); ++itrack) {
143 vector<int> geoSectors =
146 atan2(1.,
m_tracks2D[itrack]->getCotTheta()));
147 if (geoSectors.size() == 0)
continue;
151 unsigned long hitPattern =
154 unsigned long chitPattern =
160 if ((chitPattern & 341) != 341 &&
161 (chitPattern & 341) != 340 &&
162 (chitPattern & 341) != 337 &&
163 (chitPattern & 341) != 325 &&
164 (chitPattern & 341) != 277 &&
165 (chitPattern & 341) != 85 &&
167 B2DEBUG(250,
"Not enough axial hits (<4), setting track invalid!");
171 unsigned long puredriftth =
175 if (isector < 0)
continue;
177 vector<unsigned> hitIds;
183 vector<float> MLPinput =
m_NeuroTrigger.getInputVector(isector, hitIds);
185 for (
unsigned isl = 0; isl < 9; isl++) {
190 vector<float> target;
198 double z = (zIndex >= 0) ? target[zIndex] : 0.;
200 double cot = (thetaIndex >= 0) ? cos(target[thetaIndex]) / sin(target[thetaIndex]) : 0.;
201 std::vector<unsigned> tsvector(9, 0);
202 for (
unsigned i = 0; i < hitIds.size(); ++i) {
206 std::vector<bool> driftthreshold;
207 for (
int k = 8; k >= 0; k--) {
208 driftthreshold.push_back(!tsvector[k] ||
static_cast<bool>((puredriftth & (1 << k)) >> k));
216 if (tphi > -1 * M_PI_4 && tphi < 1 * M_PI_4) { quadrant = 3; }
217 else if (tphi > 1 * M_PI_4 && tphi < 3 * M_PI_4) { quadrant = 0; }
218 else if (tphi > 3 * M_PI_4 || tphi < -3 * M_PI_4) { quadrant = 1; }
219 else if (tphi > -3 * M_PI_4 && tphi < -1 * M_PI_4) { quadrant = 2; }
239 std::stringstream intomega;
240 std::stringstream intphi;
241 std::stringstream intz;
242 std::stringstream inttheta;
243 intomega << std::fixed << std::setprecision(0) << NNtrack->getOmega() /
Const::speedOfLight / 1.5e-4 * 0.3 * 34.;
244 intphi << std::fixed << std::setprecision(0) << (((NNtrack->getPhi0() - M_PI / 2.*NNtrack->
getQuadrant()) - M_PI / 4.) * 2 *
247 std::vector<float> recalcsw(0.);
248 recalcsw =
m_cdctriggerneuroconfig->getMLPs()[0].scaleTarget({
static_cast<float>(NNtrack->getZ0()),
static_cast<float>(NNtrack->getDirection().Theta())});
249 intz << std::fixed << std::setprecision(0) << recalcsw[0] * 4096;
250 inttheta << std::fixed << std::setprecision(0) << recalcsw[1] * 4096;
252 NNtrack->setRawOmega(std::stoi(intomega.str()));
254 NNtrack->setRawZ(std::stoi(intz.str()));
255 NNtrack->setRawTheta(std::stoi(inttheta.str()));
256 NNtrack->setHasETFTime(
m_tracks2D[itrack]->getHasETFTime());
257 NNtrack->setETF_unpacked(
m_tracks2D[itrack]->getETF_unpacked());
258 NNtrack->setETF_recalced(
m_tracks2D[itrack]->getETF_recalced());
265 for (
unsigned i = 0; i < hitIds.size(); ++i) {
271 for (
unsigned ii = 0; ii < MLPinput.size(); ++ii) {
275 auto* storeInput =
m_mlpInput.appendNew(MLPinput,
unsigned(isector));
276 NNtrack->addRelationTo(storeInput);