CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SiStripElectronSeedProducer Class Reference

#include <SiStripElectronSeedProducer.h>

Inheritance diagram for SiStripElectronSeedProducer:
edm::stream::EDProducer<>

Public Member Functions

void produce (edm::Event &e, const edm::EventSetup &c) override
 
 SiStripElectronSeedProducer (const edm::ParameterSet &conf)
 
 ~SiStripElectronSeedProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Private Attributes

edm::ParameterSet conf_
 
SiStripElectronSeedGeneratormatcher_
 
edm::EDGetTokenT< reco::SuperClusterCollectionsuperClusters_ [2]
 

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 15 of file SiStripElectronSeedProducer.h.

Constructor & Destructor Documentation

SiStripElectronSeedProducer::SiStripElectronSeedProducer ( const edm::ParameterSet conf)
explicit

Definition at line 21 of file SiStripElectronSeedProducer.cc.

References edm::ParameterSet::addParameter(), edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), SiStripElectronSeedGenerator::Tokens::token_bs, and SiStripElectronSeedGenerator::Tokens::token_mte.

22 {
23  if(iConfig.exists("SeedConfiguration")){
24  conf_ = iConfig.getParameter<edm::ParameterSet>("SeedConfiguration") ;
25  }else{
26  conf_.addParameter("beamSpot",edm::InputTag("offlineBeamSpot"));
27  conf_.addParameter("tibOriginZCut",20.);
28  conf_.addParameter("tidOriginZCut",20.);
29  conf_.addParameter("tecOriginZCut",20.);
30  conf_.addParameter("monoOriginZCut",20.);
31  conf_.addParameter("tibDeltaPsiCut",0.1);
32  conf_.addParameter("tidDeltaPsiCut",0.1);
33  conf_.addParameter("tecDeltaPsiCut",0.1);
34  conf_.addParameter("monoDeltaPsiCut",0.1);
35  conf_.addParameter("tibPhiMissHit2Cut",0.006);
36  conf_.addParameter("tidPhiMissHit2Cut",0.006);
37  conf_.addParameter("tecPhiMissHit2Cut",0.007);
38  conf_.addParameter("monoPhiMissHit2Cut",0.02);
39  conf_.addParameter("tibZMissHit2Cut",0.35);
40  conf_.addParameter("tidRMissHit2Cut",0.3);
41  conf_.addParameter("tecRMissHit2Cut",0.3);
42  conf_.addParameter("tidEtaUsage", 1.2);
43  conf_.addParameter("tidMaxHits",4);
44  conf_.addParameter("tecMaxHits",2);
45  conf_.addParameter("monoMaxHits",4);
46  conf_.addParameter("maxSeeds",5);
47  }
49  ssesg_tokens.token_bs = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpot"));
50  if (conf_.existsAs<edm::InputTag>("measurementTrackerEvent")) {
51  ssesg_tokens.token_mte = consumes<MeasurementTrackerEvent>(conf_.getParameter<edm::InputTag>("measurementTrackerEvent"));
52  }
53  matcher_ = new SiStripElectronSeedGenerator(conf_,ssesg_tokens);
54 
55 
56 
57  // get labels from config
58  superClusters_[0]=consumes<reco::SuperClusterCollection>(iConfig.getParameter<edm::InputTag>("barrelSuperClusters"));
59  superClusters_[1]=consumes<reco::SuperClusterCollection>(iConfig.getParameter<edm::InputTag>("endcapSuperClusters"));
60 
61  //register your products
62  produces<ElectronSeedCollection>();
63 }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:185
SiStripElectronSeedGenerator * matcher_
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:143
edm::EDGetTokenT< reco::SuperClusterCollection > superClusters_[2]
edm::EDGetTokenT< reco::BeamSpot > token_bs
SiStripElectronSeedProducer::~SiStripElectronSeedProducer ( )
override

Definition at line 65 of file SiStripElectronSeedProducer.cc.

66 {
67  // do anything here that needs to be done at desctruction time
68  // (e.g. close files, deallocate resources etc.)
69  delete matcher_;
70 }
SiStripElectronSeedGenerator * matcher_

Member Function Documentation

void SiStripElectronSeedProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Definition at line 72 of file SiStripElectronSeedProducer.cc.

References fastPrimaryVertexProducer_cfi::clusters, edm::Event::getByToken(), mps_fire::i, LogDebug, eostools::move(), and edm::Event::put().

73 {
74  using namespace edm;
75  using namespace std;
76 
77  LogDebug("entering");
78  LogDebug("") <<"[SiStripElectronSeedProducer::produce] entering " ;
79 
80  matcher_->setupES(iSetup);
81 
83  std::unique_ptr<ElectronSeedCollection> pSeeds;
84 
85  // do both barrel and endcap instances
86  for (unsigned int i=0; i<2; i++) {
87 
88  // get the superclusters
90  if(e.getByToken(superClusters_[i],clusters)) {
91  // run the seed generator and put the ElectronSeeds into a collection
92  matcher_->run(e,iSetup,clusters,*seeds);
93  }
94 
95  }
96 
97  pSeeds = std::unique_ptr<ElectronSeedCollection>(seeds);
98 
99  e.put(std::move(pSeeds));
100 
101 }
#define LogDebug(id)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
SiStripElectronSeedGenerator * matcher_
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
void setupES(const edm::EventSetup &setup)
edm::EDGetTokenT< reco::SuperClusterCollection > superClusters_[2]
HLT enums.
void run(edm::Event &, const edm::EventSetup &setup, const edm::Handle< reco::SuperClusterCollection > &, reco::ElectronSeedCollection &)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

edm::ParameterSet SiStripElectronSeedProducer::conf_
private

Definition at line 27 of file SiStripElectronSeedProducer.h.

SiStripElectronSeedGenerator* SiStripElectronSeedProducer::matcher_
private

Definition at line 28 of file SiStripElectronSeedProducer.h.

edm::EDGetTokenT<reco::SuperClusterCollection> SiStripElectronSeedProducer::superClusters_[2]
private

Definition at line 26 of file SiStripElectronSeedProducer.h.