1 #ifndef CandidatePointSeededTrackingRegionsProducer_h 2 #define CandidatePointSeededTrackingRegionsProducer_h 61 enum class SeedingMode {CANDIDATE_SEEDED, POINT_SEEDED, CANDIDATE_POINT_SEEDED};
90 std::vector<double> etaPoints = points.
getParameter<std::vector<double>>(
"eta");
91 std::vector<double> phiPoints = points.
getParameter<std::vector<double>>(
"phi");
96 for(
size_t i = 0;
i < etaPoints.size(); ++
i ){
160 m_nSigmaZBeamSpot = regPSet.
getParameter<
double>(
"nSigmaZBeamSpot");
161 if (m_nSigmaZBeamSpot < 0.)
176 descPoints.
add<std::vector<double>> (
"eta", {} );
177 descPoints.add<std::vector<double>> (
"phi", {} );
180 desc.
add<
unsigned int>(
"maxNRegions", 10);
183 desc.
add<
unsigned int>(
"maxNVertices", 1);
185 desc.
add<
double>(
"ptMin", 0.9);
186 desc.
add<
double>(
"originRadius", 0.2);
187 desc.
add<
double>(
"zErrorBeamSpot", 24.2);
188 desc.
add<
double>(
"deltaEta_Cand", -1.);
189 desc.
add<
double>(
"deltaPhi_Cand", -1.);
190 desc.
add<
double>(
"deltaEta_Point", -1.);
191 desc.
add<
double>(
"deltaPhi_Point", -1.);
192 desc.
add<
bool>(
"precise",
true);
194 desc.
add<
double>(
"nSigmaZVertex", 3.);
195 desc.
add<
double>(
"zErrorVetex", 0.2);
196 desc.
add<
double>(
"nSigmaZBeamSpot", 4.);
198 desc.
add<
std::string>(
"whereToUseMeasurementTracker",
"ForSiStrips");
201 desc.
add<
bool>(
"searchOpt",
false);
207 descriptions.
add(
"candidatePointSeededTrackingRegionsFromBeamSpot", descRegion);
213 std::vector<std::unique_ptr<TrackingRegion> >
result;
217 size_t n_objects = 0;
221 n_objects = objects->
size();
222 if (n_objects == 0)
return result;
225 const auto& objs = *objects;
230 if( !bs.
isValid() )
return result;
236 std::vector< std::pair< GlobalPoint, float > > origins;
241 origins.emplace_back( default_origin,
250 for (
const auto&
v : (*vertices) )
252 if (
v.isFake() || !
v.isValid() )
continue;
262 origins.emplace_back( default_origin,
272 measurementTracker = hmte.
product();
281 for(
const auto&
object : objs) {
283 GlobalVector direction(
object.momentum().
x(),
object.momentum().
y(),
object.momentum().
z() );
285 for(
const auto& origin : origins) {
287 result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(
316 for(
const auto& origin : origins) {
318 result.push_back( std::make_unique<RectangularEtaPhiTrackingRegion>(
345 for(
const auto&
object : objs) {
347 double eta_Cand =
object.eta();
348 double phi_Cand =
object.phi();
352 double eta_Point = etaPhiPoint.first;
353 double phi_Point = etaPhiPoint.second;
354 double dEta_Cand_Point =
std::abs(eta_Cand-eta_Point);
369 double phiMin_RoI =
deltaPhi(phi_Cand_minus,phi_Point_minus)>0. ? phi_Cand_minus : phi_Point_minus ;
370 double phiMax_RoI =
deltaPhi(phi_Cand_plus,phi_Point_plus)<0. ? phi_Cand_plus : phi_Point_plus;
373 double eta_RoI = 0.5*(etaMax_RoI+etaMin_RoI);
374 double deltaEta_RoI = etaMax_RoI - eta_RoI;
376 double phi_RoI = 0.5*(phiMax_RoI+phiMin_RoI);
377 if( phiMax_RoI < phiMin_RoI ) phi_RoI-=
M_PI;
379 double deltaPhi_RoI =
deltaPhi(phiMax_RoI,phi_RoI);
388 for(
const auto& origin : origins) {
390 result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(
418 edm::LogInfo (
"CandidatePointSeededTrackingRegionsProducer") <<
"produced "<<n_regions<<
" regions";
T getParameter(std::string const &) const
double z0() const
z coordinate
edm::EDGetTokenT< reco::VertexCollection > m_token_vertex
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
Geom::Theta< T > theta() const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< Vertex > VertexCollection
collection of Vertex objects
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
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)
double z0Error() const
error on z
CandidatePointSeededTrackingRegionsProducer(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
edm::EDGetTokenT< reco::BeamSpot > m_token_beamSpot
T const * product() const
std::vector< GlobalVector > m_directionPoints
double sigmaZ() const
sigma z
void add(std::string const &label, ParameterSetDescription const &psetDescription)
OperationMode m_operationMode
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &e, const edm::EventSetup &es) const override
double y0() const
y coordinate
bool isUninitialized() const
~CandidatePointSeededTrackingRegionsProducer() override
edm::EDGetTokenT< reco::CandidateView > m_token_input
double x0() const
x coordinate