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)) {
73 if (std::get<0>(btft)) {
75 pts.push_back(trkBS.
pt());
76 ptErrs.push_back(trkBS.
ptError());
77 chi2s.push_back(std::get<2>(btft));
91 if (pvHandle.
isValid() && !pvHandle->empty()) {
92 auto pv = pvHandle->at(0);
97 if (std::get<0>(btft)) {
99 pts.push_back(trkBS.
pt());
100 ptErrs.push_back(trkBS.
ptError());
101 chi2s.push_back(std::get<2>(btft));
113 ptErrs.push_back(
muon.bestTrack()->ptError());
114 chi2s.push_back(-1.
f);
123 event.put(
std::move(valueMap),
"muonBSConstrainedPt");
129 filler.insert(
muons, ptErrs.begin(), ptErrs.end());
131 event.put(
std::move(valueMap),
"muonBSConstrainedPtErr");
139 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