55 const std::vector<reco::TransientTrack>& ttracks,
88 srcTag_( iConfig.getParameter<
edm::InputTag>(
"src" ) ),
89 bsSrcTag_( iConfig.getParameter<
edm::InputTag>(
"beamSpot" ) ),
91 primaryMass_( iConfig.getParameter<double>(
"primaryMass" ) ),
92 primaryWidth_( iConfig.getParameter<double>(
"primaryWidth" ) ),
102 produces< std::vector<MomentumConstraint> >();
103 produces<TrackMomConstraintAssociationCollection>();
130 std::unique_ptr<std::vector<MomentumConstraint> > pairs(
new std::vector<MomentumConstraint>);
133 if ( trackColl->size() == 2 )
139 std::vector<reco::TransientTrack> ttracks(2);
141 ttracks[0].
setES( iSetup );
143 ttracks[1].
setES( iSetup );
150 std::pair<double, double> fitMomenta;
157 if ( ( fitMomenta.first > 0. ) and ( fitMomenta.second > 0. ) )
161 pairs->push_back( constraint1 );
166 pairs->push_back( constraint2 );
196 std::pair<double, double>
203 return std::make_pair( secondaryMomenta.first.norm(),
204 secondaryMomenta.second.norm() );
208 std::pair<double, double>
210 const std::vector<reco::TransientTrack>& ttracks,
213 std::pair<double, double>
result = std::make_pair( -1., -1. );
216 std::pair<bool, TrajectoryStateOnSurface> oldInnermostState1 =
innermostState( ttracks[0] );
217 std::pair<bool, TrajectoryStateOnSurface> oldInnermostState2 =
innermostState( ttracks[1] );
218 if ( !oldInnermostState1.second.isValid() || !oldInnermostState2.second.isValid() )
return result;
223 if ( !tbdTrajState.
isValid() )
return result;
228 if ( !match1 || !match2 )
return result;
230 result = std::make_pair( fabs( 1./tbdTrajState.
trajectoryStates(
true).first.localParameters().qbp() ),
231 fabs( 1./tbdTrajState.
trajectoryStates(
true).second.localParameters().qbp() ) );
236 std::pair<bool, TrajectoryStateOnSurface>
253 double deltaX = lp1.
x() - lp2.
x();
254 double deltaY = lp1.
y() - lp2.
y();
261 if ( strMomentumForRefitting ==
"atVertex" ) {
263 }
else if ( strMomentumForRefitting ==
"atInnermostSurface" ) {
266 throw cms::Exception(
"TwoBodyDecayMomConstraintProducer") <<
"value of config variable 'momentumForRefitting': " 267 <<
"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.
const double primaryMass_
std::pair< bool, TrajectoryStateOnSurface > innermostState(const reco::TransientTrack &ttrack) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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
virtual const TwoBodyDecay estimate(const std::vector< reco::TransientTrack > &tracks, const TwoBodyDecayVirtualMeasurement &vm) const
const edm::InputTag srcTag_
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::TrackCollection > trackCollToken_
TwoBodyDecayMomConstraintProducer(const edm::ParameterSet &)
const TwoBodyDecayFitter tbdFitter_
const double chi2CutValue_
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
void produce(edm::StreamID streamid, edm::Event &, const edm::EventSetup &) const override
TrajectoryStateOnSurface outermostMeasurementState() const
const double secondaryMass_
std::pair< double, double > momentaAtVertex(const TwoBodyDecay &tbd) const
static MomentumForRefitting momentumForRefittingFromString(std::string momentumForRefittingString)
RefProd< PROD > getRefBeforePut()
void setES(const edm::EventSetup &es)
edm::AssociationMap< edm::OneToOne< reco::TrackCollection, std::vector< MomentumConstraint > > > TrackMomConstraintAssociationCollection
std::pair< double, double > momentaAtInnermostSurface(const TwoBodyDecay &tbd, const std::vector< reco::TransientTrack > &ttracks, const MagneticField *magField) const
T const * product() const
std::pair< TrajectoryStateOnSurface, TrajectoryStateOnSurface > TsosContainer
const edm::InputTag bsSrcTag_
T const * product() const
edm::EDGetTokenT< reco::BeamSpot > bsToken_
const std::pair< AlgebraicVector, AlgebraicVector > cartesianSecondaryMomenta(const AlgebraicVector ¶m)