CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
TSGForOIFromL2 Class Reference

Create L3MuonTrajectorySeeds from L2 Muons updated at vertex in an outside-in manner. More...

#include <TSGForOIFromL2.h>

Inheritance diagram for TSGForOIFromL2:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void produce (edm::StreamID sid, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
 
 TSGForOIFromL2 (const edm::ParameterSet &iConfig)
 
 ~TSGForOIFromL2 () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

double calculateSFFromL2 (const reco::TrackRef track) const
 Calculate the dynamic error SF by analysing the L2. More...
 
void makeSeedsFromHits (const GeometricSearchDet &layer, const TrajectoryStateOnSurface &tsos, const Propagator &propagatorAlong, const edm::ESHandle< Chi2MeasurementEstimatorBase > &estimator, const edm::Handle< MeasurementTrackerEvent > &measurementTracker, double errorSF, unsigned int &hitSeedsMade, unsigned int &numSeedsMade, unsigned int &layerCount, std::vector< TrajectorySeed > &out) const
 Find hits on a given layer (TOB or TEC) and create seeds from updated TSOS with hit. More...
 
void makeSeedsWithoutHits (const GeometricSearchDet &layer, const TrajectoryStateOnSurface &tsos, const Propagator &propagatorAlong, const edm::ESHandle< Chi2MeasurementEstimatorBase > &estimator, double errorSF, unsigned int &hitlessSeedsMade, unsigned int &numSeedsMade, std::vector< TrajectorySeed > &out) const
 Create seeds without hits on a given layer (TOB or TEC) More...
 
double match_Chi2 (const TrajectoryStateOnSurface &tsos1, const TrajectoryStateOnSurface &tsos2) const
 Find compatability between two TSOSs. More...
 

Private Attributes

const bool adjustErrorsDynamicallyForHitless_
 
const bool adjustErrorsDynamicallyForHits_
 Whether or not to use an automatically calculated scale-factor value. More...
 
const bool displacedReco_
 Displaced reconstruction. More...
 
const std::string estimatorName_
 Estimator used to find dets and TrajectoryMeasurements. More...
 
const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecordestimatorToken_
 
const double eta1_
 
const double eta2_
 
const double eta3_
 
const double eta4_
 
const double eta5_
 
const double eta6_
 
const double eta7_
 
const double fixedErrorRescalingForHitless_
 
const double fixedErrorRescalingForHits_
 Rescale L2 parameter uncertainties (fixed error vs pT, eta) More...
 
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecordgeometryToken_
 
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmagfieldToken_
 
const double maxEtaForTOB_
 Maximum eta value to activate searching in the TOB. More...
 
const unsigned int maxHitlessSeeds_
 Maximum number of hitless seeds for each L2. More...
 
const unsigned int maxHitSeeds_
 Maximum number of hitbased seeds for each L2. More...
 
const unsigned int maxSeeds_
 Maximum number of seeds for each L2. More...
 
const edm::EDGetTokenT< MeasurementTrackerEventmeasurementTrackerTag_
 
const double minEtaForTEC_
 Minimum eta value to activate searching in the TEC. More...
 
const unsigned int numL2ValidHitsCutAllEndcap_
 
const unsigned int numL2ValidHitsCutAllEta_
 L2 valid hit cuts to decide seed creation by both states. More...
 
const unsigned int numOfHitsToTry_
 How many hits to try per layer. More...
 
const unsigned int numOfLayersToTry_
 How many layers to try. More...
 
const std::string propagatorName_
 Counters and flags for the implementation. More...
 
const edm::ESGetToken< Propagator, TrackingComponentsRecordpropagatorToken_
 
const double pT1_
 pT, eta ranges and scale factor values More...
 
const double pT2_
 
const double pT3_
 
const double SF1_
 
const double SF2_
 
const double SF3_
 
const double SF4_
 
const double SF5_
 
const double SF6_
 
const double SFHd_
 
const double SFHld_
 
const edm::ESGetToken< Propagator, TrackingComponentsRecordsHPOppositeToken_
 
const edm::EDGetTokenT< reco::TrackCollectionsrc_
 Labels for input collections. More...
 
const std::string theCategory_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtmpTkGeometryToken_
 
const double tsosDiff1_
 Distance of L2 TSOSs before and after updated with vertex. More...
 
const double tsosDiff2_
 
const std::unique_ptr< TrajectoryStateUpdatorupdator_
 KFUpdator defined in constructor. More...
 
const bool useHitLessSeeds_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Create L3MuonTrajectorySeeds from L2 Muons updated at vertex in an outside-in manner.

Author
Benjamin Radburn-Smith, Santiago Folgueras, Bibhuprasad Mahakud, Jan Frederik Schulte (Purdue University, West Lafayette, USA)
Benjamin Radburn-Smith, Santiago Folgueras, Bibhuprasad Mahakud, Jan Frederik Schulte (Purdue University, West Lafayette)

Definition at line 34 of file TSGForOIFromL2.h.

Constructor & Destructor Documentation

◆ TSGForOIFromL2()

TSGForOIFromL2::TSGForOIFromL2 ( const edm::ParameterSet iConfig)
explicit

Definition at line 14 of file TSGForOIFromL2.cc.

15  : src_(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("src"))),
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")),
31  updator_(new KFUpdator()),
33  consumes<MeasurementTrackerEvent>(iConfig.getParameter<edm::InputTag>("MeasurementTrackerEvent"))),
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  SFHld_(iConfig.getParameter<double>("SFHld")),
51  SFHd_(iConfig.getParameter<double>("SFHd")),
52  tsosDiff1_(iConfig.getParameter<double>("tsosDiff1")),
53  tsosDiff2_(iConfig.getParameter<double>("tsosDiff2")),
54  displacedReco_(iConfig.getParameter<bool>("displacedReco")),
55  propagatorName_(iConfig.getParameter<std::string>("propagatorName")),
56  theCategory_(std::string("Muon|RecoMuon|TSGForOIFromL2")),
62  sHPOppositeToken_(esConsumes(edm::ESInputTag("", "hltESPSteppingHelixPropagatorOpposite"))) {
63  produces<std::vector<TrajectorySeed> >();
64 }
const bool useHitLessSeeds_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const double eta2_
const unsigned int numOfHitsToTry_
How many hits to try per layer.
const double SFHd_
const double minEtaForTEC_
Minimum eta value to activate searching in the TEC.
const std::string estimatorName_
Estimator used to find dets and TrajectoryMeasurements.
const double SFHld_
const unsigned int maxHitSeeds_
Maximum number of hitbased seeds for each L2.
const double SF2_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tmpTkGeometryToken_
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > geometryToken_
const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > estimatorToken_
const unsigned int maxHitlessSeeds_
Maximum number of hitless seeds for each L2.
const double pT2_
const double SF6_
const double tsosDiff2_
const double eta7_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
const unsigned int numL2ValidHitsCutAllEndcap_
const double tsosDiff1_
Distance of L2 TSOSs before and after updated with vertex.
const unsigned int maxSeeds_
Maximum number of seeds for each L2.
const double eta1_
const std::unique_ptr< TrajectoryStateUpdator > updator_
KFUpdator defined in constructor.
const double SF3_
const double fixedErrorRescalingForHits_
Rescale L2 parameter uncertainties (fixed error vs pT, eta)
const double maxEtaForTOB_
Maximum eta value to activate searching in the TOB.
const bool adjustErrorsDynamicallyForHits_
Whether or not to use an automatically calculated scale-factor value.
const std::string theCategory_
const edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerTag_
const unsigned int numL2ValidHitsCutAllEta_
L2 valid hit cuts to decide seed creation by both states.
const double eta6_
const double eta5_
const double SF4_
const edm::EDGetTokenT< reco::TrackCollection > src_
Labels for input collections.
const double eta3_
const double eta4_
const bool adjustErrorsDynamicallyForHitless_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > sHPOppositeToken_
const bool displacedReco_
Displaced reconstruction.
const double SF5_
const unsigned int numOfLayersToTry_
How many layers to try.
const std::string propagatorName_
Counters and flags for the implementation.
const double SF1_
const double pT3_
const double pT1_
pT, eta ranges and scale factor values
const double fixedErrorRescalingForHitless_

