1 #ifndef CandidatePointSeededTrackingRegionsProducer_h 2 #define CandidatePointSeededTrackingRegionsProducer_h 68 if (seedingModeString ==
"Candidate")
70 else if (seedingModeString ==
"Point")
72 else if (seedingModeString ==
"CandidatePoint")
84 std::vector<double> etaPoints = points.
getParameter<std::vector<double>>(
"eta");
85 std::vector<double> phiPoints = points.
getParameter<std::vector<double>>(
"phi");
87 if (!(etaPoints.size() == phiPoints.size()))
89 if (etaPoints.empty())
91 <<
"At least one point should be defined for point or candidate+point seeding modes";
93 for (
size_t i = 0;
i < etaPoints.size(); ++
i) {
118 <<
"Delta eta and phi parameters must be set for candidates in candidate seeding mode";
124 <<
"Delta eta and phi parameters must be set for points in point seeding mode";
132 "candidates and points in candidate+point seeding mode";
143 if (regPSet.
exists(
"searchOpt"))
160 descPoints.
add<std::vector<double>>(
"eta", {});
161 descPoints.add<std::vector<double>>(
"phi", {});
164 desc.add<
unsigned int>(
"maxNRegions", 10);
168 desc.add<
double>(
"ptMin", 0.9);
169 desc.add<
double>(
"originRadius", 0.2);
170 desc.add<
double>(
"deltaEta_Cand", -1.);
171 desc.add<
double>(
"deltaPhi_Cand", -1.);
172 desc.add<
double>(
"deltaEta_Point", -1.);
173 desc.add<
double>(
"deltaPhi_Point", -1.);
174 desc.add<
bool>(
"precise",
true);
179 desc.add<
bool>(
"searchOpt",
false);
185 descriptions.
add(
"candidatePointSeededTrackingRegionsFromBeamSpot", descRegion);
189 std::vector<std::unique_ptr<TrackingRegion>>
result;
193 size_t n_objects = 0;
205 if (origins.empty()) {
227 for (
const auto&
object :
objs) {
228 GlobalVector direction(
object.momentum().
x(),
object.momentum().
y(),
object.momentum().
z());
230 for (
const auto& origin : origins) {
231 result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(direction,
257 for (
const auto& origin : origins) {
258 result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(direction,
283 for (
const auto&
object :
objs) {
284 double eta_Cand =
object.eta();
285 double phi_Cand =
object.phi();
288 double eta_Point = etaPhiPoint.first;
289 double phi_Point = etaPhiPoint.second;
290 double dEta_Cand_Point =
std::abs(eta_Cand - eta_Point);
307 double phiMin_RoI =
deltaPhi(phi_Cand_minus, phi_Point_minus) > 0. ? phi_Cand_minus : phi_Point_minus;
308 double phiMax_RoI =
deltaPhi(phi_Cand_plus, phi_Point_plus) < 0. ? phi_Cand_plus : phi_Point_plus;
311 double eta_RoI = 0.5 * (etaMax_RoI + etaMin_RoI);
312 double deltaEta_RoI = etaMax_RoI - eta_RoI;
314 double phi_RoI = 0.5 * (phiMax_RoI + phiMin_RoI);
315 if (phiMax_RoI < phiMin_RoI)
318 double deltaPhi_RoI =
deltaPhi(phiMax_RoI, phi_RoI);
327 for (
const auto& origin : origins) {
328 result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(direction,
355 edm::LogInfo(
"CandidatePointSeededTrackingRegionsProducer") <<
"produced " << n_regions <<
" regions";
T getParameter(std::string const &) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
~CandidatePointSeededTrackingRegionsProducer() override=default
constexpr T normalizedPhi(T phi)
Sin< T >::type sin(const T &t)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
T const * product() const
constexpr bool isUninitialized() const noexcept
static void fillDescriptions(edm::ParameterSetDescription &desc, const std::string &defaultBeamSpot="offlineBeamSpot", const std::string &defaultVertex="firstStepPrimaryVertices", int defaultMaxVertices=-1)
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
std::vector< std::pair< double, double > > m_etaPhiPoints
edm::EDGetTokenT< MeasurementTrackerEvent > m_token_measurementTracker
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_whereToUseMeasurementTracker
VertexBeamspotOrigins m_origins
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
SeedingMode m_seedingMode
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Log< level::Info, false > LogInfo
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &e, const edm::EventSetup &es) const override
CandidatePointSeededTrackingRegionsProducer(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
std::vector< GlobalVector > m_directionPoints
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > token_field
Origins origins(const edm::Event &iEvent) const
edm::EDGetTokenT< reco::CandidateView > m_token_input
edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > token_msmaker