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<>

Public Member Functions

 ElectronNHitSeedProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) final
 
 ~ElectronNHitSeedProducer () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::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
 

Detailed Description

Definition at line 40 of file ElectronNHitSeedProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 94 of file ElectronNHitSeedProducer.cc.

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

95  : matcher_(pset.getParameter<edm::ParameterSet>("matcherConfig")),
96  initialSeedsToken_(consumes<TrajectorySeedCollection>(pset.getParameter<edm::InputTag>("initialSeeds"))),
97  verticesToken_(consumes<std::vector<reco::Vertex>>(pset.getParameter<edm::InputTag>("vertices"))),
98  beamSpotToken_(consumes<reco::BeamSpot>(pset.getParameter<edm::InputTag>("beamSpot"))),
99  measTkEvtToken_(consumes<MeasurementTrackerEvent>(pset.getParameter<edm::InputTag>("measTkEvt"))) {
100  const auto superClusTags = pset.getParameter<std::vector<edm::InputTag>>("superClusters");
101  for (const auto& scTag : superClusTags) {
102  superClustersTokens_.emplace_back(consumes<std::vector<reco::SuperClusterRef>>(scTag));
103  }
104  produces<reco::ElectronSeedCollection>();
105 }
T getParameter(std::string const &) const
edm::EDGetTokenT< TrajectorySeedCollection > initialSeedsToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
edm::EDGetTokenT< std::vector< reco::Vertex > > verticesToken_
std::vector< edm::EDGetTokenT< std::vector< reco::SuperClusterRef > > > superClustersTokens_
edm::EDGetTokenT< MeasurementTrackerEvent > measTkEvtToken_
ElectronNHitSeedProducer::~ElectronNHitSeedProducer ( )
overridedefault

Member Function Documentation

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

Definition at line 107 of file ElectronNHitSeedProducer.cc.

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

107  {
109  desc.add<edm::InputTag>("initialSeeds", edm::InputTag("hltElePixelSeedsCombined"));
110  desc.add<edm::InputTag>("vertices", edm::InputTag());
111  desc.add<edm::InputTag>("beamSpot", edm::InputTag("hltOnlineBeamSpot"));
112  desc.add<edm::InputTag>("measTkEvt", edm::InputTag("hltSiStripClusters"));
113  desc.add<std::vector<edm::InputTag>>("superClusters",
114  std::vector<edm::InputTag>{edm::InputTag{"hltEgammaSuperClustersToPixelMatch"}});
116 
117  descriptions.add("electronNHitSeedProducer", desc);
118 }
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 
)
final

Definition at line 120 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_.

120  {
121  edm::ESHandle<TrackerTopology> trackerTopoHandle;
122  iSetup.get<TrackerTopologyRcd>().get(trackerTopoHandle);
123 
124  matcher_.doEventSetup(iSetup);
125  matcher_.setMeasTkEvtHandle(getHandle(iEvent, measTkEvtToken_));
126 
127  auto eleSeeds = std::make_unique<reco::ElectronSeedCollection>();
128  auto initialSeedsHandle = getHandle(iEvent, initialSeedsToken_);
129 
130  auto beamSpotHandle = getHandle(iEvent, beamSpotToken_);
131  GlobalPoint primVtxPos = convertToGP(beamSpotHandle->position());
132 
133  // Loop over all super-cluster collections (typically barrel and forward are supplied separately)
134  for (const auto& superClustersToken : superClustersTokens_) {
135  auto superClustersHandle = getHandle(iEvent, superClustersToken);
136  for (auto& superClusRef : *superClustersHandle) {
137  //the eta of the supercluster when mustache clustered is slightly biased due to bending in magnetic field
138  //the eta of its seed cluster is a better estimate of the orginal position
139  GlobalPoint caloPosition(GlobalPoint::Polar(superClusRef->seed()->position().theta(), //seed theta
140  superClusRef->position().phi(), //supercluster phi
141  superClusRef->position().r())); //supercluster r
142 
143  const std::vector<TrajSeedMatcher::SeedWithInfo> matchedSeeds =
144  matcher_.compatibleSeeds(*initialSeedsHandle, caloPosition, primVtxPos, superClusRef->energy());
145 
146  for (auto& matchedSeed : matchedSeeds) {
147  reco::ElectronSeed eleSeed(matchedSeed.seed());
148  reco::ElectronSeed::CaloClusterRef caloClusRef(superClusRef);
149  eleSeed.setCaloCluster(caloClusRef);
150  eleSeed.setNrLayersAlongTraj(matchedSeed.nrValidLayers());
151  for (auto& matchInfo : matchedSeed.matches()) {
152  eleSeed.addHitInfo(makeSeedPixelVar(matchInfo, *trackerTopoHandle));
153  }
154  eleSeeds->emplace_back(eleSeed);
155  }
156  }
157  }
158  iEvent.put(std::move(eleSeeds));
159 }
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:131
edm::EDGetTokenT< TrajectorySeedCollection > initialSeedsToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
void setMeasTkEvtHandle(edm::Handle< MeasurementTrackerEvent > handle)
std::vector< edm::EDGetTokenT< std::vector< reco::SuperClusterRef > > > superClustersTokens_
edm::EDGetTokenT< MeasurementTrackerEvent > measTkEvtToken_
T get() const
Definition: EventSetup.h:73
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 55 of file ElectronNHitSeedProducer.cc.

Referenced by produce().

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

Definition at line 53 of file ElectronNHitSeedProducer.cc.

Referenced by produce().

TrajSeedMatcher ElectronNHitSeedProducer::matcher_
private

Definition at line 50 of file ElectronNHitSeedProducer.cc.

Referenced by produce().

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

Definition at line 56 of file ElectronNHitSeedProducer.cc.

Referenced by produce().

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

Definition at line 52 of file ElectronNHitSeedProducer.cc.

Referenced by ElectronNHitSeedProducer(), and produce().

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

Definition at line 54 of file ElectronNHitSeedProducer.cc.