1 #ifndef PointSeededTrackingRegionsProducer_h
2 #define PointSeededTrackingRegionsProducer_h
20 #include <TLorentzVector.h>
65 else edm::LogError (
"PointSeededTrackingRegionsProducer")<<
"Unknown mode string: "<<modeString;
88 if (regPSet.
exists(
"measurementTrackerName"))
95 if (regPSet.
exists(
"whereToUseMeasurementTracker"))
109 m_nSigmaZBeamSpot = regPSet.
getParameter<
double>(
"nSigmaZBeamSpot");
110 if (m_nSigmaZBeamSpot < 0.)
111 edm::LogError (
"PointSeededTrackingRegionsProducer")<<
"nSigmaZBeamSpot must be positive for BeamSpotSigma mode!";
120 std::vector<TrackingRegion* >
result;
125 if( !bs.
isValid() )
return result;
128 GlobalPoint default_origin( bs->x0(), bs->y0(), bs->z0() );
131 std::vector< std::pair< GlobalPoint, float > > origins;
135 origins.push_back( std::make_pair( default_origin,
142 for (reco::VertexCollection::const_iterator iv = vertices->begin(),
ev = vertices->end();
144 if ( iv->isFake() || !iv->isValid() )
continue;
146 origins.push_back( std::make_pair(
GlobalPoint( iv->x(), iv->y(), iv->z() ),
152 if ( origins.empty() ) {
153 origins.push_back( std::make_pair( default_origin,
163 measurementTracker = hmte.
product();
175 double z = (x*x+y*
y)/TMath::Tan(theta);
198 edm::LogInfo (
"PointSeededTrackingRegionsProducer") <<
"produced "<<n_regions<<
" regions";
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
bool getByToken(EDGetToken token, Handle< PROD > &result) const
PointSeededTrackingRegionsProducer(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
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
edm::EDGetTokenT< MeasurementTrackerEvent > token_measurementTracker
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_whereToUseMeasurementTracker
U second(std::pair< T, U > const &p)
edm::EDGetTokenT< reco::VertexCollection > token_vertex
static UseMeasurementTracker doubleToUseMeasurementTracker(double value)
T const * product() const
virtual ~PointSeededTrackingRegionsProducer()
virtual std::vector< TrackingRegion * > regions(const edm::Event &e, const edm::EventSetup &es) const
bool isUninitialized() const