CMS 3D CMS Logo

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

#include <ElectronSeedTrackRefFix.h>

Inheritance diagram for ElectronSeedTrackRefFix:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ElectronSeedTrackRefFix (const edm::ParameterSet &)
 
 ~ElectronSeedTrackRefFix ()
 
- 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
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 ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT
< edm::ValueMap
< reco::PreIdRef > > 
idMapToken
 
edm::InputTag idsTag
 
edm::EDGetTokenT
< reco::PreIdCollection
idsToken
 
edm::InputTag newTracksTag
 
edm::EDGetTokenT
< reco::TrackCollection
newTracksToken
 
edm::InputTag oldTracksTag
 
edm::EDGetTokenT
< reco::TrackCollection
oldTracksToken
 
std::string preidgsfLabel
 
std::string preidLabel
 
edm::InputTag seedsTag
 
edm::EDGetTokenT
< reco::ElectronSeedCollection
seedsToken
 

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
 
- 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 18 of file ElectronSeedTrackRefFix.h.

Constructor & Destructor Documentation

ElectronSeedTrackRefFix::ElectronSeedTrackRefFix ( const edm::ParameterSet iConfig)
explicit

Definition at line 26 of file ElectronSeedTrackRefFix.cc.

References edm::ParameterSet::getParameter().

