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"))
156 descPoints.
add<std::vector<double>>(
"eta", {});
157 descPoints.add<std::vector<double>>(
"phi", {});
160 desc.add<
unsigned int>(
"maxNRegions", 10);
164 desc.add<
double>(
"ptMin", 0.9);
165 desc.add<
double>(
"originRadius", 0.2);
166 desc.add<
double>(
"deltaEta_Cand", -1.);
167 desc.add<
double>(
"deltaPhi_Cand", -1.);
168 desc.add<
double>(
"deltaEta_Point", -1.);
169 desc.add<
double>(
"deltaPhi_Point", -1.);
170 desc.add<
bool>(
"precise",
true);
175 desc.add<
bool>(
"searchOpt",
false);
181 descriptions.
add(
"candidatePointSeededTrackingRegionsFromBeamSpot", descRegion);
185 std::vector<std::unique_ptr<TrackingRegion>>
result;
189 size_t n_objects = 0;
201 if (origins.empty()) {
217 for (
const auto&
object :
objs) {
218 GlobalVector direction(
object.momentum().
x(),
object.momentum().
y(),
object.momentum().
z());
220 for (
const auto& origin : origins) {
221 result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(direction,
245 for (
const auto& origin : origins) {
246 result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(direction,
269 for (
const auto&
object :
objs) {
270 double eta_Cand =
object.eta();
271 double phi_Cand =
object.phi();
274 double eta_Point = etaPhiPoint.first;
275 double phi_Point = etaPhiPoint.second;
276 double dEta_Cand_Point =
std::abs(eta_Cand - eta_Point);
293 double phiMin_RoI =
deltaPhi(phi_Cand_minus, phi_Point_minus) > 0. ? phi_Cand_minus : phi_Point_minus;
294 double phiMax_RoI =
deltaPhi(phi_Cand_plus, phi_Point_plus) < 0. ? phi_Cand_plus : phi_Point_plus;
297 double eta_RoI = 0.5 * (etaMax_RoI + etaMin_RoI);
298 double deltaEta_RoI = etaMax_RoI - eta_RoI;
300 double phi_RoI = 0.5 * (phiMax_RoI + phiMin_RoI);
301 if (phiMax_RoI < phiMin_RoI)
304 double deltaPhi_RoI =
deltaPhi(phiMax_RoI, phi_RoI);
313 for (
const auto& origin : origins) {
314 result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(direction,
339 edm::LogInfo(
"CandidatePointSeededTrackingRegionsProducer") <<
"produced " << n_regions <<
" regions";