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 Member Functions
GsfElectronCoreEcalDrivenProducer Class Reference

#include <GsfElectronCoreEcalDrivenProducer.h>

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

Public Member Functions

 GsfElectronCoreEcalDrivenProducer (const edm::ParameterSet &conf)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~GsfElectronCoreEcalDrivenProducer ()
 
- Public Member Functions inherited from GsfElectronCoreBaseProducer
 GsfElectronCoreBaseProducer (const edm::ParameterSet &conf)
 
virtual ~GsfElectronCoreBaseProducer ()
 
- 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 (const std::string &iProcessName, std::vector< const char * > &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 Member Functions

void produceEcalDrivenCore (const reco::GsfTrackRef &gsfTrackRef, reco::GsfElectronCoreCollection *electrons)
 

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 GsfElectronCoreBaseProducer
static void fillDescription (edm::ParameterSetDescription &)
 
- 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 GsfElectronCoreBaseProducer
void fillElectronCore (reco::GsfElectronCore *)
 
void initEvent (edm::Event &event, const edm::EventSetup &setup)
 
- 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)
 
- Protected Attributes inherited from GsfElectronCoreBaseProducer
edm::Handle
< reco::TrackCollection
ctfTracksH_
 
edm::Handle
< reco::GsfPFRecTrackCollection
gsfPfRecTracksH_
 
edm::Handle
< reco::GsfTrackCollection
gsfTracksH_
 
bool useGsfPfRecTracks_
 

Detailed Description

Definition at line 7 of file GsfElectronCoreEcalDrivenProducer.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file GsfElectronCoreEcalDrivenProducer.cc.

GsfElectronCoreEcalDrivenProducer::~GsfElectronCoreEcalDrivenProducer ( )
virtual

Definition at line 89 of file GsfElectronCoreEcalDrivenProducer.cc.

90  {}

Member Function Documentation

void GsfElectronCoreEcalDrivenProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 31 of file GsfElectronCoreEcalDrivenProducer.cc.

References HI_PhotonSkim_cff::electrons, edm::Ref< C, T, F >::get(), GsfElectronCoreBaseProducer::gsfPfRecTracksH_, GsfElectronCoreBaseProducer::gsfTracksH_, i, GsfElectronCoreBaseProducer::initEvent(), produceEcalDrivenCore(), edm::Handle< T >::product(), and GsfElectronCoreBaseProducer::useGsfPfRecTracks_.

32  {
33  // base input
35 
36  // output
37  std::auto_ptr<GsfElectronCoreCollection> electrons(new GsfElectronCoreCollection) ;
38 
39  // loop on ecal driven tracks
41  {
42  const GsfPFRecTrackCollection * gsfPfRecTrackCollection = gsfPfRecTracksH_.product() ;
43  GsfPFRecTrackCollection::const_iterator gsfPfRecTrack ;
44  for ( gsfPfRecTrack=gsfPfRecTrackCollection->begin() ;
45  gsfPfRecTrack!=gsfPfRecTrackCollection->end() ;
46  ++gsfPfRecTrack )
47  {
48  const GsfTrackRef gsfTrackRef = gsfPfRecTrack->gsfTrackRef() ;
49  produceEcalDrivenCore(gsfTrackRef,electrons.get()) ;
50  }
51  }
52  else
53  {
54  const GsfTrackCollection * gsfTrackCollection = gsfTracksH_.product() ;
55  for ( unsigned int i=0 ; i<gsfTrackCollection->size() ; ++i )
56  {
58  produceEcalDrivenCore(gsfTrackRef,electrons.get()) ;
59  }
60  }
61 
62  event.put(electrons) ;
63  }
void initEvent(edm::Event &event, const edm::EventSetup &setup)
int i
Definition: DBlmapReader.cc:9
void produceEcalDrivenCore(const reco::GsfTrackRef &gsfTrackRef, reco::GsfElectronCoreCollection *electrons)
edm::Handle< reco::GsfTrackCollection > gsfTracksH_
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
std::vector< GsfElectronCore > GsfElectronCoreCollection
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
T const * product() const
Definition: Handle.h:81
edm::Handle< reco::GsfPFRecTrackCollection > gsfPfRecTracksH_
void GsfElectronCoreEcalDrivenProducer::produceEcalDrivenCore ( const reco::GsfTrackRef gsfTrackRef,
reco::GsfElectronCoreCollection electrons 
)
private

Definition at line 65 of file GsfElectronCoreEcalDrivenProducer.cc.

References edm::RefToBase< T >::castTo(), reco::GsfElectronCore::ecalDrivenSeed(), GsfElectronCoreBaseProducer::fillElectronCore(), edm::Ref< C, T, F >::isNull(), mathSSE::return(), fileCollector::seed, and reco::GsfElectronCore::setSuperCluster().

Referenced by produce().

66  {
67  GsfElectronCore * eleCore = new GsfElectronCore(gsfTrackRef) ;
68 
69  if (!eleCore->ecalDrivenSeed())
70  { delete eleCore ; return ; }
71 
73 
74  edm::RefToBase<TrajectorySeed> seed = gsfTrackRef->extra()->seedRef() ;
75  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>() ;
76  edm::RefToBase<CaloCluster> caloCluster = elseed->caloCluster() ;
77  SuperClusterRef scRef = caloCluster.castTo<SuperClusterRef>() ;
78  if (!scRef.isNull())
79  {
80  eleCore->setSuperCluster(scRef) ;
81  electrons->push_back(*eleCore) ;
82  }
83  else
84  { edm::LogWarning("GsfElectronCoreEcalDrivenProducer")<<"Seed CaloCluster is not a SuperCluster, unexpected..." ; }
85 
86  delete eleCore ;
87  }
bool ecalDrivenSeed() const
return((rh^lh)&mask)
void setSuperCluster(const SuperClusterRef &scl)
bool isNull() const
Checks for null.
Definition: Ref.h:249
REF castTo() const
Definition: RefToBase.h:278
void fillElectronCore(reco::GsfElectronCore *)