27 {
28  // read parameters
29  preidgsfLabel = iConfig.getParameter<string>("PreGsfLabel");
30  preidLabel= iConfig.getParameter<string>("PreIdLabel");
31  oldTracksTag = iConfig.getParameter<InputTag>("oldTrackCollection");
32  newTracksTag = iConfig.getParameter<InputTag>("newTrackCollection");
33  seedsTag = iConfig.getParameter<InputTag>("seedCollection");
34  idsTag = iConfig.getParameter<InputTag>("idCollection");
35 
36  //register your products
37  produces<reco::ElectronSeedCollection>(preidgsfLabel);
38  produces<reco::PreIdCollection>(preidLabel);
39  produces<ValueMap<reco::PreIdRef> >(preidLabel);
40 
41  //create tokens
42  oldTracksToken = consumes<reco::TrackCollection>(oldTracksTag);
43  newTracksToken = consumes<reco::TrackCollection>(newTracksTag);
44  seedsToken = consumes<reco::ElectronSeedCollection>(seedsTag);
45  idsToken = consumes<reco::PreIdCollection >(idsTag);
46  idMapToken = consumes<ValueMap<reco::PreIdRef> >(idsTag) ;
47 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > newTracksToken
edm::EDGetTokenT< reco::TrackCollection > oldTracksToken
edm::EDGetTokenT< reco::ElectronSeedCollection > seedsToken
edm::EDGetTokenT< edm::ValueMap< reco::PreIdRef > > idMapToken
edm::EDGetTokenT< reco::PreIdCollection > idsToken
ElectronSeedTrackRefFix::~ElectronSeedTrackRefFix ( )

Definition at line 50 of file ElectronSeedTrackRefFix.cc.

51 {
52 
53  // do anything here that needs to be done at desctruction time
54  // (e.g. close files, deallocate resources etc.)
55 
56 }

Member Function Documentation

void ElectronSeedTrackRefFix::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 123 of file ElectronSeedTrackRefFix.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

123  {
124  //The following says we do not know what parameters are allowed so do no validation
125  // Please change this to state exactly what you do use, even if it is no parameters
127  desc.setUnknown();
128  descriptions.addDefault(desc);
129 }
void addDefault(ParameterSetDescription const &psetDescription)
void ElectronSeedTrackRefFix::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 65 of file ElectronSeedTrackRefFix.cc.

References edm::helper::Filler< Map >::fill(), edm::Event::getByToken(), i, edm::helper::Filler< Map >::insert(), edm::Event::put(), alignCSCRings::s, findQualityFiles::size, edmStreamStallGrapher::t, and makeHLTPrescaleTable::values.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

66 {
67  using namespace edm;
68 
69  Handle<TrackCollection> oldTracks;
70  iEvent.getByToken(oldTracksToken,oldTracks);
71 
72  Handle<TrackCollection> newTracks;
73  iEvent.getByToken(newTracksToken,newTracks);
74 
76  iEvent.getByToken(seedsToken,iSeeds);
77 
79  iEvent.getByToken(idsToken,iIds);
80 
82  iEvent.getByToken(idMapToken,iIdMap);
83 
84  auto_ptr<ElectronSeedCollection> oSeeds(new ElectronSeedCollection);
85  auto_ptr<PreIdCollection> oIds(new PreIdCollection);
86  auto_ptr<ValueMap<PreIdRef> > oIdMap(new ValueMap<PreIdRef>);
87 
88  ValueMap<PreIdRef>::Filler mapFiller(*oIdMap);
89 
90  for(unsigned int s = 0;s<iSeeds->size();++s){
91  oSeeds->push_back(iSeeds->at(s));
92  TrackRef newTrackRef(newTracks,oSeeds->back().ctfTrack().index());
93  oSeeds->back().setCtfTrack(newTrackRef);
94  }
95 
96  for(unsigned int i = 0;i<iIds->size();++i){
97  oIds->push_back(iIds->at(i));
98  TrackRef newTrackRef(newTracks,oIds->back().trackRef().index());
99  oIds->back().setTrack(newTrackRef);
100  }
101 
102  iEvent.put(oSeeds,preidgsfLabel);
103  const edm::OrphanHandle<reco::PreIdCollection> preIdProd = iEvent.put(oIds,preidLabel);
104 
105  vector<PreIdRef> values;
106  for(unsigned int t = 0;t<newTracks->size();++t){
107  if(t < oldTracks->size()){
108  TrackRef oldTrackRef(oldTracks,t);
109  values.push_back(PreIdRef(preIdProd,(*(iIdMap.product()))[oldTrackRef].index()));
110  }
111  else{
112  values.push_back(PreIdRef());
113  }
114  }
115  mapFiller.insert(newTracks,values.begin(),values.end());
116  mapFiller.fill();
117 
118  iEvent.put(oIdMap,preidLabel);
119 }
int i
Definition: DBlmapReader.cc:9
std::vector< reco::PreId > PreIdCollection
Definition: PreIdFwd.h:6
edm::EDGetTokenT< reco::TrackCollection > newTracksToken
edm::EDGetTokenT< reco::TrackCollection > oldTracksToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
edm::EDGetTokenT< reco::ElectronSeedCollection > seedsToken
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
edm::EDGetTokenT< edm::ValueMap< reco::PreIdRef > > idMapToken
edm::Ref< reco::PreIdCollection > PreIdRef
Definition: PreIdFwd.h:8
edm::EDGetTokenT< reco::PreIdCollection > idsToken
tuple size
Write out results.

Member Data Documentation

edm::EDGetTokenT<edm::ValueMap<reco::PreIdRef> > ElectronSeedTrackRefFix::idMapToken
private

Definition at line 33 of file ElectronSeedTrackRefFix.h.

edm::InputTag ElectronSeedTrackRefFix::idsTag
private

Definition at line 40 of file ElectronSeedTrackRefFix.h.

edm::EDGetTokenT<reco::PreIdCollection > ElectronSeedTrackRefFix::idsToken
private

Definition at line 32 of file ElectronSeedTrackRefFix.h.

edm::InputTag ElectronSeedTrackRefFix::newTracksTag
private

Definition at line 38 of file ElectronSeedTrackRefFix.h.

edm::EDGetTokenT<reco::TrackCollection > ElectronSeedTrackRefFix::newTracksToken
private

Definition at line 29 of file ElectronSeedTrackRefFix.h.

edm::InputTag ElectronSeedTrackRefFix::oldTracksTag
private

Definition at line 37 of file ElectronSeedTrackRefFix.h.

edm::EDGetTokenT<reco::TrackCollection > ElectronSeedTrackRefFix::oldTracksToken
private

Definition at line 30 of file ElectronSeedTrackRefFix.h.

std::string ElectronSeedTrackRefFix::preidgsfLabel
private

Definition at line 35 of file ElectronSeedTrackRefFix.h.

std::string ElectronSeedTrackRefFix::preidLabel
private

Definition at line 36 of file ElectronSeedTrackRefFix.h.

edm::InputTag ElectronSeedTrackRefFix::seedsTag
private

Definition at line 39 of file ElectronSeedTrackRefFix.h.

edm::EDGetTokenT<reco::ElectronSeedCollection > ElectronSeedTrackRefFix::seedsToken
private

Definition at line 31 of file ElectronSeedTrackRefFix.h.