CMS 3D CMS Logo

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

#include <GsfElectronCoreEcalDrivenProducer.h>

Inheritance diagram for GsfElectronCoreEcalDrivenProducer:
GsfElectronCoreBaseProducer edm::EDProducer edm::ProducerBase 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::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from GsfElectronCoreBaseProducer
static void fillDescription (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 
- Protected Attributes inherited from GsfElectronCoreBaseProducer
edm::Handle
< reco::TrackCollection
ctfTracksH_
 
edm::Handle
< reco::GsfTrackCollection
gsfTracksH_
 

Detailed Description

Definition at line 6 of file GsfElectronCoreEcalDrivenProducer.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file GsfElectronCoreEcalDrivenProducer.cc.

29  {}
GsfElectronCoreBaseProducer(const edm::ParameterSet &conf)
tuple config
Definition: cmsDriver.py:17
GsfElectronCoreEcalDrivenProducer::~GsfElectronCoreEcalDrivenProducer ( )
virtual

Definition at line 68 of file GsfElectronCoreEcalDrivenProducer.cc.

69  {}

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 31 of file GsfElectronCoreEcalDrivenProducer.cc.

References edm::RefToBase< T >::castTo(), GsfElectronCoreBaseProducer::fillElectronCore(), GsfElectronCoreBaseProducer::gsfTracksH_, i, GsfElectronCoreBaseProducer::initEvent(), edm::Ref< C, T, F >::isNull(), and edm::Handle< T >::product().

32  {
33  // base input
35 
36  // output
37  std::auto_ptr<GsfElectronCoreCollection> electrons(new GsfElectronCoreCollection) ;
38 
39  // loop on ecal driven tracks
40  const GsfTrackCollection * gsfTrackCollection = gsfTracksH_.product() ;
41  for ( unsigned int i=0 ; i<gsfTrackCollection->size() ; ++i )
42  {
44  GsfElectronCore * ele = new GsfElectronCore(gsfTrackRef) ;
45 
46  if (!ele->ecalDrivenSeed())
47  { delete ele ; continue ; }
48 
50 
51  edm::RefToBase<TrajectorySeed> seed = gsfTrackRef->extra()->seedRef() ;
52  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>() ;
53  edm::RefToBase<CaloCluster> caloCluster = elseed->caloCluster() ;
54  SuperClusterRef scRef = caloCluster.castTo<SuperClusterRef>() ;
55  if (!scRef.isNull())
56  {
57  ele->setSuperCluster(scRef) ;
58  electrons->push_back(*ele) ;
59  }
60  else
61  { edm::LogWarning("GsfElectronCoreEcalDrivenProducer")<<"Seed CaloCluster is not a SuperCluster, unexpected..." ; }
62 
63  delete ele ;
64  }
65  event.put(electrons) ;
66  }
void initEvent(edm::Event &event, const edm::EventSetup &setup)
int i
Definition: DBlmapReader.cc:9
edm::Handle< reco::GsfTrackCollection > gsfTracksH_
bool isNull() const
Checks for null.
Definition: Ref.h:244
std::vector< GsfElectronCore > GsfElectronCoreCollection
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
Definition: GsfTrackFwd.h:9
REF castTo() const
cast to a concrete type
Definition: RefToBase.h:236
T const * product() const
Definition: Handle.h:74
void fillElectronCore(reco::GsfElectronCore *)