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 | Private Attributes
GsfElectronCoreProducer Class Reference

#include <GsfElectronCoreProducer.h>

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

Public Member Functions

 GsfElectronCoreProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~GsfElectronCoreProducer ()
 
- 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
 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 produceTrackerDrivenCore (const reco::GsfTrackRef &gsfTrackRef, std::list< reco::GsfElectronCore * > &electrons)
 

Private Attributes

edm::Handle
< reco::GsfElectronCoreCollection
edCoresH_
 
edm::EDGetTokenT
< reco::GsfElectronCoreCollection
edCoresTag_
 
edm::Handle
< reco::GsfElectronCoreCollection
pfCoresH_
 
edm::EDGetTokenT
< reco::GsfElectronCoreCollection
pfCoresTag_
 

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
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 9 of file GsfElectronCoreProducer.h.

Constructor & Destructor Documentation

GsfElectronCoreProducer::GsfElectronCoreProducer ( const edm::ParameterSet config)
explicit

Definition at line 32 of file GsfElectronCoreProducer.cc.

References edCoresTag_, edm::ParameterSet::getParameter(), and pfCoresTag_.

34  {
35  edCoresTag_ = consumes<reco::GsfElectronCoreCollection>(config.getParameter<edm::InputTag>("ecalDrivenGsfElectronCoresTag"));
36  pfCoresTag_ = consumes<reco::GsfElectronCoreCollection>(config.getParameter<edm::InputTag>("pflowGsfElectronCoresTag"));
37 // pfSuperClustersTag_ = config.getParameter<edm::InputTag>("pfSuperClusters") ;
38 // pfSuperClusterTrackMapTag_ = config.getParameter<edm::InputTag>("pfSuperClusterTrackMap") ;
39  }
T getParameter(std::string const &) const
GsfElectronCoreBaseProducer(const edm::ParameterSet &conf)
edm::EDGetTokenT< reco::GsfElectronCoreCollection > pfCoresTag_
edm::EDGetTokenT< reco::GsfElectronCoreCollection > edCoresTag_
GsfElectronCoreProducer::~GsfElectronCoreProducer ( )
virtual

Definition at line 138 of file GsfElectronCoreProducer.cc.

139  {}

Member Function Documentation

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

Implements edm::stream::EDProducerBase.

Definition at line 41 of file GsfElectronCoreProducer.cc.

References runEdmFileComparison::collection, edCoresH_, edCoresTag_, HI_PhotonSkim_cff::electrons, edm::false, newFWLiteAna::found, GsfElectronCoreBaseProducer::gsfPfRecTracksH_, GsfElectronCoreBaseProducer::gsfTracksH_, i, GsfElectronCoreBaseProducer::initEvent(), LogDebug, pfCoresH_, pfCoresTag_, produceTrackerDrivenCore(), edm::Handle< T >::product(), funct::true, and GsfElectronCoreBaseProducer::useGsfPfRecTracks_.

