CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Attributes
SeedingOTEDProducer Class Reference
Inheritance diagram for SeedingOTEDProducer:
edm::stream::EDProducer<>

Classes

struct  isInvalid
 

Public Member Functions

AlgebraicSymMatrix55 assign44To55 (const AlgebraicSymMatrix44 &) const
 
const TrajectoryStateOnSurface buildInitialTSOS (const VectorHit *) const
 
unsigned int checkLayer (unsigned int iidd)
 
std::vector< const VectorHit * > collectVHsOnLayer (const edmNew::DetSetVector< VectorHit > &, unsigned int)
 
float computeGlobalThetaError (const VectorHit *vh, const double sigmaZ_beamSpot) const
 
float computeInverseMomentumError (const VectorHit *vh, const float globalTheta, const double sigmaZ_beamSpot, const double transverseMomentum) const
 
TrajectorySeed createSeed (const TrajectoryStateOnSurface &tsos, const edm::OwnVector< TrackingRecHit > &container, const DetId &id, const Propagator &prop) const
 
void printVHsOnLayer (const edmNew::DetSetVector< VectorHit > &, unsigned int)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
std::pair< bool,
TrajectoryStateOnSurface
propagateAndUpdate (const TrajectoryStateOnSurface initialTSOS, const Propagator &, const TrackingRecHit &hit) const
 
TrajectorySeedCollection run (edm::Handle< VectorHitCollection >)
 
 SeedingOTEDProducer (const edm::ParameterSet &)
 
 ~SeedingOTEDProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Attributes

const reco::BeamSpotbeamSpot_
 
edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
const MeasurementEstimatorestimator_
 
edm::ESGetToken
< Chi2MeasurementEstimatorBase,
TrackingComponentsRecord
estToken_
 
std::unique_ptr
< LayerMeasurements
layerMeasurements_
 
const MagneticFieldmagField_
 
edm::ESGetToken< MagneticField,
IdealMagneticFieldRecord
magFieldToken_
 
const MeasurementTrackermeasurementTracker_
 
edm::ESGetToken
< MeasurementTracker,
CkfComponentsRecord
measurementTrackerToken_
 
const Propagatorpropagator_
 
edm::ESGetToken< Propagator,
TrackingComponentsRecord
propagatorToken_
 
edm::EDPutTokenT
< TrajectorySeedCollection
putToken_
 
const edm::EDGetTokenT
< MeasurementTrackerEvent
tkMeasEventToken_
 
const TrackerTopologytkTopo_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
topoToken_
 
const TrajectoryStateUpdatorupdator_
 
std::string updatorName_
 
edm::ESGetToken
< TrajectoryStateUpdator,
TrackingComponentsRecord
updatorToken_
 
edm::EDGetTokenT
< VectorHitCollection
vhProducerToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 37 of file SeedingOTEDProducer.cc.

Constructor & Destructor Documentation

SeedingOTEDProducer::SeedingOTEDProducer ( const edm::ParameterSet conf)
explicit

Definition at line 95 of file SeedingOTEDProducer.cc.

References beamSpotToken_, edm::ParameterSet::getParameter(), HLT_FULL_cff::InputTag, putToken_, AlCaHLTBitMon_QueryRunRegistry::string, updatorName_, and vhProducerToken_.

96  : tkMeasEventToken_(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))),
98  propagatorToken_(esConsumes(edm::ESInputTag("", "PropagatorWithMaterial"))),
100  updatorToken_(esConsumes(edm::ESInputTag("", "KFUpdator"))),
102  estToken_(esConsumes(edm::ESInputTag("", "Chi2"))) {
103  vhProducerToken_ = consumes<VectorHitCollection>(edm::InputTag(conf.getParameter<edm::InputTag>("src")));
104  beamSpotToken_ = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpotLabel"));
105  updatorName_ = conf.getParameter<std::string>("updator");
106  putToken_ = produces<TrajectorySeedCollection>();
107 }
edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > estToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > measurementTrackerToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
edm::ESGetToken< TrajectoryStateUpdator, TrackingComponentsRecord > updatorToken_
edm::EDGetTokenT< VectorHitCollection > vhProducerToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDPutTokenT< TrajectorySeedCollection > putToken_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
const edm::EDGetTokenT< MeasurementTrackerEvent > tkMeasEventToken_
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
SeedingOTEDProducer::~SeedingOTEDProducer ( )
override

