50 const std::vector<reco::TransientTrack>& ttracks,
82 : srcTag_(iConfig.getParameter<
edm::
InputTag>(
"src")),
83 bsSrcTag_(iConfig.getParameter<
edm::
InputTag>(
"beamSpot")),
85 primaryMass_(iConfig.getParameter<double>(
"primaryMass")),
86 primaryWidth_(iConfig.getParameter<double>(
"primaryWidth")),
87 secondaryMass_(iConfig.getParameter<double>(
"secondaryMass")),
88 sigmaPositionCutValue_(iConfig.getParameter<double>(
"sigmaPositionCut")),
89 chi2CutValue_(iConfig.getParameter<double>(
"chi2Cut")),
90 fixedMomentumError_(iConfig.getParameter<double>(
"fixedMomentumError")),
91 momentumForRefitting_(momentumForRefittingFromString(iConfig.getParameter<
std::
string>(
"momentumForRefitting"))) {
95 produces<std::vector<MomentumConstraint> >();
96 produces<TrackMomConstraintAssociationCollection>();
121 std::unique_ptr<std::vector<MomentumConstraint> > pairs(
new std::vector<MomentumConstraint>);
122 std::unique_ptr<TrackMomConstraintAssociationCollection>
output(
130 std::vector<reco::TransientTrack> ttracks(2);
132 ttracks[0].
setES(iSetup);
134 ttracks[1].
setES(iSetup);
142 std::pair<double, double> fitMomenta;
149 if ((fitMomenta.first > 0.) and (fitMomenta.second > 0.)) {
152 pairs->push_back(constraint1);
157 pairs->push_back(constraint2);
191 return std::make_pair(secondaryMomenta.first.norm(), secondaryMomenta.second.norm());
196 std::pair<double, double>
result = std::make_pair(-1., -1.);
199 std::pair<bool, TrajectoryStateOnSurface> oldInnermostState1 =
innermostState(ttracks[0]);
200 std::pair<bool, TrajectoryStateOnSurface> oldInnermostState2 =
innermostState(ttracks[1]);
201 if (!oldInnermostState1.second.isValid() || !oldInnermostState2.second.isValid())
213 if (!match1 || !match2)
217 fabs(1. / tbdTrajState.
trajectoryStates(
true).second.localParameters().qbp()));
234 double deltaX = lp1.
x() - lp2.
x();
235 double deltaY = lp1.
y() - lp2.
y();
242 if (strMomentumForRefitting ==
"atVertex") {
244 }
else if (strMomentumForRefitting ==
"atInnermostSurface") {
247 throw cms::Exception(
"TwoBodyDecayMomConstraintProducer") <<
"value of config variable 'momentumForRefitting': "
248 <<
"has to be 'atVertex' or 'atInnermostSurface'";