◆ ~TSGForOIFromL2()

TSGForOIFromL2::~TSGForOIFromL2 ( )
override

Definition at line 66 of file TSGForOIFromL2.cc.

66 {}

Member Function Documentation

◆ calculateSFFromL2()

double TSGForOIFromL2::calculateSFFromL2 ( const reco::TrackRef  track) const
private

Calculate the dynamic error SF by analysing the L2.

Definition at line 531 of file TSGForOIFromL2.cc.

References funct::abs(), eta1_, eta2_, eta3_, eta4_, eta5_, eta6_, LogTrace, pT1_, pT2_, pT3_, SF1_, SF2_, SF3_, SF4_, SF5_, SF6_, theCategory_, and HLT_2024v11_cff::track.

Referenced by produce().

531  {
532  double theSF = 1.0;
533  // L2 direction vs pT blowup - as was previously done:
534  // Split into 4 pT ranges: <pT1_, pT1_<pT2_, pT2_<pT3_, <pT4_: 13,30,70
535  // Split into different eta ranges depending in pT
536  double abseta = std::abs(track->eta());
537  if (track->pt() <= pT1_)
538  theSF = SF1_;
539  else if (track->pt() > pT1_ && track->pt() <= pT2_) {
540  if (abseta <= eta3_)
541  theSF = SF3_;
542  else if (abseta > eta3_ && abseta <= eta6_)
543  theSF = SF2_;
544  else if (abseta > eta6_)
545  theSF = SF3_;
546  } else if (track->pt() > pT2_ && track->pt() <= pT3_) {
547  if (abseta <= eta1_)
548  theSF = SF6_;
549  else if (abseta > eta1_ && abseta <= eta2_)
550  theSF = SF4_;
551  else if (abseta > eta2_ && abseta <= eta3_)
552  theSF = SF6_;
553  else if (abseta > eta3_ && abseta <= eta4_)
554  theSF = SF1_;
555  else if (abseta > eta4_ && abseta <= eta5_)
556  theSF = SF1_;
557  else if (abseta > eta5_)
558  theSF = SF5_;
559  } else if (track->pt() > pT3_) {
560  if (abseta <= eta3_)
561  theSF = SF5_;
562  else if (abseta > eta3_ && abseta <= eta4_)
563  theSF = SF4_;
564  else if (abseta > eta4_ && abseta <= eta5_)
565  theSF = SF4_;
566  else if (abseta > eta5_)
567  theSF = SF5_;
568  }
569 
570  LogTrace(theCategory_) << "TSGForOIFromL2::calculateSFFromL2: SF has been calculated as: " << theSF;
571 
572  return theSF;
573 }
const double eta2_
const double SF2_
#define LogTrace(id)
const double pT2_
const double SF6_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const double eta1_
const double SF3_
const std::string theCategory_
const double eta6_
const double eta5_
const double SF4_
const double eta3_
const double eta4_
const double SF5_
const double SF1_
const double pT3_
const double pT1_
pT, eta ranges and scale factor values

◆ fillDescriptions()

void TSGForOIFromL2::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 600 of file TSGForOIFromL2.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

