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 (const std::string &iProcessName, std::vector< const char * > &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

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 49 of file TemplatedVertexArbitrator.h.

Member Typedef Documentation

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

Definition at line 51 of file TemplatedVertexArbitrator.h.

Constructor & Destructor Documentation

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

Definition at line 69 of file TemplatedVertexArbitrator.h.

References edm::ParameterSet::getParameter().

70 {
71  token_primaryVertex = consumes<reco::VertexCollection>(params.getParameter<edm::InputTag>("primaryVertices"));
72  token_secondaryVertex = consumes<Product>(params.getParameter<edm::InputTag>("secondaryVertices"));
73  token_beamSpot = consumes<reco::BeamSpot>(params.getParameter<edm::InputTag>("beamSpot"));
74  token_tracks = consumes<InputContainer>(params.getParameter<edm::InputTag>("tracks"));
75  produces<Product>();
77 }
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
T getParameter(std::string const &) const
edm::EDGetTokenT< Product > token_secondaryVertex
edm::EDGetTokenT< InputContainer > token_tracks
TrackVertexArbitration< VTX > * theArbitrator
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 80 of file TemplatedVertexArbitrator.h.

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

81 {
82  using namespace reco;
83 
85  event.getByToken(token_secondaryVertex, secondaryVertices);
86  Product theSecVertexColl = *(secondaryVertices.product());
87 
89  event.getByToken(token_primaryVertex, primaryVertices);
90 
91  std::auto_ptr<Product> recoVertices(new Product);
92  if(primaryVertices->size()!=0){
93  const reco::Vertex &pv = (*primaryVertices)[0];
94 
96  event.getByToken(token_tracks, tracks);
97 
99  es.get<TransientTrackRecord>().get("TransientTrackBuilder",
100  trackBuilder);
101 
103  event.getByToken(token_beamSpot,beamSpot);
104 
105  std::vector<TransientTrack> selectedTracks;
106  for(typename InputContainer::const_iterator track = tracks->begin();
107  track != tracks->end(); ++track) {
108  selectedTracks.push_back(tthelpers::buildTT(tracks,trackBuilder,track - tracks->begin()));
109  }
110 
111 
112  // const edm::RefVector< TrackCollection > tracksForArbitration= selectedTracks;
113  Product theRecoVertices = theArbitrator->trackVertexArbitrator(beamSpot, pv, selectedTracks,
114  theSecVertexColl);
115 
116  for(unsigned int ivtx=0; ivtx < theRecoVertices.size(); ivtx++){
117  recoVertices->push_back(theRecoVertices[ivtx]);
118  }
119 
120  }
121  event.put(recoVertices);
122 
123 
124 
125 }
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
edm::EDGetTokenT< Product > token_secondaryVertex
edm::EDGetTokenT< InputContainer > token_tracks
TrackVertexArbitration< VTX > * theArbitrator
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
tuple tracks
Definition: testEve_cfg.py:39
const T & get() const
Definition: EventSetup.h:55
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 >
TrackVertexArbitration<VTX>* TemplatedVertexArbitrator< InputContainer, VTX >::theArbitrator
private

Definition at line 64 of file TemplatedVertexArbitrator.h.

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

Definition at line 63 of file TemplatedVertexArbitrator.h.

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

Definition at line 60 of file TemplatedVertexArbitrator.h.

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

Definition at line 61 of file TemplatedVertexArbitrator.h.

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

Definition at line 62 of file TemplatedVertexArbitrator.h.