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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 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::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_
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 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 
)
final

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:125
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:71
def move(src, dest)
Definition: eostools.py:511

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.