test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SiStripElectronProducer Class Reference

#include <RecoEgamma/EgammaElectronProducers/interface/SiStripElectronProducer.h>

Inheritance diagram for SiStripElectronProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &)
 
 SiStripElectronProducer (const edm::ParameterSet &)
 
 ~SiStripElectronProducer ()
 
- 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)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

SiStripElectronAlgoalgo_p
 
edm::EDGetTokenT
< SiStripMatchedRecHit2DCollection
matched_sistrips2dtag_
 
edm::EDGetTokenT
< SiStripRecHit2DCollection
rphi_sistrips2dtag_
 
std::string siHitProducer_
 
std::string siMatchedHitCollection_
 
std::string siRphiHitCollection_
 
std::string siStereoHitCollection_
 
std::string siStripElectronsLabel_
 
edm::EDGetTokenT
< SiStripRecHit2DCollection
stereo_sistrips2dtag_
 
std::string superClusterCollection_
 
std::string superClusterProducer_
 
edm::EDGetTokenT
< reco::SuperClusterCollection
superClustertag_
 
std::string trackCandidatesLabel_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 35 of file SiStripElectronProducer.h.

Constructor & Destructor Documentation

SiStripElectronProducer::SiStripElectronProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 46 of file SiStripElectronProducer.cc.

References algo_p, edm::ParameterSet::getParameter(), HLT_25ns10e33_v2_cff::InputTag, LogDebug, matched_sistrips2dtag_, rphi_sistrips2dtag_, siHitProducer_, siMatchedHitCollection_, siRphiHitCollection_, siStereoHitCollection_, siStripElectronsLabel_, stereo_sistrips2dtag_, AlCaHLTBitMon_QueryRunRegistry::string, superClusterCollection_, superClusterProducer_, superClustertag_, and trackCandidatesLabel_.

47 {
48  // register your products
49  siStripElectronsLabel_ = iConfig.getParameter<std::string>("siStripElectronsLabel");
50  trackCandidatesLabel_ = iConfig.getParameter<std::string>("trackCandidatesLabel");
51  produces<reco::SiStripElectronCollection>(siStripElectronsLabel_);
52  produces<TrackCandidateCollection>(trackCandidatesLabel_);
53 
54  // get parameters
55  siHitProducer_ = iConfig.getParameter<std::string>("siHitProducer");
56  siRphiHitCollection_ = iConfig.getParameter<std::string>("siRphiHitCollection");
57  siStereoHitCollection_ = iConfig.getParameter<std::string>("siStereoHitCollection");
58  siMatchedHitCollection_ = iConfig.getParameter<std::string>("siMatchedHitCollection");
59 
60  superClusterProducer_ = iConfig.getParameter<std::string>("superClusterProducer");
61  superClusterCollection_ = iConfig.getParameter<std::string>("superClusterCollection");
62 
64  consumes<SiStripRecHit2DCollection>(edm::InputTag(siHitProducer_,siRphiHitCollection_));
66  consumes<SiStripRecHit2DCollection>(edm::InputTag(siHitProducer_,siStereoHitCollection_));
68  consumes<SiStripMatchedRecHit2DCollection>(edm::InputTag(siHitProducer_,siMatchedHitCollection_));
70  consumes<reco::SuperClusterCollection>(edm::InputTag(superClusterProducer_,superClusterCollection_));
71 
73  iConfig.getParameter<int32_t>("maxHitsOnDetId"),
74  iConfig.getParameter<double>("originUncertainty"),
75  iConfig.getParameter<double>("phiBandWidth"), // this is in radians
76  iConfig.getParameter<double>("maxNormResid"),
77  iConfig.getParameter<int32_t>("minHits"),
78  iConfig.getParameter<double>("maxReducedChi2"));
79 
80  LogDebug("") << " Welcome to SiStripElectronProducer " ;
81 
82 }
#define LogDebug(id)
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::SuperClusterCollection > superClustertag_
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > matched_sistrips2dtag_
edm::EDGetTokenT< SiStripRecHit2DCollection > stereo_sistrips2dtag_
SiStripElectronAlgo * algo_p
edm::EDGetTokenT< SiStripRecHit2DCollection > rphi_sistrips2dtag_
SiStripElectronProducer::~SiStripElectronProducer ( )

Definition at line 90 of file SiStripElectronProducer.cc.

References algo_p.

91 {
92  // do anything here that needs to be done at desctruction time
93  // (e.g. close files, deallocate resources etc.)
94  delete algo_p;
95 }
SiStripElectronAlgo * algo_p

Member Function Documentation

void SiStripElectronProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 115 of file SiStripElectronProducer.cc.

References algo_p, relval_parameters_module::energy, reco::CaloCluster::energy(), SiStripElectronAlgo::findElectron(), edm::EventSetup::get(), edm::Event::getByToken(), i, LogDebug, matched_sistrips2dtag_, SiStripElectronAlgo::prepareEvent(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), edm::Event::put(), rphi_sistrips2dtag_, siStripElectronsLabel_, stereo_sistrips2dtag_, superClustertag_, and trackCandidatesLabel_.