Definition at line 109 of file SeedingOTEDProducer.cc.

109 {}

Member Function Documentation

AlgebraicSymMatrix55 SeedingOTEDProducer::assign44To55 ( const AlgebraicSymMatrix44 mat44) const

Definition at line 325 of file SeedingOTEDProducer.cc.

References mps_fire::i, dqmiolumiharvest::j, and mps_fire::result.

Referenced by buildInitialTSOS().

325  {
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];
330  }
331  }
332  return result;
333 }
tuple result
Definition: mps_fire.py:311
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const TrajectoryStateOnSurface SeedingOTEDProducer::buildInitialTSOS ( const VectorHit vHit) const

Definition at line 290 of file SeedingOTEDProducer.cc.

References assign44To55(), beamSpot_, RecoTauCleanerPlugins::charge, computeInverseMomentumError(), VectorHit::covMatrix(), TrackingRecHit::det(), PVValHelper::dx, PVValHelper::dy, BaseTrackerRecHit::globalPosition(), MagneticField::inTesla(), VectorHit::localDirection(), VectorHit::localPosition(), magField_, VectorHit::momentum(), funct::pow(), reco::BeamSpot::sigmaZ(), GeomDet::surface(), theta(), GloballyPositioned< T >::toLocal(), VectorHit::transverseMomentum(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by run().

290  {
291  // having fun with theta
292  Global3DVector gv(vHit->globalPosition().x(), vHit->globalPosition().y(), vHit->globalPosition().z());
293  float theta = gv.theta();
294  // gv transform to local (lv)
295  const Local3DVector lv(vHit->det()->surface().toLocal(gv));
296 
297  //FIXME::charge is fine 1 every two times!!
298  GlobalPoint center(0.0, 0.0, 0.0);
299  int charge = 1;
300  // momentum is a signed quantity in this case
301  float mom = vHit->momentum(magField_->inTesla(center).z());
302  float xPos = vHit->localPosition().x();
303  float yPos = vHit->localPosition().y();
304  float dx = vHit->localDirection().x();
305  // for dy use second component of the lv renormalized to the z component
306  float dy = lv.y() / lv.z();
307 
308  // Pz and Dz should have the same sign
309  float signPz = copysign(1.0, vHit->globalPosition().z());
310 
311  LocalTrajectoryParameters ltpar2(charge / mom, dx, dy, xPos, yPos, signPz);
313  // set the error on 1/p
314  mat[0][0] = pow(computeInverseMomentumError(
315  vHit, theta, beamSpot_->sigmaZ(), vHit->transverseMomentum(magField_->inTesla(center).z())),
316  2);
317 
318  //building tsos
319  LocalTrajectoryError lterr(mat);
320  const TrajectoryStateOnSurface tsos(ltpar2, lterr, vHit->det()->surface(), magField_);
321 
322  return tsos;
323 }
virtual LocalVector localDirection() const
Definition: VectorHit.h:75
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
Geom::Theta< T > theta() const
T y() const
Definition: PV3DBase.h:60
float transverseMomentum(float magField) const
Definition: VectorHit.cc:156
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
float computeInverseMomentumError(const VectorHit *vh, const float globalTheta, const double sigmaZ_beamSpot, const double transverseMomentum) const
const GeomDet * det() const
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:61
float momentum(float magField) const
Definition: VectorHit.cc:161
const AlgebraicSymMatrix44 & covMatrix() const
Definition: VectorHit.cc:171
const MagneticField * magField_
GlobalPoint globalPosition() const final
LocalPoint localPosition() const override
Definition: VectorHit.h:74
double sigmaZ() const
sigma z
Definition: BeamSpot.h:76
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
AlgebraicSymMatrix55 assign44To55(const AlgebraicSymMatrix44 &) const
const reco::BeamSpot * beamSpot_
T x() const
Definition: PV3DBase.h:59
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
unsigned int SeedingOTEDProducer::checkLayer ( unsigned int  iidd)

Definition at line 252 of file SeedingOTEDProducer.cc.

References TrackerTopology::layer(), digitizers_cfi::strip, DetId::subdetId(), StripSubdetector::TIB, tkTopo_, and StripSubdetector::TOB.

Referenced by collectVHsOnLayer(), and printVHsOnLayer().

252  {
254  unsigned int subid = strip.subdetId();
255  if (subid == StripSubdetector::TIB || subid == StripSubdetector::TOB) {
256  return tkTopo_->layer(iidd);
257  }
258  return 0;
259 }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr auto TOB
const TrackerTopology * tkTopo_
static constexpr auto TIB
unsigned int layer(const DetId &id) const
std::vector< const VectorHit * > SeedingOTEDProducer::collectVHsOnLayer ( const edmNew::DetSetVector< VectorHit > &  input,
unsigned int  layerNumber 
)

Definition at line 261 of file SeedingOTEDProducer.cc.

References checkLayer(), edmNew::DetSetVector< T >::empty(), and vh.

Referenced by run().

262  {
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);
269  }
270  }
271  }
272  }
273 
274  return vHsOnLayer;
275 }
ValidHit vh
Definition: classes.h:14
unsigned int checkLayer(unsigned int iidd)
float SeedingOTEDProducer::computeGlobalThetaError ( const VectorHit vh,
const double  sigmaZ_beamSpot 
) const

