CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ElectronNHitSeedProducer Class Reference
Inheritance diagram for ElectronNHitSeedProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ElectronNHitSeedProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override final
 
virtual ~ElectronNHitSeedProducer ()=default
 
- 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)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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 Attributes

edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
edm::EDGetTokenT< TrajectorySeedCollectioninitialSeedsToken_
 
TrajSeedMatcher matcher_
 
edm::EDGetTokenT< MeasurementTrackerEventmeasTkEvtToken_
 
std::vector< edm::EDGetTokenT< std::vector< reco::SuperClusterRef > > > superClustersTokens_
 
edm::EDGetTokenT< std::vector< reco::Vertex > > verticesToken_
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
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
 
- 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 42 of file ElectronNHitSeedProducer.cc.

Constructor & Destructor Documentation

ElectronNHitSeedProducer::ElectronNHitSeedProducer ( const edm::ParameterSet pset)
explicit

Definition at line 104 of file ElectronNHitSeedProducer.cc.

References edm::EDConsumerBase::consumes(), edm::ParameterSet::getParameter(), and superClustersTokens_.

104  :
105  matcher_(pset.getParameter<edm::ParameterSet>("matcherConfig")),
106  initialSeedsToken_(consumes<TrajectorySeedCollection>(pset.getParameter<edm::InputTag>("initialSeeds"))),
107  verticesToken_(consumes<std::vector<reco::Vertex> >(pset.getParameter<edm::InputTag>("vertices"))),
108  beamSpotToken_(consumes<reco::BeamSpot>(pset.getParameter<edm::InputTag>("beamSpot"))),
109  measTkEvtToken_(consumes<MeasurementTrackerEvent>(pset.getParameter<edm::InputTag>("measTkEvt")))
110 {
111  const auto superClusTags = pset.getParameter<std::vector<edm::InputTag> >("superClusters");
112  for(const auto& scTag : superClusTags){
113  superClustersTokens_.emplace_back(consumes<std::vector<reco::SuperClusterRef>>(scTag));
114  }
115  produces<reco::ElectronSeedCollection>() ;
116 }
T getParameter(std::string const &) const
edm::EDGetTokenT< TrajectorySeedCollection > initialSeedsToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< std::vector< reco::Vertex > > verticesToken_
std::vector< edm::EDGetTokenT< std::vector< reco::SuperClusterRef > > > superClustersTokens_
edm::EDGetTokenT< MeasurementTrackerEvent > measTkEvtToken_
virtual ElectronNHitSeedProducer::~ElectronNHitSeedProducer ( )
virtualdefault

Member Function Documentation

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

Definition at line 118 of file ElectronNHitSeedProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and TrajSeedMatcher::makePSetDescription().

119 {
121  desc.add<edm::InputTag>("initialSeeds",edm::InputTag("hltElePixelSeedsCombined"));
122  desc.add<edm::InputTag>("vertices",edm::InputTag());
123  desc.add<edm::InputTag>("beamSpot",edm::InputTag("hltOnlineBeamSpot"));
124  desc.add<edm::InputTag>("measTkEvt",edm::InputTag("hltSiStripClusters"));
125  desc.add<std::vector<edm::InputTag> >("superClusters",std::vector<edm::InputTag>{edm::InputTag{"hltEgammaSuperClustersToPixelMatch"}});
127 
128  descriptions.add("electronNHitSeedProducer",desc);
129 }
static edm::ParameterSetDescription makePSetDescription()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void ElectronNHitSeedProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
finaloverridevirtual

Definition at line 131 of file ElectronNHitSeedProducer.cc.

References beamSpotToken_, TrajSeedMatcher::compatibleSeeds(), DEFINE_FWK_MODULE, TrajSeedMatcher::doEventSetup(), edm::EventSetup::get(), initialSeedsToken_, matcher_, measTkEvtToken_, eostools::move(), edm::Event::put(), TrajSeedMatcher::setMeasTkEvtHandle(), and superClustersTokens_.

