11 #include <boost/range/adaptor/reversed.hpp> 14 #include "TDirectory.h" 21 updateStatFunction([this]() {
updateStat(); }),
22 candidateSimMuonMatcher(candidateSimMuonMatcher),
23 eventCntPerGp(gps.size(), 0) {
25 << edmCfg.getParameter<
string>(
"patternGenerator") << std::endl;
27 if (edmCfg.getParameter<
string>(
"patternGenerator") ==
"patternGen" ||
28 edmCfg.getParameter<
string>(
"patternGenerator") ==
"2DHists" ||
29 edmCfg.getParameter<
string>(
"patternGenerator") ==
"deltaPhiVsPhiRef")
33 if (edmCfg.getParameter<
string>(
"patternGenerator") ==
"2DHists" ||
34 edmCfg.getParameter<
string>(
"patternGenerator") ==
"deltaPhiVsPhiRef")
35 updateStatFunction = [
this]() { updateStatUsingMatcher2(); };
37 if (edmCfg.exists(
"simTracksTag") ==
false)
38 throw cms::Exception(
"PatternGenerator::PatternGenerator(): no simTracksTag !!!!!!!!!!!!!!!!!");
40 if (!candidateSimMuonMatcher) {
41 edm::LogImportant(
"l1tOmtfEventPrint") <<
"PatternGenerator: candidateSimMuonMatcher is null!!!!!!" << std::endl;
51 gp->setKeyNumber(
i++);
53 if (
gp->key().thePt == 0)
59 int statBinsCnt1 = 1024 * 2;
64 statBinsCnt2 = 1024 * 2;
72 gp->iniStatisitics(statBinsCnt1, statBinsCnt2);
74 if (statBinsCnt2 < 10 &&
sizeof(
gp->getStatistics()[0][0][0][0]) < 4) {
76 <<
"PatternGenerator::initPatternGen():" << __LINE__ <<
"sizeof gp statistics " 77 <<
sizeof(
gp->getStatistics()[0][0][0][0]) << std::endl;
78 throw cms::Exception(
"PatternGenerator::initPatternGen(): getStatistics type is short!!!!");
82 edm::LogImportant(
"l1tOmtfEventPrint") <<
"PatternGenerator::initPatternGen():" << __LINE__
83 <<
" goldenPatterns.size() " <<
goldenPatterns.size() << std::endl;
90 for (
unsigned int iLayer = 0; iLayer <
gp->getPdf().size(); ++iLayer) {
91 for (
unsigned int iRefLayer = 0; iRefLayer <
gp->getPdf()[iLayer].size(); ++iRefLayer) {
92 for (
unsigned int iBin = 0; iBin <
gp->getPdf()[iLayer][iRefLayer].size(); iBin++) {
93 gp->pdfAllRef[iLayer][iRefLayer][iBin] = 1;
131 edm::LogImportant(
"l1tOmtfEventPrint") <<
":" << __LINE__ <<
" algoMuon is null" << std::endl;
132 throw runtime_error(
"algoMuon is null");
154 unsigned int refLayer = gpResult.getRefLayer();
156 if (gpResult.getFiredLayerCnt() >= 3) {
157 for (
unsigned int iLayer = 0; iLayer < gpResult.getStubResults().size(); iLayer++) {
161 if (gpResult.getStubResults()[iLayer].getMuonStub()) {
163 if (gpResult.getStubResults()[iLayer].getMuonStub()->qualityHw >= 4)
170 int phiDist = gpResult.getStubResults()[iLayer].getPdfBin();
182 phiDist += exptCandGp->
getStatistics()[iLayer][refLayer].size() / 2;
185 if (phiDist > 0 && phiDist < (
int)(exptCandGp->
getStatistics()[iLayer][refLayer].size())) {
188 exptCandGp->
updateStat(iLayer, refLayer, phiDist, 0, 1);
192 exptCandGp->
updateStat(iLayer, refLayer, phiDist, 0, 1);
203 LogTrace(
"l1tOmtfEventPrint") <<
"matchingResults.size() " << matchingResults.size() << std::endl;
206 for (
auto& matchingResult : matchingResults) {
207 if (matchingResult.muonCand && matchingResult.simTrack) {
211 AlgoMuon* algoMuon = matchingResult.procMuon.get();
213 edm::LogImportant(
"l1tOmtfEventPrint") <<
":" << __LINE__ <<
" algoMuon is null" << std::endl;
214 throw runtime_error(
"algoMuon is null");
217 double ptSim = matchingResult.simTrack->momentum().pt();
218 int chargeSim = (
abs(matchingResult.simTrack->type()) == 13) ? matchingResult.simTrack->type() / -13 : 0;
220 double muDxy = (-1 * matchingResult.simVertex->position().x() * matchingResult.simTrack->momentum().py() +
221 matchingResult.simVertex->position().y() * matchingResult.simTrack->momentum().px()) /
222 matchingResult.simTrack->momentum().pt();
224 simMuEta->Fill(matchingResult.simTrack->momentum().eta());
226 simMuPtVsDispl->Fill(matchingResult.simTrack->momentum().pt(), muDxy);
227 simMuPtVsRho->Fill(matchingResult.simTrack->momentum().pt(), matchingResult.simVertex->position().rho());
235 omtfConfig->
getProcIndx(matchingResult.muonCand->processor(), matchingResult.muonCand->trackFinderType());
240 LogTrace(
"l1tOmtfEventPrint") <<
"updateStatUsingMatcher2 " << __LINE__ << std::endl;
245 if (gpResult.getFiredLayerCnt() >= 3) {
246 int refLayer = gpResult.getRefLayer();
248 if (refLayer < 0 || !gpResult.isValid())
249 LogTrace(
"l1tOmtfEventPrint") <<
"updateStatUsingMatcher2 " << __LINE__ <<
" refLayer " << refLayer
250 <<
" gpResult.isValid() " << gpResult.isValid() << std::endl;
254 LogTrace(
"l1tOmtfEventPrint") << __FUNCTION__ <<
":" << __LINE__ <<
" updating statistic: candProcIndx " 255 <<
candProcIndx <<
" iRefHit " << iRefHit <<
" refLayer " << refLayer
256 <<
" exptPatNum " << exptPatNum <<
" ptSim " << ptSim <<
" chargeSim " 257 << chargeSim <<
" muDxy " << muDxy <<
" muRho " 258 << matchingResult.simVertex->position().rho() <<
" x " 259 << matchingResult.simVertex->position().x() <<
" y " 260 << matchingResult.simVertex->position().y() <<
" z " 261 << matchingResult.simVertex->position().z() << std::endl;
267 refPhiB = gpResult.getStubResults()[refLayerLogicNumber].getMuonStub()->phiBHw;
269 int refPhiBShifted = refPhiB + exptCandGp->
getStatistics()[0][refLayer][0].size() / 2;
272 refPhiBShifted = gpResult.getStubResults()[refLayerLogicNumber].getMuonStub()->phiHw;
275 if (refPhiBShifted < 0 || refPhiBShifted >= (
int)exptCandGp->
getStatistics()[0][refLayer][0].size()) {
277 << __FUNCTION__ <<
": " << __LINE__ <<
" wrong refPhiB " << refPhiB
278 <<
" refPhiBShifted " << refPhiBShifted;
282 for (
unsigned int iLayer = 0; iLayer < gpResult.getStubResults().size(); iLayer++) {
286 if (gpResult.getStubResults()[iLayer].getMuonStub()) {
293 int phiDist = gpResult.getStubResults()[iLayer].getPdfBin() + meanDistPhi - pdfMiddle;
296 int lutMiddle = exptCandGp->
getStatistics()[iLayer][refLayer].size() / 2;
299 << __FUNCTION__ <<
":" << __LINE__ <<
" refLayer " << refLayer <<
" iLayer " << iLayer <<
" phiDist " 300 << phiDist <<
" getPdfBin " << gpResult.getStubResults()[iLayer].getPdfBin() <<
" phiMean " 301 << meanDistPhi <<
" refPhiB " << refPhiB << std::endl;
306 int phiDistCorr = phiDist + lutMiddle;
308 if (phiDistCorr > 0 && phiDistCorr < (
int)(exptCandGp->
getStatistics()[iLayer][refLayer].size())) {
309 LogTrace(
"l1tOmtfEventPrint") << __FUNCTION__ <<
":" << __LINE__ <<
" phiDistCorr " 312 <<
" refPhiBShifted " << refPhiBShifted << std::endl;
313 exptCandGp->
updateStat(iLayer, refLayer, phiDistCorr, refPhiBShifted, 1);
317 exptCandGp->
updateStat(iLayer, refLayer, phiDist, refPhiBShifted, 1);
327 std::unique_ptr<l1t::RegionalMuonCandBxCollection>& finalCandidates) {
359 TDirectory* curDir = (TDirectory*)
inFile.Get(
"layerStats");
361 ostringstream ostrName;
363 if (
gp->key().thePt == 0)
366 for (
unsigned int iLayer = 0; iLayer <
gp->getPdf().size(); ++iLayer) {
367 for (
unsigned int iRefLayer = 0; iRefLayer <
gp->getPdf()[iLayer].size(); ++iRefLayer) {
369 ostrName <<
"histLayerStat_PatNum_" <<
gp->key().theNumber <<
"_refLayer_" << iRefLayer <<
"_Layer_" 372 TH1I* histLayerStat = (TH1I*)curDir->Get(ostrName.str().c_str());
375 int statBinsCnt = 1024 * 2;
376 if ((
int)(
gp->getStatistics()[iLayer][iRefLayer].size()) != histLayerStat->GetNbinsX()) {
377 statBinsCnt = histLayerStat->GetNbinsX();
378 gp->iniStatisitics(statBinsCnt, 1);
380 <<
"PatternGenerator::endJob() - " << ostrName.str() <<
"statBinsCnt = " << statBinsCnt << std::endl;
383 for (
int iBin = 0; iBin < statBinsCnt; iBin++) {
384 gp->updateStat(iLayer, iRefLayer, iBin, 0, histLayerStat->GetBinContent(iBin + 1));
388 <<
"PatternGenerator::endJob() - reading histLayerStat: histogram not found " << ostrName.str()
395 TH1* simMuFoundByOmtfPt_fromFile = (TH1*)
inFile.Get(
"simMuFoundByOmtfPt");
396 for (
unsigned int iGp = 0; iGp <
eventCntPerGp.size(); iGp++) {
397 eventCntPerGp[iGp] = simMuFoundByOmtfPt_fromFile->GetBinContent(simMuFoundByOmtfPt_fromFile->FindBin(iGp));
399 <<
"PatternGenerator::endJob() - eventCntPerGp: iGp" << iGp <<
" - " <<
eventCntPerGp[iGp] << std::endl;
404 int indexInGroup = 0;
408 gp->key().setIndexInGroup(indexInGroup);
412 <<
"setGroup(group): group " <<
group <<
" indexInGroup " << indexInGroup << std::endl;
414 if (
gp->key().thePt <= 10 && indexInGroup == 2) {
419 if (
gp->key().thePt > 10 && indexInGroup == 4) {
441 if (
gp->key().thePt == 0)
443 for (
unsigned int iLayer = 0; iLayer <
gp->getPdf().size(); ++iLayer) {
444 for (
unsigned int iRefLayer = 0; iRefLayer <
gp->getPdf()[iLayer].size(); ++iRefLayer) {
445 if (
gp->getDistPhiBitShift(iLayer, iRefLayer)) {
447 string(__FUNCTION__) +
":" +
to_string(__LINE__) +
448 "gp->getDistPhiBitShift(iLayer, iRefLayer) != 0 - cannot change DistPhiBitShift then!!!!");
472 if ((
gp->key().thePt <= 8) &&
473 (iLayer == 1 || iLayer == 3 || iLayer == 5)) {
474 gp->setDistPhiBitShift(2, iLayer, iRefLayer);
475 }
else if ((
gp->key().thePt <= 10) && (iLayer == 10)) {
476 gp->setDistPhiBitShift(1, iLayer, iRefLayer);
477 }
else if ((
gp->key().thePt <= 10) &&
478 (iLayer == 1 || iLayer == 3 || iLayer == 5)) {
479 gp->setDistPhiBitShift(1, iLayer, iRefLayer);
480 }
else if ((
gp->key().thePt <= 17) && (iLayer == 1)) {
483 gp->setDistPhiBitShift(1, iLayer, iRefLayer);
484 }
else if ((
gp->key().thePt >= 11 &&
gp->key().thePt <= 17) && (iLayer == 3 || iLayer == 5)) {
487 gp->setDistPhiBitShift(0, iLayer, iRefLayer);
489 gp->setDistPhiBitShift(0, iLayer, iRefLayer);
494 double minHitCntThresh = 0.001;
497 if (
gp->key().thePt == 0)
502 <<
"PatternGenerator::upadatePdfs() Calculating meanDistPhi " <<
gp->key() <<
" eventCnt " 503 <<
eventCntPerGp[
gp->key().number()] <<
" minHitCnt " << minHitCnt << std::endl;
505 for (
unsigned int iLayer = 0; iLayer <
gp->getPdf().size(); ++iLayer) {
506 for (
unsigned int iRefLayer = 0; iRefLayer <
gp->getPdf()[iLayer].size(); ++iRefLayer) {
508 double meanDistPhi = 0;
510 for (
unsigned int iBin = 1; iBin <
gp->getStatistics()[iLayer][iRefLayer].size(); iBin++) {
512 meanDistPhi += iBin *
gp->getStatistics()[iLayer][iRefLayer][iBin][0];
513 count +=
gp->getStatistics()[iLayer][iRefLayer][iBin][0];
517 meanDistPhi /=
count;
519 meanDistPhi -= (
gp->getStatistics()[iLayer][iRefLayer].size() / 2);
521 if (
count < minHitCnt)
525 << __FUNCTION__ <<
": " << __LINE__ <<
" " <<
gp->key() <<
" iLayer " << iLayer <<
" iRefLayer " 526 << iRefLayer <<
" count " <<
count <<
" meanDistPhi " << meanDistPhi << endl;
528 gp->setMeanDistPhiValue(round(meanDistPhi), iLayer, iRefLayer);
535 for (
unsigned int iGroup = 0; iGroup < patternGroups.size(); iGroup++) {
536 edm::LogImportant(
"l1tOmtfEventPrint") <<
"patternGroup " << std::setw(2) << iGroup <<
" ";
537 for (
unsigned int i = 0;
i < patternGroups[iGroup].size();
i++) {
538 edm::LogImportant(
"l1tOmtfEventPrint") <<
i <<
" patNum " << patternGroups[iGroup][
i] <<
" ";
544 for (
unsigned int iLayer = 0; iLayer <
goldenPatterns.at(0)->getPdf().size(); ++iLayer) {
545 for (
unsigned int iRefLayer = 0; iRefLayer <
goldenPatterns.at(0)->getPdf()[iLayer].size(); ++iRefLayer) {
549 for (
unsigned int iGroup = 0; iGroup < patternGroups.size(); iGroup++) {
550 double meanDistPhi = 0;
553 for (
unsigned int i = 0;
i < patternGroups[iGroup].size();
i++) {
555 if (
gp->meanDistPhiValue(iLayer, iRefLayer) != 0) {
556 double weight = 1. /
gp->key().thePt;
557 meanDistPhi +=
weight *
gp->meanDistPhiValue(iLayer, iRefLayer);
586 for (
unsigned int i = 0;
i < patternGroups[iGroup].size();
i++) {
588 gp->setMeanDistPhiValue(round(meanDistPhi), iLayer, iRefLayer);
590 << __FUNCTION__ <<
": " << __LINE__ <<
" iGroup " << iGroup <<
" numInGroup " <<
i <<
" " <<
gp->key()
591 <<
" iLayer " << iLayer <<
" iRefLayer " << iRefLayer <<
" meanDistPhi after averaging " 592 << meanDistPhi << endl;
602 if (
gp->key().thePt == 0)
606 int minHitCnt = 2 * minHitCntThresh *
eventCntPerGp[
gp->key().number()];
608 for (
unsigned int iLayer = 0; iLayer <
gp->getPdf().size(); ++iLayer) {
609 for (
unsigned int iRefLayer = 0; iRefLayer <
gp->getPdf()[iLayer].size(); ++iRefLayer) {
612 for (
unsigned int iBin = 0; iBin <
gp->getStatistics()[iLayer][iRefLayer].size();
614 norm +=
gp->getStatistics()[iLayer][iRefLayer][iBin][0];
617 int pdfMiddle =
gp->getPdf()[iLayer][iRefLayer].size() / 2;
618 int statBinGroupSize = 1 <<
gp->getDistPhiBitShift(iLayer, iRefLayer);
619 for (
unsigned int iBinPdf = 0; iBinPdf <
gp->getPdf()[iLayer][iRefLayer].size(); iBinPdf++) {
622 for (
int i = 0;
i < statBinGroupSize;
i++) {
624 statBinGroupSize * ((
int)(iBinPdf)-pdfMiddle) +
i +
gp->meanDistPhiValue(iLayer, iRefLayer);
626 iBinStat += (
gp->getStatistics()[iLayer][iRefLayer].size() / 2);
628 if (iBinStat >= 0 && iBinStat < (
int)
gp->getStatistics()[iLayer][iRefLayer].size()) {
629 pdfVal +=
gp->getStatistics()[iLayer][iRefLayer][iBinStat][0];
632 if (norm > minHitCnt) {
633 pdfVal /= (norm * statBinGroupSize);
639 pdfVal =
gp->getStatistics()[iLayer][iRefLayer][iBinStat][0] / norm;
642 << __FUNCTION__ <<
": " << __LINE__ <<
" " <<
gp->key() <<
"calculating pdf: iLayer " << iLayer
643 <<
" iRefLayer " << iRefLayer <<
" norm " << std::setw(5) << norm <<
" no hits cnt " << std::setw(5)
644 <<
gp->getStatistics()[iLayer][iRefLayer][iBinStat][0] <<
" pdfVal " << pdfVal << endl;
647 double minPdfValFactor = 1;
651 int digitisedVal = 0;
653 digitisedVal = rint(pdfMaxVal -
log(pdfVal) / minPlog * pdfMaxVal);
656 gp->setPdfValue(digitisedVal, iLayer, iRefLayer, iBinPdf);
665 outfile.mkdir(
"ptDeltaPhiHists")->cd();
677 edm::LogImportant(
"l1tOmtfEventPrint") << __FUNCTION__ <<
": " << __LINE__ <<
" Correcting P(C_k) " << std::endl;
679 for (
unsigned int iRefLayer = 0; iRefLayer <
goldenPatterns[0]->getPdf()[0].size(); ++iRefLayer) {
681 if (iRefLayer == 0 || iRefLayer == 2)
683 else if (iRefLayer == 5)
685 else if (iRefLayer == 1)
687 else if (iRefLayer == 3)
689 else if (iRefLayer == 5)
691 else if (iRefLayer == 6 || iRefLayer == 7)
695 << __FUNCTION__ <<
":" << __LINE__ <<
" RefLayer " << iRefLayer <<
" step " <<
step << std::endl;
698 if (
gp->key().thePt == 0 ||
gp->key().theCharge !=
sign)
704 double ptRange = ptTo - ptFrom;
706 double minPdfValFactor = 0.1;
720 int digitisedVal = rint(pdfMaxVal -
log(classProb) / minPlog * pdfMaxVal);
722 int newPdfVal = digitisedVal;
741 if (ptFrom >= 22 && ptFrom <= 26)
751 gp->setPdfValue(newPdfVal, refLayerLogicNumber, iRefLayer, iPdf);
756 <<
" ptRange " <<
ptRange <<
" RefLayer " << iRefLayer <<
" newPdfVal " << newPdfVal << std::endl;
763 edm::LogImportant(
"l1tOmtfEventPrint") << __FUNCTION__ <<
": " << __LINE__ <<
" reCalibratePt" << std::endl;
764 std::map<int, float> ptMap;
796 if (
gp->key().thePt == 0)
802 gp->key().setPt(newPt);
808 int indexInGroup = 0;
812 gp->key().setIndexInGroup(indexInGroup);
816 <<
"setGroup(group): group " <<
group <<
" indexInGroup " << indexInGroup << std::endl;
818 if (
gp->key().thePt <= 12 && indexInGroup == 2) {
823 if (
gp->key().thePt > 12 && indexInGroup == 4) {
831 for (
unsigned int iGroup = 0; iGroup < patternGroups.size(); iGroup++) {
832 edm::LogImportant(
"l1tOmtfEventPrint") <<
"patternGroup " << std::setw(2) << iGroup <<
" ";
833 for (
unsigned int i = 0;
i < patternGroups[iGroup].size();
i++) {
834 edm::LogImportant(
"l1tOmtfEventPrint") <<
i <<
" patNum " << patternGroups[iGroup][
i] <<
" ";
841 for (
unsigned int iLayer = 0; iLayer <
goldenPatterns.at(0)->getPdf().size(); ++iLayer) {
842 for (
unsigned int iRefLayer = 0; iRefLayer <
goldenPatterns.at(0)->getPdf()[iLayer].size(); ++iRefLayer) {
847 for (
unsigned int iGroup = 0; iGroup < patternGroups.size(); iGroup++) {
848 double meanDistPhi = 0;
850 for (
unsigned int i = 0;
i < patternGroups[iGroup].size();
i++) {
852 meanDistPhi +=
gp->meanDistPhiValue(iLayer, iRefLayer);
853 if (
gp->meanDistPhiValue(iLayer, iRefLayer) != 0)
856 << __FUNCTION__ <<
": " << __LINE__ <<
" iGroup " << iGroup <<
" numInGroup " <<
i <<
" " <<
gp->key()
857 <<
" iLayer " << iLayer <<
" iRefLayer " << iRefLayer <<
" old meanDistPhiValue " 858 <<
gp->meanDistPhiValue(iLayer, iRefLayer) << endl;
862 meanDistPhi /= mergedCnt;
863 meanDistPhi = (
int)meanDistPhi;
866 for (
unsigned int i = 0;
i < patternGroups[iGroup].size();
i++) {
869 if (refLayerLogicNum != iLayer) {
870 int shift = meanDistPhi -
gp->meanDistPhiValue(iLayer, iRefLayer);
872 << __FUNCTION__ <<
": " << __LINE__ <<
" iGroup " << iGroup <<
" numInGroup " <<
i <<
" " 873 <<
gp->key() <<
" iLayer " << iLayer <<
" iRefLayer " << iRefLayer
874 <<
" new meanDistPhi after averaging " << meanDistPhi <<
" old meanDistPhiValue " 875 <<
gp->meanDistPhiValue(iLayer, iRefLayer) <<
" shift " <<
shift << endl;
878 for (
int iBin = 1 -
shift; iBin < pdfBins;
880 auto pdfVal =
gp->pdfValue(iLayer, iRefLayer, iBin);
881 gp->setPdfValue(pdfVal, iLayer, iRefLayer, iBin +
shift);
883 <<
" iBin " << iBin <<
" iBin + shift " << iBin +
shift <<
" pdfVal " << pdfVal << endl;
885 for (
int iBin = pdfBins +
shift; iBin < pdfBins; iBin++) {
886 gp->setPdfValue(0, iLayer, iRefLayer, iBin);
888 }
else if (
shift > 0) {
889 for (
int iBin = pdfBins - 1 -
shift; iBin > 0;
891 auto pdfVal =
gp->pdfValue(iLayer, iRefLayer, iBin);
892 gp->setPdfValue(pdfVal, iLayer, iRefLayer, iBin +
shift);
894 <<
" iBin " << iBin <<
" iBin + shift " << iBin +
shift <<
" pdfVal " << pdfVal << endl;
896 for (
int iBin =
shift; iBin > 0; iBin--) {
897 gp->setPdfValue(0, iLayer, iRefLayer, iBin);
902 gp->setMeanDistPhiValue(round(meanDistPhi), iLayer, iRefLayer);
T getParameter(std::string const &) const
~PatternGenerator() override
CandidateSimMuonMatcher * candidateSimMuonMatcher
virtual void updateStat(unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin, unsigned int what, double value)
AlgoMuons::value_type omtfCand
void updateStatUsingMatcher2()
virtual double hwEtaToEta(int hwEta) const
center of eta bin
unsigned int getPatternNum(double pt, int charge) const
charge: -1 - negative, +1 - positive
static double vxIntegMuRate(double pt_GeV, double dpt, double etaFrom, double etaTo)
const math::XYZTLorentzVectorD & momentum() const
static std::string to_string(const XMLCh *ch)
const int hwEta() const
Get compressed eta (returned int * 0.010875 = eta)
int type() const
particle type (HEP PDT convension)
std::vector< vector1D > vector2D
void observeEventEnd(const edm::Event &iEvent, std::unique_ptr< l1t::RegionalMuonCandBxCollection > &finalCandidates) override
l1t::RegionalMuonCand regionalMuonCand
unsigned int nPhiBins() const
void observeEventEnd(const edm::Event &iEvent, std::unique_ptr< l1t::RegionalMuonCandBxCollection > &finalCandidates) override
unsigned int nPdfAddrBits() const
resultsArrayType & getResults()
Abs< T >::type abs(const T &t)
Log< level::Error, true > LogImportant
std::function< void()> updateStatFunction
const std::vector< int > & getRefToLogicNumber() const
PatternGenerator(const edm::ParameterSet &edmCfg, const OMTFConfiguration *omtfConfig, GoldenPatternVec< GoldenPatternWithStat > &gps, CandidateSimMuonMatcher *candidateSimMuonMatcher)
std::vector< MatchingResult > getMatchingResults()
int ptGevToHw(double ptGev) const override
uGMT pt scale conversion: [0GeV, 0.5GeV) = 1 [0.5GeV, 1 Gev) = 2
unsigned int candProcIndx
std::vector< std::unique_ptr< GoldenPatternType > > GoldenPatternVec
void modifyClassProb(double step)
GoldenPatternVec< GoldenPatternWithStat > & goldenPatterns
PatternPt getPatternPtRange(unsigned int patNum) const
unsigned int getProcIndx(unsigned int iProcessor, l1t::tftype mtfType) const
input phi should be in the hardware scale (nPhiBins units for 2pi), can be in range -nPhiBins ...
std::vector< unsigned int > eventCntPerGp
static unsigned int const shift
int meanDistPhiValue(unsigned int iLayer, unsigned int iRefLayer) const
unsigned int nProcessors() const
vector2D getPatternGroups(const std::vector< std::unique_ptr< GoldenPatternType > > &goldenPats) const
unsigned int nPdfBins() const
const OMTFConfiguration * omtfConfig
void saveHists(TFile &outfile) override
bool isBendingLayer(unsigned int iLayer) const override
const StatArrayType & getStatistics() const