Definition at line 346 of file SeedingOTEDProducer.cc.

References GlobalErrorBase< T, ErrorWeightType >::czz(), funct::derivative(), BaseTrackerRecHit::globalPosition(), VectorHit::lowerGlobalPosErr(), PV3DBase< T, PVType, FrameType >::mag2(), PV3DBase< T, PVType, FrameType >::perp(), and funct::pow().

Referenced by computeInverseMomentumError().

346  {
347  double derivative = vh->globalPosition().perp() / vh->globalPosition().mag2();
348  double derivative2 = pow(derivative, 2);
349  return pow(derivative2 * vh->lowerGlobalPosErr().czz() + derivative2 * pow(sigmaZ_beamSpot, 2), 0.5);
350 }
T mag2() const
Definition: PV3DBase.h:63
T perp() const
Definition: PV3DBase.h:69
Derivative< X, A >::type derivative(const A &_)
Definition: Derivative.h:18
GlobalError lowerGlobalPosErr() const
Definition: VectorHit.cc:123
GlobalPoint globalPosition() const final
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
float SeedingOTEDProducer::computeInverseMomentumError ( const VectorHit vh,
const float  globalTheta,
const double  sigmaZ_beamSpot,
const double  transverseMomentum 
) const

Definition at line 352 of file SeedingOTEDProducer.cc.

References computeGlobalThetaError(), funct::cos(), funct::pow(), and funct::sin().

Referenced by buildInitialTSOS().

