1 #ifndef CandidatePointSeededTrackingRegionsProducer_h 2 #define CandidatePointSeededTrackingRegionsProducer_h 82 std::vector<double> etaPoints = points.
getParameter<std::vector<double>>(
"eta");
83 std::vector<double> phiPoints = points.
getParameter<std::vector<double>>(
"phi");
88 for(
size_t i = 0;
i < etaPoints.size(); ++
i ){
146 descPoints.
add<std::vector<double>> (
"eta", {} );
147 descPoints.add<std::vector<double>> (
"phi", {} );
150 desc.
add<
unsigned int>(
"maxNRegions", 10);
154 desc.
add<
double>(
"ptMin", 0.9);
155 desc.
add<
double>(
"originRadius", 0.2);
156 desc.
add<
double>(
"deltaEta_Cand", -1.);
157 desc.
add<
double>(
"deltaPhi_Cand", -1.);
158 desc.
add<
double>(
"deltaEta_Point", -1.);
159 desc.
add<
double>(
"deltaPhi_Point", -1.);
160 desc.
add<
bool>(
"precise",
true);
162 desc.
add<
std::string>(
"whereToUseMeasurementTracker",
"ForSiStrips");
165 desc.
add<
bool>(
"searchOpt",
false);
171 descriptions.
add(
"candidatePointSeededTrackingRegionsFromBeamSpot", descRegion);
177 std::vector<std::unique_ptr<TrackingRegion> >
result;
181 size_t n_objects = 0;
185 n_objects = objects->
size();
186 if (n_objects == 0)
return result;
189 const auto& objs = *objects;
192 if(origins.empty()) {
200 measurementTracker = hmte.
product();
209 for(
const auto&
object : objs) {
211 GlobalVector direction(
object.momentum().
x(),
object.momentum().
y(),
object.momentum().
z() );
213 for(
const auto& origin : origins) {
215 result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(
244 for(
const auto& origin : origins) {
246 result.push_back( std::make_unique<RectangularEtaPhiTrackingRegion>(
273 for(
const auto&
object : objs) {
275 double eta_Cand =
object.eta();
276 double phi_Cand =
object.phi();
280 double eta_Point = etaPhiPoint.first;
281 double phi_Point = etaPhiPoint.second;
282 double dEta_Cand_Point =
std::abs(eta_Cand-eta_Point);
297 double phiMin_RoI =
deltaPhi(phi_Cand_minus,phi_Point_minus)>0. ? phi_Cand_minus : phi_Point_minus ;
298 double phiMax_RoI =
deltaPhi(phi_Cand_plus,phi_Point_plus)<0. ? phi_Cand_plus : phi_Point_plus;
301 double eta_RoI = 0.5*(etaMax_RoI+etaMin_RoI);
302 double deltaEta_RoI = etaMax_RoI - eta_RoI;
304 double phi_RoI = 0.5*(phiMax_RoI+phiMin_RoI);
305 if( phiMax_RoI < phiMin_RoI ) phi_RoI-=
M_PI;
307 double deltaPhi_RoI =
deltaPhi(phiMax_RoI,phi_RoI);
316 for(
const auto& origin : origins) {
318 result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(
346 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
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