CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
TemplatedVertexArbitrator< InputContainer, VTX > Class Template Reference

#include <TemplatedVertexArbitrator.h>

Inheritance diagram for TemplatedVertexArbitrator< InputContainer, VTX >:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef std::vector< VTX > Product
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

virtual void produce (edm::Event &event, const edm::EventSetup &es) override
 
 TemplatedVertexArbitrator (const edm::ParameterSet &params)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 Member Functions

bool trackFilter (const reco::TrackRef &track) const
 

Private Attributes

std::unique_ptr
< TrackVertexArbitration< VTX > > 
theArbitrator
 
edm::EDGetTokenT< reco::BeamSpottoken_beamSpot
 
edm::EDGetTokenT
< reco::VertexCollection
token_primaryVertex
 
edm::EDGetTokenT< Producttoken_secondaryVertex
 
edm::EDGetTokenT< InputContainer > token_tracks
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::stream::EDProducerBase
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

template<class InputContainer, class VTX>
class TemplatedVertexArbitrator< InputContainer, VTX >

Definition at line 52 of file TemplatedVertexArbitrator.h.

Member Typedef Documentation

template<class InputContainer , class VTX >
typedef std::vector<VTX> TemplatedVertexArbitrator< InputContainer, VTX >::Product

Definition at line 54 of file TemplatedVertexArbitrator.h.

Constructor & Destructor Documentation

template<class InputContainer , class VTX >
TemplatedVertexArbitrator< InputContainer, VTX >::TemplatedVertexArbitrator ( const edm::ParameterSet params)

Definition at line 72 of file TemplatedVertexArbitrator.h.

References edm::ParameterSet::getParameter().

73 {
74  token_primaryVertex = consumes<reco::VertexCollection>(params.getParameter<edm::InputTag>("primaryVertices"));
75  token_secondaryVertex = consumes<Product>(params.getParameter<edm::InputTag>("secondaryVertices"));
76  token_beamSpot = consumes<reco::BeamSpot>(params.getParameter<edm::InputTag>("beamSpot"));
77  token_tracks = consumes<InputContainer>(params.getParameter<edm::InputTag>("tracks"));
78  produces<Product>();
79  theArbitrator.reset( new TrackVertexArbitration<VTX>(params) );
80 }
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
T getParameter(std::string const &) const
edm::EDGetTokenT< Product > token_secondaryVertex
std::unique_ptr< TrackVertexArbitration< VTX > > theArbitrator
edm::EDGetTokenT< InputContainer > token_tracks
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex

Member Function Documentation

template<class InputContainer , class VTX >
void TemplatedVertexArbitrator< InputContainer, VTX >::produce ( edm::Event event,
const edm::EventSetup es 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 83 of file TemplatedVertexArbitrator.h.

References SiPixelRawToDigiRegional_cfi::beamSpot, tthelpers::buildTT(), edm::EventSetup::get(), nTracks(), HLT_25ns10e33_v2_cff::primaryVertices, MetAnalyzer::pv(), dt_dqm_sourceclient_common_cff::reco, HLT_25ns10e33_v2_cff::secondaryVertices, TrackCollections2monitor_cff::selectedTracks, and testEve_cfg::tracks.

84 {
85  using namespace reco;
86 
88  event.getByToken(token_secondaryVertex, secondaryVertices);
89  Product theSecVertexColl = *(secondaryVertices.product());
90 
92  event.getByToken(token_primaryVertex, primaryVertices);
93 
94  std::auto_ptr<Product> recoVertices(new Product);
95  if(primaryVertices->size()!=0){
96  const reco::Vertex &pv = (*primaryVertices)[0];
97 
99  event.getByToken(token_tracks, tracks);
100 
102  es.get<TransientTrackRecord>().get("TransientTrackBuilder",
103  trackBuilder);
104 
106  event.getByToken(token_beamSpot,beamSpot);
107 
108  std::vector<TransientTrack> selectedTracks;
109  for(typename InputContainer::const_iterator track = tracks->begin();
110  track != tracks->end(); ++track) {
111  selectedTracks.push_back(tthelpers::buildTT(tracks,trackBuilder,track - tracks->begin()));
112  }
113 
114 
115  // const edm::RefVector< TrackCollection > tracksForArbitration= selectedTracks;
116  Product theRecoVertices = theArbitrator->trackVertexArbitrator(beamSpot, pv, selectedTracks,
117  theSecVertexColl);
118 
119  for(unsigned int ivtx=0; ivtx < theRecoVertices.size(); ivtx++){
120  if ( !(nTracks(theRecoVertices[ivtx]) > 1) ) continue;
121  recoVertices->push_back(theRecoVertices[ivtx]);
122  }
123 
124  }
125  event.put(recoVertices);
126 
127 
128 
129 }
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
const unsigned int nTracks(const reco::Vertex &sv)
edm::EDGetTokenT< Product > token_secondaryVertex
std::unique_ptr< TrackVertexArbitration< VTX > > theArbitrator
edm::EDGetTokenT< InputContainer > token_tracks
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
tuple tracks
Definition: testEve_cfg.py:39
const T & get() const
Definition: EventSetup.h:56
reco::TransientTrack buildTT(edm::Handle< reco::TrackCollection > &tracks, edm::ESHandle< TransientTrackBuilder > &trackbuilder, unsigned int k)
Definition: TTHelpers.h:4
template<class InputContainer , class VTX >
bool TemplatedVertexArbitrator< InputContainer, VTX >::trackFilter ( const reco::TrackRef track) const
private

Member Data Documentation

template<class InputContainer , class VTX >
std::unique_ptr<TrackVertexArbitration<VTX> > TemplatedVertexArbitrator< InputContainer, VTX >::theArbitrator
private

Definition at line 67 of file TemplatedVertexArbitrator.h.

template<class InputContainer , class VTX >
edm::EDGetTokenT<reco::BeamSpot> TemplatedVertexArbitrator< InputContainer, VTX >::token_beamSpot
private

Definition at line 66 of file TemplatedVertexArbitrator.h.

template<class InputContainer , class VTX >
edm::EDGetTokenT<reco::VertexCollection> TemplatedVertexArbitrator< InputContainer, VTX >::token_primaryVertex
private

Definition at line 63 of file TemplatedVertexArbitrator.h.

template<class InputContainer , class VTX >
edm::EDGetTokenT<Product> TemplatedVertexArbitrator< InputContainer, VTX >::token_secondaryVertex
private

Definition at line 64 of file TemplatedVertexArbitrator.h.

template<class InputContainer , class VTX >
edm::EDGetTokenT<InputContainer> TemplatedVertexArbitrator< InputContainer, VTX >::token_tracks
private

Definition at line 65 of file TemplatedVertexArbitrator.h.