CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
JetSignalVertexCompatibility Class Reference

#include <JetSignalVertexCompatibility.h>

Inheritance diagram for JetSignalVertexCompatibility:
edm::stream::EDProducer<>

Public Member Functions

 JetSignalVertexCompatibility (const edm::ParameterSet &params)
 
void produce (edm::Event &event, const edm::EventSetup &es) override
 
 ~JetSignalVertexCompatibility () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

reco::JetSignalVertexCompatibilityAlgo algo
 
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecordbuilderToken
 
edm::EDGetTokenT< reco::JetTracksAssociationCollectionjetTracksAssocToken
 
edm::EDGetTokenT< reco::VertexCollectionprimaryVerticesToken
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 17 of file JetSignalVertexCompatibility.h.

Constructor & Destructor Documentation

◆ JetSignalVertexCompatibility()

JetSignalVertexCompatibility::JetSignalVertexCompatibility ( const edm::ParameterSet params)

Definition at line 24 of file JetSignalVertexCompatibility.cc.

References builderToken, deDxTools::esConsumes(), jetTracksAssocToken, submitPVValidationJobs::params, and primaryVerticesToken.

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 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
reco::JetSignalVertexCompatibilityAlgo algo
edm::EDGetTokenT< reco::JetTracksAssociationCollection > jetTracksAssocToken
edm::EDGetTokenT< reco::VertexCollection > primaryVerticesToken
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > builderToken

◆ ~JetSignalVertexCompatibility()

JetSignalVertexCompatibility::~JetSignalVertexCompatibility ( )
override

Definition at line 32 of file JetSignalVertexCompatibility.cc.

32 {}

Member Function Documentation

◆ produce()

void JetSignalVertexCompatibility::produce ( edm::Event event,
const edm::EventSetup es 
)
override

Definition at line 34 of file JetSignalVertexCompatibility.cc.

References algo, builderToken, reco::JetSignalVertexCompatibilityAlgo::compatibility(), edm::EventSetup::getData(), ic5JetVertexCompatibility_cfi::jetTracksAssoc, jetTracksAssocToken, eostools::move(), HLT_2022v15_cff::primaryVertices, primaryVerticesToken, reco::JetSignalVertexCompatibilityAlgo::resetEvent(), mps_fire::result, and pwdgSkimBPark_cfi::tracks.

34  {
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 }
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
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ algo

reco::JetSignalVertexCompatibilityAlgo JetSignalVertexCompatibility::algo
private

Definition at line 25 of file JetSignalVertexCompatibility.h.

Referenced by produce().

◆ builderToken

edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> JetSignalVertexCompatibility::builderToken
private

Definition at line 29 of file JetSignalVertexCompatibility.h.

Referenced by JetSignalVertexCompatibility(), and produce().

◆ jetTracksAssocToken

edm::EDGetTokenT<reco::JetTracksAssociationCollection> JetSignalVertexCompatibility::jetTracksAssocToken
private

Definition at line 27 of file JetSignalVertexCompatibility.h.

Referenced by JetSignalVertexCompatibility(), and produce().

◆ primaryVerticesToken

edm::EDGetTokenT<reco::VertexCollection> JetSignalVertexCompatibility::primaryVerticesToken
private

Definition at line 28 of file JetSignalVertexCompatibility.h.

Referenced by JetSignalVertexCompatibility(), and produce().