CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JetSignalVertexCompatibility.cc
Go to the documentation of this file.
1 #include <memory>
2 
8 
15 
18 
20 
22 
23 using namespace reco;
24 
26  const edm::ParameterSet &params) :
27  algo(params.getParameter<double>("cut"),
28  params.getParameter<double>("temperature"))
29 {
30  jetTracksAssocToken = consumes<JetTracksAssociationCollection>(params.getParameter<edm::InputTag>("jetTracksAssoc"));
31  primaryVerticesToken = consumes<VertexCollection>(params.getParameter<edm::InputTag>("primaryVertices"));
32  produces<JetFloatAssociation::Container>();
33 }
34 
36 {
37 }
38 
40  const edm::EventSetup &es)
41 {
43  es.get<TransientTrackRecord>().get("TransientTrackBuilder",
44  trackBuilder);
45 
46  algo.resetEvent(trackBuilder.product());
47 
49  event.getByToken(jetTracksAssocToken, jetTracksAssoc);
50 
51  edm::Handle<VertexCollection> primaryVertices;
52  event.getByToken(primaryVerticesToken, primaryVertices);
53 
54  std::auto_ptr<JetFloatAssociation::Container> result(
55  new JetFloatAssociation::Container(jetTracksAssoc->keyProduct()));
56 
58  jetTracksAssoc->begin();
59  iter != jetTracksAssoc->end(); ++iter) {
60  if (primaryVertices->empty())
61  (*result)[iter->first] = -1.;
62 
63  const TrackRefVector &tracks = iter->second;
64  std::vector<float> compatibility =
65  algo.compatibility(*primaryVertices, tracks);
66 
67  // the first vertex is the presumed signal vertex
68  (*result)[iter->first] = compatibility[0];
69  }
70 
71  algo.resetEvent(0);
72 
73  event.put(result);
74 }
std::vector< float > compatibility(const reco::VertexCollection &vertices, const reco::TrackRefVector &tracks) const
T getParameter(std::string const &) const
EcalChannelStatus Container
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)
tuple result
Definition: query.py:137
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
tuple tracks
Definition: testEve_cfg.py:39
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
JetSignalVertexCompatibility(const edm::ParameterSet &params)
virtual void produce(edm::Event &event, const edm::EventSetup &es)