26 produces<edm::ValueMap<float>>(
"muonBSConstrainedPt");
27 produces<edm::ValueMap<float>>(
"muonBSConstrainedPtErr");
28 produces<edm::ValueMap<float>>(
"muonBSConstrainedChi2");
38 ->setComment(
"Primary vertex collection");
53 std::vector<float>
pts, ptErrs, chi2s;
55 ptErrs.reserve(
muons->size());
56 chi2s.reserve(
muons->size());
61 double BeamWidthX = beamSpotHandle->
BeamWidthX();
63 double BeamWidthY = beamSpotHandle->
BeamWidthY();
68 if ((BeamWidthXError / BeamWidthX < 0.3) && (BeamWidthYError / BeamWidthY < 0.3)) {
72 if (std::get<0>(btft)) {
74 pts.push_back(trkBS.
pt());
75 ptErrs.push_back(trkBS.
ptError());
76 chi2s.push_back(std::get<2>(btft));
90 if (pvHandle.
isValid() && !pvHandle->empty()) {
91 auto pv = pvHandle->at(0);
96 if (std::get<0>(btft)) {
98 pts.push_back(trkBS.
pt());
99 ptErrs.push_back(trkBS.
ptError());
100 chi2s.push_back(std::get<2>(btft));
112 ptErrs.push_back(
muon.bestTrack()->ptError());
113 chi2s.push_back(-1.
f);
122 event.put(
std::move(valueMap),
"muonBSConstrainedPt");
128 filler.insert(
muons, ptErrs.begin(), ptErrs.end());
130 event.put(
std::move(valueMap),
"muonBSConstrainedPtErr");
138 event.put(
std::move(valueMap),
"muonBSConstrainedChi2");
double BeamWidthX() const
beam width X
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void produce(edm::StreamID streamID, edm::Event &event, const edm::EventSetup &setup) const override
double BeamWidthYError() const
error on beam width Y, assume error in X = Y
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
std::tuple< bool, reco::TransientTrack, float > BTFtuple
Global3DPoint GlobalPoint
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > ttbToken_
std::vector< Vertex > VertexCollection
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
std::vector< Muon > MuonCollection
collection of Muon objects
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
BTFtuple constrain(const reco::TransientTrack &track, const GlobalPoint &priorPos, const GlobalError &priorError) const
reco::TransientTrack build(const reco::Track *p) const
static const double pts[33]
double pt() const
track transverse momentum
MuonBeamspotConstraintValueMapProducer(const edm::ParameterSet &config)
double BeamWidthY() const
beam width Y
#define DEFINE_FWK_MODULE(type)
SingleTrackVertexConstraint stvc
edm::EDGetTokenT< pat::MuonCollection > muonToken_
double BeamWidthXError() const
error on beam width X, assume error in X = Y
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< reco::VertexCollection > PrimaryVertexToken_
~MuonBeamspotConstraintValueMapProducer() override=default