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'";
LocalPoint localPosition() const
const double primaryMass_
std::pair< double, double > momentaAtVertex(const TwoBodyDecay &tbd) const
#define DEFINE_FWK_MODULE(type)
~TwoBodyDecayMomConstraintProducer() override=default
const double sigmaPositionCutValue_
const double fixedMomentumError_
std::pair< double, double > momentaAtInnermostSurface(const TwoBodyDecay &tbd, const std::vector< reco::TransientTrack > &ttracks, const MagneticField *magField) const
const MomentumForRefitting momentumForRefitting_
const double primaryWidth_
void produce(edm::StreamID streamid, edm::Event &, const edm::EventSetup &) const override
const edm::InputTag srcTag_
std::pair< bool, TrajectoryStateOnSurface > innermostState(const reco::TransientTrack &ttrack) const
GlobalPoint globalPosition() const
edm::EDGetTokenT< reco::TrackCollection > trackCollToken_
TwoBodyDecayMomConstraintProducer(const edm::ParameterSet &)
const TwoBodyDecayFitter tbdFitter_
const double chi2CutValue_
TrajectoryStateOnSurface outermostMeasurementState() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > trackingGeometryToken_
TrajectoryStateOnSurface innermostMeasurementState() const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
bool getData(T &iHolder) const
const double secondaryMass_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
static MomentumForRefitting momentumForRefittingFromString(std::string momentumForRefittingString)
edm::AssociationMap< edm::OneToOne< reco::TrackCollection, std::vector< MomentumConstraint > > > TrackMomConstraintAssociationCollection
bool match(const TrajectoryStateOnSurface &newTsos, const TrajectoryStateOnSurface &oldTsos) const
std::pair< TrajectoryStateOnSurface, TrajectoryStateOnSurface > TsosContainer
const TsosContainer & trajectoryStates(bool useRefittedState=true) const
const edm::InputTag bsSrcTag_
virtual const TwoBodyDecay estimate(const std::vector< reco::TransientTrack > &tracks, const TwoBodyDecayVirtualMeasurement &vm) const
edm::EDGetTokenT< reco::BeamSpot > bsToken_
const std::pair< AlgebraicVector, AlgebraicVector > cartesianSecondaryMomenta(const AlgebraicVector ¶m)