1 #ifndef RecoTracker_TkTrackingRegions_L1MuonSeededTrackingRegionsProducer_h
2 #define RecoTracker_TkTrackingRegions_L1MuonSeededTrackingRegionsProducer_h
25 #include "CLHEP/Vector/ThreeVector.h"
61 l1MinPt_(iConfig.getParameter<double>(
"L1MinPt")),
62 l1MaxEta_(iConfig.getParameter<double>(
"L1MaxEta")),
63 l1MinQuality_(iConfig.getParameter<unsigned int>(
"L1MinQuality")),
64 minPtBarrel_(iConfig.getParameter<double>(
"SetMinPtBarrelTo")),
65 minPtEndcap_(iConfig.getParameter<double>(
"SetMinPtEndcapTo")),
72 if (modeString ==
"BeamSpotFixed")
74 else if (modeString ==
"BeamSpotSigma")
76 else if (modeString ==
"VerticesFixed")
78 else if (modeString ==
"VerticesSigma")
81 edm::LogError(
"L1MuonSeededTrackingRegionsProducer") <<
"Unknown mode string: " << modeString;
98 if (m_ptRanges.size() < 2) {
99 edm::LogError(
"L1MuonSeededTrackingRegionsProducer") <<
"Size of ptRanges does not be less than 2" << std::endl;
104 <<
"Size of deltaEtas does not match number of pt bins." << std::endl;
109 <<
"Size of deltaPhis does not match number of pt bins." << std::endl;
129 m_nSigmaZBeamSpot = regPSet.
getParameter<
double>(
"nSigmaZBeamSpot");
130 if (m_nSigmaZBeamSpot < 0.)
132 <<
"nSigmaZBeamSpot must be positive for BeamSpotSigma mode!";
150 desc.
add<
double>(
"L1MinPt", -1.);
151 desc.
add<
double>(
"L1MaxEta", 5.0);
152 desc.
add<
unsigned int>(
"L1MinQuality", 0);
153 desc.
add<
double>(
"SetMinPtBarrelTo", 3.5);
154 desc.
add<
double>(
"SetMinPtEndcapTo", 1.0);
155 desc.
add<
bool>(
"CentralBxOnly",
true);
161 descRegion.add<
int>(
"maxNRegions", 10);
164 descRegion.add<
int>(
"maxNVertices", 1);
165 descRegion.add<
double>(
"ptMin", 0.0);
166 descRegion.add<
double>(
"originRadius", 0.2);
167 descRegion.add<
double>(
"zErrorBeamSpot", 24.2);
168 descRegion.add<std::vector<double>>(
"ptRanges", {0., 1.e9});
169 descRegion.add<std::vector<double>>(
"deltaEtas", {0.35});
170 descRegion.add<std::vector<double>>(
"deltaPhis", {0.2});
171 descRegion.add<
bool>(
"precise",
true);
172 descRegion.add<
double>(
"nSigmaZVertex", 3.);
173 descRegion.add<
double>(
"zErrorVetex", 0.2);
174 descRegion.add<
double>(
"nSigmaZBeamSpot", 4.);
175 descRegion.add<
std::string>(
"whereToUseMeasurementTracker",
"Never");
177 descRegion.add<
bool>(
"searchOpt",
false);
182 psd0.
addUntracked<std::vector<std::string>>(
"Propagators", {
"SteppingHelixPropagatorAny"});
183 psd0.add<
bool>(
"RPCLayers",
false);
184 psd0.addUntracked<
bool>(
"UseMuonNavigation",
false);
187 descriptions.
add(
"hltIterL3MuonPixelTracksTrackingRegions", desc);
192 std::vector<std::unique_ptr<TrackingRegion>>
result;
197 if (muColl->size() == 0)
207 GlobalPoint default_origin(bs->x0(), bs->y0(), bs->z0());
210 std::vector<std::pair<GlobalPoint, float>> origins;
214 origins.push_back(std::make_pair(
220 for (reco::VertexCollection::const_iterator
v = vertices->begin();
223 if (
v->isFake() || !
v->isValid())
226 origins.push_back(std::make_pair(
GlobalPoint(
v->x(),
v->y(),
v->z()),
231 if (origins.empty()) {
232 origins.push_back(std::make_pair(
251 for (
int ibx = muColl->getFirstBX(); ibx <= muColl->getLastBX() && n_regions <
m_maxNRegions; ++ibx) {
255 for (
auto it = muColl->begin(ibx); it != muColl->end(ibx) && n_regions <
m_maxNRegions; it++) {
256 unsigned int quality = it->hwQual();
261 float eta = it->eta();
266 float phi = it->phi();
268 int valid_charge = it->hwChargeValid();
269 int charge = it->charge();
284 CLHEP::Hep3Vector vec(0., 1., 0.);
293 detLayer =
service_->detLayerGeometry()->idToLayer(theid);
306 detLayer =
service_->detLayerGeometry()->idToLayer(theid);
350 result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(direction,
367 edm::LogInfo(
"L1MuonSeededTrackingRegionsProducer") <<
"produced " << n_regions <<
" regions";
static constexpr double sigma_x_
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
const bool centralBxOnly_
static constexpr int l1MuonTF_link_EMTFP_f_
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
const std::string propagatorName_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Sin< T >::type sin(const T &t)
constexpr bool isUninitialized() const noexcept
Global3DPoint GlobalPoint
Geom::Theta< T > theta() const
__host__ __device__ constexpr RandomIt upper_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
edm::EDGetTokenT< MeasurementTrackerEvent > token_measurementTracker
std::vector< Vertex > VertexCollection
collection of Vertex objects
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
std::vector< double > m_deltaEtas
Exp< T >::type exp(const T &t)
const double minPtEndcap_
edm::EDGetTokenT< l1t::MuonBxCollection > token_input
Log< level::Error, false > LogError
static constexpr double sigma_qbpt_invalid_charge_
std::vector< double > m_deltaPhis
~L1MuonSeededTrackingRegionsProducer() override=default
static constexpr double sigma_qbpt_endcap_
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
static const double deltaEta
static constexpr double sigma_lambda_
bool getData(T &iHolder) const
U second(std::pair< T, U > const &p)
static constexpr double sigma_y_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static constexpr double sigma_qbpt_barrel_
static constexpr int l1MuonTF_link_EMTFN_f_
Cos< T >::type cos(const T &t)
const double minPtBarrel_
Abs< T >::type abs(const T &t)
bool get(ProductID const &oid, Handle< PROD > &result) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const unsigned l1MinQuality_
edm::EDGetTokenT< reco::VertexCollection > token_vertex
GlobalVector momentum() const
Log< level::Info, false > LogInfo
std::unique_ptr< MuonServiceProxy > service_
static constexpr int l1MuonTF_link_EMTFP_i_
T const * product() const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > token_field
virtual const Surface::PositionType & position() const
Returns position of the surface.
std::vector< double > m_ptRanges
T getParameter(std::string const &) const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
void add(std::string const &label, ParameterSetDescription const &psetDescription)
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_whereToUseMeasurementTracker
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &iEvent, const edm::EventSetup &iSetup) const override
L1MuonSeededTrackingRegionsProducer(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC)
static constexpr int l1MuonTF_link_EMTFN_i_
static constexpr double sigma_phi_
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > token_msmaker