1 #ifndef CandidatePointSeededTrackingRegionsProducer_h 2 #define CandidatePointSeededTrackingRegionsProducer_h 84 std::vector<double> etaPoints = points.
getParameter<std::vector<double>>(
"eta");
85 std::vector<double> phiPoints = points.
getParameter<std::vector<double>>(
"phi");
90 for(
size_t i = 0;
i < etaPoints.size(); ++
i ){
148 descPoints.
add<std::vector<double>> (
"eta", {} );
149 descPoints.add<std::vector<double>> (
"phi", {} );
152 desc.
add<
unsigned int>(
"maxNRegions", 10);
156 desc.
add<
double>(
"ptMin", 0.9);
157 desc.
add<
double>(
"originRadius", 0.2);
158 desc.
add<
double>(
"deltaEta_Cand", -1.);
159 desc.
add<
double>(
"deltaPhi_Cand", -1.);
160 desc.
add<
double>(
"deltaEta_Point", -1.);
161 desc.
add<
double>(
"deltaPhi_Point", -1.);
162 desc.
add<
bool>(
"precise",
true);
164 desc.
add<
std::string>(
"whereToUseMeasurementTracker",
"ForSiStrips");
167 desc.
add<
bool>(
"searchOpt",
false);
173 descriptions.
add(
"candidatePointSeededTrackingRegionsFromBeamSpot", descRegion);
179 std::vector<std::unique_ptr<TrackingRegion> >
result;
183 size_t n_objects = 0;
187 n_objects = objects->
size();
188 if (n_objects == 0)
return result;
191 const auto& objs = *objects;
194 if(origins.empty()) {
202 measurementTracker = hmte.
product();
211 for(
const auto&
object : objs) {
213 GlobalVector direction(
object.momentum().
x(),
object.momentum().
y(),
object.momentum().
z() );
215 for(
const auto& origin : origins) {
217 result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(
246 for(
const auto& origin : origins) {
248 result.push_back( std::make_unique<RectangularEtaPhiTrackingRegion>(
275 for(
const auto&
object : objs) {
277 double eta_Cand =
object.eta();
278 double phi_Cand =
object.phi();
282 double eta_Point = etaPhiPoint.first;
283 double phi_Point = etaPhiPoint.second;
284 double dEta_Cand_Point =
std::abs(eta_Cand-eta_Point);
299 double phiMin_RoI =
deltaPhi(phi_Cand_minus,phi_Point_minus)>0. ? phi_Cand_minus : phi_Point_minus ;
300 double phiMax_RoI =
deltaPhi(phi_Cand_plus,phi_Point_plus)<0. ? phi_Cand_plus : phi_Point_plus;
303 double eta_RoI = 0.5*(etaMax_RoI+etaMin_RoI);
304 double deltaEta_RoI = etaMax_RoI - eta_RoI;
306 double phi_RoI = 0.5*(phiMax_RoI+phiMin_RoI);
307 if( phiMax_RoI < phiMin_RoI ) phi_RoI-=
M_PI;
309 double deltaPhi_RoI =
deltaPhi(phiMax_RoI,phi_RoI);
318 for(
const auto& origin : origins) {
320 result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(
348 edm::LogInfo (
"CandidatePointSeededTrackingRegionsProducer") <<
"produced "<<n_regions<<
" regions";
Origins origins(const edm::Event &iEvent) const
T getParameter(std::string const &) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
constexpr T normalizedPhi(T phi)
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
static void fillDescriptions(edm::ParameterSetDescription &desc, const std::string &defaultBeamSpot="offlineBeamSpot", const std::string &defaultVertex="firstStepPrimaryVertices", int defaultMaxVertices=-1)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
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)
CandidatePointSeededTrackingRegionsProducer(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
T const * product() const
std::vector< GlobalVector > m_directionPoints
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &e, const edm::EventSetup &es) const override
bool isUninitialized() const
~CandidatePointSeededTrackingRegionsProducer() override
edm::EDGetTokenT< reco::CandidateView > m_token_input