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(
131 if (trackColl->size() == 2) {
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)
222 result = std::make_pair(fabs(1. / tbdTrajState.
trajectoryStates(
true).first.localParameters().qbp()),
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'";
bool match(const TrajectoryStateOnSurface &newTsos, const TrajectoryStateOnSurface &oldTsos) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
const double primaryMass_
std::pair< bool, TrajectoryStateOnSurface > innermostState(const reco::TransientTrack &ttrack) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
LocalPoint localPosition() const
~TwoBodyDecayMomConstraintProducer() override=default
const double sigmaPositionCutValue_
const double fixedMomentumError_
GlobalPoint globalPosition() const
const MomentumForRefitting momentumForRefitting_
const TsosContainer & trajectoryStates(bool useRefittedState=true) const
const double primaryWidth_
TrajectoryStateOnSurface innermostMeasurementState() const
void produce(edm::StreamID streamid, edm::Event &, const edm::EventSetup &) const override
virtual const TwoBodyDecay estimate(const std::vector< reco::TransientTrack > &tracks, const TwoBodyDecayVirtualMeasurement &vm) const
const edm::InputTag srcTag_
bool getData(T &iHolder) const
edm::EDGetTokenT< reco::TrackCollection > trackCollToken_
TwoBodyDecayMomConstraintProducer(const edm::ParameterSet &)
const TwoBodyDecayFitter tbdFitter_
const double chi2CutValue_
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > trackingGeometryToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
TrajectoryStateOnSurface outermostMeasurementState() const
const double secondaryMass_
std::pair< double, double > momentaAtVertex(const TwoBodyDecay &tbd) const
static MomentumForRefitting momentumForRefittingFromString(std::string momentumForRefittingString)
edm::AssociationMap< edm::OneToOne< reco::TrackCollection, std::vector< MomentumConstraint > > > TrackMomConstraintAssociationCollection
RefProd< PROD > getRefBeforePut()
std::pair< double, double > momentaAtInnermostSurface(const TwoBodyDecay &tbd, const std::vector< reco::TransientTrack > &ttracks, const MagneticField *magField) const
std::pair< TrajectoryStateOnSurface, TrajectoryStateOnSurface > TsosContainer
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const edm::InputTag bsSrcTag_
edm::EDGetTokenT< reco::BeamSpot > bsToken_
const std::pair< AlgebraicVector, AlgebraicVector > cartesianSecondaryMomenta(const AlgebraicVector ¶m)