51 const std::vector<reco::TransientTrack>& ttracks,
85 : srcTag_(iConfig.getParameter<
edm::
InputTag>(
"src")),
86 bsSrcTag_(iConfig.getParameter<
edm::
InputTag>(
"beamSpot")),
88 primaryMass_(iConfig.getParameter<double>(
"primaryMass")),
89 primaryWidth_(iConfig.getParameter<double>(
"primaryWidth")),
90 secondaryMass_(iConfig.getParameter<double>(
"secondaryMass")),
91 sigmaPositionCutValue_(iConfig.getParameter<double>(
"sigmaPositionCut")),
92 chi2CutValue_(iConfig.getParameter<double>(
"chi2Cut")),
93 fixedMomentumError_(iConfig.getParameter<double>(
"fixedMomentumError")),
94 momentumForRefitting_(momentumForRefittingFromString(iConfig.getParameter<
std::
string>(
"momentumForRefitting"))),
100 produces<std::vector<MomentumConstraint> >();
101 produces<TrackMomConstraintAssociationCollection>();
127 std::unique_ptr<std::vector<MomentumConstraint> > pairs(
new std::vector<MomentumConstraint>);
128 std::unique_ptr<TrackMomConstraintAssociationCollection>
output(
136 std::vector<reco::TransientTrack> ttracks(2);
138 ttracks[0].setTrackingGeometry(trackingGeometry);
140 ttracks[1].setTrackingGeometry(trackingGeometry);
148 std::pair<double, double> fitMomenta;
155 if ((fitMomenta.first > 0.) and (fitMomenta.second > 0.)) {
158 pairs->push_back(constraint1);
163 pairs->push_back(constraint2);
197 return std::make_pair(secondaryMomenta.first.norm(), secondaryMomenta.second.norm());
202 std::pair<double, double>
result = std::make_pair(-1., -1.);
205 std::pair<bool, TrajectoryStateOnSurface> oldInnermostState1 =
innermostState(ttracks[0]);
206 std::pair<bool, TrajectoryStateOnSurface> oldInnermostState2 =
innermostState(ttracks[1]);
207 if (!oldInnermostState1.second.isValid() || !oldInnermostState2.second.isValid())
219 if (!match1 || !match2)
223 fabs(1. / tbdTrajState.
trajectoryStates(
true).second.localParameters().qbp()));
240 double deltaX = lp1.
x() - lp2.
x();
241 double deltaY = lp1.
y() - lp2.
y();
248 if (strMomentumForRefitting ==
"atVertex") {
250 }
else if (strMomentumForRefitting ==
"atInnermostSurface") {
253 throw cms::Exception(
"TwoBodyDecayMomConstraintProducer") <<
"value of config variable 'momentumForRefitting': "
254 <<
"has to be 'atVertex' or 'atInnermostSurface'";