600  {
602  desc.add<edm::InputTag>("src", edm::InputTag("hltL2Muons", "UpdatedAtVtx"));
603  desc.add<int>("layersToTry", 2);
604  desc.add<double>("fixedErrorRescaleFactorForHitless", 2.0);
605  desc.add<int>("hitsToTry", 1);
606  desc.add<bool>("adjustErrorsDynamicallyForHits", false);
607  desc.add<bool>("adjustErrorsDynamicallyForHitless", true);
608  desc.add<edm::InputTag>("MeasurementTrackerEvent", edm::InputTag("hltSiStripClusters"));
609  desc.add<bool>("UseHitLessSeeds", true);
610  desc.add<std::string>("estimator", "hltESPChi2MeasurementEstimator100");
611  desc.add<double>("maxEtaForTOB", 1.8);
612  desc.add<double>("minEtaForTEC", 0.7);
613  desc.addUntracked<bool>("debug", false);
614  desc.add<double>("fixedErrorRescaleFactorForHits", 1.0);
615  desc.add<unsigned int>("maxSeeds", 20);
616  desc.add<unsigned int>("maxHitlessSeeds", 5);
617  desc.add<unsigned int>("maxHitSeeds", 1);
618  desc.add<unsigned int>("numL2ValidHitsCutAllEta", 20);
619  desc.add<unsigned int>("numL2ValidHitsCutAllEndcap", 30);
620  desc.add<double>("pT1", 13.0);
621  desc.add<double>("pT2", 30.0);
622  desc.add<double>("pT3", 70.0);
623  desc.add<double>("eta1", 0.2);
624  desc.add<double>("eta2", 0.3);
625  desc.add<double>("eta3", 1.0);
626  desc.add<double>("eta4", 1.2);
627  desc.add<double>("eta5", 1.6);
628  desc.add<double>("eta6", 1.4);
629  desc.add<double>("eta7", 2.1);
630  desc.add<double>("SF1", 3.0);
631  desc.add<double>("SF2", 4.0);
632  desc.add<double>("SF3", 5.0);
633  desc.add<double>("SF4", 7.0);
634  desc.add<double>("SF5", 10.0);
635  desc.add<double>("SF6", 2.0);
636  desc.add<double>("SFHld", 2.0)->setComment("Scale Factor used to rescale the TSOS error of the hitless seeds");
637  desc.add<double>("SFHd", 4.0)->setComment("Scale Factor used to rescale the TSOS error of the hit based seeds");
638  desc.add<double>("tsosDiff1", 0.2);
639  desc.add<double>("tsosDiff2", 0.02);
640  desc.add<bool>("displacedReco", false)->setComment("Flag to turn on the displaced seeding");
641  desc.add<std::string>("propagatorName", "PropagatorWithMaterialParabolicMf");
642  descriptions.add("TSGForOIFromL2", desc);
643 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ makeSeedsFromHits()

void TSGForOIFromL2::makeSeedsFromHits ( const GeometricSearchDet layer,
const TrajectoryStateOnSurface tsos,
const Propagator propagatorAlong,
const edm::ESHandle< Chi2MeasurementEstimatorBase > &  estimator,
const edm::Handle< MeasurementTrackerEvent > &  measurementTracker,
double  errorSF,
unsigned int &  hitSeedsMade,
unsigned int &  numSeedsMade,
unsigned int &  layerCount,
std::vector< TrajectorySeed > &  out 
) const
private

Find hits on a given layer (TOB or TEC) and create seeds from updated TSOS with hit.

Definition at line 454 of file TSGForOIFromL2.cc.

References MeasurementDetWithData::fastMeasurements(), newFWLiteAna::found, MeasurementDetWithData::isNull(), TrajectoryStateOnSurface::isValid(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, nano_mu_digi_cff::layer, LogTrace, maxHitSeeds_, HLTSiStripMonitoring_cff::measurementTracker, eostools::move(), numOfHitsToTry_, numOfLayersToTry_, oppositeToMomentum, MillePedeFileConverter_cfg::out, trajectoryStateTransform::persistentState(), L1TMuonDQMOffline_cfi::propagatorAlong, edm::OwnVector< T, P >::push_back(), TrajectoryStateOnSurface::rescaleError(), fileCollector::seed, edm::OwnVector< T, P >::size(), jetUpdater_cfi::sort, and updator_.

Referenced by produce().

463  {
464  if (layerCount > numOfLayersToTry_)
465  return;
466 
467  // Error Rescaling
468  TrajectoryStateOnSurface onLayer(tsos);
469  onLayer.rescaleError(errorSF);
470 
471  std::vector<GeometricSearchDet::DetWithState> dets;
472  layer.compatibleDetsV(onLayer, propagatorAlong, *estimator, dets);
473 
474  // Find Measurements on each DetWithState
475  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsFromHits: Find measurements on each detWithState "
476  << dets.size() << std::endl;
477  std::vector<TrajectoryMeasurement> meas;
478  for (std::vector<GeometricSearchDet::DetWithState>::iterator it = dets.begin(); it != dets.end(); ++it) {
479  MeasurementDetWithData det = measurementTracker->idToDet(it->first->geographicalId());
480  if (det.isNull())
481  continue;
482  if (!it->second.isValid())
483  continue; // Skip if TSOS is not valid
484 
485  std::vector<TrajectoryMeasurement> mymeas =
486  det.fastMeasurements(it->second, onLayer, propagatorAlong, *estimator); // Second TSOS is not used
487  for (std::vector<TrajectoryMeasurement>::const_iterator it2 = mymeas.begin(), ed2 = mymeas.end(); it2 != ed2;
488  ++it2) {
489  if (it2->recHit()->isValid())
490  meas.push_back(*it2); // Only save those which are valid
491  }
492  }
493 
494  // Update TSOS using TMs after sorting, then create Trajectory Seed and put into vector
495  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsFromHits: Update TSOS using TMs after sorting, then create "
496  "Trajectory Seed, number of TM = "
497  << meas.size() << std::endl;
498  std::sort(meas.begin(), meas.end(), TrajMeasLessEstim());
499 
500  unsigned int found = 0;
501  for (std::vector<TrajectoryMeasurement>::const_iterator it = meas.begin(); it != meas.end(); ++it) {
502  TrajectoryStateOnSurface updatedTSOS = updator_->update(it->forwardPredictedState(), *it->recHit());
503  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsFromHits: TSOS for TM " << found << std::endl;
504  if (not updatedTSOS.isValid())
505  continue;
506 
508  seedHits.push_back(*it->recHit()->hit());
509  PTrajectoryStateOnDet const& pstate =
510  trajectoryStateTransform::persistentState(updatedTSOS, it->recHit()->geographicalId().rawId());
511  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsFromHits: Number of seedHits: " << seedHits.size()
512  << std::endl;
513  TrajectorySeed seed(pstate, std::move(seedHits), oppositeToMomentum);
514  out.push_back(seed);
515  found++;
516  numSeedsMade++;
517  hitSeedsMade++;
518  if (found == numOfHitsToTry_)
519  break;
520  if (hitSeedsMade > maxHitSeeds_)
521  return;
522  }
523 
524  if (found)
525  layerCount++;
526 }
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &tsos2, const Propagator &prop, const MeasurementEstimator &est) const
const unsigned int numOfHitsToTry_
How many hits to try per layer.
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
const unsigned int maxHitSeeds_
Maximum number of hitbased seeds for each L2.
#define LogTrace(id)
void push_back(D *&d)
Definition: OwnVector.h:326
size_type size() const
Definition: OwnVector.h:300
const std::unique_ptr< TrajectoryStateUpdator > updator_
KFUpdator defined in constructor.
const unsigned int numOfLayersToTry_
How many layers to try.
def move(src, dest)
Definition: eostools.py:511

◆ makeSeedsWithoutHits()

void TSGForOIFromL2::makeSeedsWithoutHits ( const GeometricSearchDet layer,
const TrajectoryStateOnSurface tsos,
const Propagator propagatorAlong,
const edm::ESHandle< Chi2MeasurementEstimatorBase > &  estimator,
double  errorSF,
unsigned int &  hitlessSeedsMade,
unsigned int &  numSeedsMade,
std::vector< TrajectorySeed > &  out 
) const
private

Create seeds without hits on a given layer (TOB or TEC)

Definition at line 420 of file TSGForOIFromL2.cc.

References nano_mu_digi_cff::layer, LogTrace, oppositeToMomentum, MillePedeFileConverter_cfg::out, trajectoryStateTransform::persistentState(), L1TMuonDQMOffline_cfi::propagatorAlong, and theCategory_.

Referenced by produce().

427  {
428  // create hitless seeds
429  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsWithoutHits: Start hitless" << std::endl;
430  std::vector<GeometricSearchDet::DetWithState> dets;
431  layer.compatibleDetsV(tsos, propagatorAlong, *estimator, dets);
432  if (!dets.empty()) {
433  auto const& detOnLayer = dets.front().first;
434  auto const& tsosOnLayer = dets.front().second;
435  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsWithoutHits: tsosOnLayer " << tsosOnLayer << std::endl;
436  if (!tsosOnLayer.isValid()) {
437  edm::LogInfo(theCategory_) << "ERROR!: Hitless TSOS is not valid!";
438  } else {
439  dets.front().second.rescaleError(errorSF);
440  PTrajectoryStateOnDet const& ptsod =
441  trajectoryStateTransform::persistentState(tsosOnLayer, detOnLayer->geographicalId().rawId());
443  out.push_back(TrajectorySeed(ptsod, rHC, oppositeToMomentum));
444  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::makeSeedsWithoutHits: TSOS (Hitless) done " << std::endl;
445  hitlessSeedsMade++;
446  numSeedsMade++;
447  }
448  }
449 }
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
#define LogTrace(id)
const std::string theCategory_
Log< level::Info, false > LogInfo

◆ match_Chi2()

double TSGForOIFromL2::match_Chi2 ( const TrajectoryStateOnSurface tsos1,
const TrajectoryStateOnSurface tsos2 
) const
private

Find compatability between two TSOSs.

Definition at line 578 of file TSGForOIFromL2.cc.

References TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), visualization-live-secondInstance_cfg::m, LocalTrajectoryError::matrix(), findQualityFiles::v, and LocalTrajectoryParameters::vector().

