16 maxSeeds_(iConfig.getParameter<uint32_t>(
"maxSeeds")),
17 maxHitlessSeeds_(iConfig.getParameter<uint32_t>(
"maxHitlessSeeds")),
18 maxHitSeeds_(iConfig.getParameter<uint32_t>(
"maxHitSeeds")),
19 numOfLayersToTry_(iConfig.getParameter<int32_t>(
"layersToTry")),
20 numOfHitsToTry_(iConfig.getParameter<int32_t>(
"hitsToTry")),
21 numL2ValidHitsCutAllEta_(iConfig.getParameter<uint32_t>(
"numL2ValidHitsCutAllEta")),
22 numL2ValidHitsCutAllEndcap_(iConfig.getParameter<uint32_t>(
"numL2ValidHitsCutAllEndcap")),
23 fixedErrorRescalingForHits_(iConfig.getParameter<double>(
"fixedErrorRescaleFactorForHits")),
24 fixedErrorRescalingForHitless_(iConfig.getParameter<double>(
"fixedErrorRescaleFactorForHitless")),
25 adjustErrorsDynamicallyForHits_(iConfig.getParameter<
bool>(
"adjustErrorsDynamicallyForHits")),
26 adjustErrorsDynamicallyForHitless_(iConfig.getParameter<
bool>(
"adjustErrorsDynamicallyForHitless")),
27 estimatorName_(iConfig.getParameter<
std::
string>(
"estimator")),
28 minEtaForTEC_(iConfig.getParameter<double>(
"minEtaForTEC")),
29 maxEtaForTOB_(iConfig.getParameter<double>(
"maxEtaForTOB")),
30 useHitLessSeeds_(iConfig.getParameter<
bool>(
"UseHitLessSeeds")),
32 measurementTrackerTag_(
34 pT1_(iConfig.getParameter<double>(
"pT1")),
35 pT2_(iConfig.getParameter<double>(
"pT2")),
36 pT3_(iConfig.getParameter<double>(
"pT3")),
37 eta1_(iConfig.getParameter<double>(
"eta1")),
38 eta2_(iConfig.getParameter<double>(
"eta2")),
39 eta3_(iConfig.getParameter<double>(
"eta3")),
40 eta4_(iConfig.getParameter<double>(
"eta4")),
41 eta5_(iConfig.getParameter<double>(
"eta5")),
42 eta6_(iConfig.getParameter<double>(
"eta6")),
43 eta7_(iConfig.getParameter<double>(
"eta7")),
44 SF1_(iConfig.getParameter<double>(
"SF1")),
45 SF2_(iConfig.getParameter<double>(
"SF2")),
46 SF3_(iConfig.getParameter<double>(
"SF3")),
47 SF4_(iConfig.getParameter<double>(
"SF4")),
48 SF5_(iConfig.getParameter<double>(
"SF5")),
49 SF6_(iConfig.getParameter<double>(
"SF6")),
50 tsosDiff1_(iConfig.getParameter<double>(
"tsosDiff1")),
51 tsosDiff2_(iConfig.getParameter<double>(
"tsosDiff2")),
52 propagatorName_(iConfig.getParameter<
std::
string>(
"propagatorName")),
53 theCategory_(
std::
string(
"Muon|RecoMuon|TSGForOIFromL2")) {
54 produces<std::vector<TrajectorySeed> >();
64 unsigned int numSeedsMade = 0;
65 unsigned int layerCount = 0;
66 unsigned int hitlessSeedsMadeIP = 0;
67 unsigned int hitlessSeedsMadeMuS = 0;
68 unsigned int hitSeedsMade = 0;
95 std::unique_ptr<std::vector<TrajectorySeed> >
result(
new std::vector<TrajectorySeed>());
99 std::vector<ForwardDetLayer const*>
const& tecPositive =
103 std::vector<ForwardDetLayer const*>
const& tecNegative =
118 for (
unsigned int l2TrackColIndex(0); l2TrackColIndex != l2TrackCol->size(); ++l2TrackColIndex) {
122 std::vector<TrajectorySeed>
out;
123 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::produce: L2 muon pT, eta, phi --> " << l2->pt() <<
" , " << l2->eta()
124 <<
" , " << l2->phi() << std::endl;
128 dummyPlane->move(fts.
position() - dummyPlane->position());
130 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::produce: Created TSOSatIP: " << tsosAtIP << std::endl;
135 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::produce: Created TSOSatMuonSystem: " << tsosAtMuonSystem
139 <<
"TSGForOIFromL2::produce: Check the error of the L2 parameter and use hit seeds if big errors" << std::endl;
149 double L2muonEta = l2->eta();
150 double absL2muonEta =
std::abs(L2muonEta);
151 bool useBoth =
false;
152 if (outerTkStateInside.isValid() && outerTkStateOutside.
isValid()) {
163 if (absL2muonEta >
eta1_ && absL2muonEta <
eta1_)
168 hitlessSeedsMadeIP = 0;
169 hitlessSeedsMadeMuS = 0;
174 double errorSFHitless =
180 for (
auto it = tob.rbegin(); it != tob.rend(); ++it) {
181 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::produce: looping in TOB layer " << layerCount << std::endl;
217 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
218 <<
" , layerCount = " << layerCount << std::endl;
224 hitlessSeedsMadeIP = 0;
225 hitlessSeedsMadeMuS = 0;
232 for (
auto it = tecPositive.rbegin(); it != tecPositive.rend(); ++it) {
233 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::produce: looping in TEC+ layer " << layerCount << std::endl;
268 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
269 <<
" , layerCount = " << layerCount << std::endl;
275 for (
auto it = tecNegative.rbegin(); it != tecNegative.rend(); ++it) {
276 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::produce: looping in TEC- layer " << layerCount << std::endl;
311 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
312 <<
" , layerCount = " << layerCount << std::endl;
315 for (std::vector<TrajectorySeed>::iterator it =
out.begin(); it !=
out.end(); ++it) {
334 unsigned int& hitlessSeedsMade,
335 unsigned int& numSeedsMade,
336 std::vector<TrajectorySeed>&
out)
const {
338 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsWithoutHits: Start hitless" << std::endl;
339 std::vector<GeometricSearchDet::DetWithState> dets;
342 auto const& detOnLayer = dets.front().first;
343 auto const& tsosOnLayer = dets.front().second;
344 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsWithoutHits: tsosOnLayer " << tsosOnLayer << std::endl;
345 if (!tsosOnLayer.isValid()) {
348 dets.front().second.rescaleError(errorSF);
353 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsWithoutHits: TSOS (Hitless) done " << std::endl;
369 unsigned int& hitSeedsMade,
370 unsigned int& numSeedsMade,
371 unsigned int& layerCount,
372 std::vector<TrajectorySeed>&
out)
const {
380 std::vector<GeometricSearchDet::DetWithState> dets;
384 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsFromHits: Find measurements on each detWithState "
385 << dets.size() << std::endl;
386 std::vector<TrajectoryMeasurement> meas;
387 for (std::vector<GeometricSearchDet::DetWithState>::iterator it = dets.begin(); it != dets.end(); ++it) {
391 if (!it->second.isValid())
394 std::vector<TrajectoryMeasurement> mymeas =
396 for (std::vector<TrajectoryMeasurement>::const_iterator it2 = mymeas.begin(), ed2 = mymeas.end(); it2 != ed2;
398 if (it2->recHit()->isValid())
399 meas.push_back(*it2);
404 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsFromHits: Update TSOS using TMs after sorting, then create "
405 "Trajectory Seed, number of TM = "
406 << meas.size() << std::endl;
409 unsigned int found = 0;
410 for (std::vector<TrajectoryMeasurement>::const_iterator it = meas.begin(); it != meas.end(); ++it) {
412 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsFromHits: TSOS for TM " <<
found << std::endl;
417 seedHits.
push_back(*it->recHit()->hit());
420 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsFromHits: Number of seedHits: " << seedHits.
size()
453 else if (abseta >
eta6_)
466 else if (abseta >
eta5_)
475 else if (abseta >
eta5_)
479 LogTrace(
theCategory_) <<
"TSGForOIFromL2::calculateSFFromL2: SF has been calculated as: " << theSF;
494 bool ierr = !
m.Invert();
497 edm::LogInfo(
"TSGForOIFromL2") <<
"Error inverting covariance matrix";
501 double est = ROOT::Math::Similarity(
v,
m);
512 desc.add<
int>(
"layersToTry", 2);
513 desc.add<
double>(
"fixedErrorRescaleFactorForHitless", 2.0);
514 desc.add<
int>(
"hitsToTry", 1);
515 desc.add<
bool>(
"adjustErrorsDynamicallyForHits",
false);
516 desc.add<
bool>(
"adjustErrorsDynamicallyForHitless",
true);
518 desc.add<
bool>(
"UseHitLessSeeds",
true);
519 desc.add<
std::string>(
"estimator",
"hltESPChi2MeasurementEstimator100");
520 desc.add<
double>(
"maxEtaForTOB", 1.8);
521 desc.add<
double>(
"minEtaForTEC", 0.7);
522 desc.addUntracked<
bool>(
"debug",
false);
523 desc.add<
double>(
"fixedErrorRescaleFactorForHits", 1.0);
524 desc.add<
unsigned int>(
"maxSeeds", 20);
525 desc.add<
unsigned int>(
"maxHitlessSeeds", 5);
526 desc.add<
unsigned int>(
"maxHitSeeds", 1);
527 desc.add<
unsigned int>(
"numL2ValidHitsCutAllEta", 20);
528 desc.add<
unsigned int>(
"numL2ValidHitsCutAllEndcap", 30);
529 desc.add<
double>(
"pT1", 13.0);
530 desc.add<
double>(
"pT2", 30.0);
531 desc.add<
double>(
"pT3", 70.0);
532 desc.add<
double>(
"eta1", 0.2);
533 desc.add<
double>(
"eta2", 0.3);
534 desc.add<
double>(
"eta3", 1.0);
535 desc.add<
double>(
"eta4", 1.2);
536 desc.add<
double>(
"eta5", 1.6);
537 desc.add<
double>(
"eta6", 1.4);
538 desc.add<
double>(
"eta7", 2.1);
539 desc.add<
double>(
"SF1", 3.0);
540 desc.add<
double>(
"SF2", 4.0);
541 desc.add<
double>(
"SF3", 5.0);
542 desc.add<
double>(
"SF4", 7.0);
543 desc.add<
double>(
"SF5", 10.0);
544 desc.add<
double>(
"SF6", 2.0);
545 desc.add<
double>(
"tsosDiff1", 0.2);
546 desc.add<
double>(
"tsosDiff2", 0.02);
547 desc.add<
std::string>(
"propagatorName",
"PropagatorWithMaterialParabolicMf");
548 descriptions.
add(
"TSGForOIFromL2",
desc);