355  {
356  //for pT > 2GeV, 1/pT has sigma = 1/sqrt(12)
357  float varianceInverseTransvMomentum = 1. / 12;
358  float derivativeTheta2 = pow(cos(globalTheta) / transverseMomentum, 2);
359  float derivativeInverseTransvMomentum2 = pow(sin(globalTheta), 2);
360  float thetaError = computeGlobalThetaError(vh, sigmaZ_beamSpot);
361  return pow(derivativeTheta2 * pow(thetaError, 2) + derivativeInverseTransvMomentum2 * varianceInverseTransvMomentum,
362  0.5);
363 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float computeGlobalThetaError(const VectorHit *vh, const double sigmaZ_beamSpot) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
TrajectorySeed SeedingOTEDProducer::createSeed ( const TrajectoryStateOnSurface tsos,
const edm::OwnVector< TrackingRecHit > &  container,
const DetId id,
const Propagator prop 
) const

Definition at line 365 of file SeedingOTEDProducer.cc.

References trajectoryStateTransform::persistentState(), and Propagator::propagationDirection().

Referenced by run().

368  {
370  return TrajectorySeed(seedTSOS, container, prop.propagationDirection());
371 }
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
void SeedingOTEDProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 111 of file SeedingOTEDProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

111  {
113  desc.add<edm::InputTag>("src", edm::InputTag("siPhase2VectorHits", "accepted"));
114  desc.add<edm::InputTag>("trackerEvent", edm::InputTag("MeasurementTrackerEvent"));
115  desc.add<edm::InputTag>("beamSpotLabel", edm::InputTag("offlineBeamSpot"));
116  desc.add<std::string>("updator", std::string("KFUpdator"));
117  descriptions.add("SeedingOTEDProducer", desc);
118 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void SeedingOTEDProducer::printVHsOnLayer ( const edmNew::DetSetVector< VectorHit > &  input,
unsigned int  layerNumber 
)

Definition at line 277 of file SeedingOTEDProducer.cc.

References checkLayer(), edmNew::DetSetVector< T >::empty(), LogTrace, and vh.

277  {
278  if (!input.empty()) {
279  for (const auto& DSViter : input) {
280  for (const auto& vh : DSViter) {
281  if (checkLayer(DSViter.id()) == layerNumber)
282  LogTrace("SeedingOTEDProducer") << " VH in layer " << layerNumber << " >> " << vh;
283  }
284  }
285  } else {
286  LogTrace("SeedingOTEDProducer") << " No VHs in layer " << layerNumber << ".";
287  }
288 }
#define LogTrace(id)
ValidHit vh
Definition: classes.h:14
unsigned int checkLayer(unsigned int iidd)
void SeedingOTEDProducer::produce ( edm::Event event,
const edm::EventSetup es 
)
override

Definition at line 120 of file SeedingOTEDProducer.cc.

References beamSpot_, beamSpotToken_, estimator_, estToken_, edm::EventSetup::getData(), edm::EventSetup::getHandle(), layerMeasurements_, magField_, magFieldToken_, measurementTracker_, measurementTrackerToken_, edm::ESHandle< class >::product(), propagator_, propagatorToken_, putToken_, run(), tkMeasEventToken_, tkTopo_, topoToken_, updator_, updatorToken_, and vhProducerToken_.

120  {
121  tkTopo_ = &es.getData(topoToken_);
122 
124  measurementTracker_ = measurementTrackerHandle.product();
125 
126  auto const& measurementTrackerEvent = event.get(tkMeasEventToken_);
127 
128  layerMeasurements_ = std::make_unique<LayerMeasurements>(*measurementTrackerHandle, measurementTrackerEvent);
129 
131 
133 
135 
137 
138  beamSpot_ = &event.get(beamSpotToken_);
139 
140  // Get the vector hits
141  auto vhs = event.getHandle(vhProducerToken_);
142 
143  event.emplace(putToken_, run(vhs));
144 }
edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > estToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
bool getData(T &iHolder) const
Definition: EventSetup.h:122
edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > measurementTrackerToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
TrajectorySeedCollection run(edm::Handle< VectorHitCollection >)
edm::ESGetToken< TrajectoryStateUpdator, TrackingComponentsRecord > updatorToken_
edm::EDGetTokenT< VectorHitCollection > vhProducerToken_
const TrackerTopology * tkTopo_
const MagneticField * magField_
const TrajectoryStateUpdator * updator_
T const * product() const
Definition: ESHandle.h:86
const Propagator * propagator_
const MeasurementTracker * measurementTracker_
edm::EDPutTokenT< TrajectorySeedCollection > putToken_
const MeasurementEstimator * estimator_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
const edm::EDGetTokenT< MeasurementTrackerEvent > tkMeasEventToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
const reco::BeamSpot * beamSpot_
std::unique_ptr< LayerMeasurements > layerMeasurements_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
std::pair< bool, TrajectoryStateOnSurface > SeedingOTEDProducer::propagateAndUpdate ( const TrajectoryStateOnSurface  initialTSOS,
const Propagator prop,
const TrackingRecHit hit 
) const

Definition at line 335 of file SeedingOTEDProducer.cc.

References TrackingRecHit::det(), TrajectoryStateOnSurface::isValid(), Propagator::propagate(), GeomDet::surface(), UNLIKELY, TrajectoryStateUpdator::update(), and updator_.

Referenced by run().

336  {
337  TrajectoryStateOnSurface propTSOS = prop.propagate(initialTSOS, hit.det()->surface());
338  if UNLIKELY (!propTSOS.isValid())
339  return std::make_pair(false, propTSOS);
340  TrajectoryStateOnSurface updatedTSOS = updator_->update(propTSOS, hit);
341  if UNLIKELY (!updatedTSOS.isValid())
342  return std::make_pair(false, updatedTSOS);
343  return std::make_pair(true, updatedTSOS);
344 }
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
const GeomDet * det() const
const TrajectoryStateUpdator * updator_
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
#define UNLIKELY(x)
Definition: Likely.h:21
TrajectorySeedCollection SeedingOTEDProducer::run ( edm::Handle< VectorHitCollection vHs)

Definition at line 146 of file SeedingOTEDProducer.cc.

References alongMomentum, buildInitialTSOS(), TrackingRecHit::clone(), Propagator::clone(), collectVHsOnLayer(), createSeed(), estimator_, MeasurementTracker::geometricSearchTracker(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), layerMeasurements_, measurementTracker_, oppositeToMomentum, edm::Handle< T >::product(), propagateAndUpdate(), Propagator::propagationDirection(), propagator_, edm::OwnVector< T, P >::push_back(), mps_fire::result, Propagator::setPropagationDirection(), GeometricSearchTracker::tobLayers(), UNLIKELY, TrajectoryStateUpdator::update(), updator_, and PV3DBase< T, PVType, FrameType >::z().

Referenced by produce().

146  {
148  //check if all the first three layers have VHs
149  std::vector<const VectorHit*> vhSeedsL1 = collectVHsOnLayer(*vHs.product(), 1);
150  std::vector<const VectorHit*> vhSeedsL2 = collectVHsOnLayer(*vHs.product(), 2);
151  std::vector<const VectorHit*> vhSeedsL3 = collectVHsOnLayer(*vHs.product(), 3);
152  if (vhSeedsL1.empty() || vhSeedsL2.empty() || vhSeedsL3.empty()) {
153  return result;
154  }
155 
156  //seeds are built in the L3 of the OT
157  const BarrelDetLayer* barrelOTLayer2 = measurementTracker_->geometricSearchTracker()->tobLayers().at(1);
158 
159  //the search propag directiondepend on the sign of signZ*signPz, while the building is always the contrary
160  Propagator* searchingPropagator = &*propagator_->clone();
161  Propagator* buildingPropagator = &*propagator_->clone();
162  buildingPropagator->setPropagationDirection(alongMomentum);
163 
164  for (const auto& hitL3 : vhSeedsL3) {
165  //building a tsos out of a VectorHit
166  const TrajectoryStateOnSurface initialTSOS = buildInitialTSOS(hitL3);
167  float signZ = copysign(1.0, initialTSOS.globalPosition().z());
168  float signPz = copysign(1.0, initialTSOS.globalMomentum().z());
169 
170  //set the direction of the propagator
171  if (signZ * signPz > 0.0)
172  searchingPropagator->setPropagationDirection(oppositeToMomentum);
173  else
174  searchingPropagator->setPropagationDirection(alongMomentum);
175 
176  //find vHits in layer 2
177  std::vector<TrajectoryMeasurement> measurementsL2 =
178  layerMeasurements_->measurements(*barrelOTLayer2, initialTSOS, *searchingPropagator, *estimator_);
179 
180  std::vector<TrajectoryMeasurement>::iterator measurementsL2end =
181  std::remove_if(measurementsL2.begin(), measurementsL2.end(), isInvalid());
182  measurementsL2.erase(measurementsL2end, measurementsL2.end());
183 
184  if (!measurementsL2.empty()) {
185  //not sure if building it everytime takes time/memory
186  const DetLayer* barrelOTLayer1 = measurementTracker_->geometricSearchTracker()->tobLayers().at(0);
187 
188  for (const auto& mL2 : measurementsL2) {
189  const TrackingRecHit* hitL2 = mL2.recHit().get();
190 
191  //propagate to the L2 and update the TSOS
192  std::pair<bool, TrajectoryStateOnSurface> updatedTSOS =
193  propagateAndUpdate(initialTSOS, *searchingPropagator, *hitL2);
194  if (!updatedTSOS.first)
195  continue;
196 
197  //searching possible VHs in L1
198  std::vector<TrajectoryMeasurement> measurementsL1 =
199  layerMeasurements_->measurements(*barrelOTLayer1, updatedTSOS.second, *searchingPropagator, *estimator_);
200  std::vector<TrajectoryMeasurement>::iterator measurementsL1end =
201  std::remove_if(measurementsL1.begin(), measurementsL1.end(), isInvalid());
202  measurementsL1.erase(measurementsL1end, measurementsL1.end());
203 
204  if (!measurementsL1.empty()) {
205  for (const auto& mL1 : measurementsL1) {
206  const TrackingRecHit* hitL1 = mL1.recHit().get();
207 
208  //propagate to the L1 and update the TSOS
209  std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL1 =
210  propagateAndUpdate(updatedTSOS.second, *searchingPropagator, *hitL1);
211  if (!updatedTSOSL1.first)
212  continue;
213 
214  //building trajectory inside-out
215  if (searchingPropagator->propagationDirection() == alongMomentum) {
216  buildingPropagator->setPropagationDirection(oppositeToMomentum);
217  } else {
218  buildingPropagator->setPropagationDirection(alongMomentum);
219  }
220 
221  updatedTSOSL1.second.rescaleError(100);
222 
223  TrajectoryStateOnSurface updatedTSOSL1_final = updator_->update(updatedTSOSL1.second, *hitL1);
224  if UNLIKELY (!updatedTSOSL1_final.isValid())
225  continue;
226  std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL2_final =
227  propagateAndUpdate(updatedTSOSL1_final, *buildingPropagator, *hitL2);
228  if (!updatedTSOSL2_final.first)
229  continue;
230  std::pair<bool, TrajectoryStateOnSurface> updatedTSOSL3_final =
231  propagateAndUpdate(updatedTSOSL2_final.second, *buildingPropagator, *hitL3);
232  if (!updatedTSOSL3_final.first)
233  continue;
234 
236  container.push_back(hitL1->clone());
237  container.push_back(hitL2->clone());
238  container.push_back(hitL3->clone());
239 
240  TrajectorySeed ts =
241  createSeed(updatedTSOSL3_final.second, container, hitL3->geographicalId(), *buildingPropagator);
242  result.push_back(ts);
243  }
244  }
245  }
246  }
247  }
248  result.shrink_to_fit();
249  return result;
250 }
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:130
TrajectorySeed createSeed(const TrajectoryStateOnSurface &tsos, const edm::OwnVector< TrackingRecHit > &container, const DetId &id, const Propagator &prop) const
virtual Propagator * clone() const =0
GlobalPoint globalPosition() const
std::vector< BarrelDetLayer const * > const & tobLayers() const
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
tuple result
Definition: mps_fire.py:311
void push_back(D *&d)
Definition: OwnVector.h:326
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
std::vector< TrajectorySeed > TrajectorySeedCollection
T z() const
Definition: PV3DBase.h:61
std::vector< const VectorHit * > collectVHsOnLayer(const edmNew::DetSetVector< VectorHit > &, unsigned int)
virtual TrackingRecHit * clone() const =0
const TrajectoryStateUpdator * updator_
T const * product() const
Definition: Handle.h:70
std::pair< bool, TrajectoryStateOnSurface > propagateAndUpdate(const TrajectoryStateOnSurface initialTSOS, const Propagator &, const TrackingRecHit &hit) const
const Propagator * propagator_
const MeasurementTracker * measurementTracker_
GlobalVector globalMomentum() const
const MeasurementEstimator * estimator_
const TrajectoryStateOnSurface buildInitialTSOS(const VectorHit *) const
#define UNLIKELY(x)
Definition: Likely.h:21
std::unique_ptr< LayerMeasurements > layerMeasurements_
const GeometricSearchTracker * geometricSearchTracker() const

Member Data Documentation

const reco::BeamSpot* SeedingOTEDProducer::beamSpot_
private

Definition at line 83 of file SeedingOTEDProducer.cc.

Referenced by buildInitialTSOS(), and produce().

edm::EDGetTokenT<reco::BeamSpot> SeedingOTEDProducer::beamSpotToken_
private

Definition at line 82 of file SeedingOTEDProducer.cc.

Referenced by produce(), and SeedingOTEDProducer().

const MeasurementEstimator* SeedingOTEDProducer::estimator_
private

Definition at line 77 of file SeedingOTEDProducer.cc.

Referenced by produce(), and run().

edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> SeedingOTEDProducer::estToken_
private

Definition at line 91 of file SeedingOTEDProducer.cc.

Referenced by produce().

std::unique_ptr<LayerMeasurements> SeedingOTEDProducer::layerMeasurements_
private

Definition at line 76 of file SeedingOTEDProducer.cc.

Referenced by produce(), and run().

const MagneticField* SeedingOTEDProducer::magField_
private

Definition at line 79 of file SeedingOTEDProducer.cc.

Referenced by buildInitialTSOS(), and produce().

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> SeedingOTEDProducer::magFieldToken_
private

Definition at line 88 of file SeedingOTEDProducer.cc.

Referenced by produce().

const MeasurementTracker* SeedingOTEDProducer::measurementTracker_
private

Definition at line 75 of file SeedingOTEDProducer.cc.

Referenced by produce(), and run().

edm::ESGetToken<MeasurementTracker, CkfComponentsRecord> SeedingOTEDProducer::measurementTrackerToken_
private

Definition at line 90 of file SeedingOTEDProducer.cc.

Referenced by produce().

const Propagator* SeedingOTEDProducer::propagator_
private

Definition at line 78 of file SeedingOTEDProducer.cc.

Referenced by produce(), and run().

edm::ESGetToken<Propagator, TrackingComponentsRecord> SeedingOTEDProducer::propagatorToken_
private

Definition at line 87 of file SeedingOTEDProducer.cc.

Referenced by produce().

edm::EDPutTokenT<TrajectorySeedCollection> SeedingOTEDProducer::putToken_
private

Definition at line 92 of file SeedingOTEDProducer.cc.

Referenced by produce(), and SeedingOTEDProducer().

const edm::EDGetTokenT<MeasurementTrackerEvent> SeedingOTEDProducer::tkMeasEventToken_
private

Definition at line 81 of file SeedingOTEDProducer.cc.

Referenced by produce().

const TrackerTopology* SeedingOTEDProducer::tkTopo_
private

Definition at line 74 of file SeedingOTEDProducer.cc.

Referenced by checkLayer(), and produce().

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SeedingOTEDProducer::topoToken_
private

Definition at line 86 of file SeedingOTEDProducer.cc.

Referenced by produce().

const TrajectoryStateUpdator* SeedingOTEDProducer::updator_
private

Definition at line 80 of file SeedingOTEDProducer.cc.

Referenced by produce(), propagateAndUpdate(), and run().

std::string SeedingOTEDProducer::updatorName_
private

Definition at line 84 of file SeedingOTEDProducer.cc.

Referenced by SeedingOTEDProducer().

edm::ESGetToken<TrajectoryStateUpdator, TrackingComponentsRecord> SeedingOTEDProducer::updatorToken_
private

Definition at line 89 of file SeedingOTEDProducer.cc.

Referenced by produce().

edm::EDGetTokenT<VectorHitCollection> SeedingOTEDProducer::vhProducerToken_
private

Definition at line 73 of file SeedingOTEDProducer.cc.

Referenced by produce(), and SeedingOTEDProducer().