578  {
579  if (!tsos1.isValid() || !tsos2.isValid())
580  return -1.;
581 
583  AlgebraicSymMatrix55 m(tsos1.localError().matrix() + tsos2.localError().matrix());
584 
585  bool ierr = !m.Invert();
586 
587  if (ierr) {
588  edm::LogInfo("TSGForOIFromL2") << "Error inverting covariance matrix";
589  return -1;
590  }
591 
592  double est = ROOT::Math::Similarity(v, m);
593 
594  return est;
595 }
const LocalTrajectoryError & localError() const
const LocalTrajectoryParameters & localParameters() const
AlgebraicVector5 vector() const
ROOT::Math::SVector< double, 5 > AlgebraicVector5
Log< level::Info, false > LogInfo
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const AlgebraicSymMatrix55 & matrix() const

◆ produce()

void TSGForOIFromL2::produce ( edm::StreamID  sid,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 71 of file TSGForOIFromL2.cc.

References funct::abs(), adjustErrorsDynamicallyForHitless_, adjustErrorsDynamicallyForHits_, alongMomentum, Plane::build(), calculateSFFromL2(), displacedReco_, estimatorToken_, eta1_, eta7_, fixedErrorRescalingForHitless_, fixedErrorRescalingForHits_, MeasurementTrackerEvent::geometricSearchTracker(), geometryToken_, edm::EventSetup::getHandle(), iEvent, trajectoryStateTransform::initialFreeState(), trajectoryStateTransform::innerStateOnSurface(), TrackerGeometry::isThere(), TrajectoryStateOnSurface::isValid(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, LogTrace, magfieldToken_, makeSeedsFromHits(), makeSeedsWithoutHits(), maxEtaForTOB_, maxHitlessSeeds_, maxHitSeeds_, maxSeeds_, measurementTrackerTag_, minEtaForTEC_, eostools::move(), GeometricSearchTracker::negTecLayers(), GeometricSearchTracker::negTidLayers(), numL2ValidHitsCutAllEndcap_, numL2ValidHitsCutAllEta_, oppositeToMomentum, MillePedeFileConverter_cfg::out, GeomDetEnumerators::P2OTEC, FreeTrajectoryState::position(), GeometricSearchTracker::posTecLayers(), GeometricSearchTracker::posTidLayers(), edm::ESHandle< T >::product(), L1TMuonDQMOffline_cfi::propagatorAlong, L1TMuonDQMOffline_cfi::propagatorOpposite, propagatorToken_, mps_fire::result, SetPropagationDirection(), SFHd_, SFHld_, sHPOppositeToken_, src_, theCategory_, tmpTkGeometryToken_, GeometricSearchTracker::tobLayers(), and useHitLessSeeds_.

71  {
72  // Initialize variables
73  unsigned int numSeedsMade = 0;
74  unsigned int layerCount = 0;
75  unsigned int hitlessSeedsMadeIP = 0;
76  unsigned int hitlessSeedsMadeMuS = 0;
77  unsigned int hitSeedsMade = 0;
78  unsigned int hitSeedsMadeMuS = 0;
79 
80  // Surface used to make a TSOS at the PCA to the beamline
82 
83  // Read ESHandles
84  edm::Handle<MeasurementTrackerEvent> measurementTrackerH;
86  const edm::ESHandle<MagneticField> magfieldH = iSetup.getHandle(magfieldToken_);
87  const edm::ESHandle<Propagator> propagatorAlongH = iSetup.getHandle(propagatorToken_);
88  const edm::ESHandle<Propagator>& propagatorOppositeH = propagatorAlongH;
89  const edm::ESHandle<TrackerGeometry> tmpTkGeometryH = iSetup.getHandle(tmpTkGeometryToken_);
91 
92  iEvent.getByToken(measurementTrackerTag_, measurementTrackerH);
93 
94  // Read L2 track collection
96  iEvent.getByToken(src_, l2TrackCol);
97 
98  // The product
99  std::unique_ptr<std::vector<TrajectorySeed> > result(new std::vector<TrajectorySeed>());
100 
101  // Get vector of Detector layers
102  std::vector<BarrelDetLayer const*> const& tob = measurementTrackerH->geometricSearchTracker()->tobLayers();
103  std::vector<ForwardDetLayer const*> const& tecPositive =
104  tmpTkGeometryH->isThere(GeomDetEnumerators::P2OTEC)
105  ? measurementTrackerH->geometricSearchTracker()->posTidLayers()
106  : measurementTrackerH->geometricSearchTracker()->posTecLayers();
107  std::vector<ForwardDetLayer const*> const& tecNegative =
108  tmpTkGeometryH->isThere(GeomDetEnumerators::P2OTEC)
109  ? measurementTrackerH->geometricSearchTracker()->negTidLayers()
110  : measurementTrackerH->geometricSearchTracker()->negTecLayers();
111 
112  // Get suitable propagators
113  std::unique_ptr<Propagator> propagatorAlong = SetPropagationDirection(*propagatorAlongH, alongMomentum);
114  std::unique_ptr<Propagator> propagatorOpposite = SetPropagationDirection(*propagatorOppositeH, oppositeToMomentum);
115 
116  // Stepping Helix Propagator for propogation from muon system to tracker
117  const edm::ESHandle<Propagator> SHPOpposite = iSetup.getHandle(sHPOppositeToken_);
118 
119  // Loop over the L2's and make seeds for all of them
120  LogTrace(theCategory_) << "TSGForOIFromL2::produce: Number of L2's: " << l2TrackCol->size();
121  for (unsigned int l2TrackColIndex(0); l2TrackColIndex != l2TrackCol->size(); ++l2TrackColIndex) {
122  const reco::TrackRef l2(l2TrackCol, l2TrackColIndex);
123 
124  // Container of Seeds
125  std::vector<TrajectorySeed> out;
126  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: L2 muon pT, eta, phi --> " << l2->pt() << " , " << l2->eta()
127  << " , " << l2->phi() << std::endl;
128 
130 
131  dummyPlane->move(fts.position() - dummyPlane->position());
132  TrajectoryStateOnSurface tsosAtIP = TrajectoryStateOnSurface(fts, *dummyPlane);
133  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: Created TSOSatIP: " << tsosAtIP << std::endl;
134 
135  // Get the TSOS on the innermost layer of the L2
136  TrajectoryStateOnSurface tsosAtMuonSystem =
137  trajectoryStateTransform::innerStateOnSurface(*l2, *geometryH, magfieldH.product());
138  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: Created TSOSatMuonSystem: " << tsosAtMuonSystem
139  << std::endl;
140 
141  LogTrace("TSGForOIFromL2")
142  << "TSGForOIFromL2::produce: Check the error of the L2 parameter and use hit seeds if big errors" << std::endl;
143 
144  StateOnTrackerBound fromInside(propagatorAlong.get());
145  TrajectoryStateOnSurface outerTkStateInside = fromInside(fts);
146 
147  StateOnTrackerBound fromOutside(&*SHPOpposite);
148  TrajectoryStateOnSurface outerTkStateOutside = fromOutside(tsosAtMuonSystem);
149 
150  // Check if the two positions (using updated and not-updated TSOS) agree withing certain extent.
151  // If both TSOSs agree, use only the one at vertex, as it uses more information. If they do not agree, search for seeds based on both.
152  double L2muonEta = l2->eta();
153  double absL2muonEta = std::abs(L2muonEta);
154  bool useBoth = false;
155  if (outerTkStateInside.isValid() && outerTkStateOutside.isValid()) {
156  //following commented out variables dist1 (5 par compatibility of tsos at outertracker surface)
157  //dist2 (angle between two tsos) could further be explored in combination of L2 valid hits for seeding. So kept for
158  //future developers
159  //auto dist1 = match_Chi2(outerTkStateInside,outerTkStateOutside);//for future developers
160  //auto dist2 = deltaR(outerTkStateInside.globalMomentum(),outerTkStateOutside.globalMomentum());//for future developers
161  //if ((dist1 > tsosDiff1_ || dist2 > tsosDiff2_) && l2->numberOfValidHits() < 20) useBoth = true;//for future developers
162  if (l2->numberOfValidHits() < numL2ValidHitsCutAllEta_)
163  useBoth = true;
164  if (l2->numberOfValidHits() < numL2ValidHitsCutAllEndcap_ && absL2muonEta > eta7_)
165  useBoth = true;
166  if (absL2muonEta > eta1_ && absL2muonEta < eta1_)
167  useBoth = true;
168  }
169 
170  numSeedsMade = 0;
171  hitlessSeedsMadeIP = 0;
172  hitlessSeedsMadeMuS = 0;
173  hitSeedsMade = 0;
174  hitSeedsMadeMuS = 0;
175 
176  // calculate scale factors
178  double errorSFHitless =
180 
181  // BARREL
182  if (absL2muonEta < maxEtaForTOB_) {
183  layerCount = 0;
184  for (auto it = tob.rbegin(); it != tob.rend(); ++it) {
185  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: looping in TOB layer " << layerCount << std::endl;
186  if (useHitLessSeeds_ && hitlessSeedsMadeIP < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
188  tsosAtIP,
189  *(propagatorAlong.get()),
190  estimatorH,
191  errorSFHitless,
192  hitlessSeedsMadeIP,
193  numSeedsMade,
194  out);
195 
196  // Do not create hitbased seeds in barrel region
197  if (absL2muonEta > 1.0 && hitSeedsMade < maxHitSeeds_ && numSeedsMade < maxSeeds_)
199  tsosAtIP,
200  *(propagatorAlong.get()),
201  estimatorH,
202  measurementTrackerH,
203  errorSFHits,
204  hitSeedsMade,
205  numSeedsMade,
206  layerCount,
207  out);
208 
209  if (useBoth && !displacedReco_) {
210  if (useHitLessSeeds_ && hitlessSeedsMadeMuS < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
212  outerTkStateOutside,
213  *(propagatorOpposite.get()),
214  estimatorH,
215  errorSFHitless,
216  hitlessSeedsMadeMuS,
217  numSeedsMade,
218  out);
219  }
220  }
221  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
222  << " , layerCount = " << layerCount << std::endl;
223  }
224 
225  // Reset number of seeds if in overlap region
226  if (absL2muonEta > minEtaForTEC_ && absL2muonEta < maxEtaForTOB_ && !displacedReco_) {
227  numSeedsMade = 0;
228  hitlessSeedsMadeIP = 0;
229  hitlessSeedsMadeMuS = 0;
230  hitSeedsMade = 0;
231  }
232 
233  // ENDCAP+
234  if (L2muonEta > minEtaForTEC_) {
235  layerCount = 0;
236  for (auto it = tecPositive.rbegin(); it != tecPositive.rend(); ++it) {
237  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: looping in TEC+ layer " << layerCount << std::endl;
238  if (useHitLessSeeds_ && hitlessSeedsMadeIP < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
240  tsosAtIP,
241  *(propagatorAlong.get()),
242  estimatorH,
243  errorSFHitless,
244  hitlessSeedsMadeIP,
245  numSeedsMade,
246  out);
247 
248  if (absL2muonEta > 1.0 && hitSeedsMade < maxHitSeeds_ && numSeedsMade < maxSeeds_)
250  tsosAtIP,
251  *(propagatorAlong.get()),
252  estimatorH,
253  measurementTrackerH,
254  errorSFHits,
255  hitSeedsMade,
256  numSeedsMade,
257  layerCount,
258  out);
259 
260  if (useBoth && !displacedReco_) {
261  if (useHitLessSeeds_ && hitlessSeedsMadeMuS < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
263  outerTkStateOutside,
264  *(propagatorOpposite.get()),
265  estimatorH,
266  errorSFHitless,
267  hitlessSeedsMadeMuS,
268  numSeedsMade,
269  out);
270  }
271  }
272  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
273  << " , layerCount = " << layerCount << std::endl;
274  }
275 
276  // ENDCAP-
277  if (L2muonEta < -minEtaForTEC_) {
278  layerCount = 0;
279  for (auto it = tecNegative.rbegin(); it != tecNegative.rend(); ++it) {
280  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: looping in TEC- layer " << layerCount << std::endl;
281  if (useHitLessSeeds_ && hitlessSeedsMadeIP < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
283  tsosAtIP,
284  *(propagatorAlong.get()),
285  estimatorH,
286  errorSFHitless,
287  hitlessSeedsMadeIP,
288  numSeedsMade,
289  out);
290 
291  if (absL2muonEta > 1.0 && hitSeedsMade < maxHitSeeds_ && numSeedsMade < maxSeeds_)
293  tsosAtIP,
294  *(propagatorAlong.get()),
295  estimatorH,
296  measurementTrackerH,
297  errorSFHits,
298  hitSeedsMade,
299  numSeedsMade,
300  layerCount,
301  out);
302 
303  if (useBoth && !displacedReco_) {
304  if (useHitLessSeeds_ && hitlessSeedsMadeMuS < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
306  outerTkStateOutside,
307  *(propagatorOpposite.get()),
308  estimatorH,
309  errorSFHitless,
310  hitlessSeedsMadeMuS,
311  numSeedsMade,
312  out);
313  }
314  }
315  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
316  << " , layerCount = " << layerCount << std::endl;
317  }
318 
319  // Displaced Reconstruction
320  if (displacedReco_ && outerTkStateOutside.isValid()) {
321  layerCount = 0;
322  for (auto it = tob.rbegin(); it != tob.rend(); ++it) {
323  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: looping in TOB layer " << layerCount;
324  if (useHitLessSeeds_ && hitlessSeedsMadeMuS < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
326  outerTkStateOutside,
327  *(propagatorOpposite.get()),
328  estimatorH,
329  errorSFHitless * SFHld_,
330  hitlessSeedsMadeMuS,
331  numSeedsMade,
332  out);
333  if (hitSeedsMadeMuS < maxHitSeeds_ && numSeedsMade < maxSeeds_)
335  outerTkStateOutside,
336  *(propagatorOpposite.get()),
337  estimatorH,
338  measurementTrackerH,
339  errorSFHits * SFHd_,
340  hitSeedsMadeMuS,
341  numSeedsMade,
342  layerCount,
343  out);
344  }
345  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
346  << " , layerCount = " << layerCount;
347  if (L2muonEta >= 0.0) {
348  layerCount = 0;
349  for (auto it = tecPositive.rbegin(); it != tecPositive.rend(); ++it) {
350  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: looping in TEC+ layer " << layerCount << std::endl;
351  if (useHitLessSeeds_ && hitlessSeedsMadeMuS < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
353  outerTkStateOutside,
354  *(propagatorOpposite.get()),
355  estimatorH,
356  errorSFHitless * SFHld_,
357  hitlessSeedsMadeMuS,
358  numSeedsMade,
359  out);
360  if (hitSeedsMadeMuS < maxHitSeeds_ && numSeedsMade < maxSeeds_)
362  outerTkStateOutside,
363  *(propagatorOpposite.get()),
364  estimatorH,
365  measurementTrackerH,
366  errorSFHits * SFHd_,
367  hitSeedsMadeMuS,
368  numSeedsMade,
369  layerCount,
370  out);
371  }
372  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
373  << " , layerCount = " << layerCount;
374  }
375 
376  else {
377  layerCount = 0;
378  for (auto it = tecNegative.rbegin(); it != tecNegative.rend(); ++it) {
379  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2::produce: looping in TEC- layer " << layerCount;
380  if (useHitLessSeeds_ && hitlessSeedsMadeMuS < maxHitlessSeeds_ && numSeedsMade < maxSeeds_)
382  outerTkStateOutside,
383  *(propagatorOpposite.get()),
384  estimatorH,
385  errorSFHitless * SFHld_,
386  hitlessSeedsMadeMuS,
387  numSeedsMade,
388  out);
389  if (hitSeedsMadeMuS < maxHitSeeds_ && numSeedsMade < maxSeeds_)
391  outerTkStateOutside,
392  *(propagatorOpposite.get()),
393  estimatorH,
394  measurementTrackerH,
395  errorSFHits * SFHd_,
396  hitSeedsMadeMuS,
397  numSeedsMade,
398  layerCount,
399  out);
400  }
401  LogTrace("TSGForOIFromL2") << "TSGForOIFromL2:::produce: NumSeedsMade = " << numSeedsMade
402  << " , layerCount = " << layerCount;
403  }
404  }
405 
406  for (std::vector<TrajectorySeed>::iterator it = out.begin(); it != out.end(); ++it) {
407  result->push_back(*it);
408  }
409 
410  } // L2Collection
411 
412  edm::LogInfo(theCategory_) << "TSGForOIFromL2::produce: number of seeds made: " << result->size();
413 
414  iEvent.put(std::move(result));
415 }
const bool useHitLessSeeds_
std::vector< ForwardDetLayer const * > const & posTecLayers() const
const double SFHd_
const double minEtaForTEC_
Minimum eta value to activate searching in the TEC.
const double SFHld_
const unsigned int maxHitSeeds_
Maximum number of hitbased seeds for each L2.
double calculateSFFromL2(const reco::TrackRef track) const
Calculate the dynamic error SF by analysing the L2.
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tmpTkGeometryToken_
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > geometryToken_
#define LogTrace(id)
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
GlobalPoint position() const
const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > estimatorToken_
const unsigned int maxHitlessSeeds_
Maximum number of hitless seeds for each L2.
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
int iEvent
Definition: GenABIO.cc:224
T const * product() const
Definition: ESHandle.h:86
const double eta7_
bool isThere(GeomDetEnumerators::SubDetector subdet) const
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
const unsigned int numL2ValidHitsCutAllEndcap_
const unsigned int maxSeeds_
Maximum number of seeds for each L2.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const double eta1_
void makeSeedsWithoutHits(const GeometricSearchDet &layer, const TrajectoryStateOnSurface &tsos, const Propagator &propagatorAlong, const edm::ESHandle< Chi2MeasurementEstimatorBase > &estimator, double errorSF, unsigned int &hitlessSeedsMade, unsigned int &numSeedsMade, std::vector< TrajectorySeed > &out) const
Create seeds without hits on a given layer (TOB or TEC)
const double fixedErrorRescalingForHits_
Rescale L2 parameter uncertainties (fixed error vs pT, eta)
const double maxEtaForTOB_
Maximum eta value to activate searching in the TOB.
const bool adjustErrorsDynamicallyForHits_
Whether or not to use an automatically calculated scale-factor value.
const std::string theCategory_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
const edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerTag_
const unsigned int numL2ValidHitsCutAllEta_
L2 valid hit cuts to decide seed creation by both states.
std::vector< ForwardDetLayer const * > const & negTidLayers() const
Log< level::Info, false > LogInfo
std::vector< ForwardDetLayer const * > const & posTidLayers() const
const GeometricSearchTracker * geometricSearchTracker() const
const edm::EDGetTokenT< reco::TrackCollection > src_
Labels for input collections.
std::vector< BarrelDetLayer const * > const & tobLayers() const
const bool adjustErrorsDynamicallyForHitless_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > sHPOppositeToken_
const bool displacedReco_
Displaced reconstruction.
std::vector< ForwardDetLayer const * > const & negTecLayers() const
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
void makeSeedsFromHits(const GeometricSearchDet &layer, const TrajectoryStateOnSurface &tsos, const Propagator &propagatorAlong, const edm::ESHandle< Chi2MeasurementEstimatorBase > &estimator, const edm::Handle< MeasurementTrackerEvent > &measurementTracker, double errorSF, unsigned int &hitSeedsMade, unsigned int &numSeedsMade, unsigned int &layerCount, std::vector< TrajectorySeed > &out) const
Find hits on a given layer (TOB or TEC) and create seeds from updated TSOS with hit.
def move(src, dest)
Definition: eostools.py:511
TrajectoryStateOnSurface innerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
const double fixedErrorRescalingForHitless_

