49 return (
A.second >
B.second);
66 typedef std::pair<std::unique_ptr<const SeedMvaEstimatorPhase2>, std::unique_ptr<const SeedMvaEstimatorPhase2>>
109 mvaFile_B_0_(iConfig.getParameter<
edm::FileInPath>(
"mvaFile_B_0")),
110 mvaFile_E_0_(iConfig.getParameter<
edm::FileInPath>(
"mvaFile_E_0")),
112 mvaScaleMean_B_(iConfig.getParameter<
std::
vector<double>>(
"mvaScaleMean_B")),
113 mvaScaleStd_B_(iConfig.getParameter<
std::
vector<double>>(
"mvaScaleStd_B")),
114 mvaScaleMean_E_(iConfig.getParameter<
std::
vector<double>>(
"mvaScaleMean_E")),
115 mvaScaleStd_E_(iConfig.getParameter<
std::
vector<double>>(
"mvaScaleStd_E")),
117 etaEdge_(iConfig.getParameter<double>(
"etaEdge")),
118 mvaCut_B_(iConfig.getParameter<double>(
"mvaCut_B")),
119 mvaCut_E_(iConfig.getParameter<double>(
"mvaCut_E")),
121 doSort_(iConfig.getParameter<
bool>(
"doSort")),
122 nSeedsMax_B_(iConfig.getParameter<
int>(
"nSeedsMax_B")),
123 nSeedsMax_E_(iConfig.getParameter<
int>(
"nSeedsMax_E")),
125 baseScore_(iConfig.getParameter<double>(
"baseScore")),
133 produces<TrajectorySeedCollection>();
143 auto result = std::make_unique<TrajectorySeedCollection>();
162 if (!(hasL1TkMu && hasSeed)) {
163 edm::LogError(
"SeedClassifierError") <<
"Error! Cannot find L1TkMuon or TrajectorySeed\n" 164 <<
"hasL1TkMu : " << hasL1TkMu <<
"\n" 165 <<
"hasSeed : " << hasSeed <<
"\n";
171 std::vector<std::pair<unsigned, double>> pairSeedIdxMvaScore_B = {};
172 std::vector<std::pair<unsigned, double>> pairSeedIdxMvaScore_E = {};
174 for (
auto i = 0
U;
i < h_Seed->size(); ++
i) {
175 const auto&
seed(h_Seed->at(
i));
179 .toGlobal(
seed.startingState().parameters().momentum());
182 .toGlobal(
seed.startingState().parameters().position());
202 pairSeedIdxMvaScore_B.push_back(make_pair(
i, logistic));
204 pairSeedIdxMvaScore_E.push_back(make_pair(
i, logistic));
210 for (
auto i = 0
U;
i < pairSeedIdxMvaScore_B.size(); ++
i) {
213 const auto&
seed(h_Seed->at(pairSeedIdxMvaScore_B.at(
i).first));
217 for (
auto i = 0
U;
i < pairSeedIdxMvaScore_E.size(); ++
i) {
220 const auto&
seed(h_Seed->at(pairSeedIdxMvaScore_E.at(
i).first));
227 for (
auto i = 0
U;
i < h_Seed->size(); ++
i) {
228 const auto&
seed(h_Seed->at(
i));
232 .toGlobal(
seed.startingState().parameters().momentum());
235 .toGlobal(
seed.startingState().parameters().position());
276 pairMvaEstimator.first->computeMva(
seed, global_p, global_x, h_L1TkMu, magfieldH,
propagatorAlong, geomTracker);
278 mva = pairMvaEstimator.second->computeMva(
291 edm::FileInPath(
"RecoMuon/TrackerSeedGenerator/data/xgb_Phase2_Iter2FromL1_barrel_v0.xml"));
293 edm::FileInPath(
"RecoMuon/TrackerSeedGenerator/data/xgb_Phase2_Iter2FromL1_endcap_v0.xml"));
294 desc.add<std::vector<double>>(
"mvaScaleMean_B",
295 {0.00033113700731766336,
296 1.6825601468762878e-06,
297 1.790932122524803e-06,
298 0.010534608406382916,
299 0.005969459957330139,
300 0.0009605022254971113,
302 7.846741237608237e-05,
305 0.39815551065544846});
306 desc.add<std::vector<double>>(
"mvaScaleStd_B",
307 {0.0006042948363798624,
308 2.445644111872427e-06,
309 3.454992543447134e-06,
314 0.058296511682094855,
317 0.4101160349549534});
318 desc.add<std::vector<double>>(
"mvaScaleMean_E",
319 {0.00022658482374555603,
320 5.358921973784045e-07,
321 1.010003713549798e-06,
322 0.0007886873612224615,
323 0.001197730548842408,
324 -0.0030252353426003594,
326 -0.0006940626775109026,
329 0.28798220230180455});
330 desc.add<std::vector<double>>(
"mvaScaleStd_E",
331 {0.0003857726789049956,
332 1.4853721474087994e-06,
333 6.982997036736564e-06,
341 0.3179899794578072});
342 desc.add<
bool>(
"doSort",
true);
343 desc.add<
int>(
"nSeedsMax_B", 20);
344 desc.add<
int>(
"nSeedsMax_E", 20);
345 desc.add<
double>(
"mvaCut_B", 0.);
346 desc.add<
double>(
"mvaCut_E", 0.);
347 desc.add<
double>(
"etaEdge", 1.2);
348 desc.add<
double>(
"baseScore", 0.5);
349 descriptions.
add(
"MuonHLTSeedMVAClassifierPhase2",
desc);
bool sortByMvaScorePhase2(const std::pair< unsigned, double > &A, const std::pair< unsigned, double > &B)
const edm::EDGetTokenT< TrajectorySeedCollection > t_Seed_
double getSeedMva(const pairSeedMvaEstimator &pairMvaEstimator, const TrajectorySeed &seed, const GlobalVector &global_p, const GlobalPoint &global_x, const edm::Handle< l1t::TrackerMuonCollection > &h_L1TkMu, const edm::ESHandle< MagneticField > &magfieldH, const Propagator &propagatorAlong, const GeometricSearchTracker &geomTracker)
const std::vector< double > mvaScaleMean_B_
Log< level::Error, false > LogError
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldESToken_
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
pairSeedMvaEstimator mvaEstimator_
std::vector< TrajectorySeed > TrajectorySeedCollection
const edm::FileInPath mvaFile_E_0_
const std::vector< double > mvaScaleStd_E_
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
GeometricSearchTracker * build(const GeometricDet *theGeometricTracker, const TrackerGeometry *theGeomDetGeometry, const TrackerTopology *tTopo, const bool usePhase2Stacks=false) __attribute__((cold))
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< l1t::TrackerMuonCollection > t_L1TkMu_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorESToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyESToken_
MuonHLTSeedMVAClassifierPhase2(const edm::ParameterSet &)
const edm::ESGetToken< GeometricDet, IdealGeometryRecord > geomDetESToken_
std::vector< TrackerMuon > TrackerMuonCollection
~MuonHLTSeedMVAClassifierPhase2() override=default
const std::vector< double > mvaScaleMean_E_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::pair< std::unique_ptr< const SeedMvaEstimatorPhase2 >, std::unique_ptr< const SeedMvaEstimatorPhase2 > > pairSeedMvaEstimator
void produce(edm::Event &, const edm::EventSetup &) override
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryESToken_
const std::vector< double > mvaScaleStd_B_
const edm::FileInPath mvaFile_B_0_