CMS 3D CMS Logo

JetSignalVertexCompatibility.cc
Go to the documentation of this file.
1 #include <memory>
2 
7 
14 
17 
19 
21 
22 using namespace reco;
23 
25  : algo(params.getParameter<double>("cut"), params.getParameter<double>("temperature")) {
26  jetTracksAssocToken = consumes<JetTracksAssociationCollection>(params.getParameter<edm::InputTag>("jetTracksAssoc"));
27  primaryVerticesToken = consumes<VertexCollection>(params.getParameter<edm::InputTag>("primaryVertices"));
28  builderToken = esConsumes(edm::ESInputTag("", "TransientTrackBuilder"));
29  produces<JetFloatAssociation::Container>();
30 }
31 
33 
36 
38  event.getByToken(jetTracksAssocToken, jetTracksAssoc);
39 
41  event.getByToken(primaryVerticesToken, primaryVertices);
42 
43  auto result = std::make_unique<JetFloatAssociation::Container>(jetTracksAssoc->keyProduct());
44 
46  ++iter) {
47  if (primaryVertices->empty())
48  (*result)[iter->first] = -1.;
49 
50  const TrackRefVector &tracks = iter->second;
51  std::vector<float> compatibility = algo.compatibility(*primaryVertices, tracks);
52 
53  // the first vertex is the presumed signal vertex
54  (*result)[iter->first] = compatibility[0];
55  }
56 
57  algo.resetEvent(nullptr);
58 
59  event.put(std::move(result));
60 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
std::vector< float > compatibility(const reco::VertexCollection &vertices, const reco::TrackRefVector &tracks) const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
transient_vector_type::const_iterator const_iterator
reco::JetSignalVertexCompatibilityAlgo algo
edm::EDGetTokenT< reco::JetTracksAssociationCollection > jetTracksAssocToken
edm::EDGetTokenT< reco::VertexCollection > primaryVerticesToken
void resetEvent(const TransientTrackBuilder *trackBuilder)
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > builderToken
void produce(edm::Event &event, const edm::EventSetup &es) override
JetSignalVertexCompatibility(const edm::ParameterSet &params)
fixed size matrix
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1