171 LogTrace(
"l1tOmtfEventPrint") <<
" " << __FUNCTION__ <<
":" << __LINE__ << std::endl;
172 auto& gpResult = algoMuon->getGpResultConstr();
175 LogTrace(
"l1tOmtfEventPrint") <<
" " << __FUNCTION__ <<
":" << __LINE__ << std::endl;
182 unsigned int inputCnt = 18;
183 unsigned int outputCnt = 2;
184 const float noHitVal = 1023.;
189 std::vector<float>
inputs(inputCnt, noHitVal);
191 for (
unsigned int iLogicLayer = 0; iLogicLayer < gpResult.getStubResults().size(); ++iLogicLayer) {
192 auto& stubResult = gpResult.getStubResults()[iLogicLayer];
193 if (stubResult.getMuonStub()) {
194 int hitPhi = stubResult.getMuonStub()->phiHw;
196 int phiRefHit = gpResult.getStubResults()[refLayerLogicNum].getMuonStub()->phiHw;
199 hitPhi = stubResult.getMuonStub()->phiBHw;
205 hit.layer = iLogicLayer;
206 hit.quality = stubResult.getMuonStub()->qualityHw;
207 hit.eta = stubResult.getMuonStub()->etaHw;
208 hit.valid = stubResult.getValid();
211 hit.phiDist = hitPhi - phiRefHit;
220 if (
hit.phiDist > 504 ||
hit.phiDist < -512) {
223 <<
" layer " <<
int(
hit.layer) <<
" hit.phiDist " <<
hit.phiDist <<
" valid " << stubResult.getValid()
224 <<
" !!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
230 hit.
z = cscId.chamber() % 2;
233 LogTrace(
"l1tOmtfEventPrint") <<
"hit: layer " << (
int)
hit.layer <<
" quality " << (
int)
hit.quality <<
" eta " 234 << (
int)
hit.eta <<
" valid " << (
int)
hit.valid <<
" phiDist " << (
int)
hit.phiDist
235 <<
" z " << (
int)
hit.
z << std::endl;
241 LogTrace(
"l1tOmtfEventPrint") <<
" " << __FUNCTION__ <<
":" << __LINE__ << std::endl;
243 std::vector<double> nnResult(outputCnt);
246 LogTrace(
"l1tOmtfEventPrint") <<
" " << __FUNCTION__ <<
":" << __LINE__ << std::endl;
248 double pt = std::copysign(nnResult.at(0), nnResult.at(1));
250 LogTrace(
"l1tOmtfEventPrint") <<
" " << __FUNCTION__ <<
":" << __LINE__ <<
" nnResult.at(0) " << nnResult.at(0)
251 <<
" nnResult.at(1) " << nnResult.at(1) <<
" pt " <<
pt << std::endl;
253 std::vector<float>
pts;
254 pts.emplace_back(
pt);
257 auto calibratedHwPt =
lutNetworkFP->getCalibratedHwPt();
258 algoMuon->setPtNNConstr(calibratedHwPt);
260 algoMuon->setChargeNNConstr(nnResult[1] >= 0 ? 1 : -1);
263 boost::property_tree::ptree procDataTree;
264 for (
unsigned int i = 0;
i <
inputs.size();
i++) {
265 auto& inputTree = procDataTree.add(
"input",
"");
266 inputTree.add(
"<xmlattr>.num",
i);
267 inputTree.add(
"<xmlattr>.val",
inputs[
i]);
270 std::ostringstream ostr;
271 ostr <<
std::fixed << std::setprecision(19) << nnResult.at(0);
272 procDataTree.add(
"output0.<xmlattr>.val", ostr.str());
275 ostr <<
std::fixed << std::setprecision(19) << nnResult.at(1);
276 procDataTree.add(
"output1.<xmlattr>.val", ostr.str());
278 procDataTree.add(
"calibratedHwPt.<xmlattr>.val", calibratedHwPt);
280 procDataTree.add(
"hwSign.<xmlattr>.val", algoMuon->getChargeNNConstr() < 0 ? 1 : 0);
282 for (
auto& obs : observers)
283 obs->addProcesorData(
"regressionNN", procDataTree);
Log< level::Info, true > LogVerbatim
const OMTFConfiguration * omtfConfig
unique_ptr< lutNN::LutNetworkFixedPointRegressionBase > lutNetworkFP
bool omtfHitToEventInput(OmtfHit &hit, std::vector< float > &inputs, unsigned int omtfRefLayer, bool print)
static const double pts[33]
const std::vector< int > & getRefToLogicNumber() const
bool isBendingLayer(unsigned int iLayer) const override