Member Data Documentation

◆ adjustErrorsDynamicallyForHitless_

const bool TSGForOIFromL2::adjustErrorsDynamicallyForHitless_
private

Definition at line 70 of file TSGForOIFromL2.h.

Referenced by produce().

◆ adjustErrorsDynamicallyForHits_

const bool TSGForOIFromL2::adjustErrorsDynamicallyForHits_
private

Whether or not to use an automatically calculated scale-factor value.

Definition at line 69 of file TSGForOIFromL2.h.

Referenced by produce().

◆ displacedReco_

const bool TSGForOIFromL2::displacedReco_
private

Displaced reconstruction.

Definition at line 101 of file TSGForOIFromL2.h.

Referenced by produce().

◆ estimatorName_

const std::string TSGForOIFromL2::estimatorName_
private

Estimator used to find dets and TrajectoryMeasurements.

Definition at line 73 of file TSGForOIFromL2.h.

◆ estimatorToken_

const edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> TSGForOIFromL2::estimatorToken_
private

Definition at line 106 of file TSGForOIFromL2.h.

Referenced by produce().

◆ eta1_

const double TSGForOIFromL2::eta1_
private

Definition at line 92 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2(), and produce().

◆ eta2_

const double TSGForOIFromL2::eta2_
private

Definition at line 92 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ eta3_

