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()));
97 topoToken_(esConsumes()),
98 propagatorToken_(esConsumes(
edm::
ESInputTag(
"",
"PropagatorWithMaterial"))),
99 magFieldToken_(esConsumes()),
101 measurementTrackerToken_(esConsumes()),
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,