CMS 3D CMS Logo

JetSignalVertexCompatibility.cc
Go to the documentation of this file.
1 #include <memory>
2 
8 
15 
18 
20 
22 
23 using namespace reco;
24 
26  : algo(params.getParameter<double>("cut"), params.getParameter<double>("temperature")) {
27  jetTracksAssocToken = consumes<JetTracksAssociationCollection>(params.getParameter<edm::InputTag>("jetTracksAssoc"));
28  primaryVerticesToken = consumes<VertexCollection>(params.getParameter<edm::InputTag>("primaryVertices"));
29  produces<JetFloatAssociation::Container>();
30 }
31 
33 
36  es.get<TransientTrackRecord>().get("TransientTrackBuilder", trackBuilder);
37 
38  algo.resetEvent(trackBuilder.product());
39 
41  event.getByToken(jetTracksAssocToken, jetTracksAssoc);
42 
44  event.getByToken(primaryVerticesToken, primaryVertices);
45 
46  auto result = std::make_unique<JetFloatAssociation::Container>(jetTracksAssoc->keyProduct());
47 
49  ++iter) {
50  if (primaryVertices->empty())
51  (*result)[iter->first] = -1.;
52 
53  const TrackRefVector &tracks = iter->second;
54  std::vector<float> compatibility = algo.compatibility(*primaryVertices, tracks);
55 
56  // the first vertex is the presumed signal vertex
57  (*result)[iter->first] = compatibility[0];
58  }
59 
60  algo.resetEvent(nullptr);
61 
62  event.put(std::move(result));
63 }
std::vector< float > compatibility(const reco::VertexCollection &vertices, const reco::TrackRefVector &tracks) const
transient_vector_type::const_iterator const_iterator
reco::JetSignalVertexCompatibilityAlgo algo
edm::EDGetTokenT< reco::JetTracksAssociationCollection > jetTracksAssocToken
edm::EDGetTokenT< reco::VertexCollection > primaryVerticesToken
T const * product() const
Definition: ESHandle.h:86
void resetEvent(const TransientTrackBuilder *trackBuilder)
T get() const
Definition: EventSetup.h:82
void produce(edm::Event &event, const edm::EventSetup &es) override
auto const & tracks
cannot be loose
JetSignalVertexCompatibility(const edm::ParameterSet &params)
fixed size matrix
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1