116 {
117  // Extract data from the event
118  edm::ESHandle<TrackerGeometry> trackerHandle;
119  iSetup.get<TrackerDigiGeometryRecord>().get(trackerHandle);
120 
122  iEvent.getByToken(rphi_sistrips2dtag_, rphiHitsHandle);
123 
125  iEvent.getByToken(stereo_sistrips2dtag_, stereoHitsHandle);
126 
128  iEvent.getByToken(matched_sistrips2dtag_, matchedHitsHandle);
129 
130  edm::ESHandle<MagneticField> magneticFieldHandle;
131  iSetup.get<IdealMagneticFieldRecord>().get(magneticFieldHandle);
132 
134  iEvent.getByToken(superClustertag_, superClusterHandle);
135 
136  // Set up SiStripElectronAlgo for this event
137  algo_p->prepareEvent(trackerHandle, rphiHitsHandle, stereoHitsHandle, matchedHitsHandle, magneticFieldHandle);
138 
139  // Prepare the output electron candidates and clouds to be filled
140  std::auto_ptr<reco::SiStripElectronCollection> electronOut(new reco::SiStripElectronCollection);
141  std::auto_ptr<TrackCandidateCollection> trackCandidateOut(new TrackCandidateCollection);
142 
143  //Retrieve tracker topology from geometry
145  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
146  const TrackerTopology *tTopo=tTopoHand.product();
147 
148  // counter for electron candidates
149  int siStripElectCands = 0 ;
150 
151  std::ostringstream str;
152 
153 
154  // Loop over clusters
155  str << "Starting loop over superclusters."<< "\n" << std::endl;
156  for (unsigned int i = 0; i < superClusterHandle.product()->size(); i++) {
157  const reco::SuperCluster* sc = &(*reco::SuperClusterRef(superClusterHandle, i));
158  double energy = sc->energy();
159 
160  if (algo_p->findElectron(*electronOut, *trackCandidateOut, reco::SuperClusterRef(superClusterHandle, i),tTopo)) {
161  str << "Supercluster energy: " << energy << ", FOUND an electron." << "\n" << std::endl;
162  ++siStripElectCands ;
163  }
164  else {
165  str << "Supercluster energy: " << energy << ", DID NOT FIND an electron."<< "\n" << std::endl;
166  }
167  }
168  str << "Ending loop over superclusters." << "\n" << std::endl;
169 
170  str << " Found " << siStripElectCands
171  << " SiStripElectron Candidates before track fit "
172  << "\n" << std::endl ;
173 
174  LogDebug("SiStripElectronProducer") << str.str();
175 
176  // Put the electron candidates and the tracking trajectories into the event
177  iEvent.put(electronOut, siStripElectronsLabel_);
178  iEvent.put(trackCandidateOut, trackCandidatesLabel_);
179 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::vector< TrackCandidate > TrackCandidateCollection
edm::EDGetTokenT< reco::SuperClusterCollection > superClustertag_
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
std::vector< SiStripElectron > SiStripElectronCollection
collectin of SiStripElectron objects
double energy() const
cluster energy
Definition: CaloCluster.h:121
bool findElectron(reco::SiStripElectronCollection &electronOut, TrackCandidateCollection &trackCandidateOut, const reco::SuperClusterRef &superclusterIn, const TrackerTopology *tTopo)
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > matched_sistrips2dtag_
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< SiStripRecHit2DCollection > stereo_sistrips2dtag_
SiStripElectronAlgo * algo_p
edm::EDGetTokenT< SiStripRecHit2DCollection > rphi_sistrips2dtag_
void prepareEvent(const edm::ESHandle< TrackerGeometry > &tracker, const edm::Handle< SiStripRecHit2DCollection > &rphiHits, const edm::Handle< SiStripRecHit2DCollection > &stereoHits, const edm::Handle< SiStripMatchedRecHit2DCollection > &matchedHits, const edm::ESHandle< MagneticField > &magneticField)

Member Data Documentation

SiStripElectronAlgo* SiStripElectronProducer::algo_p
private
edm::EDGetTokenT<SiStripMatchedRecHit2DCollection> SiStripElectronProducer::matched_sistrips2dtag_
private

Definition at line 55 of file SiStripElectronProducer.h.

Referenced by produce(), and SiStripElectronProducer().

edm::EDGetTokenT<SiStripRecHit2DCollection> SiStripElectronProducer::rphi_sistrips2dtag_
private

Definition at line 53 of file SiStripElectronProducer.h.

Referenced by produce(), and SiStripElectronProducer().

std::string SiStripElectronProducer::siHitProducer_
private

Definition at line 44 of file SiStripElectronProducer.h.

Referenced by SiStripElectronProducer().

std::string SiStripElectronProducer::siMatchedHitCollection_
private

Definition at line 47 of file SiStripElectronProducer.h.

Referenced by SiStripElectronProducer().

std::string SiStripElectronProducer::siRphiHitCollection_
private

Definition at line 45 of file SiStripElectronProducer.h.

Referenced by SiStripElectronProducer().

std::string SiStripElectronProducer::siStereoHitCollection_
private

Definition at line 46 of file SiStripElectronProducer.h.

Referenced by SiStripElectronProducer().

std::string SiStripElectronProducer::siStripElectronsLabel_
private

Definition at line 50 of file SiStripElectronProducer.h.

Referenced by produce(), and SiStripElectronProducer().

edm::EDGetTokenT<SiStripRecHit2DCollection> SiStripElectronProducer::stereo_sistrips2dtag_
private

Definition at line 54 of file SiStripElectronProducer.h.

Referenced by produce(), and SiStripElectronProducer().

std::string SiStripElectronProducer::superClusterCollection_
private

Definition at line 49 of file SiStripElectronProducer.h.

Referenced by SiStripElectronProducer().

std::string SiStripElectronProducer::superClusterProducer_
private

Definition at line 48 of file SiStripElectronProducer.h.

Referenced by SiStripElectronProducer().

edm::EDGetTokenT<reco::SuperClusterCollection> SiStripElectronProducer::superClustertag_
private

Definition at line 56 of file SiStripElectronProducer.h.

Referenced by produce(), and SiStripElectronProducer().

std::string SiStripElectronProducer::trackCandidatesLabel_
private

Definition at line 51 of file SiStripElectronProducer.h.

Referenced by produce(), and SiStripElectronProducer().