132 {
133  edm::ESHandle<TrackerTopology> trackerTopoHandle;
134  iSetup.get<TrackerTopologyRcd>().get(trackerTopoHandle);
135 
136  matcher_.doEventSetup(iSetup);
137  matcher_.setMeasTkEvtHandle(getHandle(iEvent,measTkEvtToken_));
138 
139  auto eleSeeds = std::make_unique<reco::ElectronSeedCollection>();
140 
141  auto initialSeedsHandle = getHandle(iEvent,initialSeedsToken_);
142 
143  auto beamSpotHandle = getHandle(iEvent,beamSpotToken_);
144  GlobalPoint primVtxPos = convertToGP(beamSpotHandle->position());
145 
146  for(const auto& superClustersToken : superClustersTokens_){
147  auto superClustersHandle = getHandle(iEvent,superClustersToken);
148  for(auto& superClusRef : *superClustersHandle){
149 
150  //the eta of the supercluster when mustache clustered is slightly biased due to bending in magnetic field
151  //the eta of its seed cluster is a better estimate of the orginal position
152  GlobalPoint caloPosition(GlobalPoint::Polar(superClusRef->seed()->position().theta(), //seed theta
153  superClusRef->position().phi(), //supercluster phi
154  superClusRef->position().r())); //supercluster r
155 
156 
157  const std::vector<TrajSeedMatcher::SeedWithInfo> matchedSeeds =
158  matcher_.compatibleSeeds(*initialSeedsHandle,caloPosition,
159  primVtxPos,superClusRef->energy());
160 
161  for(auto& matchedSeed : matchedSeeds){
162  reco::ElectronSeed eleSeed(matchedSeed.seed());
163  reco::ElectronSeed::CaloClusterRef caloClusRef(superClusRef);
164  eleSeed.setCaloCluster(caloClusRef);
165  eleSeed.setNrLayersAlongTraj(matchedSeed.nrValidLayers());
166  for(auto& matchInfo : matchedSeed.matches()){
167  eleSeed.addHitInfo(makeSeedPixelVar(matchInfo,*trackerTopoHandle));
168  }
169  eleSeeds->emplace_back(eleSeed);
170  }
171  }
172 
173  }
174  iEvent.put(std::move(eleSeeds));
175 }
void doEventSetup(const edm::EventSetup &iSetup)
std::vector< TrajSeedMatcher::SeedWithInfo > compatibleSeeds(const TrajectorySeedCollection &seeds, const GlobalPoint &candPos, const GlobalPoint &vprim, const float energy)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
edm::EDGetTokenT< TrajectorySeedCollection > initialSeedsToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
void setMeasTkEvtHandle(edm::Handle< MeasurementTrackerEvent > handle)
std::vector< edm::EDGetTokenT< std::vector< reco::SuperClusterRef > > > superClustersTokens_
const T & get() const
Definition: EventSetup.h:56
edm::EDGetTokenT< MeasurementTrackerEvent > measTkEvtToken_
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::EDGetTokenT<reco::BeamSpot> ElectronNHitSeedProducer::beamSpotToken_
private

Definition at line 60 of file ElectronNHitSeedProducer.cc.

Referenced by produce().

edm::EDGetTokenT<TrajectorySeedCollection> ElectronNHitSeedProducer::initialSeedsToken_
private

Definition at line 58 of file ElectronNHitSeedProducer.cc.

Referenced by produce().

TrajSeedMatcher ElectronNHitSeedProducer::matcher_
private

Definition at line 55 of file ElectronNHitSeedProducer.cc.

Referenced by produce().

edm::EDGetTokenT<MeasurementTrackerEvent> ElectronNHitSeedProducer::measTkEvtToken_
private

Definition at line 61 of file ElectronNHitSeedProducer.cc.

Referenced by produce().

std::vector<edm::EDGetTokenT<std::vector<reco::SuperClusterRef> > > ElectronNHitSeedProducer::superClustersTokens_
private

Definition at line 57 of file ElectronNHitSeedProducer.cc.

Referenced by ElectronNHitSeedProducer(), and produce().

edm::EDGetTokenT<std::vector<reco::Vertex> > ElectronNHitSeedProducer::verticesToken_
private

Definition at line 59 of file ElectronNHitSeedProducer.cc.