56 const float globalTheta,
57 const double sigmaZ_beamSpot,
58 const double transverseMomentum)
const;
67 return ((measurement.
recHit() ==
nullptr) || !(measurement.
recHit()->isValid()) ||
68 !((measurement).updatedState().isValid()));
106 putToken_ = produces<TrajectorySeedCollection>();
117 descriptions.
add(
"SeedingOTEDProducer",
desc);
152 if (vhSeedsL1.empty() || vhSeedsL2.empty() || vhSeedsL3.empty()) {
164 for (
const auto& hitL3 : vhSeedsL3) {
171 if (signZ * signPz > 0.0)
177 std::vector<TrajectoryMeasurement> measurementsL2 =
180 std::vector<TrajectoryMeasurement>::iterator measurementsL2end =
181 std::remove_if(measurementsL2.begin(), measurementsL2.end(),
isInvalid());
182 measurementsL2.erase(measurementsL2end, measurementsL2.end());
184 if (!measurementsL2.empty()) {
188 for (
const auto& mL2 : measurementsL2) {
192 std::pair<bool, TrajectoryStateOnSurface> updatedTSOS =
194 if (!updatedTSOS.first)
198 std::vector<TrajectoryMeasurement> measurementsL1 =
200 std::vector<TrajectoryMeasurement>::iterator measurementsL1end =
201 std::remove_if(measurementsL1.begin(), measurementsL1.end(),
isInvalid());
202 measurementsL1.erase(measurementsL1end, measurementsL1.end());
204 if (!measurementsL1.empty()) {
205 for (
const auto& mL1 : measurementsL1) {
209 std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL1 =
211 if (!updatedTSOSL1.first)
221 updatedTSOSL1.second.rescaleError(100);
226 std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL2_final =
228 if (!updatedTSOSL2_final.first)
230 std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final =
232 if (!updatedTSOSL3_final.first)
241 createSeed(updatedTSOSL3_final.second, container, hitL3->geographicalId(), *buildingPropagator);
254 unsigned int subid =
strip.subdetId();
262 unsigned int layerNumber) {
263 std::vector<const VectorHit*> vHsOnLayer;
264 if (!
input.empty()) {
265 for (
const auto& DSViter :
input) {
266 if (
checkLayer(DSViter.id()) == layerNumber) {
267 for (
const auto& vh : DSViter) {
268 vHsOnLayer.push_back(&vh);
278 if (!
input.empty()) {
279 for (
const auto& DSViter :
input) {
280 for (
const auto& vh : DSViter) {
282 LogTrace(
"SeedingOTEDProducer") <<
" VH in layer " << layerNumber <<
" >> " << vh;
286 LogTrace(
"SeedingOTEDProducer") <<
" No VHs in layer " << layerNumber <<
".";
293 float theta = gv.theta();
306 float dy = lv.y() / lv.z();
327 for (
int i = 1;
i < 5;
i++) {
328 for (
int j = 1;
j < 5;
j++) {
339 return std::make_pair(
false, propTSOS);
342 return std::make_pair(
false, updatedTSOS);
343 return std::make_pair(
true, updatedTSOS);
353 const float globalTheta,
354 const double sigmaZ_beamSpot,
355 const double transverseMomentum)
const {
357 float varianceInverseTransvMomentum = 1. / 12;
358 float derivativeTheta2 =
pow(
cos(globalTheta) / transverseMomentum, 2);
359 float derivativeInverseTransvMomentum2 =
pow(
sin(globalTheta), 2);
361 return pow(derivativeTheta2 *
pow(thetaError, 2) + derivativeInverseTransvMomentum2 * varianceInverseTransvMomentum,
SeedingOTEDProducer(const edm::ParameterSet &)
std::pair< bool, TrajectoryStateOnSurface > propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, const Propagator &, const TrackingRecHit &hit) const
virtual void setPropagationDirection(PropagationDirection dir)
edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > estToken_
T getParameter(std::string const &) const
virtual LocalVector localDirection() const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Derivative< X, A >::type derivative(const A &_)
float transverseMomentum(float magField) const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
float computeGlobalThetaError(const VectorHit *vh, const double sigmaZ_beamSpot) const
Sin< T >::type sin(const T &t)
T const * product() const
void produce(edm::Event &, const edm::EventSetup &) override
virtual Propagator * clone() const =0
GlobalError lowerGlobalPosErr() const
void printVHsOnLayer(const edmNew::DetSetVector< VectorHit > &, unsigned int)
virtual PropagationDirection propagationDirection() const final
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
static void fillDescriptions(edm::ConfigurationDescriptions &)
float momentum(float magField) const
LocalPoint toLocal(const GlobalPoint &gp) const
const GeometricSearchTracker * geometricSearchTracker() const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
const GeomDet * det() const
unsigned int layer(const DetId &id) const
static std::string const input
~SeedingOTEDProducer() override
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
T const * product() const
GlobalPoint globalPosition() const
std::vector< TrajectorySeed > TrajectorySeedCollection
float computeInverseMomentumError(const VectorHit *vh, const float globalTheta, const double sigmaZ_beamSpot, const double transverseMomentum) const
Cos< T >::type cos(const T &t)
std::vector< const VectorHit * > collectVHsOnLayer(const edmNew::DetSetVector< VectorHit > &, unsigned int)
edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > measurementTrackerToken_
#define DEFINE_FWK_MODULE(type)
ROOT::Math::SMatrix< double, 4, 4, ROOT::Math::MatRepSym< double, 4 > > AlgebraicSymMatrix44
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
static constexpr auto TOB
TrajectorySeedCollection run(edm::Handle< VectorHitCollection >)
edm::ESGetToken< TrajectoryStateUpdator, TrackingComponentsRecord > updatorToken_
edm::EDGetTokenT< VectorHitCollection > vhProducerToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const TrackerTopology * tkTopo_
const MagneticField * magField_
virtual TrackingRecHit * clone() const =0
AlgebraicSymMatrix55 assign44To55(const AlgebraicSymMatrix44 &) const
GlobalPoint globalPosition() const final
LocalPoint localPosition() const override
const TrajectoryStateUpdator * updator_
static constexpr auto TIB
const Plane & surface() const
The nominal surface of the GeomDet.
double sigmaZ() const
sigma z
const TrajectoryStateOnSurface buildInitialTSOS(const VectorHit *) const
const AlgebraicSymMatrix44 & covMatrix() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
void add(std::string const &label, ParameterSetDescription const &psetDescription)
GlobalVector globalMomentum() const
const Propagator * propagator_
const MeasurementTracker * measurementTracker_
edm::EDPutTokenT< TrajectorySeedCollection > putToken_
std::vector< BarrelDetLayer const * > const & tobLayers() const
const MeasurementEstimator * estimator_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
const edm::EDGetTokenT< MeasurementTrackerEvent > tkMeasEventToken_
const reco::BeamSpot * beamSpot_
std::unique_ptr< LayerMeasurements > layerMeasurements_
TrajectorySeed createSeed(const TrajectoryStateOnSurface &tsos, const edm::OwnVector< TrackingRecHit > &container, const DetId &id, const Propagator &prop) const
unsigned int checkLayer(unsigned int iidd)
bool operator()(const TrajectoryMeasurement &measurement)
Power< A, B >::type pow(const A &a, const B &b)
ConstRecHitPointer const & recHit() const
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_