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 Member Functions | Private Attributes
TrackVertexArbitrator Class Reference
Inheritance diagram for TrackVertexArbitrator:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void produce (edm::Event &event, const edm::EventSetup &es) override
 
 TrackVertexArbitrator (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
 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
 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
 
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

TrackVertexArbitrationtheArbitrator
 
edm::EDGetTokenT< reco::BeamSpottoken_beamSpot
 
edm::EDGetTokenT
< reco::VertexCollection
token_primaryVertex
 
edm::EDGetTokenT
< reco::VertexCollection
token_secondaryVertex
 
edm::EDGetTokenT
< reco::TrackCollection
token_tracks
 

Additional Inherited Members

- 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
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 45 of file TrackVertexArbitrator.cc.

Constructor & Destructor Documentation

TrackVertexArbitrator::TrackVertexArbitrator ( const edm::ParameterSet params)

Definition at line 62 of file TrackVertexArbitrator.cc.

References edm::ParameterSet::getParameter(), theArbitrator, token_beamSpot, token_primaryVertex, token_secondaryVertex, and token_tracks.

63 {
64  token_primaryVertex = consumes<reco::VertexCollection>(params.getParameter<edm::InputTag>("primaryVertices"));
65  token_secondaryVertex = consumes<reco::VertexCollection>(params.getParameter<edm::InputTag>("secondaryVertices"));
66  token_beamSpot = consumes<reco::BeamSpot>(params.getParameter<edm::InputTag>("beamSpot"));
67  token_tracks = consumes<reco::TrackCollection>(params.getParameter<edm::InputTag>("tracks"));
68  produces<reco::VertexCollection>();
70 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
edm::EDGetTokenT< reco::VertexCollection > token_secondaryVertex
edm::EDGetTokenT< reco::TrackCollection > token_tracks
TrackVertexArbitration * theArbitrator

Member Function Documentation

void TrackVertexArbitrator::produce ( edm::Event event,
const edm::EventSetup es 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 73 of file TrackVertexArbitrator.cc.

References SiPixelRawToDigiRegional_cfi::beamSpot, edm::EventSetup::get(), edm::RefVector< C, T, F >::push_back(), dt_dqm_sourceclient_common_cff::reco, TrackCollections2monitor_cff::selectedTracks, theArbitrator, token_beamSpot, token_primaryVertex, token_secondaryVertex, token_tracks, testEve_cfg::tracks, and TrackVertexArbitration::trackVertexArbitrator().

74 {
75  using namespace reco;
76 
77  edm::Handle<VertexCollection> secondaryVertices;
78  event.getByToken(token_secondaryVertex, secondaryVertices);
79  VertexCollection theSecVertexColl = *(secondaryVertices.product());
80 
81  edm::Handle<VertexCollection> primaryVertices;
82  event.getByToken(token_primaryVertex, primaryVertices);
83 
84  std::auto_ptr<VertexCollection> recoVertices(new VertexCollection);
85  if(primaryVertices->size()!=0){
86  const reco::Vertex &pv = (*primaryVertices)[0];
87 
89  event.getByToken(token_tracks, tracks);
90 
92  es.get<TransientTrackRecord>().get("TransientTrackBuilder",
93  trackBuilder);
94 
96  event.getByToken(token_beamSpot,beamSpot);
97 
98 
100  for(TrackCollection::const_iterator track = tracks->begin();
101  track != tracks->end(); ++track) {
102  TrackRef ref(tracks, track - tracks->begin());
103  selectedTracks.push_back(ref);
104 
105  }
106 
107 
108  const edm::RefVector< TrackCollection > tracksForArbitration= selectedTracks;
109  reco::VertexCollection theRecoVertices = theArbitrator->trackVertexArbitrator(beamSpot, pv, trackBuilder, tracksForArbitration,
110  theSecVertexColl);
111 
112  for(unsigned int ivtx=0; ivtx < theRecoVertices.size(); ivtx++){
113  recoVertices->push_back(theRecoVertices[ivtx]);
114  }
115 
116  }
117  event.put(recoVertices);
118 
119 
120 
121 }
reco::VertexCollection trackVertexArbitrator(edm::Handle< reco::BeamSpot > &beamSpot, const reco::Vertex &pv, edm::ESHandle< TransientTrackBuilder > &trackBuilder, const edm::RefVector< reco::TrackCollection > &selectedTracks, reco::VertexCollection &secondaryVertices)
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
edm::EDGetTokenT< reco::VertexCollection > token_primaryVertex
edm::EDGetTokenT< reco::VertexCollection > token_secondaryVertex
edm::EDGetTokenT< reco::TrackCollection > token_tracks
TrackVertexArbitration * theArbitrator
tuple tracks
Definition: testEve_cfg.py:39
const T & get() const
Definition: EventSetup.h:55
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
bool TrackVertexArbitrator::trackFilter ( const reco::TrackRef track) const
private

Member Data Documentation

TrackVertexArbitration* TrackVertexArbitrator::theArbitrator
private

Definition at line 59 of file TrackVertexArbitrator.cc.

Referenced by produce(), and TrackVertexArbitrator().

edm::EDGetTokenT<reco::BeamSpot> TrackVertexArbitrator::token_beamSpot
private

Definition at line 58 of file TrackVertexArbitrator.cc.

Referenced by produce(), and TrackVertexArbitrator().

edm::EDGetTokenT<reco::VertexCollection> TrackVertexArbitrator::token_primaryVertex
private

Definition at line 55 of file TrackVertexArbitrator.cc.

Referenced by produce(), and TrackVertexArbitrator().

edm::EDGetTokenT<reco::VertexCollection> TrackVertexArbitrator::token_secondaryVertex
private

Definition at line 56 of file TrackVertexArbitrator.cc.

Referenced by produce(), and TrackVertexArbitrator().

edm::EDGetTokenT<reco::TrackCollection> TrackVertexArbitrator::token_tracks
private

Definition at line 57 of file TrackVertexArbitrator.cc.

Referenced by produce(), and TrackVertexArbitrator().