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);
128 layerMeasurements_ = std::make_unique<LayerMeasurements>(*measurementTrackerHandle, measurementTrackerEvent);
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);
242 result.push_back(ts);
248 result.shrink_to_fit();
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++) {
329 result[
i][
j] = mat44[
i - 1][
j - 1];
339 return std::make_pair(
false, propTSOS);
342 return std::make_pair(
false, updatedTSOS);
343 return std::make_pair(
true, updatedTSOS);
348 double derivative2 =
pow(derivative, 2);
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 &)
virtual void setPropagationDirection(PropagationDirection dir)
edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > estToken_
ConstRecHitPointer const & recHit() const
TrajectorySeed createSeed(const TrajectoryStateOnSurface &tsos, const edm::OwnVector< TrackingRecHit > &container, const DetId &id, const Propagator &prop) const
Derivative< X, A >::type derivative(const A &_)
virtual LocalVector localDirection() const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
#define DEFINE_FWK_MODULE(type)
GlobalError lowerGlobalPosErr() const
Sin< T >::type sin(const T &t)
void produce(edm::Event &, const edm::EventSetup &) override
Geom::Theta< T > theta() const
virtual Propagator * clone() const =0
GlobalPoint globalPosition() const
void printVHsOnLayer(const edmNew::DetSetVector< VectorHit > &, unsigned int)
std::vector< BarrelDetLayer const * > const & tobLayers() const
virtual PropagationDirection propagationDirection() const final
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
static void fillDescriptions(edm::ConfigurationDescriptions &)
float transverseMomentum(float magField) const
const Plane & surface() const
The nominal surface of the GeomDet.
static std::string const input
bool getData(T &iHolder) const
float computeGlobalThetaError(const VectorHit *vh, const double sigmaZ_beamSpot) const
~SeedingOTEDProducer() override
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
float computeInverseMomentumError(const VectorHit *vh, const float globalTheta, const double sigmaZ_beamSpot, const double transverseMomentum) const
std::vector< TrajectorySeed > TrajectorySeedCollection
const GeomDet * det() const
LocalPoint toLocal(const GlobalPoint &gp) const
Cos< T >::type cos(const T &t)
std::vector< const VectorHit * > collectVHsOnLayer(const edmNew::DetSetVector< VectorHit > &, unsigned int)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > measurementTrackerToken_
float momentum(float magField) const
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_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< VectorHitCollection > vhProducerToken_
const AlgebraicSymMatrix44 & covMatrix() const
const TrackerTopology * tkTopo_
const MagneticField * magField_
virtual TrackingRecHit * clone() const =0
GlobalPoint globalPosition() const final
LocalPoint localPosition() const override
const TrajectoryStateUpdator * updator_
static constexpr auto TIB
T const * product() const
std::pair< bool, TrajectoryStateOnSurface > propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, const Propagator &, const TrackingRecHit &hit) const
double sigmaZ() const
sigma z
T const * product() const
T getParameter(std::string const &) const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
void add(std::string const &label, ParameterSetDescription const &psetDescription)
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
const Propagator * propagator_
unsigned int layer(const DetId &id) const
AlgebraicSymMatrix55 assign44To55(const AlgebraicSymMatrix44 &) const
const MeasurementTracker * measurementTracker_
GlobalVector globalMomentum() const
edm::EDPutTokenT< TrajectorySeedCollection > putToken_
const MeasurementEstimator * estimator_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
const TrajectoryStateOnSurface buildInitialTSOS(const VectorHit *) const
const edm::EDGetTokenT< MeasurementTrackerEvent > tkMeasEventToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const reco::BeamSpot * beamSpot_
std::unique_ptr< LayerMeasurements > layerMeasurements_
const GeometricSearchTracker * geometricSearchTracker() const
unsigned int checkLayer(unsigned int iidd)
bool operator()(const TrajectoryMeasurement &measurement)
Power< A, B >::type pow(const A &a, const B &b)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_