const double TSGForOIFromL2::eta3_
private

Definition at line 92 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ eta4_

const double TSGForOIFromL2::eta4_
private

Definition at line 92 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ eta5_

const double TSGForOIFromL2::eta5_
private

Definition at line 92 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ eta6_

const double TSGForOIFromL2::eta6_
private

Definition at line 92 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ eta7_

const double TSGForOIFromL2::eta7_
private

Definition at line 92 of file TSGForOIFromL2.h.

Referenced by produce().

◆ fixedErrorRescalingForHitless_

const double TSGForOIFromL2::fixedErrorRescalingForHitless_
private

Definition at line 66 of file TSGForOIFromL2.h.

Referenced by produce().

◆ fixedErrorRescalingForHits_

const double TSGForOIFromL2::fixedErrorRescalingForHits_
private

Rescale L2 parameter uncertainties (fixed error vs pT, eta)

Definition at line 65 of file TSGForOIFromL2.h.

Referenced by produce().

◆ geometryToken_

const edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> TSGForOIFromL2::geometryToken_
private

Definition at line 110 of file TSGForOIFromL2.h.

Referenced by produce().

◆ magfieldToken_

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> TSGForOIFromL2::magfieldToken_
private

Definition at line 107 of file TSGForOIFromL2.h.

