test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
JetSignalVertexCompatibility Class Reference

#include <JetSignalVertexCompatibility.h>

Inheritance diagram for JetSignalVertexCompatibility:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 JetSignalVertexCompatibility (const edm::ParameterSet &params)
 
virtual void produce (edm::Event &event, const edm::EventSetup &es)
 
 ~JetSignalVertexCompatibility ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

reco::JetSignalVertexCompatibilityAlgo algo
 
edm::EDGetTokenT
< reco::JetTracksAssociationCollection
jetTracksAssocToken
 
edm::EDGetTokenT
< reco::VertexCollection
primaryVerticesToken
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 13 of file JetSignalVertexCompatibility.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file JetSignalVertexCompatibility.cc.

References edm::ParameterSet::getParameter(), jetTracksAssocToken, and primaryVerticesToken.

26  :
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 }
T getParameter(std::string const &) const
reco::JetSignalVertexCompatibilityAlgo algo
edm::EDGetTokenT< reco::JetTracksAssociationCollection > jetTracksAssocToken
edm::EDGetTokenT< reco::VertexCollection > primaryVerticesToken
JetSignalVertexCompatibility::~JetSignalVertexCompatibility ( )

Definition at line 35 of file JetSignalVertexCompatibility.cc.

36 {
37 }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 39 of file JetSignalVertexCompatibility.cc.

References algo, reco::JetSignalVertexCompatibilityAlgo::compatibility(), edm::EventSetup::get(), jetTracksAssocToken, HLT_25ns10e33_v2_cff::primaryVertices, primaryVerticesToken, edm::ESHandle< class >::product(), reco::JetSignalVertexCompatibilityAlgo::resetEvent(), mps_fire::result, and testEve_cfg::tracks.

41 {
43  es.get<TransientTrackRecord>().get("TransientTrackBuilder",
44  trackBuilder);
45 
46  algo.resetEvent(trackBuilder.product());
47 
49  event.getByToken(jetTracksAssocToken, jetTracksAssoc);
50 
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
transient_vector_type::const_iterator const_iterator
reco::JetSignalVertexCompatibilityAlgo algo
edm::EDGetTokenT< reco::JetTracksAssociationCollection > jetTracksAssocToken
edm::EDGetTokenT< reco::VertexCollection > primaryVerticesToken
tuple result
Definition: mps_fire.py:84
void resetEvent(const TransientTrackBuilder *trackBuilder)
tuple tracks
Definition: testEve_cfg.py:39
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
edm::AssociationVector< reco::JetRefBaseProd, Values > Container

Member Data Documentation

reco::JetSignalVertexCompatibilityAlgo JetSignalVertexCompatibility::algo
private

Definition at line 21 of file JetSignalVertexCompatibility.h.

Referenced by produce().

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

Definition at line 23 of file JetSignalVertexCompatibility.h.

Referenced by JetSignalVertexCompatibility(), and produce().

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

Definition at line 24 of file JetSignalVertexCompatibility.h.

Referenced by JetSignalVertexCompatibility(), and produce().