42  {
43  // base input
45 
46  // transient output
47  std::list<GsfElectronCore *> electrons ;
48 
49  // event input
50  event.getByToken(edCoresTag_,edCoresH_) ;
51  event.getByToken(pfCoresTag_,pfCoresH_) ;
52 // event.getByToken(pfSuperClustersTag_,pfClustersH_) ;
53 // event.getByToken(pfSuperClusterTrackMapTag_,pfClusterTracksH_) ;
54 
55  // loop on pure tracker driven tracks
57  {
58  const GsfPFRecTrackCollection * gsfPfRecTrackCollection = gsfPfRecTracksH_.product() ;
59  GsfPFRecTrackCollection::const_iterator gsfPfRecTrack ;
60  for ( gsfPfRecTrack=gsfPfRecTrackCollection->begin() ;
61  gsfPfRecTrack!=gsfPfRecTrackCollection->end() ;
62  ++gsfPfRecTrack )
63  {
64  const GsfTrackRef gsfTrackRef = gsfPfRecTrack->gsfTrackRef() ;
65  produceTrackerDrivenCore(gsfTrackRef,electrons) ;
66  }
67  }
68  else
69  {
70  const GsfTrackCollection * gsfTrackCollection = gsfTracksH_.product() ;
71  for ( unsigned int i=0 ; i<gsfTrackCollection->size() ; ++i )
72  {
74  produceTrackerDrivenCore(gsfTrackRef,electrons) ;
75  }
76  }
77 
78  // clone ecal driven electrons
79  const GsfElectronCoreCollection * edCoresCollection = edCoresH_.product() ;
80  GsfElectronCoreCollection::const_iterator edCoreIter ;
81  for
82  ( edCoreIter = edCoresCollection->begin() ;
83  edCoreIter != edCoresCollection->end() ;
84  edCoreIter++ )
85  { electrons.push_back(edCoreIter->clone()) ; }
86 
87  // add pflow info
88  const GsfElectronCoreCollection * pfCoresCollection = pfCoresH_.product() ;
89  GsfElectronCoreCollection::const_iterator pfCoreIter ;
90  std::list<GsfElectronCore *>::iterator eleCore ;
91  bool found ;
92  for ( eleCore = electrons.begin() ; eleCore != electrons.end() ; eleCore++ )
93  {
94 // (*eleCore)->setParentSuperCluster((*pfClusterTracksH_)[(*eleCore)->gsfTrack()]) ;
95  found = false ;
96  for
97  ( pfCoreIter = pfCoresCollection->begin() ;
98  pfCoreIter != pfCoresCollection->end() ;
99  pfCoreIter++ )
100  {
101  if (pfCoreIter->gsfTrack()==(*eleCore)->gsfTrack())
102  {
103  if (found)
104  {
105  edm::LogWarning("GsfElectronCoreProducer")<<"associated pfGsfElectronCore already found" ;
106  }
107  else
108  {
109  found = true ;
110  (*eleCore)->setParentSuperCluster(pfCoreIter->parentSuperCluster()) ;
111  }
112  }
113  }
114  }
115 
116  // store
117  std::auto_ptr<GsfElectronCoreCollection> collection(new GsfElectronCoreCollection) ;
118  for ( eleCore = electrons.begin() ; eleCore != electrons.end() ; eleCore++ )
119  {
120  if ((*eleCore)->superCluster().isNull())
121  { LogDebug("GsfElectronCoreProducer")<<"GsfTrack with no associated SuperCluster at all." ; }
122  else
123  { collection->push_back(**eleCore) ; }
124  delete (*eleCore) ;
125  }
126  event.put(collection) ;
127  }
#define LogDebug(id)
void initEvent(edm::Event &event, const edm::EventSetup &setup)
int i
Definition: DBlmapReader.cc:9
edm::Handle< reco::GsfElectronCoreCollection > edCoresH_
void produceTrackerDrivenCore(const reco::GsfTrackRef &gsfTrackRef, std::list< reco::GsfElectronCore * > &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
edm::EDGetTokenT< reco::GsfElectronCoreCollection > pfCoresTag_
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< reco::GsfElectronCoreCollection > edCoresTag_
edm::Handle< reco::GsfPFRecTrackCollection > gsfPfRecTracksH_
edm::Handle< reco::GsfElectronCoreCollection > pfCoresH_
volatile std::atomic< bool > shutdown_flag false
void GsfElectronCoreProducer::produceTrackerDrivenCore ( const reco::GsfTrackRef gsfTrackRef,
std::list< reco::GsfElectronCore * > &  electrons 
)
private

Definition at line 129 of file GsfElectronCoreProducer.cc.

References reco::GsfElectronCore::ecalDrivenSeed(), GsfElectronCoreBaseProducer::fillElectronCore(), and mathSSE::return().

Referenced by produce().

130  {
131  GsfElectronCore * eleCore = new GsfElectronCore(gsfTrackRef) ;
132  if (eleCore->ecalDrivenSeed())
133  { delete eleCore ; return ; }
135  electrons.push_back(eleCore) ;
136  }
bool ecalDrivenSeed() const
return((rh^lh)&mask)
void fillElectronCore(reco::GsfElectronCore *)

Member Data Documentation

edm::Handle<reco::GsfElectronCoreCollection> GsfElectronCoreProducer::edCoresH_
private

Definition at line 26 of file GsfElectronCoreProducer.h.

Referenced by produce().

edm::EDGetTokenT<reco::GsfElectronCoreCollection> GsfElectronCoreProducer::edCoresTag_
private

Definition at line 21 of file GsfElectronCoreProducer.h.

Referenced by GsfElectronCoreProducer(), and produce().

edm::Handle<reco::GsfElectronCoreCollection> GsfElectronCoreProducer::pfCoresH_
private

Definition at line 27 of file GsfElectronCoreProducer.h.

Referenced by produce().

edm::EDGetTokenT<reco::GsfElectronCoreCollection> GsfElectronCoreProducer::pfCoresTag_
private

Definition at line 22 of file GsfElectronCoreProducer.h.

Referenced by GsfElectronCoreProducer(), and produce().