171 auto output = std::make_unique<L2MuonTrajectorySeedCollection>();
175 LogDebug(metname) <<
"Number of muons " << muColl->size() << endl;
178 vector<int> offlineSeedMap;
181 offlineSeedMap = vector<int>(offlineSeedHandle->size(), 0);
184 for (
auto const &tkmu : *muColl) {
186 auto const &it = tkmu.trkPtr();
189 auto p3 = it->momentum();
191 float tk_p = p3.mag();
195 float tk_pt = p3.perp();
196 float tk_eta = p3.eta();
203 float tk_phi = p3.phi();
204 float tk_q = it->rInv() > 0 ? 1. : -1.;
205 float tk_z = it->POCA().z();
207 float dzCorrPhi = 1.;
209 float etaProp = tk_aeta;
213 deta = tk_z /
distMB2_ / cosh(tk_aeta);
218 dzCorrPhi = 1. +
delta;
222 deta = zOzs / (1. - zOzs);
224 deta = zOzs / (1. + zOzs);
225 deta = deta * tanh(tk_eta);
231 float eta = tk_eta + deta;
234 int charge = it->rInv() > 0 ? 1 : -1;
239 LogDebug(metname) <<
"New L2 Muon Seed";
240 LogDebug(metname) <<
"Pt = " << pt <<
" GeV/c";
242 LogDebug(metname) <<
"theta = " << theta <<
" rad";
243 LogDebug(metname) <<
"phi = " << phi <<
" rad";
253 CLHEP::Hep3Vector vec(0., 1., 0.);
260 LogDebug(metname) <<
"The seed is in the barrel";
264 detLayer =
service_->detLayerGeometry()->idToLayer(theid);
277 LogDebug(metname) <<
"The seed is in the endcap";
282 detLayer =
service_->detLayerGeometry()->idToLayer(theid);
300 mat[0][0] = (0.25 /
pt) * (0.25 / pt);
302 mat[0][0] = (0.4 /
pt) * (0.4 / pt);
304 mat[1][1] = 0.05 * 0.05;
305 mat[2][2] = 0.2 * 0.2;
306 mat[3][3] = 20. * 20.;
307 mat[4][4] = 20. * 20.;
313 LogDebug(metname) <<
"Free trajectory State from the parameters";
319 LogDebug(metname) <<
"State after the propagation on the layer";
334 std::vector<pair<const GeomDet *, TrajectoryStateOnSurface>> detsWithStates =
337 if (detsWithStates.empty() &&
barrel) {
341 const DetLayer *ME2DetLayer =
service_->detLayerGeometry()->idToLayer(fallback_id);
347 if (!detsWithStates.empty()) {
349 const GeomDet *newTSOSDet = detsWithStates.front().first;
351 LogDebug(metname) <<
"Most compatible det";
365 if (assoOffseed !=
nullptr) {
367 for (
auto const &recHit : assoOffseed->
recHits()) {
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
TrackCharge charge() const
constexpr T reduceRange(T x)
std::string dumpLayer(const DetLayer *layer) const
static constexpr float phiCorr1_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
static constexpr float distMB2_
static constexpr float phiCorr0_
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
constexpr uint32_t rawId() const
get the raw id
Geom::Theta< T > theta() const
__host__ __device__ constexpr RandomIt upper_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
GlobalPoint globalPosition() const
edm::EDGetTokenT< edm::View< TrajectorySeed > > offlineSeedToken_
Exp< T >::type exp(const T &t)
std::string propagatorName_
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
const TrajectorySeed * associateOfflineSeedToL1(edm::Handle< edm::View< TrajectorySeed >> &, std::vector< int > &, TrajectoryStateOnSurface &, double)
std::string dumpMuonId(const DetId &id) const
std::string dumpFTS(const FreeTrajectoryState &fts) const
const bool useUnassociatedL1_
std::string dumpTSOS(const TrajectoryStateOnSurface &tsos) const
std::vector< double > etaBins_
std::unique_ptr< MuonServiceProxy > service_
the event setup proxy, it takes care the services update
Cos< T >::type cos(const T &t)
std::unique_ptr< MeasurementEstimator > estimator_
Abs< T >::type abs(const T &t)
DetId geographicalId() const
The label of this GeomDet.
const double minPtEndcap_
const bool useOfflineSeed_
std::vector< double > matchingDR_
static constexpr float distME2_
RecHitRange recHits() const
static constexpr float etaBoundary_
PTrajectoryStateOnDet const & startingState() const
virtual const Surface::PositionType & position() const
Returns position of the surface.
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const double minPtBarrel_
const double minPtL1TkBarrel_
static constexpr float phiCorr2_
GlobalVector globalMomentum() const
edm::EDGetTokenT< l1t::TkMuonCollection > muCollToken_