CMS 3D CMS Logo

SiStripElectronSeedProducer.cc
Go to the documentation of this file.
1 // Producer for making electron seeds from Si Strip hits.
2 
9 
14 
16 
17 #include <iostream>
18 
19 using namespace reco;
20 
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 }
64 
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 }
71 
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 }
102 
#define LogDebug(id)
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::EDGetTokenT< MeasurementTrackerEvent > token_mte
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:144
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
virtual void produce(edm::Event &e, const edm::EventSetup &c)
fixed size matrix
HLT enums.
SiStripElectronSeedProducer(const edm::ParameterSet &conf)
def move(src, dest)
Definition: eostools.py:510
edm::EDGetTokenT< reco::BeamSpot > token_bs