37 bool sortByMvaScore(
const std::pair<unsigned, double>&
A,
const std::pair<unsigned, double>&
B) {
38 return (
A.second >
B.second);
57 typedef std::pair<std::unique_ptr<const SeedMvaEstimator>, std::unique_ptr<const SeedMvaEstimator>>
96 rejectAll_(iConfig.getParameter<
bool>(
"rejectAll")),
97 isFromL1_(iConfig.getParameter<
bool>(
"isFromL1")),
99 mvaFileB_(iConfig.getParameter<
edm::FileInPath>(isFromL1_ ?
"mvaFileBL1" :
"mvaFileBL2")),
100 mvaFileE_(iConfig.getParameter<
edm::FileInPath>(isFromL1_ ?
"mvaFileEL1" :
"mvaFileEL2")),
102 mvaScaleMeanB_(iConfig.getParameter<
std::
vector<double>>(isFromL1_ ?
"mvaScaleMeanBL1" :
"mvaScaleMeanBL2")),
103 mvaScaleStdB_(iConfig.getParameter<
std::
vector<double>>(isFromL1_ ?
"mvaScaleStdBL1" :
"mvaScaleStdBL2")),
104 mvaScaleMeanE_(iConfig.getParameter<
std::
vector<double>>(isFromL1_ ?
"mvaScaleMeanEL1" :
"mvaScaleMeanEL2")),
105 mvaScaleStdE_(iConfig.getParameter<
std::
vector<double>>(isFromL1_ ?
"mvaScaleStdEL1" :
"mvaScaleStdEL2")),
107 doSort_(iConfig.getParameter<
bool>(
"doSort")),
108 nSeedsMaxB_(iConfig.getParameter<
int>(
"nSeedsMaxB")),
109 nSeedsMaxE_(iConfig.getParameter<
int>(
"nSeedsMaxE")),
111 etaEdge_(iConfig.getParameter<double>(
"etaEdge")),
112 mvaCutB_(iConfig.getParameter<double>(
"mvaCutB")),
113 mvaCutE_(iConfig.getParameter<double>(
"mvaCutE")),
115 minL1Qual_(iConfig.getParameter<
int>(
"minL1Qual")),
116 baseScore_(iConfig.getParameter<double>(
"baseScore")) {
123 produces<TrajectorySeedCollection>();
128 auto result = std::make_unique<TrajectorySeedCollection>();
150 std::vector<std::pair<unsigned, double>> pairSeedIdxMvaScoreB = {};
151 std::vector<std::pair<unsigned, double>> pairSeedIdxMvaScoreE = {};
154 trkGeom.
idToDet(
seed.startingState().detId())->surface().
toGlobal(
seed.startingState().parameters().momentum());
195 pairSeedIdxMvaScoreB.push_back(std::make_pair(&
seed - &
seeds.at(0),
score));
197 pairSeedIdxMvaScoreE.push_back(std::make_pair(&
seed - &
seeds.at(0),
score));
207 for (
auto i = 0
U;
i < pairSeedIdxMvaScoreB.size(); ++
i) {
210 const auto&
seed(
seeds.at(pairSeedIdxMvaScoreB.at(
i).first));
214 for (
auto i = 0
U;
i < pairSeedIdxMvaScoreE.size(); ++
i) {
217 const auto&
seed(
seeds.at(pairSeedIdxMvaScoreE.at(
i).first));
232 mva = pairMvaEstimator.first->computeMva(
seed, global_p, l1Muons, l2Muons);
234 mva = pairMvaEstimator.second->computeMva(
seed, global_p, l1Muons, l2Muons);
247 desc.add<
bool>(
"rejectAll",
false);
248 desc.add<
bool>(
"isFromL1",
false);
251 edm::FileInPath(
"RecoMuon/TrackerSeedGenerator/data/xgb_Run3_Iter2FromL1Seeds_barrel.xml"));
253 edm::FileInPath(
"RecoMuon/TrackerSeedGenerator/data/xgb_Run3_Iter2FromL1Seeds_endcap.xml"));
255 edm::FileInPath(
"RecoMuon/TrackerSeedGenerator/data/xgb_Run3_Iter2Seeds_barrel.xml"));
257 edm::FileInPath(
"RecoMuon/TrackerSeedGenerator/data/xgb_Run3_Iter2Seeds_endcap.xml"));
258 desc.add<std::vector<double>>(
"mvaScaleMeanBL1", {0., 0., 0., 0., 0., 0., 0., 0.});
259 desc.add<std::vector<double>>(
"mvaScaleStdBL1", {1., 1., 1., 1., 1., 1., 1., 1.});
260 desc.add<std::vector<double>>(
"mvaScaleMeanEL1", {0., 0., 0., 0., 0., 0., 0., 0.});
261 desc.add<std::vector<double>>(
"mvaScaleStdEL1", {1., 1., 1., 1., 1., 1., 1., 1.});
262 desc.add<std::vector<double>>(
"mvaScaleMeanBL2", {0., 0., 0., 0., 0., 0., 0., 0., 0., 0.});
263 desc.add<std::vector<double>>(
"mvaScaleStdBL2", {1., 1., 1., 1., 1., 1., 1., 1., 1., 1.});
264 desc.add<std::vector<double>>(
"mvaScaleMeanEL2", {0., 0., 0., 0., 0., 0., 0., 0., 0., 0.});
265 desc.add<std::vector<double>>(
"mvaScaleStdEL2", {1., 1., 1., 1., 1., 1., 1., 1., 1., 1.});
267 desc.add<
bool>(
"doSort",
false);
268 desc.add<
int>(
"nSeedsMaxB", 1e6);
269 desc.add<
int>(
"nSeedsMaxE", 1e6);
271 desc.add<
double>(
"etaEdge", 1.2);
272 desc.add<
double>(
"mvaCutB", -1.);
273 desc.add<
double>(
"mvaCutE", -1.);
275 desc.add<
int>(
"minL1Qual", 7);
276 desc.add<
double>(
"baseScore", 0.5);
278 descriptions.
add(
"MuonHLTSeedMVAClassifier",
desc);