15 maxSeeds_(iConfig.getParameter<uint32_t>(
"maxSeeds")),
16 maxHitlessSeeds_(iConfig.getParameter<uint32_t>(
"maxHitlessSeeds")),
17 maxHitSeeds_(iConfig.getParameter<uint32_t>(
"maxHitSeeds")),
18 numOfLayersToTry_(iConfig.getParameter<int32_t>(
"layersToTry")),
19 numOfHitsToTry_(iConfig.getParameter<int32_t>(
"hitsToTry")),
20 numL2ValidHitsCutAllEta_(iConfig.getParameter<uint32_t>(
"numL2ValidHitsCutAllEta")),
21 numL2ValidHitsCutAllEndcap_(iConfig.getParameter<uint32_t>(
"numL2ValidHitsCutAllEndcap")),
22 fixedErrorRescalingForHits_(iConfig.getParameter<double>(
"fixedErrorRescaleFactorForHits")),
23 fixedErrorRescalingForHitless_(iConfig.getParameter<double>(
"fixedErrorRescaleFactorForHitless")),
24 adjustErrorsDynamicallyForHits_(iConfig.getParameter<
bool>(
"adjustErrorsDynamicallyForHits")),
25 adjustErrorsDynamicallyForHitless_(iConfig.getParameter<
bool>(
"adjustErrorsDynamicallyForHitless")),
26 estimatorName_(iConfig.getParameter<
std::
string>(
"estimator")),
27 minEtaForTEC_(iConfig.getParameter<double>(
"minEtaForTEC")),
28 maxEtaForTOB_(iConfig.getParameter<double>(
"maxEtaForTOB")),
29 useHitLessSeeds_(iConfig.getParameter<
bool>(
"UseHitLessSeeds")),
31 measurementTrackerTag_(
33 pT1_(iConfig.getParameter<double>(
"pT1")),
34 pT2_(iConfig.getParameter<double>(
"pT2")),
35 pT3_(iConfig.getParameter<double>(
"pT3")),
36 eta1_(iConfig.getParameter<double>(
"eta1")),
37 eta2_(iConfig.getParameter<double>(
"eta2")),
38 eta3_(iConfig.getParameter<double>(
"eta3")),
39 eta4_(iConfig.getParameter<double>(
"eta4")),
40 eta5_(iConfig.getParameter<double>(
"eta5")),
41 eta6_(iConfig.getParameter<double>(
"eta6")),
42 eta7_(iConfig.getParameter<double>(
"eta7")),
43 SF1_(iConfig.getParameter<double>(
"SF1")),
44 SF2_(iConfig.getParameter<double>(
"SF2")),
45 SF3_(iConfig.getParameter<double>(
"SF3")),
46 SF4_(iConfig.getParameter<double>(
"SF4")),
47 SF5_(iConfig.getParameter<double>(
"SF5")),
48 SF6_(iConfig.getParameter<double>(
"SF6")),
49 tsosDiff1_(iConfig.getParameter<double>(
"tsosDiff1")),
50 tsosDiff2_(iConfig.getParameter<double>(
"tsosDiff2")),
51 propagatorName_(iConfig.getParameter<
std::
string>(
"propagatorName")),
52 theCategory_(
std::
string(
"Muon|RecoMuon|TSGForOIFromL2")) {
53 produces<std::vector<TrajectorySeed> >();
63 unsigned int numSeedsMade = 0;
64 unsigned int layerCount = 0;
65 unsigned int hitlessSeedsMadeIP = 0;
66 unsigned int hitlessSeedsMadeMuS = 0;
67 unsigned int hitSeedsMade = 0;
94 std::unique_ptr<std::vector<TrajectorySeed> >
result(
new std::vector<TrajectorySeed>());
98 std::vector<ForwardDetLayer const*>
const& tecPositive =
102 std::vector<ForwardDetLayer const*>
const& tecNegative =
117 for (
unsigned int l2TrackColIndex(0); l2TrackColIndex != l2TrackCol->size(); ++l2TrackColIndex) {
121 std::vector<TrajectorySeed>
out;
122 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::produce: L2 muon pT, eta, phi --> " << l2->pt() <<
" , " << l2->eta()
123 <<
" , " << l2->phi() << std::endl;
127 dummyPlane->move(fts.
position() - dummyPlane->position());
129 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::produce: Created TSOSatIP: " << tsosAtIP << std::endl;
134 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::produce: Created TSOSatMuonSystem: " << tsosAtMuonSystem
138 <<
"TSGForOIFromL2::produce: Check the error of the L2 parameter and use hit seeds if big errors" << std::endl;
148 double L2muonEta = l2->eta();
149 double absL2muonEta =
std::abs(L2muonEta);
150 bool useBoth =
false;
151 if (outerTkStateInside.isValid() && outerTkStateOutside.
isValid()) {
162 if (absL2muonEta >
eta1_ && absL2muonEta <
eta1_)
167 hitlessSeedsMadeIP = 0;
168 hitlessSeedsMadeMuS = 0;
173 double errorSFHitless =
179 for (
auto it = tob.rbegin(); it != tob.rend(); ++it) {
180 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::produce: looping in TOB layer " << layerCount << std::endl;
216 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
217 <<
" , layerCount = " << layerCount << std::endl;
223 hitlessSeedsMadeIP = 0;
224 hitlessSeedsMadeMuS = 0;
231 for (
auto it = tecPositive.rbegin(); it != tecPositive.rend(); ++it) {
232 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::produce: looping in TEC+ layer " << layerCount << std::endl;
267 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
268 <<
" , layerCount = " << layerCount << std::endl;
274 for (
auto it = tecNegative.rbegin(); it != tecNegative.rend(); ++it) {
275 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::produce: looping in TEC- layer " << layerCount << std::endl;
310 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
311 <<
" , layerCount = " << layerCount << std::endl;
314 for (std::vector<TrajectorySeed>::iterator it =
out.begin(); it !=
out.end(); ++it) {
333 unsigned int& hitlessSeedsMade,
334 unsigned int& numSeedsMade,
335 std::vector<TrajectorySeed>&
out)
const {
337 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsWithoutHits: Start hitless" << std::endl;
338 std::vector<GeometricSearchDet::DetWithState> dets;
341 auto const& detOnLayer = dets.front().first;
342 auto const& tsosOnLayer = dets.front().second;
343 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsWithoutHits: tsosOnLayer " << tsosOnLayer << std::endl;
344 if (!tsosOnLayer.isValid()) {
347 dets.front().second.rescaleError(errorSF);
352 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsWithoutHits: TSOS (Hitless) done " << std::endl;
368 unsigned int& hitSeedsMade,
369 unsigned int& numSeedsMade,
370 unsigned int& layerCount,
371 std::vector<TrajectorySeed>&
out)
const {
379 std::vector<GeometricSearchDet::DetWithState> dets;
383 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsFromHits: Find measurements on each detWithState "
384 << dets.size() << std::endl;
385 std::vector<TrajectoryMeasurement> meas;
386 for (std::vector<GeometricSearchDet::DetWithState>::iterator it = dets.begin(); it != dets.end(); ++it) {
390 if (!it->second.isValid())
393 std::vector<TrajectoryMeasurement> mymeas =
395 for (std::vector<TrajectoryMeasurement>::const_iterator it2 = mymeas.begin(), ed2 = mymeas.end(); it2 != ed2;
397 if (it2->recHit()->isValid())
398 meas.push_back(*it2);
403 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsFromHits: Update TSOS using TMs after sorting, then create "
404 "Trajectory Seed, number of TM = "
405 << meas.size() << std::endl;
408 unsigned int found = 0;
409 for (std::vector<TrajectoryMeasurement>::const_iterator it = meas.begin(); it != meas.end(); ++it) {
411 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsFromHits: TSOS for TM " <<
found << std::endl;
416 seedHits.
push_back(*it->recHit()->hit());
419 LogTrace(
"TSGForOIFromL2") <<
"TSGForOIFromL2::makeSeedsFromHits: Number of seedHits: " << seedHits.
size()
452 else if (abseta >
eta6_)
465 else if (abseta >
eta5_)
474 else if (abseta >
eta5_)
478 LogTrace(
theCategory_) <<
"TSGForOIFromL2::calculateSFFromL2: SF has been calculated as: " << theSF;
493 bool ierr = !
m.Invert();
496 edm::LogInfo(
"TSGForOIFromL2") <<
"Error inverting covariance matrix";
500 double est = ROOT::Math::Similarity(
v,
m);
511 desc.
add<
int>(
"layersToTry", 2);
512 desc.
add<
double>(
"fixedErrorRescaleFactorForHitless", 2.0);
513 desc.
add<
int>(
"hitsToTry", 1);
514 desc.
add<
bool>(
"adjustErrorsDynamicallyForHits",
false);
515 desc.
add<
bool>(
"adjustErrorsDynamicallyForHitless",
true);
517 desc.
add<
bool>(
"UseHitLessSeeds",
true);
518 desc.
add<
std::string>(
"estimator",
"hltESPChi2MeasurementEstimator100");
519 desc.
add<
double>(
"maxEtaForTOB", 1.8);
520 desc.
add<
double>(
"minEtaForTEC", 0.7);
522 desc.
add<
double>(
"fixedErrorRescaleFactorForHits", 1.0);
523 desc.
add<
unsigned int>(
"maxSeeds", 20);
524 desc.
add<
unsigned int>(
"maxHitlessSeeds", 5);
525 desc.
add<
unsigned int>(
"maxHitSeeds", 1);
526 desc.
add<
unsigned int>(
"numL2ValidHitsCutAllEta", 20);
527 desc.
add<
unsigned int>(
"numL2ValidHitsCutAllEndcap", 30);
528 desc.
add<
double>(
"pT1", 13.0);
529 desc.
add<
double>(
"pT2", 30.0);
530 desc.
add<
double>(
"pT3", 70.0);
531 desc.
add<
double>(
"eta1", 0.2);
532 desc.
add<
double>(
"eta2", 0.3);
533 desc.
add<
double>(
"eta3", 1.0);
534 desc.
add<
double>(
"eta4", 1.2);
535 desc.
add<
double>(
"eta5", 1.6);
536 desc.
add<
double>(
"eta6", 1.4);
537 desc.
add<
double>(
"eta7", 2.1);
538 desc.
add<
double>(
"SF1", 3.0);
539 desc.
add<
double>(
"SF2", 4.0);
540 desc.
add<
double>(
"SF3", 5.0);
541 desc.
add<
double>(
"SF4", 7.0);
542 desc.
add<
double>(
"SF5", 10.0);
543 desc.
add<
double>(
"SF6", 2.0);
544 desc.
add<
double>(
"tsosDiff1", 0.2);
545 desc.
add<
double>(
"tsosDiff2", 0.02);
546 desc.
add<
std::string>(
"propagatorName",
"PropagatorWithMaterialParabolicMf");
547 descriptions.
add(
"TSGForOIFromL2", desc);