Referenced by produce().

◆ maxEtaForTOB_

const double TSGForOIFromL2::maxEtaForTOB_
private

Maximum eta value to activate searching in the TOB.

Definition at line 79 of file TSGForOIFromL2.h.

Referenced by produce().

◆ maxHitlessSeeds_

const unsigned int TSGForOIFromL2::maxHitlessSeeds_
private

Maximum number of hitless seeds for each L2.

Definition at line 49 of file TSGForOIFromL2.h.

Referenced by produce().

◆ maxHitSeeds_

const unsigned int TSGForOIFromL2::maxHitSeeds_
private

Maximum number of hitbased seeds for each L2.

Definition at line 52 of file TSGForOIFromL2.h.

Referenced by makeSeedsFromHits(), and produce().

◆ maxSeeds_

const unsigned int TSGForOIFromL2::maxSeeds_
private

Maximum number of seeds for each L2.

Definition at line 46 of file TSGForOIFromL2.h.

Referenced by produce().

◆ measurementTrackerTag_

const edm::EDGetTokenT<MeasurementTrackerEvent> TSGForOIFromL2::measurementTrackerTag_
private

Definition at line 88 of file TSGForOIFromL2.h.

Referenced by produce().

◆ minEtaForTEC_

const double TSGForOIFromL2::minEtaForTEC_
private

