50 if (ptRanges_.size() < 2) {
51 edm::LogError(
"MuonTrackingRegionByPtBuilder") <<
"Size of ptRanges does not be less than 2." << std::endl;
55 if (
deltaEtas_.size() != ptRanges_.size() - 1) {
57 <<
"Size of deltaEtas does not match number of pt bins." << std::endl;
61 if (
deltaPhis_.size() != ptRanges_.size() - 1) {
63 <<
"Size of deltaPhis does not match number of pt bins." << std::endl;
97 std::vector<std::unique_ptr<TrackingRegion>>
result;
103 for (
auto it = tracks->cbegin(), ed = tracks->cend(); it != ed && nRegions <
theMaxRegions; ++it) {
104 result.push_back(
region(*it, ev, es));
135 double pt = staTrack.
pt();
139 GlobalVector forSmallMomentum(innerMomentum.x(), innerMomentum.y(), innerMomentum.z());
140 if (staTrack.
p() <= 1.5) {
141 pt =
std::abs(forSmallMomentum.perp());
155 vertexPos =
GlobalPoint(bs->x0(), bs->y0(), bs->z0());
162 if (vtxHandleFlag && !vertexCollection->empty()) {
164 reco::VertexCollection::const_iterator vtx = vertexCollection->begin();
165 if (!vtx->isFake() && vtx->isValid()) {
166 vertexPos =
GlobalPoint(vtx->x(), vtx->y(), vtx->z());
188 measurementTracker = hmte.
product();
197 auto region = std::make_unique<RectangularEtaPhiTrackingRegion>(dirVector,
210 LogDebug(
"MuonTrackingRegionByPtBuilder")
211 <<
"the region parameters are:\n"
212 <<
"\n dirVector: " << dirVector <<
"\n vertexPos: " << vertexPos <<
"\n minPt: " << minPt
213 <<
"\n deltaR:" << deltaR <<
"\n deltaZ:" << deltaZ <<
"\n region_dEta:" << region_dEta
214 <<
"\n region_dPhi:" << region_dPhi <<
"\n on demand parameter: " <<
static_cast<int>(
theOnDemand);
221 desc.
add<
double>(
"DeltaR", 0.2);
223 desc.
add<
int>(
"OnDemand", -1);
226 desc.
add<
bool>(
"UseVertex",
false);
227 desc.
add<
double>(
"Rescale_Dz", 3.0);
228 desc.
add<
bool>(
"Pt_fixed",
false);
229 desc.
add<
bool>(
"Z_fixed",
true);
230 desc.
add<
double>(
"Pt_min", 1.5);
231 desc.
add<
double>(
"DeltaZ", 15.9);
232 desc.
add<std::vector<double>>(
"ptRanges", {0., 1.e9});
233 desc.
add<std::vector<double>>(
"deltaEtas", {0.2});
234 desc.
add<std::vector<double>>(
"deltaPhis", {0.15});
235 desc.
add<
int>(
"maxRegions", 1);
236 desc.
add<
bool>(
"precise",
true);
238 descriptions.
add(
"MuonTrackingRegionByPtBuilder", desc);
241 "Build a TrackingRegion around a standalone muon. Options to define region around beamspot or primary vertex and "
242 "dynamic regions are included.");
double p() const
momentum vector magnitude
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::Event * theEvent
constexpr bool isUninitialized() const noexcept
Global3DPoint GlobalPoint
std::vector< Track > TrackCollection
collection of Tracks
__host__ __device__ constexpr RandomIt upper_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
std::vector< Vertex > VertexCollection
collection of Vertex objects
auto const & tracks
cannot be loose
const Vector & momentum() const
track momentum vector
Log< level::Error, false > LogError
edm::EDGetTokenT< reco::VertexCollection > vertexCollectionToken
bool getData(T &iHolder) const
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &, const edm::EventSetup &) const override
Create Region of Interest.
const edm::EventSetup * theEventSetup
std::unique_ptr< RectangularEtaPhiTrackingRegion > region(const reco::TrackRef &) const
Define tracking region.
double pt() const
track transverse momentum
Abs< T >::type abs(const T &t)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< double > deltaPhis_
std::vector< double > deltaEtas_
void setComment(std::string const &value)
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken
void build(const edm::ParameterSet &, edm::ConsumesCollector &)
T const * product() const
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > msmakerToken
XYZVectorD XYZVector
spatial vector with cartesian internal representation
edm::EDGetTokenT< reco::TrackCollection > inputCollectionToken
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Add Fill Descriptions.
RectangularEtaPhiTrackingRegion::UseMeasurementTracker theOnDemand
edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerToken
std::vector< double > ptRanges_
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
static UseMeasurementTracker intToUseMeasurementTracker(int value)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bfieldToken
void setEvent(const edm::Event &, const edm::EventSetup &)
Pass the Event to the algo at each event.