Minimum eta value to activate searching in the TEC.

Definition at line 76 of file TSGForOIFromL2.h.

Referenced by produce().

◆ numL2ValidHitsCutAllEndcap_

const unsigned int TSGForOIFromL2::numL2ValidHitsCutAllEndcap_
private

Definition at line 62 of file TSGForOIFromL2.h.

Referenced by produce().

◆ numL2ValidHitsCutAllEta_

const unsigned int TSGForOIFromL2::numL2ValidHitsCutAllEta_
private

L2 valid hit cuts to decide seed creation by both states.

Definition at line 61 of file TSGForOIFromL2.h.

Referenced by produce().

◆ numOfHitsToTry_

const unsigned int TSGForOIFromL2::numOfHitsToTry_
private

How many hits to try per layer.

Definition at line 58 of file TSGForOIFromL2.h.

Referenced by makeSeedsFromHits().

◆ numOfLayersToTry_

const unsigned int TSGForOIFromL2::numOfLayersToTry_
private

How many layers to try.

Definition at line 55 of file TSGForOIFromL2.h.

Referenced by makeSeedsFromHits().

◆ propagatorName_

const std::string TSGForOIFromL2::propagatorName_
private

Counters and flags for the implementation.

Definition at line 104 of file TSGForOIFromL2.h.

◆ propagatorToken_

const edm::ESGetToken<Propagator, TrackingComponentsRecord> TSGForOIFromL2::propagatorToken_
private

Definition at line 108 of file TSGForOIFromL2.h.

Referenced by produce().

◆ pT1_

const double TSGForOIFromL2::pT1_
private

pT, eta ranges and scale factor values

Definition at line 91 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ pT2_

const double TSGForOIFromL2::pT2_
private

Definition at line 91 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ pT3_

const double TSGForOIFromL2::pT3_
private

Definition at line 91 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ SF1_

const double TSGForOIFromL2::SF1_
private

Definition at line 93 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ SF2_

const double TSGForOIFromL2::SF2_
private

Definition at line 93 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ SF3_

const double TSGForOIFromL2::SF3_
private

Definition at line 93 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ SF4_

const double TSGForOIFromL2::SF4_
private

Definition at line 93 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ SF5_

const double TSGForOIFromL2::SF5_
private

Definition at line 93 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ SF6_

const double TSGForOIFromL2::SF6_
private

Definition at line 93 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2().

◆ SFHd_

const double TSGForOIFromL2::SFHd_
private

Definition at line 94 of file TSGForOIFromL2.h.

Referenced by produce().

◆ SFHld_

const double TSGForOIFromL2::SFHld_
private

Definition at line 94 of file TSGForOIFromL2.h.

Referenced by produce().

◆ sHPOppositeToken_

const edm::ESGetToken<Propagator, TrackingComponentsRecord> TSGForOIFromL2::sHPOppositeToken_
private

Definition at line 111 of file TSGForOIFromL2.h.

Referenced by produce().

◆ src_

const edm::EDGetTokenT<reco::TrackCollection> TSGForOIFromL2::src_
private

Labels for input collections.

Definition at line 43 of file TSGForOIFromL2.h.

Referenced by produce().

◆ theCategory_

const std::string TSGForOIFromL2::theCategory_
private

Definition at line 105 of file TSGForOIFromL2.h.

Referenced by calculateSFFromL2(), makeSeedsWithoutHits(), and produce().

◆ tmpTkGeometryToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> TSGForOIFromL2::tmpTkGeometryToken_
private

Definition at line 109 of file TSGForOIFromL2.h.

Referenced by produce().

◆ tsosDiff1_

const double TSGForOIFromL2::tsosDiff1_
private

Distance of L2 TSOSs before and after updated with vertex.

Definition at line 97 of file TSGForOIFromL2.h.

◆ tsosDiff2_

const double TSGForOIFromL2::tsosDiff2_
private

Definition at line 98 of file TSGForOIFromL2.h.

◆ updator_

const std::unique_ptr<TrajectoryStateUpdator> TSGForOIFromL2::updator_
private

KFUpdator defined in constructor.

Definition at line 86 of file TSGForOIFromL2.h.

Referenced by makeSeedsFromHits().

◆ useHitLessSeeds_

const bool TSGForOIFromL2::useHitLessSeeds_
private

Switch ON (True) : use additional hits for seeds depending on the L2 properties (ignores numOfMaxSeeds_) Switch OFF (False): the numOfMaxSeeds_ defines if we will use hitless (numOfMaxSeeds_==1) or hitless+hits (numOfMaxSeeds_>1)

Definition at line 83 of file TSGForOIFromL2.h.

Referenced by produce().